diff --git a/gulpfile.js b/gulpfile.js index 9ceed8b3..74c7e3ec 100755 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,7 +9,7 @@ var gulp = require('gulp') , version , glowscript_libraries; -version = '3.2.0'; +version = '3.2.1'; glowscript_libraries = { "glow": [ diff --git a/package/RScompiler.3.2.1.min.js b/package/RScompiler.3.2.1.min.js new file mode 100644 index 00000000..acc2c3d4 --- /dev/null +++ b/package/RScompiler.3.2.1.min.js @@ -0,0 +1,4 @@ +/*This is a combined, compressed file. Look at https://github.com/BruceSherwood/glowscript for source code and copyright information.*/!function(n){var e="6dc47bb1e119229b986e8123779ffc85160f3ffd",t={"compiler.js":'(function(){\n "use strict";\n var ρσ_iterator_symbol = (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") ? Symbol.iterator : "iterator-Symbol-5d0927e5554349048cf0e3762a228256";\n var ρσ_kwargs_symbol = (typeof Symbol === "function") ? Symbol("kwargs-object") : "kwargs-object-Symbol-5d0927e5554349048cf0e3762a228256";\n var ρσ_cond_temp, ρσ_expr_temp, ρσ_last_exception;\n var ρσ_object_counter = 0;\nvar ρσ_len;\nfunction ρσ_bool(val) {\n return !!val;\n};\nif (!ρσ_bool.__argnames__) Object.defineProperties(ρσ_bool, {\n __argnames__ : {value: ["val"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_print() {\n var parts;\n if (typeof console === "object") {\n parts = [];\n for (var i = 0; i < arguments.length; i++) {\n parts.push(ρσ_str(arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i]));\n }\n console.log(parts.join(" "));\n }\n};\nif (!ρσ_print.__module__) Object.defineProperties(ρσ_print, {\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_int(val, base) {\n var ans;\n if (typeof val === "number") {\n ans = val | 0;\n } else {\n ans = parseInt(val, base || 10);\n }\n if (isNaN(ans)) {\n throw new ValueError("Invalid literal for int with base " + (base || 10) + ": " + val);\n }\n return ans;\n};\nif (!ρσ_int.__argnames__) Object.defineProperties(ρσ_int, {\n __argnames__ : {value: ["val", "base"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_float(val) {\n var ans;\n if (typeof val === "number") {\n ans = val;\n } else {\n ans = parseFloat(val);\n }\n if (isNaN(ans)) {\n throw new ValueError("Could not convert string to float: " + arguments[0]);\n }\n return ans;\n};\nif (!ρσ_float.__argnames__) Object.defineProperties(ρσ_float, {\n __argnames__ : {value: ["val"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_arraylike_creator() {\n var names;\n names = "Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" ");\n if (typeof HTMLCollection === "function") {\n names = names.concat("HTMLCollection NodeList NamedNodeMap TouchList".split(" "));\n }\n return (function() {\n var ρσ_anonfunc = function (x) {\n if (Array.isArray(x) || typeof x === "string" || names.indexOf(Object.prototype.toString.call(x).slice(8, -1)) > -1) {\n return true;\n }\n return false;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n};\nif (!ρσ_arraylike_creator.__module__) Object.defineProperties(ρσ_arraylike_creator, {\n __module__ : {value: "__main__"}\n});\n\nfunction options_object(f) {\n return (function() {\n var ρσ_anonfunc = function () {\n if (typeof arguments[arguments.length - 1] === "object") {\n arguments[ρσ_bound_index(arguments.length - 1, arguments)][ρσ_kwargs_symbol] = true;\n }\n return f.apply(this, arguments);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n};\nif (!options_object.__argnames__) Object.defineProperties(options_object, {\n __argnames__ : {value: ["f"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_id(x) {\n return x.ρσ_object_id;\n};\nif (!ρσ_id.__argnames__) Object.defineProperties(ρσ_id, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_dir(item) {\n var arr;\n arr = ρσ_list_decorate([]);\n for (var i in item) {\n arr.push(i);\n }\n return arr;\n};\nif (!ρσ_dir.__argnames__) Object.defineProperties(ρσ_dir, {\n __argnames__ : {value: ["item"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_ord(x) {\n var ans, second;\n ans = x.charCodeAt(0);\n if (55296 <= ans && ans <= 56319) {\n second = x.charCodeAt(1);\n if (56320 <= second && second <= 57343) {\n return (ans - 55296) * 1024 + second - 56320 + 65536;\n }\n throw new TypeError("string is missing the low surrogate char");\n }\n return ans;\n};\nif (!ρσ_ord.__argnames__) Object.defineProperties(ρσ_ord, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_chr(code) {\n if (code <= 65535) {\n return String.fromCharCode(code);\n }\n code -= 65536;\n return String.fromCharCode(55296 + (code >> 10), 56320 + (code & 1023));\n};\nif (!ρσ_chr.__argnames__) Object.defineProperties(ρσ_chr, {\n __argnames__ : {value: ["code"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_callable(x) {\n return typeof x === "function";\n};\nif (!ρσ_callable.__argnames__) Object.defineProperties(ρσ_callable, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_bin(x) {\n var ans;\n if (typeof x !== "number" || x % 1 !== 0) {\n throw new TypeError("integer required");\n }\n ans = x.toString(2);\n if (ans[0] === "-") {\n ans = "-" + "0b" + ans.slice(1);\n } else {\n ans = "0b" + ans;\n }\n return ans;\n};\nif (!ρσ_bin.__argnames__) Object.defineProperties(ρσ_bin, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_hex(x) {\n var ans;\n if (typeof x !== "number" || x % 1 !== 0) {\n throw new TypeError("integer required");\n }\n ans = x.toString(16);\n if (ans[0] === "-") {\n ans = "-" + "0x" + ans.slice(1);\n } else {\n ans = "0x" + ans;\n }\n return ans;\n};\nif (!ρσ_hex.__argnames__) Object.defineProperties(ρσ_hex, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_enumerate(iterable) {\n var ans, iterator;\n ans = {"_i":-1};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n if (ρσ_arraylike(iterable)) {\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n this._i += 1;\n if (this._i < iterable.length) {\n return {\'done\':false, \'value\':[this._i, iterable[this._i]]};\n }\n return {\'done\':true};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n }\n if (typeof iterable[ρσ_iterator_symbol] === "function") {\n iterator = (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();\n ans["_iterator"] = iterator;\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n var r;\n r = this._iterator.next();\n if (r.done) {\n return {\'done\':true};\n }\n this._i += 1;\n return {\'done\':false, \'value\':[this._i, r.value]};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n }\n return ρσ_enumerate(Object.keys(iterable));\n};\nif (!ρσ_enumerate.__argnames__) Object.defineProperties(ρσ_enumerate, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_reversed(iterable) {\n var ans;\n if (ρσ_arraylike(iterable)) {\n ans = {"_i": iterable.length};\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n this._i -= 1;\n if (this._i > -1) {\n return {\'done\':false, \'value\':iterable[this._i]};\n }\n return {\'done\':true};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n }\n throw new TypeError("reversed() can only be called on arrays or strings");\n};\nif (!ρσ_reversed.__argnames__) Object.defineProperties(ρσ_reversed, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_iter(iterable) {\n var ans;\n if (typeof iterable[ρσ_iterator_symbol] === "function") {\n return (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();\n }\n if (ρσ_arraylike(iterable)) {\n ans = {"_i":-1};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n this._i += 1;\n if (this._i < iterable.length) {\n return {\'done\':false, \'value\':iterable[this._i]};\n }\n return {\'done\':true};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n }\n return ρσ_iter(Object.keys(iterable));\n};\nif (!ρσ_iter.__argnames__) Object.defineProperties(ρσ_iter, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_range_next(step, length) {\n var ρσ_unpack;\n this._i += step;\n this._idx += 1;\n if (this._idx >= length) {\n ρσ_unpack = [this.__i, -1];\n this._i = ρσ_unpack[0];\n this._idx = ρσ_unpack[1];\n return {\'done\':true};\n }\n return {\'done\':false, \'value\':this._i};\n};\nif (!ρσ_range_next.__argnames__) Object.defineProperties(ρσ_range_next, {\n __argnames__ : {value: ["step", "length"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_range(start, stop, step) {\n var length, ans;\n if (arguments.length <= 1) {\n stop = start || 0;\n start = 0;\n }\n step = arguments[2] || 1;\n length = Math.max(Math.ceil((stop - start) / step), 0);\n ans = {start:start, step:step, stop:stop};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n var it;\n it = {"_i": start - step, "_idx": -1};\n it.next = ρσ_range_next.bind(it, step, length);\n it[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return it;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans.count = (function() {\n var ρσ_anonfunc = function (val) {\n if (!this._cached) {\n this._cached = list(this);\n }\n return this._cached.count(val);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["val"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans.index = (function() {\n var ρσ_anonfunc = function (val) {\n if (!this._cached) {\n this._cached = list(this);\n }\n return this._cached.index(val);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["val"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans.__len__ = (function() {\n var ρσ_anonfunc = function () {\n return length;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans.__repr__ = (function() {\n var ρσ_anonfunc = function () {\n return "range(" + ρσ_str.format("{}", start) + ", " + ρσ_str.format("{}", stop) + ", " + ρσ_str.format("{}", step) + ")";\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans.__str__ = ans.toString = ans.__repr__;\n if (typeof Proxy === "function") {\n ans = new Proxy(ans, (function(){\n var ρσ_d = {};\n ρσ_d["get"] = (function() {\n var ρσ_anonfunc = function (obj, prop) {\n var iprop;\n if (typeof prop === "string") {\n iprop = parseInt(prop);\n if (!isNaN(iprop)) {\n prop = iprop;\n }\n }\n if (typeof prop === "number") {\n if (!obj._cached) {\n obj._cached = list(obj);\n }\n return (ρσ_expr_temp = obj._cached)[(typeof prop === "number" && prop < 0) ? ρσ_expr_temp.length + prop : prop];\n }\n return obj[(typeof prop === "number" && prop < 0) ? obj.length + prop : prop];\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["obj", "prop"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this));\n }\n return ans;\n};\nif (!ρσ_range.__argnames__) Object.defineProperties(ρσ_range, {\n __argnames__ : {value: ["start", "stop", "step"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_getattr(obj, name, defval) {\n var ret;\n try {\n ret = obj[(typeof name === "number" && name < 0) ? obj.length + name : name];\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n if (ρσ_Exception instanceof TypeError) {\n if (defval === undefined) {\n throw new AttributeError("The attribute " + name + " is not present");\n }\n return defval;\n } else {\n throw ρσ_Exception;\n }\n }\n if (ret === undefined && !(name in obj)) {\n if (defval === undefined) {\n throw new AttributeError("The attribute " + name + " is not present");\n }\n ret = defval;\n }\n return ret;\n};\nif (!ρσ_getattr.__argnames__) Object.defineProperties(ρσ_getattr, {\n __argnames__ : {value: ["obj", "name", "defval"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_setattr(obj, name, value) {\n obj[(typeof name === "number" && name < 0) ? obj.length + name : name] = value;\n};\nif (!ρσ_setattr.__argnames__) Object.defineProperties(ρσ_setattr, {\n __argnames__ : {value: ["obj", "name", "value"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_hasattr(obj, name) {\n return name in obj;\n};\nif (!ρσ_hasattr.__argnames__) Object.defineProperties(ρσ_hasattr, {\n __argnames__ : {value: ["obj", "name"]},\n __module__ : {value: "__main__"}\n});\n\nρσ_len = (function() {\n var ρσ_anonfunc = function () {\n function len(obj) {\n if (ρσ_arraylike(obj)) {\n return obj.length;\n }\n if (typeof obj.__len__ === "function") {\n return obj.__len__();\n }\n if (obj instanceof Set || obj instanceof Map) {\n return obj.size;\n }\n return Object.keys(obj).length;\n };\n if (!len.__argnames__) Object.defineProperties(len, {\n __argnames__ : {value: ["obj"]},\n __module__ : {value: "__main__"}\n });\n\n function len5(obj) {\n if (ρσ_arraylike(obj)) {\n return obj.length;\n }\n if (typeof obj.__len__ === "function") {\n return obj.__len__();\n }\n return Object.keys(obj).length;\n };\n if (!len5.__argnames__) Object.defineProperties(len5, {\n __argnames__ : {value: ["obj"]},\n __module__ : {value: "__main__"}\n });\n\n return (typeof Set === "function" && typeof Map === "function") ? len : len5;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})()();\nfunction ρσ_get_module(name) {\n return ρσ_modules[(typeof name === "number" && name < 0) ? ρσ_modules.length + name : name];\n};\nif (!ρσ_get_module.__argnames__) Object.defineProperties(ρσ_get_module, {\n __argnames__ : {value: ["name"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_pow(x, y, z) {\n var ans;\n ans = Math.pow(x, y);\n if (z !== undefined) {\n ans %= z;\n }\n return ans;\n};\nif (!ρσ_pow.__argnames__) Object.defineProperties(ρσ_pow, {\n __argnames__ : {value: ["x", "y", "z"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_type(x) {\n return x.constructor;\n};\nif (!ρσ_type.__argnames__) Object.defineProperties(ρσ_type, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_divmod(x, y) {\n var d;\n if (y === 0) {\n throw new ZeroDivisionError("integer division or modulo by zero");\n }\n d = Math.floor(x / y);\n return [d, x - d * y];\n};\nif (!ρσ_divmod.__argnames__) Object.defineProperties(ρσ_divmod, {\n __argnames__ : {value: ["x", "y"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_max() {\n var kwargs = arguments[arguments.length-1];\n if (kwargs === null || typeof kwargs !== "object" || kwargs [ρσ_kwargs_symbol] !== true) kwargs = {};\n var args = Array.prototype.slice.call(arguments, 0);\n if (kwargs !== null && typeof kwargs === "object" && kwargs [ρσ_kwargs_symbol] === true) args.pop();\n var args, x;\n if (args.length === 0) {\n if (kwargs.defval !== undefined) {\n return kwargs.defval;\n }\n throw new TypeError("expected at least one argument");\n }\n if (args.length === 1) {\n args = args[0];\n }\n if (kwargs.key) {\n args = (function() {\n var ρσ_Iter = ρσ_Iterable(args), ρσ_Result = [], x;\n for (var ρσ_Index = 0; ρσ_Index < ρσ_Iter.length; ρσ_Index++) {\n x = ρσ_Iter[ρσ_Index];\n ρσ_Result.push(kwargs.key(x));\n }\n ρσ_Result = ρσ_list_constructor(ρσ_Result);\n return ρσ_Result;\n })();\n }\n if (!Array.isArray(args)) {\n args = list(args);\n }\n if (args.length) {\n return this.apply(null, args);\n }\n if (kwargs.defval !== undefined) {\n return kwargs.defval;\n }\n throw new TypeError("expected at least one argument");\n};\nif (!ρσ_max.__handles_kwarg_interpolation__) Object.defineProperties(ρσ_max, {\n __handles_kwarg_interpolation__ : {value: true},\n __module__ : {value: "__main__"}\n});\n\nvar abs = Math.abs, max = ρσ_max.bind(Math.max), min = ρσ_max.bind(Math.min), bool = ρσ_bool, type = ρσ_type;\nvar float = ρσ_float, int = ρσ_int, arraylike = ρσ_arraylike_creator(), ρσ_arraylike = arraylike;\nvar print = ρσ_print, id = ρσ_id, get_module = ρσ_get_module, pow = ρσ_pow, divmod = ρσ_divmod;\nvar dir = ρσ_dir, ord = ρσ_ord, chr = ρσ_chr, bin = ρσ_bin, hex = ρσ_hex, callable = ρσ_callable;\nvar enumerate = ρσ_enumerate, iter = ρσ_iter, reversed = ρσ_reversed, len = ρσ_len;\nvar range = ρσ_range, getattr = ρσ_getattr, setattr = ρσ_setattr, hasattr = ρσ_hasattr;function ρσ_equals(a, b) {\n var ρσ_unpack, akeys, bkeys, key;\n if (a instanceof vec) {\n if (!(b instanceof vec)) return false;\nreturn (a.x === b.x && a.y === b.y && a.z === b.z);\n}\n if (a === b) {\n return true;\n }\n if (a && typeof a.__eq__ === "function") {\n return a.__eq__(b);\n }\n if (b && typeof b.__eq__ === "function") {\n return b.__eq__(a);\n }\n if (ρσ_arraylike(a) && ρσ_arraylike(b)) {\n if ((a.length !== b.length && (typeof a.length !== "object" || ρσ_not_equals(a.length, b.length)))) {\n return false;\n }\n for (var i=0; i < a.length; i++) {\n if (!(((a[(typeof i === "number" && i < 0) ? a.length + i : i] === b[(typeof i === "number" && i < 0) ? b.length + i : i] || typeof a[(typeof i === "number" && i < 0) ? a.length + i : i] === "object" && ρσ_equals(a[(typeof i === "number" && i < 0) ? a.length + i : i], b[(typeof i === "number" && i < 0) ? b.length + i : i]))))) {\n return false;\n }\n }\n return true;\n }\n if (typeof a === "object" && typeof b === "object" && a !== null && b !== null && (a.constructor === Object && b.constructor === Object || Object.getPrototypeOf(a) === null && Object.getPrototypeOf(b) === null)) {\n ρσ_unpack = [Object.keys(a), Object.keys(b)];\n akeys = ρσ_unpack[0];\n bkeys = ρσ_unpack[1];\n if (akeys.length !== bkeys.length) {\n return false;\n }\n for (var j=0; j < akeys.length; j++) {\n key = akeys[(typeof j === "number" && j < 0) ? akeys.length + j : j];\n if (!(((a[(typeof key === "number" && key < 0) ? a.length + key : key] === b[(typeof key === "number" && key < 0) ? b.length + key : key] || typeof a[(typeof key === "number" && key < 0) ? a.length + key : key] === "object" && ρσ_equals(a[(typeof key === "number" && key < 0) ? a.length + key : key], b[(typeof key === "number" && key < 0) ? b.length + key : key]))))) {\n return false;\n }\n }\n return true;\n }\n return false;\n};\nif (!ρσ_equals.__argnames__) Object.defineProperties(ρσ_equals, {\n __argnames__ : {value: ["a", "b"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_not_equals(a, b) {\n\tif (a instanceof vec) {\n if (!(b instanceof vec)) return true;\nreturn (a.x !== b.x || a.y !== b.y || a.z !== b.z);\n}\n if (a === b) {\n return false;\n }\n if (a && typeof a.__ne__ === "function") {\n return a.__ne__(b);\n }\n if (b && typeof b.__ne__ === "function") {\n return b.__ne__(a);\n }\n return !ρσ_equals(a, b);\n};\nif (!ρσ_not_equals.__argnames__) Object.defineProperties(ρσ_not_equals, {\n __argnames__ : {value: ["a", "b"]},\n __module__ : {value: "__main__"}\n});\n\nvar equals = ρσ_equals;\nfunction ρσ_list_extend(iterable) {\n var start, iterator, result;\n if (Array.isArray(iterable) || typeof iterable === "string") {\n start = this.length;\n this.length += iterable.length;\n for (var i = 0; i < iterable.length; i++) {\n (ρσ_expr_temp = this)[ρσ_bound_index(start + i, ρσ_expr_temp)] = iterable[(typeof i === "number" && i < 0) ? iterable.length + i : i];\n }\n } else {\n iterator = (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();\n result = iterator.next();\n while (!result.done) {\n this.push(result.value);\n result = iterator.next();\n }\n }\n};\nif (!ρσ_list_extend.__argnames__) Object.defineProperties(ρσ_list_extend, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_index(val, start, stop) {\n var idx;\n start = start || 0;\n if (start < 0) {\n start = this.length + start;\n }\n if (start < 0) {\n throw new ValueError(val + " is not in list");\n }\n if (stop === undefined) {\n idx = this.indexOf(val, start);\n if (idx === -1) {\n throw new ValueError(val + " is not in list");\n }\n return idx;\n }\n if (stop < 0) {\n stop = this.length + stop;\n }\n for (var i = start; i < stop; i++) {\n if (((ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] === val || typeof (ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] === "object" && ρσ_equals((ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i], val))) {\n return i;\n }\n }\n throw new ValueError(val + " is not in list");\n};\nif (!ρσ_list_index.__argnames__) Object.defineProperties(ρσ_list_index, {\n __argnames__ : {value: ["val", "start", "stop"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_pop(index) {\n var ans;\n if (this.length === 0) {\n throw new IndexError("list is empty");\n }\n if (index === undefined) {\n index = -1;\n }\n ans = this.splice(index, 1);\n if (!ans.length) {\n throw new IndexError("pop index out of range");\n }\n return ans[0];\n};\nif (!ρσ_list_pop.__argnames__) Object.defineProperties(ρσ_list_pop, {\n __argnames__ : {value: ["index"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_remove(value) {\n for (var i = 0; i < this.length; i++) {\n if (((ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i] === value || \n value instanceof vec &&\nvalue.equals((ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i]) ||\n typeof (ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i] === "object" && ρσ_equals((ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i], value))) {\n this.splice(i, 1);\n return;\n }\n }\n throw new ValueError(value + " not in list");\n};\nif (!ρσ_list_remove.__argnames__) Object.defineProperties(ρσ_list_remove, {\n __argnames__ : {value: ["value"]},\n __module__ : {value: "__main__"}\n});\nfunction ρσ_list_to_string() {\n return "[" + this.join(", ") + "]";\n};\nif (!ρσ_list_to_string.__module__) Object.defineProperties(ρσ_list_to_string, {\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_insert(index, val) {\n if (index < 0) {\n index += this.length;\n }\n index = min(this.length, max(index, 0));\n if (index === 0) {\n this.unshift(val);\n return;\n }\n for (var i = this.length; i > index; i--) {\n (ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] = (ρσ_expr_temp = this)[ρσ_bound_index(i - 1, ρσ_expr_temp)];\n }\n (ρσ_expr_temp = this)[(typeof index === "number" && index < 0) ? ρσ_expr_temp.length + index : index] = val;\n};\nif (!ρσ_list_insert.__argnames__) Object.defineProperties(ρσ_list_insert, {\n __argnames__ : {value: ["index", "val"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_copy() {\n return ρσ_list_constructor(this);\n};\nif (!ρσ_list_copy.__module__) Object.defineProperties(ρσ_list_copy, {\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_clear() {\n this.length = 0;\n};\nif (!ρσ_list_clear.__module__) Object.defineProperties(ρσ_list_clear, {\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_as_array() {\n return Array.prototype.slice.call(this);\n};\nif (!ρσ_list_as_array.__module__) Object.defineProperties(ρσ_list_as_array, {\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_count(value) {\n return this.reduce((function() {\n var ρσ_anonfunc = function (n, val) {\n return n + (val === value);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["n", "val"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })(), 0);\n};\nif (!ρσ_list_count.__argnames__) Object.defineProperties(ρσ_list_count, {\n __argnames__ : {value: ["value"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_sort_key(value) {\n var t;\n t = typeof value;\n if (t === "string" || t === "number") {\n return value;\n }\n return value.toString();\n};\nif (!ρσ_list_sort_key.__argnames__) Object.defineProperties(ρσ_list_sort_key, {\n __argnames__ : {value: ["value"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_sort_cmp(a, b, ap, bp) {\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return ap - bp;\n};\nif (!ρσ_list_sort_cmp.__argnames__) Object.defineProperties(ρσ_list_sort_cmp, {\n __argnames__ : {value: ["a", "b", "ap", "bp"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_sort() {\n var key = (arguments[0] === undefined || ( 0 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? ρσ_list_sort.__defaults__.key : arguments[0];\n var reverse = (arguments[1] === undefined || ( 1 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? ρσ_list_sort.__defaults__.reverse : arguments[1];\n var ρσ_kwargs_obj = arguments[arguments.length-1];\n if (ρσ_kwargs_obj === null || typeof ρσ_kwargs_obj !== "object" || ρσ_kwargs_obj [ρσ_kwargs_symbol] !== true) ρσ_kwargs_obj = {};\n if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "key")){\n key = ρσ_kwargs_obj.key;\n }\n if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "reverse")){\n reverse = ρσ_kwargs_obj.reverse;\n }\n var mult, keymap, posmap, k;\n key = key || ρσ_list_sort_key;\n mult = (reverse) ? -1 : 1;\n keymap = dict();\n posmap = dict();\n for (var i=0; i < this.length; i++) {\n k = (ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i];\n keymap.set(k, key(k));\n posmap.set(k, i);\n }\n this.sort((function() {\n var ρσ_anonfunc = function (a, b) {\n return mult * ρσ_list_sort_cmp(keymap.get(a), keymap.get(b), posmap.get(a), posmap.get(b));\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["a", "b"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })());\n};\nif (!ρσ_list_sort.__defaults__) Object.defineProperties(ρσ_list_sort, {\n __defaults__ : {value: {key:null, reverse:false}},\n __handles_kwarg_interpolation__ : {value: true},\n __argnames__ : {value: ["key", "reverse"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_concat() {\n var ans;\n ans = Array.prototype.concat.apply(this, arguments);\n ρσ_list_decorate(ans);\n return ans;\n};\nif (!ρσ_list_concat.__module__) Object.defineProperties(ρσ_list_concat, {\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_slice() {\n var ans;\n ans = Array.prototype.slice.apply(this, arguments);\n ρσ_list_decorate(ans);\n return ans;\n};\nif (!ρσ_list_slice.__module__) Object.defineProperties(ρσ_list_slice, {\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_iterator(value) {\n var self;\n self = this;\n return (function(){\n var ρσ_d = {};\n ρσ_d["_i"] = -1;\n ρσ_d["_list"] = self;\n ρσ_d["next"] = (function() {\n var ρσ_anonfunc = function () {\n this._i += 1;\n if (this._i >= this._list.length) {\n return (function(){\n var ρσ_d = {};\n ρσ_d["done"] = true;\n return ρσ_d;\n }).call(this);\n }\n return (function(){\n var ρσ_d = {};\n ρσ_d["done"] = false;\n ρσ_d["value"] = (ρσ_expr_temp = this._list)[ρσ_bound_index(this._i, ρσ_expr_temp)];\n return ρσ_d;\n }).call(this);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this);\n};\nif (!ρσ_list_iterator.__argnames__) Object.defineProperties(ρσ_list_iterator, {\n __argnames__ : {value: ["value"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_len() {\n return this.length;\n};\nif (!ρσ_list_len.__module__) Object.defineProperties(ρσ_list_len, {\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_contains(val) {\n for (var i = 0; i < this.length; i++) {\n if (((ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i] === val || \n val instanceof vec &&\n val.equals((ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i]) ||\n typeof (ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i] === "object" &&\n ρσ_equals((ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i], val))) {\n return true;\n }\n }\n return false;\n};\n\nfunction ρσ_list_eq(other) {\n if (!ρσ_arraylike(other)) {\n return false;\n }\n if ((this.length !== other.length && (typeof this.length !== "object" || ρσ_not_equals(this.length, other.length)))) {\n return false;\n }\n for (var i = 0; i < this.length; i++) {\n if (!((((ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] === other[(typeof i === "number" && i < 0) ? other.length + i : i] || typeof (ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] === "object" && ρσ_equals((ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i], other[(typeof i === "number" && i < 0) ? other.length + i : i]))))) {\n return false;\n }\n }\n return true;\n};\nif (!ρσ_list_eq.__argnames__) Object.defineProperties(ρσ_list_eq, {\n __argnames__ : {value: ["other"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_decorate(ans) {\n ans.append = Array.prototype.push;\n ans.toString = ρσ_list_to_string;\n ans.inspect = ρσ_list_to_string;\n ans.extend = ρσ_list_extend;\n ans.index = ρσ_list_index;\n ans.pypop = ρσ_list_pop;\n ans.remove = ρσ_list_remove;\n ans.insert = ρσ_list_insert;\n ans.copy = ρσ_list_copy;\n ans.clear = ρσ_list_clear;\n ans.count = ρσ_list_count;\n ans.concat = ρσ_list_concat;\n ans.pysort = ρσ_list_sort;\n ans.slice = ρσ_list_slice;\n ans.as_array = ρσ_list_as_array;\n ans.__len__ = ρσ_list_len;\n ans.__contains__ = ρσ_list_contains;\n ans.__eq__ = ρσ_list_eq;\n ans.constructor = ρσ_list_constructor;\n if (typeof ans[ρσ_iterator_symbol] !== "function") {\n ans[ρσ_iterator_symbol] = ρσ_list_iterator;\n }\n return ans;\n};\nif (!ρσ_list_decorate.__argnames__) Object.defineProperties(ρσ_list_decorate, {\n __argnames__ : {value: ["ans"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_constructor(iterable) {\n var ans, iterator, result;\n if (iterable === undefined) {\n ans = [];\n } else if (ρσ_arraylike(iterable)) {\n ans = new Array(iterable.length);\n for (var i = 0; i < iterable.length; i++) {\n ans[(typeof i === "number" && i < 0) ? ans.length + i : i] = iterable[(typeof i === "number" && i < 0) ? iterable.length + i : i];\n }\n } else if (typeof iterable[ρσ_iterator_symbol] === "function") {\n iterator = (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();\n ans = ρσ_list_decorate([]);\n result = iterator.next();\n while (!result.done) {\n ans.push(result.value);\n result = iterator.next();\n }\n } else if (typeof iterable === "number") {\n ans = new Array(iterable);\n } else {\n ans = Object.keys(iterable);\n }\n return ρσ_list_decorate(ans);\n};\nif (!ρσ_list_constructor.__argnames__) Object.defineProperties(ρσ_list_constructor, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\n\nρσ_list_constructor.__name__ = "list";\nvar list = ρσ_list_constructor, list_wrap = ρσ_list_decorate;\nfunction sorted() {\n var iterable = ( 0 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true) ? undefined : arguments[0];\n var key = (arguments[1] === undefined || ( 1 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? sorted.__defaults__.key : arguments[1];\n var reverse = (arguments[2] === undefined || ( 2 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? sorted.__defaults__.reverse : arguments[2];\n var ρσ_kwargs_obj = arguments[arguments.length-1];\n if (ρσ_kwargs_obj === null || typeof ρσ_kwargs_obj !== "object" || ρσ_kwargs_obj [ρσ_kwargs_symbol] !== true) ρσ_kwargs_obj = {};\n if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "key")){\n key = ρσ_kwargs_obj.key;\n }\n if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "reverse")){\n reverse = ρσ_kwargs_obj.reverse;\n }\n var ans;\n ans = ρσ_list_constructor(iterable);\n ans.pysort(key, reverse);\n return ans;\n};\nif (!sorted.__defaults__) Object.defineProperties(sorted, {\n __defaults__ : {value: {key:null, reverse:false}},\n __handles_kwarg_interpolation__ : {value: true},\n __argnames__ : {value: ["iterable", "key", "reverse"]},\n __module__ : {value: "__main__"}\n});\n\nvar ρσ_global_object_id = 0, ρσ_set_implementation;\nfunction ρσ_set_keyfor(x) {\n var t, ans;\n t = typeof x;\n if (t === "string" || t === "number" || t === "boolean") {\n return "_" + t[0] + x;\n }\n if (x === null) {\n return "__!@#$0";\n }\n ans = x.ρσ_hash_key_prop;\n if (ans === undefined) {\n ans = "_!@#$" + (++ρσ_global_object_id);\n Object.defineProperty(x, "ρσ_hash_key_prop", (function(){\n var ρσ_d = {};\n ρσ_d["value"] = ans;\n return ρσ_d;\n }).call(this));\n }\n return ans;\n};\nif (!ρσ_set_keyfor.__argnames__) Object.defineProperties(ρσ_set_keyfor, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_set_polyfill() {\n this._store = {};\n this.size = 0;\n};\nif (!ρσ_set_polyfill.__module__) Object.defineProperties(ρσ_set_polyfill, {\n __module__ : {value: "__main__"}\n});\n\nρσ_set_polyfill.prototype.add = (function() {\n var ρσ_anonfunc = function (x) {\n var key;\n key = ρσ_set_keyfor(x);\n if (!Object.prototype.hasOwnProperty.call(this._store, key)) {\n this.size += 1;\n (ρσ_expr_temp = this._store)[(typeof key === "number" && key < 0) ? ρσ_expr_temp.length + key : key] = x;\n }\n return this;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set_polyfill.prototype.clear = (function() {\n var ρσ_anonfunc = function (x) {\n this._store = {};\n this.size = 0;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set_polyfill.prototype.delete = (function() {\n var ρσ_anonfunc = function (x) {\n var key;\n key = ρσ_set_keyfor(x);\n if (Object.prototype.hasOwnProperty.call(this._store, key)) {\n this.size -= 1;\n delete this._store[key];\n return true;\n }\n return false;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set_polyfill.prototype.has = (function() {\n var ρσ_anonfunc = function (x) {\n return Object.prototype.hasOwnProperty.call(this._store, ρσ_set_keyfor(x));\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set_polyfill.prototype.values = (function() {\n var ρσ_anonfunc = function (x) {\n var ans;\n ans = {\'_keys\': Object.keys(this._store), \'_i\':-1, \'_s\':this._store};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n this._i += 1;\n if (this._i >= this._keys.length) {\n return {\'done\': true};\n }\n return {\'done\':false, \'value\':this._s[this._keys[this._i]]};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nif (typeof Set !== "function" || typeof Set.prototype.delete !== "function") {\n ρσ_set_implementation = ρσ_set_polyfill;\n} else {\n ρσ_set_implementation = Set;\n}\nfunction ρσ_set(iterable) {\n var ans, s, iterator, result, keys;\n if (this instanceof ρσ_set) {\n this.jsset = new ρσ_set_implementation;\n ans = this;\n if (iterable === undefined) {\n return ans;\n }\n s = ans.jsset;\n if (ρσ_arraylike(iterable)) {\n for (var i = 0; i < iterable.length; i++) {\n s.add(iterable[(typeof i === "number" && i < 0) ? iterable.length + i : i]);\n }\n } else if (typeof iterable[ρσ_iterator_symbol] === "function") {\n iterator = (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();\n result = iterator.next();\n while (!result.done) {\n s.add(result.value);\n result = iterator.next();\n }\n } else {\n keys = Object.keys(iterable);\n for (var j=0; j < keys.length; j++) {\n s.add(keys[(typeof j === "number" && j < 0) ? keys.length + j : j]);\n }\n }\n return ans;\n } else {\n return new ρσ_set(iterable);\n }\n};\nif (!ρσ_set.__argnames__) Object.defineProperties(ρσ_set, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\n\nρσ_set.prototype.__name__ = "set";\nObject.defineProperties(ρσ_set.prototype, (function(){\n var ρσ_d = {};\n ρσ_d["length"] = (function(){\n var ρσ_d = {};\n ρσ_d["get"] = (function() {\n var ρσ_anonfunc = function () {\n return this.jsset.size;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this);\n ρσ_d["size"] = (function(){\n var ρσ_d = {};\n ρσ_d["get"] = (function() {\n var ρσ_anonfunc = function () {\n return this.jsset.size;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this);\n return ρσ_d;\n}).call(this));\nρσ_set.prototype.__len__ = (function() {\n var ρσ_anonfunc = function () {\n return this.jsset.size;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.has = ρσ_set.prototype.__contains__ = (function() {\n var ρσ_anonfunc = function (x) {\n return this.jsset.has(x);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.add = (function() {\n var ρσ_anonfunc = function (x) {\n this.jsset.add(x);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.clear = (function() {\n var ρσ_anonfunc = function () {\n this.jsset.clear();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.copy = (function() {\n var ρσ_anonfunc = function () {\n return ρσ_set(this);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.discard = (function() {\n var ρσ_anonfunc = function (x) {\n this.jsset.delete(x);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this.jsset.values();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.difference = (function() {\n var ρσ_anonfunc = function () {\n var ans, s, iterator, r, x, has;\n ans = new ρσ_set;\n s = ans.jsset;\n iterator = this.jsset.values();\n r = iterator.next();\n while (!r.done) {\n x = r.value;\n has = false;\n for (var i = 0; i < arguments.length; i++) {\n if (arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i].has(x)) {\n has = true;\n break;\n }\n }\n if (!has) {\n s.add(x);\n }\n r = iterator.next();\n }\n return ans;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.difference_update = (function() {\n var ρσ_anonfunc = function () {\n var s, remove, iterator, r, x;\n s = this.jsset;\n remove = [];\n iterator = s.values();\n r = iterator.next();\n while (!r.done) {\n x = r.value;\n for (var i = 0; i < arguments.length; i++) {\n if (arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i].has(x)) {\n remove.push(x);\n break;\n }\n }\n r = iterator.next();\n }\n for (var j = 0; j < remove.length; j++) {\n s.delete(remove[(typeof j === "number" && j < 0) ? remove.length + j : j]);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.intersection = (function() {\n var ρσ_anonfunc = function () {\n var ans, s, iterator, r, x, has;\n ans = new ρσ_set;\n s = ans.jsset;\n iterator = this.jsset.values();\n r = iterator.next();\n while (!r.done) {\n x = r.value;\n has = true;\n for (var i = 0; i < arguments.length; i++) {\n if (!arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i].has(x)) {\n has = false;\n break;\n }\n }\n if (has) {\n s.add(x);\n }\n r = iterator.next();\n }\n return ans;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.intersection_update = (function() {\n var ρσ_anonfunc = function () {\n var s, remove, iterator, r, x;\n s = this.jsset;\n remove = [];\n iterator = s.values();\n r = iterator.next();\n while (!r.done) {\n x = r.value;\n for (var i = 0; i < arguments.length; i++) {\n if (!arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i].has(x)) {\n remove.push(x);\n break;\n }\n }\n r = iterator.next();\n }\n for (var j = 0; j < remove.length; j++) {\n s.delete(remove[(typeof j === "number" && j < 0) ? remove.length + j : j]);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.isdisjoint = (function() {\n var ρσ_anonfunc = function (other) {\n var iterator, r, x;\n iterator = this.jsset.values();\n r = iterator.next();\n while (!r.done) {\n x = r.value;\n if (other.has(x)) {\n return false;\n }\n r = iterator.next();\n }\n return true;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["other"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.issubset = (function() {\n var ρσ_anonfunc = function (other) {\n var iterator, r, x;\n iterator = this.jsset.values();\n r = iterator.next();\n while (!r.done) {\n x = r.value;\n if (!other.has(x)) {\n return false;\n }\n r = iterator.next();\n }\n return true;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["other"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.issuperset = (function() {\n var ρσ_anonfunc = function (other) {\n var s, iterator, r, x;\n s = this.jsset;\n iterator = other.jsset.values();\n r = iterator.next();\n while (!r.done) {\n x = r.value;\n if (!s.has(x)) {\n return false;\n }\n r = iterator.next();\n }\n return true;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["other"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.pypop = (function() {\n var ρσ_anonfunc = function () {\n var iterator, r;\n iterator = this.jsset.values();\n r = iterator.next();\n if (r.done) {\n throw new KeyError("pop from an empty set");\n }\n this.jsset.delete(r.value);\n return r.value;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.remove = (function() {\n var ρσ_anonfunc = function (x) {\n if (!this.jsset.delete(x)) {\n throw new KeyError(x.toString());\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.symmetric_difference = (function() {\n var ρσ_anonfunc = function (other) {\n return this.union(other).difference(this.intersection(other));\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["other"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.symmetric_difference_update = (function() {\n var ρσ_anonfunc = function (other) {\n var common;\n common = this.intersection(other);\n this.update(other);\n this.difference_update(common);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["other"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.union = (function() {\n var ρσ_anonfunc = function () {\n var ans;\n ans = ρσ_set(this);\n ans.update.apply(ans, arguments);\n return ans;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.update = (function() {\n var ρσ_anonfunc = function () {\n var s, iterator, r;\n s = this.jsset;\n for (var i=0; i < arguments.length; i++) {\n iterator = arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i][ρσ_iterator_symbol]();\n r = iterator.next();\n while (!r.done) {\n s.add(r.value);\n r = iterator.next();\n }\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.toString = ρσ_set.prototype.__repr__ = ρσ_set.prototype.__str__ = ρσ_set.prototype.inspect = (function() {\n var ρσ_anonfunc = function () {\n return "{" + list(this).join(", ") + "}";\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.__eq__ = (function() {\n var ρσ_anonfunc = function (other) {\n var iterator, r;\n if (!other instanceof this.constructor) {\n return false;\n }\n if (other.size !== this.size) {\n return false;\n }\n if (other.size === 0) {\n return true;\n }\n iterator = other[ρσ_iterator_symbol]();\n r = iterator.next();\n while (!r.done) {\n if (!this.has(r.value)) {\n return false;\n }\n r = iterator.next();\n }\n return true;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["other"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nfunction ρσ_set_wrap(x) {\n var ans;\n ans = new ρσ_set;\n ans.jsset = x;\n return ans;\n};\nif (!ρσ_set_wrap.__argnames__) Object.defineProperties(ρσ_set_wrap, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nvar set = ρσ_set, set_wrap = ρσ_set_wrap;\nvar ρσ_dict_implementation;\nfunction ρσ_dict_polyfill() {\n this._store = {};\n this.size = 0;\n};\nif (!ρσ_dict_polyfill.__module__) Object.defineProperties(ρσ_dict_polyfill, {\n __module__ : {value: "__main__"}\n});\n\nρσ_dict_polyfill.prototype.set = (function() {\n var ρσ_anonfunc = function (x, value) {\n var key;\n key = ρσ_set_keyfor(x);\n if (!Object.prototype.hasOwnProperty.call(this._store, key)) {\n this.size += 1;\n }\n (ρσ_expr_temp = this._store)[(typeof key === "number" && key < 0) ? ρσ_expr_temp.length + key : key] = [x, value];\n return this;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x", "value"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict_polyfill.prototype.clear = (function() {\n var ρσ_anonfunc = function (x) {\n this._store = {};\n this.size = 0;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict_polyfill.prototype.delete = (function() {\n var ρσ_anonfunc = function (x) {\n var key;\n key = ρσ_set_keyfor(x);\n if (Object.prototype.hasOwnProperty.call(this._store, key)) {\n this.size -= 1;\n delete this._store[key];\n return true;\n }\n return false;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict_polyfill.prototype.has = (function() {\n var ρσ_anonfunc = function (x) {\n return Object.prototype.hasOwnProperty.call(this._store, ρσ_set_keyfor(x));\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict_polyfill.prototype.get = (function() {\n var ρσ_anonfunc = function (x) {\n try {\n return (ρσ_expr_temp = this._store)[ρσ_bound_index(ρσ_set_keyfor(x), ρσ_expr_temp)][1];\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n if (ρσ_Exception instanceof TypeError) {\n return undefined;\n } else {\n throw ρσ_Exception;\n }\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict_polyfill.prototype.values = (function() {\n var ρσ_anonfunc = function (x) {\n var ans;\n ans = {\'_keys\': Object.keys(this._store), \'_i\':-1, \'_s\':this._store};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n this._i += 1;\n if (this._i >= this._keys.length) {\n return {\'done\': true};\n }\n return {\'done\':false, \'value\':this._s[this._keys[this._i]][1]};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict_polyfill.prototype.keys = (function() {\n var ρσ_anonfunc = function (x) {\n var ans;\n ans = {\'_keys\': Object.keys(this._store), \'_i\':-1, \'_s\':this._store};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n this._i += 1;\n if (this._i >= this._keys.length) {\n return {\'done\': true};\n }\n return {\'done\':false, \'value\':this._s[this._keys[this._i]][0]};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict_polyfill.prototype.entries = (function() {\n var ρσ_anonfunc = function (x) {\n var ans;\n ans = {\'_keys\': Object.keys(this._store), \'_i\':-1, \'_s\':this._store};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n this._i += 1;\n if (this._i >= this._keys.length) {\n return {\'done\': true};\n }\n return {\'done\':false, \'value\':this._s[this._keys[this._i]]};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nif (typeof Map !== "function" || typeof Map.prototype.delete !== "function") {\n ρσ_dict_implementation = ρσ_dict_polyfill;\n} else {\n ρσ_dict_implementation = Map;\n}\nfunction ρσ_dict() {\n var iterable = ( 0 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true) ? undefined : arguments[0];\n var kw = arguments[arguments.length-1];\n if (kw === null || typeof kw !== "object" || kw [ρσ_kwargs_symbol] !== true) kw = {};\n if (this instanceof ρσ_dict) {\n this.jsmap = new ρσ_dict_implementation;\n if (iterable !== undefined) {\n this.update(iterable);\n }\n this.update(kw);\n return this;\n } else {\n return ρσ_interpolate_kwargs_constructor.call(Object.create(ρσ_dict.prototype), false, ρσ_dict, [iterable].concat([ρσ_desugar_kwargs(kw)]));\n }\n};\nif (!ρσ_dict.__handles_kwarg_interpolation__) Object.defineProperties(ρσ_dict, {\n __handles_kwarg_interpolation__ : {value: true},\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\n\nρσ_dict.prototype.__name__ = "dict";\nObject.defineProperties(ρσ_dict.prototype, (function(){\n var ρσ_d = {};\n ρσ_d["length"] = (function(){\n var ρσ_d = {};\n ρσ_d["get"] = (function() {\n var ρσ_anonfunc = function () {\n return this.jsmap.size;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this);\n ρσ_d["size"] = (function(){\n var ρσ_d = {};\n ρσ_d["get"] = (function() {\n var ρσ_anonfunc = function () {\n return this.jsmap.size;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this);\n return ρσ_d;\n}).call(this));\nρσ_dict.prototype.__len__ = (function() {\n var ρσ_anonfunc = function () {\n return this.jsmap.size;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.has = ρσ_dict.prototype.__contains__ = (function() {\n var ρσ_anonfunc = function (x) {\n return this.jsmap.has(x);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.set = ρσ_dict.prototype.__setitem__ = (function() {\n var ρσ_anonfunc = function (key, value) {\n this.jsmap.set(key, value);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["key", "value"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.__delitem__ = (function() {\n var ρσ_anonfunc = function (key) {\n this.jsmap.delete(key);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["key"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.clear = (function() {\n var ρσ_anonfunc = function () {\n this.jsmap.clear();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.copy = (function() {\n var ρσ_anonfunc = function () {\n return ρσ_dict(this);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.keys = (function() {\n var ρσ_anonfunc = function () {\n return this.jsmap.keys();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.values = (function() {\n var ρσ_anonfunc = function () {\n return this.jsmap.values();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.items = ρσ_dict.prototype.entries = (function() {\n var ρσ_anonfunc = function () {\n return this.jsmap.entries();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this.jsmap.keys();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.__getitem__ = (function() {\n var ρσ_anonfunc = function (key) {\n var ans;\n ans = this.jsmap.get(key);\n if (ans === undefined && !this.jsmap.has(key)) {\n throw new KeyError(key + "");\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["key"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.get = (function() {\n var ρσ_anonfunc = function (key, defval) {\n var ans;\n ans = this.jsmap.get(key);\n if (ans === undefined && !this.jsmap.has(key)) {\n return (defval === undefined) ? null : defval;\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["key", "defval"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.set_default = ρσ_dict.prototype.setdefault = (function() {\n var ρσ_anonfunc = function (key, defval) {\n var j;\n j = this.jsmap;\n if (!j.has(key)) {\n j.set(key, defval);\n return defval;\n }\n return j.get(key);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["key", "defval"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.fromkeys = ρσ_dict.prototype.fromkeys = (function() {\n var ρσ_anonfunc = function () {\n var iterable = ( 0 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true) ? undefined : arguments[0];\n var value = (arguments[1] === undefined || ( 1 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? ρσ_anonfunc.__defaults__.value : arguments[1];\n var ρσ_kwargs_obj = arguments[arguments.length-1];\n if (ρσ_kwargs_obj === null || typeof ρσ_kwargs_obj !== "object" || ρσ_kwargs_obj [ρσ_kwargs_symbol] !== true) ρσ_kwargs_obj = {};\n if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "value")){\n value = ρσ_kwargs_obj.value;\n }\n var ans, iterator, r;\n ans = ρσ_dict();\n iterator = iter(iterable);\n r = iterator.next();\n while (!r.done) {\n ans.set(r.value, value);\n r = iterator.next();\n }\n return ans;\n };\n if (!ρσ_anonfunc.__defaults__) Object.defineProperties(ρσ_anonfunc, {\n __defaults__ : {value: {value:null}},\n __handles_kwarg_interpolation__ : {value: true},\n __argnames__ : {value: ["iterable", "value"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.pypop = (function() {\n var ρσ_anonfunc = function (key, defval) {\n var ans;\n ans = this.jsmap.get(key);\n if (ans === undefined && !this.jsmap.has(key)) {\n if (defval === undefined) {\n throw new KeyError(key);\n }\n return defval;\n }\n this.jsmap.delete(key);\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["key", "defval"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.popitem = (function() {\n var ρσ_anonfunc = function () {\n var last, e, r;\n last = null;\n e = this.jsmap.entries();\n while (true) {\n r = e.next();\n if (r.done) {\n if (last === null) {\n throw new KeyError("dict is empty");\n }\n this.jsmap.delete(last.value[0]);\n return last.value;\n }\n last = r;\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.update = (function() {\n var ρσ_anonfunc = function () {\n var m, iterable, iterator, result, keys;\n if (arguments.length === 0) {\n return;\n }\n m = this.jsmap;\n iterable = arguments[0];\n if (Array.isArray(iterable)) {\n for (var i = 0; i < iterable.length; i++) {\n m.set(iterable[(typeof i === "number" && i < 0) ? iterable.length + i : i][0], iterable[(typeof i === "number" && i < 0) ? iterable.length + i : i][1]);\n }\n } else if (iterable instanceof ρσ_dict) {\n iterator = iterable.items();\n result = iterator.next();\n while (!result.done) {\n m.set(result.value[0], result.value[1]);\n result = iterator.next();\n }\n } else if (typeof Map === "function" && iterable instanceof Map) {\n iterator = iterable.entries();\n result = iterator.next();\n while (!result.done) {\n m.set(result.value[0], result.value[1]);\n result = iterator.next();\n }\n } else if (typeof iterable[ρσ_iterator_symbol] === "function") {\n iterator = iterable[ρσ_iterator_symbol]();\n result = iterator.next();\n while (!result.done) {\n m.set(result.value[0], result.value[1]);\n result = iterator.next();\n }\n } else {\n keys = Object.keys(iterable);\n for (var j=0; j < keys.length; j++) {\n if (keys[(typeof j === "number" && j < 0) ? keys.length + j : j] !== ρσ_iterator_symbol) {\n m.set(keys[(typeof j === "number" && j < 0) ? keys.length + j : j], iterable[ρσ_bound_index(keys[(typeof j === "number" && j < 0) ? keys.length + j : j], iterable)]);\n }\n }\n }\n if (arguments.length > 1) {\n ρσ_dict.prototype.update.call(this, arguments[1]);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.toString = ρσ_dict.prototype.inspect = ρσ_dict.prototype.__str__ = ρσ_dict.prototype.__repr__ = (function() {\n var ρσ_anonfunc = function () {\n var entries, iterator, r;\n entries = [];\n iterator = this.jsmap.entries();\n r = iterator.next();\n while (!r.done) {\n entries.push(ρσ_repr(r.value[0]) + ": " + ρσ_repr(r.value[1]));\n r = iterator.next();\n }\n return "{" + entries.join(", ") + "}";\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.__eq__ = (function() {\n var ρσ_anonfunc = function (other) {\n var iterator, r, x;\n if (!(other instanceof this.constructor)) {\n return false;\n }\n if (other.size !== this.size) {\n return false;\n }\n if (other.size === 0) {\n return true;\n }\n iterator = other.items();\n r = iterator.next();\n while (!r.done) {\n x = this.jsmap.get(r.value[0]);\n if (x === undefined && !this.jsmap.has(r.value[0]) || x !== r.value[1]) {\n return false;\n }\n r = iterator.next();\n }\n return true;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["other"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.as_object = (function() {\n var ρσ_anonfunc = function (other) {\n var ans, iterator, r;\n ans = {};\n iterator = this.jsmap.entries();\n r = iterator.next();\n while (!r.done) {\n ans[ρσ_bound_index(r.value[0], ans)] = r.value[1];\n r = iterator.next();\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["other"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nfunction ρσ_dict_wrap(x) {\n var ans;\n ans = new ρσ_dict;\n ans.jsmap = x;\n return ans;\n};\nif (!ρσ_dict_wrap.__argnames__) Object.defineProperties(ρσ_dict_wrap, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nvar dict = ρσ_dict, dict_wrap = ρσ_dict_wrap;// }}}\nvar NameError;\nNameError = ReferenceError;\nfunction Exception() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n Exception.prototype.__init__.apply(this, arguments);\n}\nρσ_extends(Exception, Error);\nException.prototype.__init__ = function __init__(message) {\n var self = this;\n self.message = message;\n self.stack = (new Error).stack;\n self.name = self.constructor.name;\n};\nif (!Exception.prototype.__init__.__argnames__) Object.defineProperties(Exception.prototype.__init__, {\n __argnames__ : {value: ["message"]},\n __module__ : {value: "__main__"}\n});\nException.__argnames__ = Exception.prototype.__init__.__argnames__;\nException.__handles_kwarg_interpolation__ = Exception.prototype.__init__.__handles_kwarg_interpolation__;\nException.prototype.__repr__ = function __repr__() {\n var self = this;\n return self.name + ": " + self.message;\n};\nif (!Exception.prototype.__repr__.__module__) Object.defineProperties(Exception.prototype.__repr__, {\n __module__ : {value: "__main__"}\n});\nException.prototype.__str__ = function __str__ () {\n if(Error.prototype.__str__) return Error.prototype.__str__.call(this);\nreturn this.__repr__();\n};\nObject.defineProperty(Exception.prototype, "__bases__", {value: [Error]});\n\nfunction AttributeError() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AttributeError.prototype.__init__.apply(this, arguments);\n}\nρσ_extends(AttributeError, Exception);\nAttributeError.prototype.__init__ = function __init__ () {\n Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);\n};\nAttributeError.prototype.__repr__ = function __repr__ () {\n if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n};\nAttributeError.prototype.__str__ = function __str__ () {\n if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);\nreturn this.__repr__();\n};\nObject.defineProperty(AttributeError.prototype, "__bases__", {value: [Exception]});\n\n\nfunction IndexError() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n IndexError.prototype.__init__.apply(this, arguments);\n}\nρσ_extends(IndexError, Exception);\nIndexError.prototype.__init__ = function __init__ () {\n Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);\n};\nIndexError.prototype.__repr__ = function __repr__ () {\n if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n};\nIndexError.prototype.__str__ = function __str__ () {\n if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);\nreturn this.__repr__();\n};\nObject.defineProperty(IndexError.prototype, "__bases__", {value: [Exception]});\n\n\nfunction KeyError() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n KeyError.prototype.__init__.apply(this, arguments);\n}\nρσ_extends(KeyError, Exception);\nKeyError.prototype.__init__ = function __init__ () {\n Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);\n};\nKeyError.prototype.__repr__ = function __repr__ () {\n if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n};\nKeyError.prototype.__str__ = function __str__ () {\n if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);\nreturn this.__repr__();\n};\nObject.defineProperty(KeyError.prototype, "__bases__", {value: [Exception]});\n\n\nfunction ValueError() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n ValueError.prototype.__init__.apply(this, arguments);\n}\nρσ_extends(ValueError, Exception);\nValueError.prototype.__init__ = function __init__ () {\n Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);\n};\nValueError.prototype.__repr__ = function __repr__ () {\n if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n};\nValueError.prototype.__str__ = function __str__ () {\n if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);\nreturn this.__repr__();\n};\nObject.defineProperty(ValueError.prototype, "__bases__", {value: [Exception]});\n\n\nfunction UnicodeDecodeError() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n UnicodeDecodeError.prototype.__init__.apply(this, arguments);\n}\nρσ_extends(UnicodeDecodeError, Exception);\nUnicodeDecodeError.prototype.__init__ = function __init__ () {\n Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);\n};\nUnicodeDecodeError.prototype.__repr__ = function __repr__ () {\n if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n};\nUnicodeDecodeError.prototype.__str__ = function __str__ () {\n if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);\nreturn this.__repr__();\n};\nObject.defineProperty(UnicodeDecodeError.prototype, "__bases__", {value: [Exception]});\n\n\nfunction AssertionError() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AssertionError.prototype.__init__.apply(this, arguments);\n}\nρσ_extends(AssertionError, Exception);\nAssertionError.prototype.__init__ = function __init__ () {\n Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);\n};\nAssertionError.prototype.__repr__ = function __repr__ () {\n if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n};\nAssertionError.prototype.__str__ = function __str__ () {\n if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);\nreturn this.__repr__();\n};\nObject.defineProperty(AssertionError.prototype, "__bases__", {value: [Exception]});\n\n\nfunction ZeroDivisionError() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n ZeroDivisionError.prototype.__init__.apply(this, arguments);\n}\nρσ_extends(ZeroDivisionError, Exception);\nZeroDivisionError.prototype.__init__ = function __init__ () {\n Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);\n};\nZeroDivisionError.prototype.__repr__ = function __repr__ () {\n if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n};\nZeroDivisionError.prototype.__str__ = function __str__ () {\n if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);\nreturn this.__repr__();\n};\nObject.defineProperty(ZeroDivisionError.prototype, "__bases__", {value: [Exception]});\n\nvar ρσ_in, ρσ_desugar_kwargs, ρσ_exists;\nfunction ρσ_eslice(arr, step, start, end) {\n var is_string;\n if (typeof arr === "string" || arr instanceof String) {\n is_string = true;\n arr = arr.split("");\n }\n if (step < 0) {\n step = -step;\n arr = arr.slice().reverse();\n if (typeof start !== "undefined") {\n start = arr.length - start - 1;\n }\n if (typeof end !== "undefined") {\n end = arr.length - end - 1;\n }\n }\n if (typeof start === "undefined") {\n start = 0;\n }\n if (typeof end === "undefined") {\n end = arr.length;\n }\n arr = arr.slice(start, end).filter((function() {\n var ρσ_anonfunc = function (e, i) {\n return i % step === 0;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["e", "i"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })());\n if (is_string) {\n arr = arr.join("");\n }\n return arr;\n};\nif (!ρσ_eslice.__argnames__) Object.defineProperties(ρσ_eslice, {\n __argnames__ : {value: ["arr", "step", "start", "end"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_delslice(arr, step, start, end) {\n var is_string, ρσ_unpack, indices;\n if (typeof arr === "string" || arr instanceof String) {\n is_string = true;\n arr = arr.split("");\n }\n if (step < 0) {\n if (typeof start === "undefined") {\n start = arr.length;\n }\n if (typeof end === "undefined") {\n end = 0;\n }\n ρσ_unpack = [end, start, -step];\n start = ρσ_unpack[0];\n end = ρσ_unpack[1];\n step = ρσ_unpack[2];\n }\n if (typeof start === "undefined") {\n start = 0;\n }\n if (typeof end === "undefined") {\n end = arr.length;\n }\n if (step === 1) {\n arr.splice(start, end - start);\n } else {\n if (end > start) {\n indices = [];\n for (var i = start; i < end; i += step) {\n indices.push(i);\n }\n for (var i = indices.length - 1; i >= 0; i--) {\n arr.splice(indices[(typeof i === "number" && i < 0) ? indices.length + i : i], 1);\n }\n }\n }\n if (is_string) {\n arr = arr.join("");\n }\n return arr;\n};\nif (!ρσ_delslice.__argnames__) Object.defineProperties(ρσ_delslice, {\n __argnames__ : {value: ["arr", "step", "start", "end"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_flatten(arr) {\n var ans, value;\n ans = ρσ_list_decorate([]);\n for (var i=0; i < arr.length; i++) {\n value = arr[(typeof i === "number" && i < 0) ? arr.length + i : i];\n if (Array.isArray(value)) {\n ans = ans.concat(ρσ_flatten(value));\n } else {\n ans.push(value);\n }\n }\n return ans;\n};\nif (!ρσ_flatten.__argnames__) Object.defineProperties(ρσ_flatten, {\n __argnames__ : {value: ["arr"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_unpack_asarray(num, iterable) {\n var ans, iterator, result;\n if (ρσ_arraylike(iterable)) {\n return iterable;\n }\n ans = [];\n if (typeof iterable[ρσ_iterator_symbol] === "function") {\n iterator = (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();\n result = iterator.next();\n while (!result.done && ans.length < num) {\n ans.push(result.value);\n result = iterator.next();\n }\n }\n return ans;\n};\nif (!ρσ_unpack_asarray.__argnames__) Object.defineProperties(ρσ_unpack_asarray, {\n __argnames__ : {value: ["num", "iterable"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_extends(child, parent) {\n child.prototype = Object.create(parent.prototype);\n child.prototype.constructor = child;\n};\nif (!ρσ_extends.__argnames__) Object.defineProperties(ρσ_extends, {\n __argnames__ : {value: ["child", "parent"]},\n __module__ : {value: "__main__"}\n});\n\nρσ_in = (function() {\n var ρσ_anonfunc = function () {\n if (typeof Map === "function" && typeof Set === "function") {\n return (function() {\n var ρσ_anonfunc = function (val, arr) {\n if (typeof arr === "string") {\n return arr.indexOf(val) !== -1;\n }\n if (typeof arr.__contains__ === "function") {\n return arr.__contains__(val);\n }\n if (arr instanceof Map || arr instanceof Set) {\n return arr.has(val);\n }\nif (arr instanceof vec)\n {\n return ρσ_list_contains.call(arr, val);\n}\n if (ρσ_arraylike(arr)) {\n return ρσ_list_contains.call(arr, val);\n }\n return Object.prototype.hasOwnProperty.call(arr, val);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["val", "arr"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n }\n return (function() {\n var ρσ_anonfunc = function (val, arr) {\n if (typeof arr === "string") {\n return arr.indexOf(val) !== -1;\n }\n if (typeof arr.__contains__ === "function") {\n return arr.__contains__(val);\n }\nif (arr instanceof vec)\n {\n return ρσ_list_contains.call(arr, val);\n}\n if (ρσ_arraylike(arr)) {\n return ρσ_list_contains.call(arr, val);\n }\n return Object.prototype.hasOwnProperty.call(arr, val);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["val", "arr"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})()();\nfunction ρσ_Iterable(iterable) {\n var iterator, ans, result;\n if (ρσ_arraylike(iterable)) {\n return iterable;\n }\n if (typeof iterable[ρσ_iterator_symbol] === "function") {\n iterator = (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();\n ans = ρσ_list_decorate([]);\n result = iterator.next();\n while (!result.done) {\n ans.push(result.value);\n result = iterator.next();\n }\n return ans;\n }\n return Object.keys(iterable);\n};\nif (!ρσ_Iterable.__argnames__) Object.defineProperties(ρσ_Iterable, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\n\nρσ_desugar_kwargs = (function() {\n var ρσ_anonfunc = function () {\n if (typeof Object.assign === "function") {\n return (function() {\n var ρσ_anonfunc = function () {\n var ans;\n ans = Object.create(null);\n ans[ρσ_kwargs_symbol] = true;\n for (var i = 0; i < arguments.length; i++) {\n Object.assign(ans, arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i]);\n }\n return ans;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n }\n return (function() {\n var ρσ_anonfunc = function () {\n var ans, keys;\n ans = Object.create(null);\n ans[ρσ_kwargs_symbol] = true;\n for (var i = 0; i < arguments.length; i++) {\n keys = Object.keys(arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i]);\n for (var j = 0; j < keys.length; j++) {\n ans[ρσ_bound_index(keys[(typeof j === "number" && j < 0) ? keys.length + j : j], ans)] = (ρσ_expr_temp = arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i])[ρσ_bound_index(keys[(typeof j === "number" && j < 0) ? keys.length + j : j], ρσ_expr_temp)];\n }\n }\n return ans;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})()();\nfunction ρσ_interpolate_kwargs(f, supplied_args) {\n var has_prop, kwobj, args, prop;\n if (!f.__argnames__) {\n return f.apply(this, supplied_args);\n }\n has_prop = Object.prototype.hasOwnProperty;\n kwobj = supplied_args.pop();\n if (f.__handles_kwarg_interpolation__) {\n args = new Array(Math.max(supplied_args.length, f.__argnames__.length) + 1);\n args[args.length-1] = kwobj;\n for (var i = 0; i < args.length - 1; i++) {\n if (i < f.__argnames__.length) {\n prop = (ρσ_expr_temp = f.__argnames__)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i];\n if (has_prop.call(kwobj, prop)) {\n args[(typeof i === "number" && i < 0) ? args.length + i : i] = kwobj[(typeof prop === "number" && prop < 0) ? kwobj.length + prop : prop];\n delete kwobj[prop];\n } else if (i < supplied_args.length) {\n args[(typeof i === "number" && i < 0) ? args.length + i : i] = supplied_args[(typeof i === "number" && i < 0) ? supplied_args.length + i : i];\n }\n } else {\n args[(typeof i === "number" && i < 0) ? args.length + i : i] = supplied_args[(typeof i === "number" && i < 0) ? supplied_args.length + i : i];\n }\n }\n return f.apply(this, args);\n }\n for (var i = 0; i < f.__argnames__.length; i++) {\n prop = (ρσ_expr_temp = f.__argnames__)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i];\n if (has_prop.call(kwobj, prop)) {\n supplied_args[(typeof i === "number" && i < 0) ? supplied_args.length + i : i] = kwobj[(typeof prop === "number" && prop < 0) ? kwobj.length + prop : prop];\n }\n }\n return f.apply(this, supplied_args);\n};\nif (!ρσ_interpolate_kwargs.__argnames__) Object.defineProperties(ρσ_interpolate_kwargs, {\n __argnames__ : {value: ["f", "supplied_args"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_interpolate_kwargs_constructor(apply, f, supplied_args) {\n if (apply) {\n f.apply(this, supplied_args);\n } else {\n ρσ_interpolate_kwargs.call(this, f, supplied_args);\n }\n return this;\n};\nif (!ρσ_interpolate_kwargs_constructor.__argnames__) Object.defineProperties(ρσ_interpolate_kwargs_constructor, {\n __argnames__ : {value: ["apply", "f", "supplied_args"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_getitem(obj, key) {\n if (obj.__getitem__) {\n return obj.__getitem__(key);\n }\n if (typeof key === "number" && key < 0) {\n key += obj.length;\n }\n return obj[(typeof key === "number" && key < 0) ? obj.length + key : key];\n};\nif (!ρσ_getitem.__argnames__) Object.defineProperties(ρσ_getitem, {\n __argnames__ : {value: ["obj", "key"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_setitem(obj, key, val) {\n if (obj.__setitem__) {\n obj.__setitem__(key, val);\n } else {\n if (typeof key === "number" && key < 0) {\n key += obj.length;\n }\n obj[(typeof key === "number" && key < 0) ? obj.length + key : key] = val;\n }\n return val;\n};\nif (!ρσ_setitem.__argnames__) Object.defineProperties(ρσ_setitem, {\n __argnames__ : {value: ["obj", "key", "val"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_delitem(obj, key) {\n if (obj.__delitem__) {\n obj.__delitem__(key);\n } else if (typeof obj.splice === "function") {\n obj.splice(key, 1);\n } else {\n if (typeof key === "number" && key < 0) {\n key += obj.length;\n }\n delete obj[key];\n }\n};\nif (!ρσ_delitem.__argnames__) Object.defineProperties(ρσ_delitem, {\n __argnames__ : {value: ["obj", "key"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_bound_index(idx, arr) {\n if (typeof idx === "number" && idx < 0) {\n idx += arr.length;\n }\n return idx;\n};\nif (!ρσ_bound_index.__argnames__) Object.defineProperties(ρσ_bound_index, {\n __argnames__ : {value: ["idx", "arr"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_splice(arr, val, start, end) {\n start = start || 0;\n if (start < 0) {\n start += arr.length;\n }\n if (end === undefined) {\n end = arr.length;\n }\n if (end < 0) {\n end += arr.length;\n }\n Array.prototype.splice.apply(arr, [start, end - start].concat(val));\n};\nif (!ρσ_splice.__argnames__) Object.defineProperties(ρσ_splice, {\n __argnames__ : {value: ["arr", "val", "start", "end"]},\n __module__ : {value: "__main__"}\n});\n\nρσ_exists = (function(){\n var ρσ_d = {};\n ρσ_d["n"] = (function() {\n var ρσ_anonfunc = function (expr) {\n return expr !== undefined && expr !== null;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["expr"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ρσ_d["d"] = (function() {\n var ρσ_anonfunc = function (expr) {\n if (expr === undefined || expr === null) {\n return Object.create(null);\n }\n return expr;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["expr"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ρσ_d["c"] = (function() {\n var ρσ_anonfunc = function (expr) {\n if (typeof expr === "function") {\n return expr;\n }\n return (function() {\n var ρσ_anonfunc = function () {\n return undefined;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["expr"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ρσ_d["g"] = (function() {\n var ρσ_anonfunc = function (expr) {\n if (expr === undefined || expr === null || typeof expr.__getitem__ !== "function") {\n return (function(){\n var ρσ_d = {};\n ρσ_d["__getitem__"] = (function() {\n var ρσ_anonfunc = function () {\n return undefined;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this);\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["expr"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ρσ_d["e"] = (function() {\n var ρσ_anonfunc = function (expr, alt) {\n return (expr === undefined || expr === null) ? alt : expr;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["expr", "alt"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n}).call(this);\nfunction ρσ_mixin() {\n var seen, resolved_props, p, target, props, name;\n seen = Object.create(null);\n seen.__argnames__ = seen.__handles_kwarg_interpolation__ = seen.__init__ = seen.__annotations__ = seen.__doc__ = seen.__bind_methods__ = seen.__bases__ = seen.constructor = seen.__class__ = true;\n resolved_props = {};\n p = target = arguments[0].prototype;\n while (p && p !== Object.prototype) {\n props = Object.getOwnPropertyNames(p);\n for (var i = 0; i < props.length; i++) {\n seen[ρσ_bound_index(props[(typeof i === "number" && i < 0) ? props.length + i : i], seen)] = true;\n }\n p = Object.getPrototypeOf(p);\n }\n for (var c = 1; c < arguments.length; c++) {\n p = arguments[(typeof c === "number" && c < 0) ? arguments.length + c : c].prototype;\n while (p && p !== Object.prototype) {\n props = Object.getOwnPropertyNames(p);\n for (var i = 0; i < props.length; i++) {\n name = props[(typeof i === "number" && i < 0) ? props.length + i : i];\n if (seen[(typeof name === "number" && name < 0) ? seen.length + name : name]) {\n continue;\n }\n seen[(typeof name === "number" && name < 0) ? seen.length + name : name] = true;\n resolved_props[(typeof name === "number" && name < 0) ? resolved_props.length + name : name] = Object.getOwnPropertyDescriptor(p, name);\n }\n p = Object.getPrototypeOf(p);\n }\n }\n Object.defineProperties(target, resolved_props);\n};\nif (!ρσ_mixin.__module__) Object.defineProperties(ρσ_mixin, {\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_instanceof() {\n var obj, bases, q, cls, p;\n obj = arguments[0];\n bases = "";\n if (obj && obj.constructor && obj.constructor.prototype) {\n bases = obj.constructor.prototype.__bases__ || "";\n }\n for (var i = 1; i < arguments.length; i++) {\n q = arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i];\n if (obj instanceof q) {\n return true;\n }\n if ((q === Array || q === ρσ_list_constructor) && Array.isArray(obj)) {\n return true;\n }\n if (q === ρσ_str && (typeof obj === "string" || obj instanceof String)) {\n return true;\n }\n if (q === ρσ_int && typeof obj === "number" && Number.isInteger(obj)) {\n return true;\n }\n if (q === ρσ_float && typeof obj === "number" && !Number.isInteger(obj)) {\n return true;\n }\n if (bases.length > 1) {\n for (var c = 1; c < bases.length; c++) {\n cls = bases[(typeof c === "number" && c < 0) ? bases.length + c : c];\n while (cls) {\n if (q === cls) {\n return true;\n }\n p = Object.getPrototypeOf(cls.prototype);\n if (!p) {\n break;\n }\n cls = p.constructor;\n }\n }\n }\n }\n return false;\n};\nif (!ρσ_instanceof.__module__) Object.defineProperties(ρσ_instanceof, {\n __module__ : {value: "__main__"}\n});\nfunction sum(iterable, start) {\n var ans, iterator, r;\n if (Array.isArray(iterable)) {\n return iterable.reduce((function() {\n var ρσ_anonfunc = function (prev, cur) {\n return prev + cur;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["prev", "cur"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })(), start || 0);\n }\n ans = start || 0;\n iterator = iter(iterable);\n r = iterator.next();\n while (!r.done) {\n ans += r.value;\n r = iterator.next();\n }\n return ans;\n};\nif (!sum.__argnames__) Object.defineProperties(sum, {\n __argnames__ : {value: ["iterable", "start"]},\n __module__ : {value: "__main__"}\n});\n\nfunction map() {\n var iterators, func, args, ans;\n iterators = new Array(arguments.length - 1);\n func = arguments[0];\n args = new Array(arguments.length - 1);\n for (var i = 1; i < arguments.length; i++) {\n iterators[ρσ_bound_index(i - 1, iterators)] = iter(arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i]);\n }\n ans = {\'_func\':func, \'_iterators\':iterators, \'_args\':args};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n var r;\n for (var i = 0; i < this._iterators.length; i++) {\n r = (ρσ_expr_temp = this._iterators)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i].next();\n if (r.done) {\n return {\'done\':true};\n }\n (ρσ_expr_temp = this._args)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] = r.value;\n }\n return {\'done\':false, \'value\':this._func.apply(undefined, this._args)};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n};\nif (!map.__module__) Object.defineProperties(map, {\n __module__ : {value: "__main__"}\n});\n\nfunction filter(func_or_none, iterable) {\n var func, ans;\n func = (func_or_none === null) ? ρσ_bool : func_or_none;\n ans = {\'_func\':func, \'_iterator\':ρσ_iter(iterable)};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n var r;\n r = this._iterator.next();\n while (!r.done) {\n if (this._func(r.value)) {\n return r;\n }\n r = this._iterator.next();\n }\n return {\'done\':true};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n};\nif (!filter.__argnames__) Object.defineProperties(filter, {\n __argnames__ : {value: ["func_or_none", "iterable"]},\n __module__ : {value: "__main__"}\n});\n\nfunction zip() {\n var iterators, ans;\n iterators = new Array(arguments.length);\n for (var i = 0; i < arguments.length; i++) {\n iterators[(typeof i === "number" && i < 0) ? iterators.length + i : i] = iter(arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i]);\n }\n ans = {\'_iterators\':iterators};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n var args, r;\n args = new Array(this._iterators.length);\n for (var i = 0; i < this._iterators.length; i++) {\n r = (ρσ_expr_temp = this._iterators)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i].next();\n if (r.done) {\n return {\'done\':true};\n }\n args[(typeof i === "number" && i < 0) ? args.length + i : i] = r.value;\n }\n return {\'done\':false, \'value\':args};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n};\nif (!zip.__module__) Object.defineProperties(zip, {\n __module__ : {value: "__main__"}\n});\n\nfunction any(iterable) {\n var i;\n var ρσ_Iter0 = ρσ_Iterable(iterable);\n for (var ρσ_Index0 = 0; ρσ_Index0 < ρσ_Iter0.length; ρσ_Index0++) {\n i = ρσ_Iter0[ρσ_Index0];\n if (i) {\n return true;\n }\n }\n return false;\n};\nif (!any.__argnames__) Object.defineProperties(any, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\n\nfunction all(iterable) {\n var i;\n var ρσ_Iter1 = ρσ_Iterable(iterable);\n for (var ρσ_Index1 = 0; ρσ_Index1 < ρσ_Iter1.length; ρσ_Index1++) {\n i = ρσ_Iter1[ρσ_Index1];\n if (!i) {\n return false;\n }\n }\n return true;\n};\nif (!all.__argnames__) Object.defineProperties(all, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\nvar decimal_sep, define_str_func, ρσ_unpack, ρσ_orig_split, ρσ_orig_replace;\ndecimal_sep = 1.1.toLocaleString()[1];\nfunction ρσ_repr_js_builtin(x, as_array) {\n var ans, b, keys, key;\n ans = [];\n b = "{}";\n if (as_array) {\n b = "[]";\n for (var i = 0; i < x.length; i++) {\n ans.push(ρσ_repr(x[(typeof i === "number" && i < 0) ? x.length + i : i]));\n }\n } else {\n keys = Object.keys(x);\n for (var k = 0; k < keys.length; k++) {\n key = keys[(typeof k === "number" && k < 0) ? keys.length + k : k];\n ans.push(JSON.stringify(key) + ":" + ρσ_repr(x[(typeof key === "number" && key < 0) ? x.length + key : key]));\n }\n }\n return b[0] + ans.join(", ") + b[1];\n};\nif (!ρσ_repr_js_builtin.__argnames__) Object.defineProperties(ρσ_repr_js_builtin, {\n __argnames__ : {value: ["x", "as_array"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_html_element_to_string(elem) {\n var attrs, val, attr, ans;\n attrs = [];\n var ρσ_Iter0 = ρσ_Iterable(elem.attributes);\n for (var ρσ_Index0 = 0; ρσ_Index0 < ρσ_Iter0.length; ρσ_Index0++) {\n attr = ρσ_Iter0[ρσ_Index0];\n if (attr.specified) {\n val = attr.value;\n if (val.length > 10) {\n val = val.slice(0, 15) + "...";\n }\n val = JSON.stringify(val);\n attrs.push("" + ρσ_str.format("{}", attr.name) + "=" + ρσ_str.format("{}", val) + "");\n }\n }\n attrs = (attrs.length) ? " " + attrs.join(" ") : "";\n ans = "<" + ρσ_str.format("{}", elem.tagName) + "" + ρσ_str.format("{}", attrs) + ">";\n return ans;\n};\nif (!ρσ_html_element_to_string.__argnames__) Object.defineProperties(ρσ_html_element_to_string, {\n __argnames__ : {value: ["elem"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_repr(x) {\n var ans, name;\n if (x === null) {\n return "None";\n }\n if (x === undefined) {\n return "undefined";\n }\n ans = x;\n if (typeof x.__repr__ === "function") {\n ans = x.__repr__();\n } else if (x === true || x === false) {\n ans = (x) ? "True" : "False";\n } else if (Array.isArray(x)) {\n ans = ρσ_repr_js_builtin(x, true);\n } else if (typeof x === "function") {\n ans = x.toString();\n } else if (typeof x === "object" && !x.toString) {\n ans = ρσ_repr_js_builtin(x);\n } else {\n name = Object.prototype.toString.call(x).slice(8, -1);\n if (ρσ_not_equals("Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".indexOf(name), -1)) {\n return name + "([" + x.map((function() {\n var ρσ_anonfunc = function (i) {\n return str.format("0x{:02x}", i);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["i"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })()).join(", ") + "])";\n }\n if (typeof HTMLElement !== "undefined" && x instanceof HTMLElement) {\n ans = ρσ_html_element_to_string(x);\n } else {\n ans = (typeof x.toString === "function") ? x.toString() : x;\n }\n if (ans === "[object Object]") {\n return ρσ_repr_js_builtin(x);\n }\n try {\n ans = JSON.stringify(x);\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n {\n } \n }\n }\n return ans + "";\n};\nif (!ρσ_repr.__argnames__) Object.defineProperties(ρσ_repr, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_str(x) {\n var ans, name;\n if (x === null) {\n return "None";\n }\n if (x === undefined) {\n return "undefined";\n }\n ans = x;\n if (typeof x.__str__ === "function") {\n ans = x.__str__();\n } else if (typeof x.__repr__ === "function") {\n ans = x.__repr__();\n } else if (x === true || x === false) {\n ans = (x) ? "True" : "False";\n } else if (Array.isArray(x)) {\n ans = ρσ_repr_js_builtin(x, true);\n } else if (typeof x.toString === "function") {\n name = Object.prototype.toString.call(x).slice(8, -1);\n if (ρσ_not_equals("Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".indexOf(name), -1)) {\n return name + "([" + x.map((function() {\n var ρσ_anonfunc = function (i) {\n return str.format("0x{:02x}", i);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["i"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })()).join(", ") + "])";\n }\n if (typeof HTMLElement !== "undefined" && x instanceof HTMLElement) {\n ans = ρσ_html_element_to_string(x);\n } else {\n ans = x.toString();\n }\n if (ans === "[object Object]") {\n ans = ρσ_repr_js_builtin(x);\n }\n } else if (typeof x === "object" && !x.toString) {\n ans = ρσ_repr_js_builtin(x);\n }\n return ans + "";\n};\nif (!ρσ_str.__argnames__) Object.defineProperties(ρσ_str, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\ndefine_str_func = (function() {\n var ρσ_anonfunc = function (name, func) {\n var f;\n (ρσ_expr_temp = ρσ_str.prototype)[(typeof name === "number" && name < 0) ? ρσ_expr_temp.length + name : name] = func;\n ρσ_str[(typeof name === "number" && name < 0) ? ρσ_str.length + name : name] = f = func.call.bind(func);\n if (func.__argnames__) {\n Object.defineProperty(f, "__argnames__", (function(){\n var ρσ_d = {};\n ρσ_d["value"] = [\'string\'].concat(func.__argnames__);\n return ρσ_d;\n }).call(this));\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["name", "func"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_unpack = [String.prototype.split.call.bind(String.prototype.split), String.prototype.replace.call.bind(String.prototype.replace)];\nρσ_orig_split = ρσ_unpack[0];\nρσ_orig_replace = ρσ_unpack[1];\ndefine_str_func("format", (function() {\n var ρσ_anonfunc = function () {\n var template, args, kwargs, explicit, implicit, idx, split, ans, pos, in_brace, markup, ch;\n template = this;\n if (template === undefined) {\n throw new TypeError("Template is required");\n }\n args = Array.prototype.slice.call(arguments);\n kwargs = {};\n if (args[args.length-1] && args[args.length-1][ρσ_kwargs_symbol] !== undefined) {\n kwargs = args[args.length-1];\n args = args.slice(0, -1);\n }\n explicit = implicit = false;\n idx = 0;\n split = ρσ_orig_split;\n if (ρσ_str.format._template_resolve_pat === undefined) {\n ρσ_str.format._template_resolve_pat = /[.\\[]/;\n }\n function resolve(arg, object) {\n var ρσ_unpack, first, key, rest, ans;\n if (!arg) {\n return object;\n }\n ρσ_unpack = [arg[0], arg.slice(1)];\n first = ρσ_unpack[0];\n arg = ρσ_unpack[1];\n key = split(arg, ρσ_str.format._template_resolve_pat, 1)[0];\n rest = arg.slice(key.length);\n ans = (first === "[") ? object[ρσ_bound_index(key.slice(0, -1), object)] : getattr(object, key);\n if (ans === undefined) {\n throw new KeyError((first === "[") ? key.slice(0, -1) : key);\n }\n return resolve(rest, ans);\n };\n if (!resolve.__argnames__) Object.defineProperties(resolve, {\n __argnames__ : {value: ["arg", "object"]},\n __module__ : {value: "__main__"}\n });\n\n function resolve_format_spec(format_spec) {\n if (ρσ_str.format._template_resolve_fs_pat === undefined) {\n ρσ_str.format._template_resolve_fs_pat = /[{]([a-zA-Z0-9_]+)[}]/g;\n }\n return format_spec.replace(ρσ_str.format._template_resolve_fs_pat, (function() {\n var ρσ_anonfunc = function (match, key) {\n if (!Object.prototype.hasOwnProperty.call(kwargs, key)) {\n return "";\n }\n return "" + kwargs[(typeof key === "number" && key < 0) ? kwargs.length + key : key];\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["match", "key"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!resolve_format_spec.__argnames__) Object.defineProperties(resolve_format_spec, {\n __argnames__ : {value: ["format_spec"]},\n __module__ : {value: "__main__"}\n });\n\n function set_comma(ans, comma) {\n var sep;\n if (comma !== ",") {\n sep = 1234;\n sep = sep.toLocaleString(undefined, {useGrouping: true})[1];\n ans = str.replace(ans, sep, comma);\n }\n return ans;\n };\n if (!set_comma.__argnames__) Object.defineProperties(set_comma, {\n __argnames__ : {value: ["ans", "comma"]},\n __module__ : {value: "__main__"}\n });\n\n function safe_comma(value, comma) {\n try {\n return set_comma(value.toLocaleString(undefined, {useGrouping: true}), comma);\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n {\n return value.toString(10);\n } \n }\n };\n if (!safe_comma.__argnames__) Object.defineProperties(safe_comma, {\n __argnames__ : {value: ["value", "comma"]},\n __module__ : {value: "__main__"}\n });\n\n function safe_fixed(value, precision, comma) {\n if (!comma) {\n return value.toFixed(precision);\n }\n try {\n return set_comma(value.toLocaleString(undefined, {useGrouping: true, minimumFractionDigits: precision, maximumFractionDigits: precision}), comma);\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n {\n return value.toFixed(precision);\n } \n }\n };\n if (!safe_fixed.__argnames__) Object.defineProperties(safe_fixed, {\n __argnames__ : {value: ["value", "precision", "comma"]},\n __module__ : {value: "__main__"}\n });\n\n function apply_formatting(value, format_spec) {\n var ρσ_unpack, fill, align, sign, fhash, zeropad, width, comma, precision, ftype, is_numeric, is_int, lftype, code, prec, exp, nval, is_positive, left, right;\n if (format_spec.indexOf("{") !== -1) {\n format_spec = resolve_format_spec(format_spec);\n }\n if (ρσ_str.format._template_format_pat === undefined) {\n ρσ_str.format._template_format_pat = /([^{}](?=[<>=^]))?([<>=^])?([-+\\x20])?(\\#)?(0)?(\\d+)?([,_])?(?:\\.(\\d+))?([bcdeEfFgGnosxX%])?/;\n }\n try {\n ρσ_unpack = format_spec.match(ρσ_str.format._template_format_pat).slice(1);\nρσ_unpack = ρσ_unpack_asarray(9, ρσ_unpack);\n fill = ρσ_unpack[0];\n align = ρσ_unpack[1];\n sign = ρσ_unpack[2];\n fhash = ρσ_unpack[3];\n zeropad = ρσ_unpack[4];\n width = ρσ_unpack[5];\n comma = ρσ_unpack[6];\n precision = ρσ_unpack[7];\n ftype = ρσ_unpack[8];\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n if (ρσ_Exception instanceof TypeError) {\n return value;\n } else {\n throw ρσ_Exception;\n }\n }\n if (zeropad) {\n fill = fill || "0";\n align = align || "=";\n } else {\n fill = fill || " ";\n align = align || ">";\n }\n is_numeric = Number(value) === value;\n is_int = is_numeric && value % 1 === 0;\n precision = parseInt(precision, 10);\n lftype = (ftype || "").toLowerCase();\n if (ftype === "n") {\n is_numeric = true;\n if (is_int) {\n if (comma) {\n throw new ValueError("Cannot specify \',\' with \'n\'");\n }\n value = parseInt(value, 10).toLocaleString();\n } else {\n value = parseFloat(value).toLocaleString();\n }\n } else if ([\'b\', \'c\', \'d\', \'o\', \'x\'].indexOf(lftype) !== -1) {\n value = parseInt(value, 10);\n is_numeric = true;\n if (!isNaN(value)) {\n if (ftype === "b") {\n value = (value >>> 0).toString(2);\n if (fhash) {\n value = "0b" + value;\n }\n } else if (ftype === "c") {\n if (value > 65535) {\n code = value - 65536;\n value = String.fromCharCode(55296 + (code >> 10), 56320 + (code & 1023));\n } else {\n value = String.fromCharCode(value);\n }\n } else if (ftype === "d") {\n if (comma) {\n value = safe_comma(value, comma);\n } else {\n value = value.toString(10);\n }\n } else if (ftype === "o") {\n value = value.toString(8);\n if (fhash) {\n value = "0o" + value;\n }\n } else if (lftype === "x") {\n value = value.toString(16);\n value = (ftype === "x") ? value.toLowerCase() : value.toUpperCase();\n if (fhash) {\n value = "0x" + value;\n }\n }\n }\n } else if ([\'e\',\'f\',\'g\',\'%\'].indexOf(lftype) !== -1) {\n is_numeric = true;\n value = parseFloat(value);\n prec = (isNaN(precision)) ? 6 : precision;\n if (lftype === "e") {\n value = value.toExponential(prec);\n value = (ftype === "E") ? value.toUpperCase() : value.toLowerCase();\n } else if (lftype === "f") {\n value = safe_fixed(value, prec, comma);\n value = (ftype === "F") ? value.toUpperCase() : value.toLowerCase();\n } else if (lftype === "%") {\n value *= 100;\n value = safe_fixed(value, prec, comma) + "%";\n } else if (lftype === "g") {\n prec = max(1, prec);\n exp = parseInt(split(value.toExponential(prec - 1).toLowerCase(), "e")[1], 10);\n if (-4 <= exp && exp < prec) {\n value = safe_fixed(value, prec - 1 - exp, comma);\n } else {\n value = value.toExponential(prec - 1);\n }\n value = value.replace(/0+$/g, "");\n if (value[value.length-1] === decimal_sep) {\n value = value.slice(0, -1);\n }\n if (ftype === "G") {\n value = value.toUpperCase();\n }\n }\n } else {\n if (comma) {\n value = parseInt(value, 10);\n if (isNaN(value)) {\n throw new ValueError("Must use numbers with , or _");\n }\n value = safe_comma(value, comma);\n }\n value += "";\n if (!isNaN(precision)) {\n value = value.slice(0, precision);\n }\n }\n value += "";\n if (is_numeric && sign) {\n nval = Number(value);\n is_positive = !isNaN(nval) && nval >= 0;\n if (is_positive && (sign === " " || sign === "+")) {\n value = sign + value;\n }\n }\n function repeat(char, num) {\n return (new Array(num+1)).join(char);\n };\n if (!repeat.__argnames__) Object.defineProperties(repeat, {\n __argnames__ : {value: ["char", "num"]},\n __module__ : {value: "__main__"}\n });\n\n if (is_numeric && width && width[0] === "0") {\n width = width.slice(1);\n ρσ_unpack = ["0", "="];\n fill = ρσ_unpack[0];\n align = ρσ_unpack[1];\n }\n width = parseInt(width || "-1", 10);\n if (isNaN(width)) {\n throw new ValueError("Invalid width specification: " + width);\n }\n if (fill && value.length < width) {\n if (align === "<") {\n value = value + repeat(fill, width - value.length);\n } else if (align === ">") {\n value = repeat(fill, width - value.length) + value;\n } else if (align === "^") {\n left = Math.floor((width - value.length) / 2);\n right = width - left - value.length;\n value = repeat(fill, left) + value + repeat(fill, right);\n } else if (align === "=") {\n if (ρσ_in(value[0], "+- ")) {\n value = value[0] + repeat(fill, width - value.length) + value.slice(1);\n } else {\n value = repeat(fill, width - value.length) + value;\n }\n } else {\n throw new ValueError("Unrecognized alignment: " + align);\n }\n }\n return value;\n };\n if (!apply_formatting.__argnames__) Object.defineProperties(apply_formatting, {\n __argnames__ : {value: ["value", "format_spec"]},\n __module__ : {value: "__main__"}\n });\n\n function parse_markup(markup) {\n var key, transformer, format_spec, pos, state, ch;\n key = transformer = format_spec = "";\n pos = 0;\n state = 0;\n while (pos < markup.length) {\n ch = markup[(typeof pos === "number" && pos < 0) ? markup.length + pos : pos];\n if (state === 0) {\n if (ch === "!") {\n state = 1;\n } else if (ch === ":") {\n state = 2;\n } else {\n key += ch;\n }\n } else if (state === 1) {\n if (ch === ":") {\n state = 2;\n } else {\n transformer += ch;\n }\n } else {\n format_spec += ch;\n }\n pos += 1;\n }\n return [key, transformer, format_spec];\n };\n if (!parse_markup.__argnames__) Object.defineProperties(parse_markup, {\n __argnames__ : {value: ["markup"]},\n __module__ : {value: "__main__"}\n });\n\n function render_markup(markup) {\n var ρσ_unpack, key, transformer, format_spec, ends_with_equal, lkey, nvalue, object, ans;\n ρσ_unpack = parse_markup(markup);\nρσ_unpack = ρσ_unpack_asarray(3, ρσ_unpack);\n key = ρσ_unpack[0];\n transformer = ρσ_unpack[1];\n format_spec = ρσ_unpack[2];\n if (transformer && [\'a\', \'r\', \'s\'].indexOf(transformer) === -1) {\n throw new ValueError("Unknown conversion specifier: " + transformer);\n }\n ends_with_equal = key.endsWith("=");\n if (ends_with_equal) {\n key = key.slice(0, -1);\n }\n lkey = key.length && split(key, /[.\\[]/, 1)[0];\n if (lkey) {\n explicit = true;\n if (implicit) {\n throw new ValueError("cannot switch from automatic field numbering to manual field specification");\n }\n nvalue = parseInt(lkey);\n object = (isNaN(nvalue)) ? kwargs[(typeof lkey === "number" && lkey < 0) ? kwargs.length + lkey : lkey] : args[(typeof nvalue === "number" && nvalue < 0) ? args.length + nvalue : nvalue];\n if (object === undefined) {\n if (isNaN(nvalue)) {\n throw new KeyError(lkey);\n }\n throw new IndexError(lkey);\n }\n object = resolve(key.slice(lkey.length), object);\n } else {\n implicit = true;\n if (explicit) {\n throw new ValueError("cannot switch from manual field specification to automatic field numbering");\n }\n if (idx >= args.length) {\n throw new IndexError("Not enough arguments to match template: " + template);\n }\n object = args[(typeof idx === "number" && idx < 0) ? args.length + idx : idx];\n idx += 1;\n }\n if (typeof object === "function") {\n object = object();\n }\n ans = "" + object;\n if (format_spec) {\n ans = apply_formatting(ans, format_spec);\n }\n if (ends_with_equal) {\n ans = "" + ρσ_str.format("{}", key) + "=" + ρσ_str.format("{}", ans) + "";\n }\n return ans;\n };\n if (!render_markup.__argnames__) Object.defineProperties(render_markup, {\n __argnames__ : {value: ["markup"]},\n __module__ : {value: "__main__"}\n });\n\n ans = "";\n pos = 0;\n in_brace = 0;\n markup = "";\n while (pos < template.length) {\n ch = template[(typeof pos === "number" && pos < 0) ? template.length + pos : pos];\n if (in_brace) {\n if (ch === "{") {\n in_brace += 1;\n markup += "{";\n } else if (ch === "}") {\n in_brace -= 1;\n if (in_brace > 0) {\n markup += "}";\n } else {\n ans += render_markup(markup);\n }\n } else {\n markup += ch;\n }\n } else {\n if (ch === "{") {\n if (template[ρσ_bound_index(pos + 1, template)] === "{") {\n pos += 1;\n ans += "{";\n } else {\n in_brace = 1;\n markup = "";\n }\n } else {\n ans += ch;\n if (ch === "}" && template[ρσ_bound_index(pos + 1, template)] === "}") {\n pos += 1;\n }\n }\n }\n pos += 1;\n }\n if (in_brace) {\n throw new ValueError("expected \'}\' before end of string");\n }\n return ans;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("capitalize", (function() {\n var ρσ_anonfunc = function () {\n var string;\n string = this;\n if (string) {\n string = string[0].toUpperCase() + string.slice(1).toLowerCase();\n }\n return string;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("center", (function() {\n var ρσ_anonfunc = function (width, fill) {\n var left, right;\n left = Math.floor((width - this.length) / 2);\n right = width - left - this.length;\n fill = fill || " ";\n return new Array(left+1).join(fill) + this + new Array(right+1).join(fill);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["width", "fill"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("count", (function() {\n var ρσ_anonfunc = function (needle, start, end) {\n var string, ρσ_unpack, pos, step, ans;\n string = this;\n start = start || 0;\n end = end || string.length;\n if (start < 0 || end < 0) {\n string = string.slice(start, end);\n ρσ_unpack = [0, string.length];\n start = ρσ_unpack[0];\n end = ρσ_unpack[1];\n }\n pos = start;\n step = needle.length;\n if (!step) {\n return 0;\n }\n ans = 0;\n while (pos !== -1) {\n pos = string.indexOf(needle, pos);\n if (pos !== -1) {\n ans += 1;\n pos += step;\n }\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["needle", "start", "end"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("endswith", (function() {\n var ρσ_anonfunc = function (suffixes, start, end) {\n var string, q;\n string = this;\n start = start || 0;\n if (typeof suffixes === "string") {\n suffixes = [suffixes];\n }\n if (end !== undefined) {\n string = string.slice(0, end);\n }\n for (var i = 0; i < suffixes.length; i++) {\n q = suffixes[(typeof i === "number" && i < 0) ? suffixes.length + i : i];\n if (string.indexOf(q, Math.max(start, string.length - q.length)) !== -1) {\n return true;\n }\n }\n return false;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["suffixes", "start", "end"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("startswith", (function() {\n var ρσ_anonfunc = function (prefixes, start, end) {\n var prefix;\n start = start || 0;\n if (typeof prefixes === "string") {\n prefixes = [prefixes];\n }\n for (var i = 0; i < prefixes.length; i++) {\n prefix = prefixes[(typeof i === "number" && i < 0) ? prefixes.length + i : i];\n end = (end === undefined) ? this.length : end;\n if (end - start >= prefix.length && prefix === this.slice(start, start + prefix.length)) {\n return true;\n }\n }\n return false;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["prefixes", "start", "end"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("find", (function() {\n var ρσ_anonfunc = function (needle, start, end) {\n var ans;\n while (start < 0) {\n start += this.length;\n }\n ans = this.indexOf(needle, start);\n if (end !== undefined && ans !== -1) {\n while (end < 0) {\n end += this.length;\n }\n if (ans >= end - needle.length) {\n return -1;\n }\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["needle", "start", "end"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("rfind", (function() {\n var ρσ_anonfunc = function (needle, start, end) {\n var ans;\n while (end < 0) {\n end += this.length;\n }\n ans = this.lastIndexOf(needle, end - 1);\n if (start !== undefined && ans !== -1) {\n while (start < 0) {\n start += this.length;\n }\n if (ans < start) {\n return -1;\n }\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["needle", "start", "end"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("index", (function() {\n var ρσ_anonfunc = function (needle, start, end) {\n var ans;\n ans = ρσ_str.prototype.find.apply(this, arguments);\n if (ans === -1) {\n throw new ValueError("substring not found");\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["needle", "start", "end"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("rindex", (function() {\n var ρσ_anonfunc = function (needle, start, end) {\n var ans;\n ans = ρσ_str.prototype.rfind.apply(this, arguments);\n if (ans === -1) {\n throw new ValueError("substring not found");\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["needle", "start", "end"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("islower", (function() {\n var ρσ_anonfunc = function () {\n return this.length > 0 && this.toLowerCase() === this.toString();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("isupper", (function() {\n var ρσ_anonfunc = function () {\n return this.length > 0 && this.toUpperCase() === this.toString();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("isspace", (function() {\n var ρσ_anonfunc = function () {\n return this.length > 0 && /^\\s+$/.test(this);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("join", (function() {\n var ρσ_anonfunc = function (iterable) {\n var ans, r;\n if (Array.isArray(iterable)) {\n return iterable.join(this);\n }\n ans = "";\n r = iterable.next();\n while (!r.done) {\n if (ans) {\n ans += this;\n }\n ans += r.value;\n r = iterable.next();\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("ljust", (function() {\n var ρσ_anonfunc = function (width, fill) {\n var string;\n string = this;\n if (width > string.length) {\n fill = fill || " ";\n string += new Array(width - string.length + 1).join(fill);\n }\n return string;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["width", "fill"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("rjust", (function() {\n var ρσ_anonfunc = function (width, fill) {\n var string;\n string = this;\n if (width > string.length) {\n fill = fill || " ";\n string = new Array(width - string.length + 1).join(fill) + string;\n }\n return string;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["width", "fill"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("lower", (function() {\n var ρσ_anonfunc = function () {\n return this.toLowerCase();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("upper", (function() {\n var ρσ_anonfunc = function () {\n return this.toUpperCase();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("lstrip", (function() {\n var ρσ_anonfunc = function (chars) {\n var string, pos;\n string = this;\n pos = 0;\n chars = chars || ρσ_str.whitespace;\n while (chars.indexOf(string[(typeof pos === "number" && pos < 0) ? string.length + pos : pos]) !== -1) {\n pos += 1;\n }\n if (pos) {\n string = string.slice(pos);\n }\n return string;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["chars"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("rstrip", (function() {\n var ρσ_anonfunc = function (chars) {\n var string, pos;\n string = this;\n pos = string.length - 1;\n chars = chars || ρσ_str.whitespace;\n while (chars.indexOf(string[(typeof pos === "number" && pos < 0) ? string.length + pos : pos]) !== -1) {\n pos -= 1;\n }\n if (pos < string.length - 1) {\n string = string.slice(0, pos + 1);\n }\n return string;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["chars"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("strip", (function() {\n var ρσ_anonfunc = function (chars) {\n return ρσ_str.prototype.lstrip.call(ρσ_str.prototype.rstrip.call(this, chars), chars);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["chars"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("partition", (function() {\n var ρσ_anonfunc = function (sep) {\n var idx;\n idx = this.indexOf(sep);\n if (idx === -1) {\n return [this, "", ""];\n }\n return [this.slice(0, idx), sep, this.slice(idx + sep.length)];\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["sep"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("rpartition", (function() {\n var ρσ_anonfunc = function (sep) {\n var idx;\n idx = this.lastIndexOf(sep);\n if (idx === -1) {\n return ["", "", this];\n }\n return [this.slice(0, idx), sep, this.slice(idx + sep.length)];\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["sep"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("replace", (function() {\n var ρσ_anonfunc = function (old, repl, count) {\n var string, pos, idx;\n string = this;\n if (count === 1) {\n return ρσ_orig_replace(string, old, repl);\n }\n if (count < 1) {\n return string;\n }\n count = count || Number.MAX_VALUE;\n pos = 0;\n while (count > 0) {\n count -= 1;\n idx = string.indexOf(old, pos);\n if (idx === -1) {\n break;\n }\n pos = idx + repl.length;\n string = string.slice(0, idx) + repl + string.slice(idx + old.length);\n }\n return string;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["old", "repl", "count"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("split", (function() {\n var ρσ_anonfunc = function (sep, maxsplit) {\n var split, ans, extra, parts;\n if (maxsplit === 0) {\n return ρσ_list_decorate([ this ]);\n }\n split = ρσ_orig_split;\n if (sep === undefined || sep === null) {\n if (maxsplit > 0) {\n ans = split(this, /(\\s+)/);\n extra = "";\n parts = [];\n for (var i = 0; i < ans.length; i++) {\n if (parts.length >= maxsplit + 1) {\n extra += ans[(typeof i === "number" && i < 0) ? ans.length + i : i];\n } else if (i % 2 === 0) {\n parts.push(ans[(typeof i === "number" && i < 0) ? ans.length + i : i]);\n }\n }\n parts[parts.length-1] += extra;\n ans = parts;\n } else {\n ans = split(this, /\\s+/);\n }\n } else {\n if (sep === "") {\n throw new ValueError("empty separator");\n }\n ans = split(this, sep);\n if (maxsplit > 0 && ans.length > maxsplit) {\n extra = ans.slice(maxsplit).join(sep);\n ans = ans.slice(0, maxsplit);\n ans.push(extra);\n }\n }\n return ρσ_list_decorate(ans);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["sep", "maxsplit"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("rsplit", (function() {\n var ρσ_anonfunc = function (sep, maxsplit) {\n var split, ans, is_space, pos, current, spc, ch, end, idx;\n if (!maxsplit) {\n return ρσ_str.prototype.split.call(this, sep);\n }\n split = ρσ_orig_split;\n if (sep === undefined || sep === null) {\n if (maxsplit > 0) {\n ans = [];\n is_space = /\\s/;\n pos = this.length - 1;\n current = "";\n while (pos > -1 && maxsplit > 0) {\n spc = false;\n ch = (ρσ_expr_temp = this)[(typeof pos === "number" && pos < 0) ? ρσ_expr_temp.length + pos : pos];\n while (pos > -1 && is_space.test(ch)) {\n spc = true;\n ch = this[--pos];\n }\n if (spc) {\n if (current) {\n ans.push(current);\n maxsplit -= 1;\n }\n current = ch;\n } else {\n current += ch;\n }\n pos -= 1;\n }\n ans.push(this.slice(0, pos + 1) + current);\n ans.reverse();\n } else {\n ans = split(this, /\\s+/);\n }\n } else {\n if (sep === "") {\n throw new ValueError("empty separator");\n }\n ans = [];\n pos = end = this.length;\n while (pos > -1 && maxsplit > 0) {\n maxsplit -= 1;\n idx = this.lastIndexOf(sep, pos);\n if (idx === -1) {\n break;\n }\n ans.push(this.slice(idx + sep.length, end));\n pos = idx - 1;\n end = idx;\n }\n ans.push(this.slice(0, end));\n ans.reverse();\n }\n return ρσ_list_decorate(ans);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["sep", "maxsplit"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("splitlines", (function() {\n var ρσ_anonfunc = function (keepends) {\n var split, parts, ans;\n split = ρσ_orig_split;\n if (keepends) {\n parts = split(this, /((?:\\r?\\n)|\\r)/);\n ans = [];\n for (var i = 0; i < parts.length; i++) {\n if (i % 2 === 0) {\n ans.push(parts[(typeof i === "number" && i < 0) ? parts.length + i : i]);\n } else {\n ans[ans.length-1] += parts[(typeof i === "number" && i < 0) ? parts.length + i : i];\n }\n }\n } else {\n ans = split(this, /(?:\\r?\\n)|\\r/);\n }\n return ρσ_list_decorate(ans);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["keepends"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("swapcase", (function() {\n var ρσ_anonfunc = function () {\n var ans, a, b;\n ans = new Array(this.length);\n for (var i = 0; i < ans.length; i++) {\n a = (ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i];\n b = a.toLowerCase();\n if (a === b) {\n b = a.toUpperCase();\n }\n ans[(typeof i === "number" && i < 0) ? ans.length + i : i] = b;\n }\n return ans.join("");\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("zfill", (function() {\n var ρσ_anonfunc = function (width) {\n var string;\n string = this;\n if (width > string.length) {\n string = new Array(width - string.length + 1).join("0") + string;\n }\n return string;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["width"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\nρσ_str.uchrs = (function() {\n var ρσ_anonfunc = function (string, with_positions) {\n return (function(){\n var ρσ_d = {};\n ρσ_d["_string"] = string;\n ρσ_d["_pos"] = 0;\n ρσ_d[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ρσ_d["next"] = (function() {\n var ρσ_anonfunc = function () {\n var length, pos, value, ans, extra;\n length = this._string.length;\n if (this._pos >= length) {\n return (function(){\n var ρσ_d = {};\n ρσ_d["done"] = true;\n return ρσ_d;\n }).call(this);\n }\n pos = this._pos;\n value = this._string.charCodeAt(this._pos++);\n ans = "\\ufffd";\n if (55296 <= value && value <= 56319) {\n if (this._pos < length) {\n extra = this._string.charCodeAt(this._pos++);\n if ((extra & 56320) === 56320) {\n ans = String.fromCharCode(value, extra);\n }\n }\n } else if ((value & 56320) !== 56320) {\n ans = String.fromCharCode(value);\n }\n if (with_positions) {\n return (function(){\n var ρσ_d = {};\n ρσ_d["done"] = false;\n ρσ_d["value"] = ρσ_list_decorate([ pos, ans ]);\n return ρσ_d;\n }).call(this);\n } else {\n return (function(){\n var ρσ_d = {};\n ρσ_d["done"] = false;\n ρσ_d["value"] = ans;\n return ρσ_d;\n }).call(this);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["string", "with_positions"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_str.uslice = (function() {\n var ρσ_anonfunc = function (string, start, end) {\n var items, iterator, r;\n items = [];\n iterator = ρσ_str.uchrs(string);\n r = iterator.next();\n while (!r.done) {\n items.push(r.value);\n r = iterator.next();\n }\n return items.slice(start || 0, (end === undefined) ? items.length : end).join("");\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["string", "start", "end"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_str.ulen = (function() {\n var ρσ_anonfunc = function (string) {\n var iterator, r, ans;\n iterator = ρσ_str.uchrs(string);\n r = iterator.next();\n ans = 0;\n while (!r.done) {\n r = iterator.next();\n ans += 1;\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["string"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_str.ascii_lowercase = "abcdefghijklmnopqrstuvwxyz";\nρσ_str.ascii_uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";\nρσ_str.ascii_letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";\nρσ_str.digits = "0123456789";\nρσ_str.punctuation = "!\\"#$%&\'()*+,-./:;<=>?@[\\\\]^_`{|}~";\nρσ_str.printable = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\\"#$%&\'()*+,-./:;<=>?@[\\\\]^_`{|}~ \\t\\n\\r\\u000b\\f";\nρσ_str.whitespace = " \\t\\n\\r\\u000b\\f";\ndefine_str_func = undefined;\nvar str = ρσ_str, repr = ρσ_repr;;\n var ρσ_modules = {};\n ρσ_modules.utils = {};\n ρσ_modules.errors = {};\n ρσ_modules.unicode_aliases = {};\n ρσ_modules.ast = {};\n ρσ_modules.string_interpolation = {};\n ρσ_modules.tokenizer = {};\n ρσ_modules.parse = {};\n ρσ_modules.output = {};\n ρσ_modules["output.stream"] = {};\n ρσ_modules["output.statements"] = {};\n ρσ_modules["output.exceptions"] = {};\n ρσ_modules["output.utils"] = {};\n ρσ_modules["output.loops"] = {};\n ρσ_modules["output.operators"] = {};\n ρσ_modules["output.functions"] = {};\n ρσ_modules["output.classes"] = {};\n ρσ_modules["output.literals"] = {};\n ρσ_modules["output.comments"] = {};\n ρσ_modules["output.modules"] = {};\n ρσ_modules["output.codegen"] = {};\n\n (function(){\n var __name__ = "utils";\n var has_prop, MAP;\n has_prop = Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty);\n function array_to_hash(a) {\n var ret, i;\n ret = Object.create(null);\n var ρσ_Iter0 = ρσ_Iterable(range(len(a)));\n for (var ρσ_Index0 = 0; ρσ_Index0 < ρσ_Iter0.length; ρσ_Index0++) {\n i = ρσ_Iter0[ρσ_Index0];\n ret[ρσ_bound_index(a[(typeof i === "number" && i < 0) ? a.length + i : i], ret)] = true;\n }\n return ret;\n };\n if (!array_to_hash.__argnames__) Object.defineProperties(array_to_hash, {\n __argnames__ : {value: ["a"]},\n __module__ : {value: "utils"}\n });\n\n function slice(a, start) {\n return Array.prototype.slice.call(a, start || 0);\n };\n if (!slice.__argnames__) Object.defineProperties(slice, {\n __argnames__ : {value: ["a", "start"]},\n __module__ : {value: "utils"}\n });\n\n function characters(str_) {\n return str_.split("");\n };\n if (!characters.__argnames__) Object.defineProperties(characters, {\n __argnames__ : {value: ["str_"]},\n __module__ : {value: "utils"}\n });\n\n function member(name, array) {\n var i;\n for (var ρσ_Index1 = array.length - 1; ρσ_Index1 > -1; ρσ_Index1-=1) {\n i = ρσ_Index1;\n if (array[(typeof i === "number" && i < 0) ? array.length + i : i] === name) {\n return true;\n }\n }\n return false;\n };\n if (!member.__argnames__) Object.defineProperties(member, {\n __argnames__ : {value: ["name", "array"]},\n __module__ : {value: "utils"}\n });\n\n function repeat_string(str_, i) {\n var d;\n if (i <= 0) {\n return "";\n }\n if (i === 1) {\n return str_;\n }\n d = repeat_string(str_, i >> 1);\n d += d;\n if (i & 1) {\n d += str_;\n }\n return d;\n };\n if (!repeat_string.__argnames__) Object.defineProperties(repeat_string, {\n __argnames__ : {value: ["str_", "i"]},\n __module__ : {value: "utils"}\n });\n\n function DefaultsError() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n DefaultsError.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(DefaultsError, ValueError);\n DefaultsError.prototype.__init__ = function __init__(name, defs) {\n var self = this;\n ValueError.prototype.__init__.call(self, name + " is not a supported option. Supported options are: " + str(Object.keys(defs)));\n };\n if (!DefaultsError.prototype.__init__.__argnames__) Object.defineProperties(DefaultsError.prototype.__init__, {\n __argnames__ : {value: ["name", "defs"]},\n __module__ : {value: "utils"}\n });\n DefaultsError.__argnames__ = DefaultsError.prototype.__init__.__argnames__;\n DefaultsError.__handles_kwarg_interpolation__ = DefaultsError.prototype.__init__.__handles_kwarg_interpolation__;\n DefaultsError.prototype.__repr__ = function __repr__ () {\n if(ValueError.prototype.__repr__) return ValueError.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n DefaultsError.prototype.__str__ = function __str__ () {\n if(ValueError.prototype.__str__) return ValueError.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(DefaultsError.prototype, "__bases__", {value: [ValueError]});\n\n function defaults(args, defs, croak) {\n var ret, i;\n if (args === true) {\n args = Object.create(null);\n }\n ret = args || Object.create(null);\n if (croak) {\n var ρσ_Iter2 = ρσ_Iterable(ret);\n for (var ρσ_Index2 = 0; ρσ_Index2 < ρσ_Iter2.length; ρσ_Index2++) {\n i = ρσ_Iter2[ρσ_Index2];\n if (!has_prop(defs, i)) {\n throw new DefaultsError(i, defs);\n }\n }\n }\n var ρσ_Iter3 = ρσ_Iterable(defs);\n for (var ρσ_Index3 = 0; ρσ_Index3 < ρσ_Iter3.length; ρσ_Index3++) {\n i = ρσ_Iter3[ρσ_Index3];\n ret[(typeof i === "number" && i < 0) ? ret.length + i : i] = (args && has_prop(args, i)) ? args[(typeof i === "number" && i < 0) ? args.length + i : i] : defs[(typeof i === "number" && i < 0) ? defs.length + i : i];\n }\n return ret;\n };\n if (!defaults.__argnames__) Object.defineProperties(defaults, {\n __argnames__ : {value: ["args", "defs", "croak"]},\n __module__ : {value: "utils"}\n });\n\n function merge(obj, ext) {\n var i;\n var ρσ_Iter4 = ρσ_Iterable(ext);\n for (var ρσ_Index4 = 0; ρσ_Index4 < ρσ_Iter4.length; ρσ_Index4++) {\n i = ρσ_Iter4[ρσ_Index4];\n obj[(typeof i === "number" && i < 0) ? obj.length + i : i] = ext[(typeof i === "number" && i < 0) ? ext.length + i : i];\n }\n return obj;\n };\n if (!merge.__argnames__) Object.defineProperties(merge, {\n __argnames__ : {value: ["obj", "ext"]},\n __module__ : {value: "utils"}\n });\n\n function noop() {\n };\n if (!noop.__module__) Object.defineProperties(noop, {\n __module__ : {value: "utils"}\n });\n\n MAP = (function() {\n var ρσ_anonfunc = function () {\n var skip;\n function MAP(a, f, backwards) {\n var ret, top, i;\n ret = ρσ_list_decorate([]);\n top = ρσ_list_decorate([]);\n function doit() {\n var val, is_last;\n val = f(a[(typeof i === "number" && i < 0) ? a.length + i : i], i);\n is_last = ρσ_instanceof(val, Last);\n if (is_last) {\n val = val.v;\n }\n if (ρσ_instanceof(val, AtTop)) {\n val = val.v;\n if (ρσ_instanceof(val, Splice)) {\n top.push.apply(top, (backwards) ? val.v.slice().reverse() : val.v);\n } else {\n top.push(val);\n }\n } else if (val !== skip) {\n if (ρσ_instanceof(val, Splice)) {\n ret.push.apply(ret, (backwards) ? val.v.slice().reverse() : val.v);\n } else {\n ret.push(val);\n }\n }\n return is_last;\n };\n if (!doit.__module__) Object.defineProperties(doit, {\n __module__ : {value: "utils"}\n });\n\n if (Array.isArray(a)) {\n if (backwards) {\n for (var ρσ_Index5 = a.length - 1; ρσ_Index5 > -1; ρσ_Index5-=1) {\n i = ρσ_Index5;\n if (doit()) {\n break;\n }\n }\n ret.reverse();\n top.reverse();\n } else {\n var ρσ_Iter6 = ρσ_Iterable(range(len(a)));\n for (var ρσ_Index6 = 0; ρσ_Index6 < ρσ_Iter6.length; ρσ_Index6++) {\n i = ρσ_Iter6[ρσ_Index6];\n if (doit()) {\n break;\n }\n }\n }\n } else {\n var ρσ_Iter7 = ρσ_Iterable(a);\n for (var ρσ_Index7 = 0; ρσ_Index7 < ρσ_Iter7.length; ρσ_Index7++) {\n i = ρσ_Iter7[ρσ_Index7];\n if (doit()) {\n break;\n }\n }\n }\n return top.concat(ret);\n };\n if (!MAP.__argnames__) Object.defineProperties(MAP, {\n __argnames__ : {value: ["a", "f", "backwards"]},\n __module__ : {value: "utils"}\n });\n\n MAP.at_top = (function() {\n var ρσ_anonfunc = function (val) {\n return new AtTop(val);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["val"]},\n __module__ : {value: "utils"}\n });\n return ρσ_anonfunc;\n })();\n MAP.splice = (function() {\n var ρσ_anonfunc = function (val) {\n return new Splice(val);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["val"]},\n __module__ : {value: "utils"}\n });\n return ρσ_anonfunc;\n })();\n MAP.last = (function() {\n var ρσ_anonfunc = function (val) {\n return new Last(val);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["val"]},\n __module__ : {value: "utils"}\n });\n return ρσ_anonfunc;\n })();\n skip = MAP.skip = Object.create(null);\n function AtTop(val) {\n this.v = val;\n };\n if (!AtTop.__argnames__) Object.defineProperties(AtTop, {\n __argnames__ : {value: ["val"]},\n __module__ : {value: "utils"}\n });\n\n function Splice(val) {\n this.v = val;\n };\n if (!Splice.__argnames__) Object.defineProperties(Splice, {\n __argnames__ : {value: ["val"]},\n __module__ : {value: "utils"}\n });\n\n function Last(val) {\n this.v = val;\n };\n if (!Last.__argnames__) Object.defineProperties(Last, {\n __argnames__ : {value: ["val"]},\n __module__ : {value: "utils"}\n });\n\n return MAP;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "utils"}\n });\n return ρσ_anonfunc;\n })().call(this);\n function push_uniq(array, el) {\n if (array.indexOf(el) < 0) {\n array.push(el);\n }\n };\n if (!push_uniq.__argnames__) Object.defineProperties(push_uniq, {\n __argnames__ : {value: ["array", "el"]},\n __module__ : {value: "utils"}\n });\n\n function string_template(text, props) {\n return text.replace(/\\{(.+?)\\}/g, (function() {\n var ρσ_anonfunc = function (str_, p) {\n return props[(typeof p === "number" && p < 0) ? props.length + p : p];\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["str_", "p"]},\n __module__ : {value: "utils"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!string_template.__argnames__) Object.defineProperties(string_template, {\n __argnames__ : {value: ["text", "props"]},\n __module__ : {value: "utils"}\n });\n\n function remove(array, el) {\n var i;\n for (var ρσ_Index8 = array.length - 1; ρσ_Index8 > -1; ρσ_Index8-=1) {\n i = ρσ_Index8;\n if (array[(typeof i === "number" && i < 0) ? array.length + i : i] === el) {\n array.splice(i, 1);\n }\n }\n };\n if (!remove.__argnames__) Object.defineProperties(remove, {\n __argnames__ : {value: ["array", "el"]},\n __module__ : {value: "utils"}\n });\n\n function mergeSort(array, cmp) {\n if (array.length < 2) {\n return array.slice();\n }\n function merge(a, b) {\n var r, ai, bi, i;\n r = ρσ_list_decorate([]);\n ai = 0;\n bi = 0;\n i = 0;\n while (ai < a.length && bi < b.length) {\n if (cmp(a[(typeof ai === "number" && ai < 0) ? a.length + ai : ai], b[(typeof bi === "number" && bi < 0) ? b.length + bi : bi]) <= 0) {\n r[(typeof i === "number" && i < 0) ? r.length + i : i] = a[(typeof ai === "number" && ai < 0) ? a.length + ai : ai];\n ai += 1;\n } else {\n r[(typeof i === "number" && i < 0) ? r.length + i : i] = b[(typeof bi === "number" && bi < 0) ? b.length + bi : bi];\n bi += 1;\n }\n i += 1;\n }\n if (ai < a.length) {\n r.push.apply(r, a.slice(ai));\n }\n if (bi < b.length) {\n r.push.apply(r, b.slice(bi));\n }\n return r;\n };\n if (!merge.__argnames__) Object.defineProperties(merge, {\n __argnames__ : {value: ["a", "b"]},\n __module__ : {value: "utils"}\n });\n\n function _ms(a) {\n var m, left, right;\n if (a.length <= 1) {\n return a;\n }\n m = Math.floor(a.length / 2);\n left = a.slice(0, m);\n right = a.slice(m);\n left = _ms(left);\n right = _ms(right);\n return merge(left, right);\n };\n if (!_ms.__argnames__) Object.defineProperties(_ms, {\n __argnames__ : {value: ["a"]},\n __module__ : {value: "utils"}\n });\n\n return _ms(array);\n };\n if (!mergeSort.__argnames__) Object.defineProperties(mergeSort, {\n __argnames__ : {value: ["array", "cmp"]},\n __module__ : {value: "utils"}\n });\n\n function set_difference(a, b) {\n return a.filter((function() {\n var ρσ_anonfunc = function (el) {\n return b.indexOf(el) < 0;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["el"]},\n __module__ : {value: "utils"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!set_difference.__argnames__) Object.defineProperties(set_difference, {\n __argnames__ : {value: ["a", "b"]},\n __module__ : {value: "utils"}\n });\n\n function set_intersection(a, b) {\n return a.filter((function() {\n var ρσ_anonfunc = function (el) {\n return b.indexOf(el) >= 0;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["el"]},\n __module__ : {value: "utils"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!set_intersection.__argnames__) Object.defineProperties(set_intersection, {\n __argnames__ : {value: ["a", "b"]},\n __module__ : {value: "utils"}\n });\n\n function make_predicate(words) {\n var a, k;\n if (typeof words === "string") {\n words = words.split(" ");\n }\n a = Object.create(null);\n var ρσ_Iter9 = ρσ_Iterable(words);\n for (var ρσ_Index9 = 0; ρσ_Index9 < ρσ_Iter9.length; ρσ_Index9++) {\n k = ρσ_Iter9[ρσ_Index9];\n a[(typeof k === "number" && k < 0) ? a.length + k : k] = true;\n }\n return a;\n };\n if (!make_predicate.__argnames__) Object.defineProperties(make_predicate, {\n __argnames__ : {value: ["words"]},\n __module__ : {value: "utils"}\n });\n\n function cache_file_name(src, cache_dir) {\n if (cache_dir) {\n src = str.replace(src, "\\\\", "/");\n return cache_dir + "/" + str.lstrip(str.replace(src, "/", "-") + ".json", "-");\n }\n return src + "-cached";\n };\n if (!cache_file_name.__argnames__) Object.defineProperties(cache_file_name, {\n __argnames__ : {value: ["src", "cache_dir"]},\n __module__ : {value: "utils"}\n });\n\n ρσ_modules.utils.has_prop = has_prop;\n ρσ_modules.utils.MAP = MAP;\n ρσ_modules.utils.array_to_hash = array_to_hash;\n ρσ_modules.utils.slice = slice;\n ρσ_modules.utils.characters = characters;\n ρσ_modules.utils.member = member;\n ρσ_modules.utils.repeat_string = repeat_string;\n ρσ_modules.utils.DefaultsError = DefaultsError;\n ρσ_modules.utils.defaults = defaults;\n ρσ_modules.utils.merge = merge;\n ρσ_modules.utils.noop = noop;\n ρσ_modules.utils.push_uniq = push_uniq;\n ρσ_modules.utils.string_template = string_template;\n ρσ_modules.utils.remove = remove;\n ρσ_modules.utils.mergeSort = mergeSort;\n ρσ_modules.utils.set_difference = set_difference;\n ρσ_modules.utils.set_intersection = set_intersection;\n ρσ_modules.utils.make_predicate = make_predicate;\n ρσ_modules.utils.cache_file_name = cache_file_name;\n })();\n\n (function(){\n var __name__ = "errors";\n function SyntaxError() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n SyntaxError.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(SyntaxError, Error);\n SyntaxError.prototype.__init__ = function __init__(message, filename, line, col, pos, is_eof) {\n var self = this;\n self.stack = (new Error).stack;\n self.message = message;\n self.line = line;\n self.col = col;\n self.pos = pos;\n self.is_eof = is_eof;\n self.filename = filename;\n self.lineNumber = line;\n self.fileName = filename;\n };\n if (!SyntaxError.prototype.__init__.__argnames__) Object.defineProperties(SyntaxError.prototype.__init__, {\n __argnames__ : {value: ["message", "filename", "line", "col", "pos", "is_eof"]},\n __module__ : {value: "errors"}\n });\n SyntaxError.__argnames__ = SyntaxError.prototype.__init__.__argnames__;\n SyntaxError.__handles_kwarg_interpolation__ = SyntaxError.prototype.__init__.__handles_kwarg_interpolation__;\n SyntaxError.prototype.toString = function toString() {\n var self = this;\n var ans;\n ans = self.message + " (line: " + self.line + ", col: " + self.col + ", pos: " + self.pos + ")";\n if (self.filename) {\n ans = self.filename + ":" + ans;\n }\n if (self.stack) {\n ans += "\\n\\n" + self.stack;\n }\n return ans;\n };\n if (!SyntaxError.prototype.toString.__module__) Object.defineProperties(SyntaxError.prototype.toString, {\n __module__ : {value: "errors"}\n });\n SyntaxError.prototype.__repr__ = function __repr__ () {\n if(Error.prototype.__repr__) return Error.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n SyntaxError.prototype.__str__ = function __str__ () {\n if(Error.prototype.__str__) return Error.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(SyntaxError.prototype, "__bases__", {value: [Error]});\n\n function ImportError() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n ImportError.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(ImportError, SyntaxError);\n ImportError.prototype.__init__ = function __init__ () {\n SyntaxError.prototype.__init__ && SyntaxError.prototype.__init__.apply(this, arguments);\n };\n ImportError.prototype.__repr__ = function __repr__ () {\n if(SyntaxError.prototype.__repr__) return SyntaxError.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n ImportError.prototype.__str__ = function __str__ () {\n if(SyntaxError.prototype.__str__) return SyntaxError.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(ImportError.prototype, "__bases__", {value: [SyntaxError]});\n \n\n ρσ_modules.errors.SyntaxError = SyntaxError;\n ρσ_modules.errors.ImportError = ImportError;\n })();\n\n (function(){\n var __name__ = "unicode_aliases";\n var DB, ALIAS_MAP;\n DB = "\\n# NameAliases-8.0.0.txt\\n# Date: 2014-11-19, 01:30:00 GMT [KW, LI]\\n#\\n# This file is a normative contributory data file in the\\n# Unicode Character Database.\\n#\\n# Copyright (c) 2005-2014 Unicode, Inc.\\n# For terms of use, see http://www.unicode.org/terms_of_use.html\\n#\\n# This file defines the formal name aliases for Unicode characters.\\n#\\n# For informative aliases, see NamesList.txt\\n#\\n# The formal name aliases are divided into five types, each with a distinct label.\\n#\\n# Type Labels:\\n#\\n# 1. correction\\n# Corrections for serious problems in the character names\\n# 2. control\\n# ISO 6429 names for C0 and C1 control functions, and other\\n# commonly occurring names for control codes\\n# 3. alternate\\n# A few widely used alternate names for format characters\\n# 4. figment\\n# Several documented labels for C1 control code points which\\n# were never actually approved in any standard\\n# 5. abbreviation\\n# Commonly occurring abbreviations (or acronyms) for control codes,\\n# format characters, spaces, and variation selectors\\n#\\n# The formal name aliases are part of the Unicode character namespace, which\\n# includes the character names and the names of named character sequences.\\n# The inclusion of ISO 6429 names and other commonly occurring names and\\n# abbreviations for control codes and format characters as formal name aliases\\n# is to help avoid name collisions between Unicode character names and the\\n# labels which commonly appear in text and/or in implementations such as regex, for\\n# control codes (which for historical reasons have no Unicode character name)\\n# or for format characters.\\n#\\n# For documentation, see NamesList.html and http://www.unicode.org/reports/tr44/\\n#\\n# FORMAT\\n#\\n# Each line has three fields, as described here:\\n#\\n# First field: Code point\\n# Second field: Alias\\n# Third field: Type\\n#\\n# The type labels used are defined above. As for property values, comparisons\\n# of type labels should ignore case.\\n#\\n# The type labels can be mapped to other strings for display, if desired.\\n#\\n# In case multiple aliases are assigned, additional aliases\\n# are provided on separate lines. Parsers of this data file should\\n# take note that the same code point can (and does) occur more than once.\\n#\\n# Note that currently the only instances of multiple aliases of the same\\n# type for a single code point are either of type \\"control\\" or \\"abbreviation\\".\\n# An alias of type \\"abbreviation\\" can, in principle, be added for any code\\n# point, although currently aliases of type \\"correction\\" do not have\\n# any additional aliases of type \\"abbreviation\\". Such relationships\\n# are not enforced by stability policies.\\n#\\n#-----------------------------------------------------------------\\n\\n0000;NULL;control\\n0000;NUL;abbreviation\\n0001;START OF HEADING;control\\n0001;SOH;abbreviation\\n0002;START OF TEXT;control\\n0002;STX;abbreviation\\n0003;END OF TEXT;control\\n0003;ETX;abbreviation\\n0004;END OF TRANSMISSION;control\\n0004;EOT;abbreviation\\n0005;ENQUIRY;control\\n0005;ENQ;abbreviation\\n0006;ACKNOWLEDGE;control\\n0006;ACK;abbreviation\\n\\n# Note that no formal name alias for the ISO 6429 \\"BELL\\" is\\n# provided for U+0007, because of the existing name collision\\n# with U+1F514 BELL.\\n\\n0007;ALERT;control\\n0007;BEL;abbreviation\\n\\n0008;BACKSPACE;control\\n0008;BS;abbreviation\\n0009;CHARACTER TABULATION;control\\n0009;HORIZONTAL TABULATION;control\\n0009;HT;abbreviation\\n0009;TAB;abbreviation\\n000A;LINE FEED;control\\n000A;NEW LINE;control\\n000A;END OF LINE;control\\n000A;LF;abbreviation\\n000A;NL;abbreviation\\n000A;EOL;abbreviation\\n000B;LINE TABULATION;control\\n000B;VERTICAL TABULATION;control\\n000B;VT;abbreviation\\n000C;FORM FEED;control\\n000C;FF;abbreviation\\n000D;CARRIAGE RETURN;control\\n000D;CR;abbreviation\\n000E;SHIFT OUT;control\\n000E;LOCKING-SHIFT ONE;control\\n000E;SO;abbreviation\\n000F;SHIFT IN;control\\n000F;LOCKING-SHIFT ZERO;control\\n000F;SI;abbreviation\\n0010;DATA LINK ESCAPE;control\\n0010;DLE;abbreviation\\n0011;DEVICE CONTROL ONE;control\\n0011;DC1;abbreviation\\n0012;DEVICE CONTROL TWO;control\\n0012;DC2;abbreviation\\n0013;DEVICE CONTROL THREE;control\\n0013;DC3;abbreviation\\n0014;DEVICE CONTROL FOUR;control\\n0014;DC4;abbreviation\\n0015;NEGATIVE ACKNOWLEDGE;control\\n0015;NAK;abbreviation\\n0016;SYNCHRONOUS IDLE;control\\n0016;SYN;abbreviation\\n0017;END OF TRANSMISSION BLOCK;control\\n0017;ETB;abbreviation\\n0018;CANCEL;control\\n0018;CAN;abbreviation\\n0019;END OF MEDIUM;control\\n0019;EOM;abbreviation\\n001A;SUBSTITUTE;control\\n001A;SUB;abbreviation\\n001B;ESCAPE;control\\n001B;ESC;abbreviation\\n001C;INFORMATION SEPARATOR FOUR;control\\n001C;FILE SEPARATOR;control\\n001C;FS;abbreviation\\n001D;INFORMATION SEPARATOR THREE;control\\n001D;GROUP SEPARATOR;control\\n001D;GS;abbreviation\\n001E;INFORMATION SEPARATOR TWO;control\\n001E;RECORD SEPARATOR;control\\n001E;RS;abbreviation\\n001F;INFORMATION SEPARATOR ONE;control\\n001F;UNIT SEPARATOR;control\\n001F;US;abbreviation\\n0020;SP;abbreviation\\n007F;DELETE;control\\n007F;DEL;abbreviation\\n\\n# PADDING CHARACTER and HIGH OCTET PRESET represent\\n# architectural concepts initially proposed for early\\n# drafts of ISO/IEC 10646-1. They were never actually\\n# approved or standardized: hence their designation\\n# here as the \\"figment\\" type. Formal name aliases\\n# (and corresponding abbreviations) for these code\\n# points are included here because these names leaked\\n# out from the draft documents and were published in\\n# at least one RFC whose names for code points was\\n# implemented in Perl regex expressions.\\n\\n0080;PADDING CHARACTER;figment\\n0080;PAD;abbreviation\\n0081;HIGH OCTET PRESET;figment\\n0081;HOP;abbreviation\\n\\n0082;BREAK PERMITTED HERE;control\\n0082;BPH;abbreviation\\n0083;NO BREAK HERE;control\\n0083;NBH;abbreviation\\n0084;INDEX;control\\n0084;IND;abbreviation\\n0085;NEXT LINE;control\\n0085;NEL;abbreviation\\n0086;START OF SELECTED AREA;control\\n0086;SSA;abbreviation\\n0087;END OF SELECTED AREA;control\\n0087;ESA;abbreviation\\n0088;CHARACTER TABULATION SET;control\\n0088;HORIZONTAL TABULATION SET;control\\n0088;HTS;abbreviation\\n0089;CHARACTER TABULATION WITH JUSTIFICATION;control\\n0089;HORIZONTAL TABULATION WITH JUSTIFICATION;control\\n0089;HTJ;abbreviation\\n008A;LINE TABULATION SET;control\\n008A;VERTICAL TABULATION SET;control\\n008A;VTS;abbreviation\\n008B;PARTIAL LINE FORWARD;control\\n008B;PARTIAL LINE DOWN;control\\n008B;PLD;abbreviation\\n008C;PARTIAL LINE BACKWARD;control\\n008C;PARTIAL LINE UP;control\\n008C;PLU;abbreviation\\n008D;REVERSE LINE FEED;control\\n008D;REVERSE INDEX;control\\n008D;RI;abbreviation\\n008E;SINGLE SHIFT TWO;control\\n008E;SINGLE-SHIFT-2;control\\n008E;SS2;abbreviation\\n008F;SINGLE SHIFT THREE;control\\n008F;SINGLE-SHIFT-3;control\\n008F;SS3;abbreviation\\n0090;DEVICE CONTROL STRING;control\\n0090;DCS;abbreviation\\n0091;PRIVATE USE ONE;control\\n0091;PRIVATE USE-1;control\\n0091;PU1;abbreviation\\n0092;PRIVATE USE TWO;control\\n0092;PRIVATE USE-2;control\\n0092;PU2;abbreviation\\n0093;SET TRANSMIT STATE;control\\n0093;STS;abbreviation\\n0094;CANCEL CHARACTER;control\\n0094;CCH;abbreviation\\n0095;MESSAGE WAITING;control\\n0095;MW;abbreviation\\n0096;START OF GUARDED AREA;control\\n0096;START OF PROTECTED AREA;control\\n0096;SPA;abbreviation\\n0097;END OF GUARDED AREA;control\\n0097;END OF PROTECTED AREA;control\\n0097;EPA;abbreviation\\n0098;START OF STRING;control\\n0098;SOS;abbreviation\\n\\n# SINGLE GRAPHIC CHARACTER INTRODUCER is another\\n# architectural concept from early drafts of ISO/IEC 10646-1\\n# which was never approved and standardized.\\n\\n0099;SINGLE GRAPHIC CHARACTER INTRODUCER;figment\\n0099;SGC;abbreviation\\n\\n009A;SINGLE CHARACTER INTRODUCER;control\\n009A;SCI;abbreviation\\n009B;CONTROL SEQUENCE INTRODUCER;control\\n009B;CSI;abbreviation\\n009C;STRING TERMINATOR;control\\n009C;ST;abbreviation\\n009D;OPERATING SYSTEM COMMAND;control\\n009D;OSC;abbreviation\\n009E;PRIVACY MESSAGE;control\\n009E;PM;abbreviation\\n009F;APPLICATION PROGRAM COMMAND;control\\n009F;APC;abbreviation\\n00A0;NBSP;abbreviation\\n00AD;SHY;abbreviation\\n01A2;LATIN CAPITAL LETTER GHA;correction\\n01A3;LATIN SMALL LETTER GHA;correction\\n034F;CGJ;abbreviation\\n061C;ALM;abbreviation\\n0709;SYRIAC SUBLINEAR COLON SKEWED LEFT;correction\\n0CDE;KANNADA LETTER LLLA;correction\\n0E9D;LAO LETTER FO FON;correction\\n0E9F;LAO LETTER FO FAY;correction\\n0EA3;LAO LETTER RO;correction\\n0EA5;LAO LETTER LO;correction\\n0FD0;TIBETAN MARK BKA- SHOG GI MGO RGYAN;correction\\n180B;FVS1;abbreviation\\n180C;FVS2;abbreviation\\n180D;FVS3;abbreviation\\n180E;MVS;abbreviation\\n200B;ZWSP;abbreviation\\n200C;ZWNJ;abbreviation\\n200D;ZWJ;abbreviation\\n200E;LRM;abbreviation\\n200F;RLM;abbreviation\\n202A;LRE;abbreviation\\n202B;RLE;abbreviation\\n202C;PDF;abbreviation\\n202D;LRO;abbreviation\\n202E;RLO;abbreviation\\n202F;NNBSP;abbreviation\\n205F;MMSP;abbreviation\\n2060;WJ;abbreviation\\n2066;LRI;abbreviation\\n2067;RLI;abbreviation\\n2068;FSI;abbreviation\\n2069;PDI;abbreviation\\n2118;WEIERSTRASS ELLIPTIC FUNCTION;correction\\n2448;MICR ON US SYMBOL;correction\\n2449;MICR DASH SYMBOL;correction\\n2B7A;LEFTWARDS TRIANGLE-HEADED ARROW WITH DOUBLE VERTICAL STROKE;correction\\n2B7C;RIGHTWARDS TRIANGLE-HEADED ARROW WITH DOUBLE VERTICAL STROKE;correction\\nA015;YI SYLLABLE ITERATION MARK;correction\\nFE18;PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRACKET;correction\\nFE00;VS1;abbreviation\\nFE01;VS2;abbreviation\\nFE02;VS3;abbreviation\\nFE03;VS4;abbreviation\\nFE04;VS5;abbreviation\\nFE05;VS6;abbreviation\\nFE06;VS7;abbreviation\\nFE07;VS8;abbreviation\\nFE08;VS9;abbreviation\\nFE09;VS10;abbreviation\\nFE0A;VS11;abbreviation\\nFE0B;VS12;abbreviation\\nFE0C;VS13;abbreviation\\nFE0D;VS14;abbreviation\\nFE0E;VS15;abbreviation\\nFE0F;VS16;abbreviation\\nFEFF;BYTE ORDER MARK;alternate\\nFEFF;BOM;abbreviation\\nFEFF;ZWNBSP;abbreviation\\n122D4;CUNEIFORM SIGN NU11 TENU;correction\\n122D5;CUNEIFORM SIGN NU11 OVER NU11 BUR OVER BUR;correction\\n1D0C5;BYZANTINE MUSICAL SYMBOL FTHORA SKLIRON CHROMA VASIS;correction\\nE0100;VS17;abbreviation\\nE0101;VS18;abbreviation\\nE0102;VS19;abbreviation\\nE0103;VS20;abbreviation\\nE0104;VS21;abbreviation\\nE0105;VS22;abbreviation\\nE0106;VS23;abbreviation\\nE0107;VS24;abbreviation\\nE0108;VS25;abbreviation\\nE0109;VS26;abbreviation\\nE010A;VS27;abbreviation\\nE010B;VS28;abbreviation\\nE010C;VS29;abbreviation\\nE010D;VS30;abbreviation\\nE010E;VS31;abbreviation\\nE010F;VS32;abbreviation\\nE0110;VS33;abbreviation\\nE0111;VS34;abbreviation\\nE0112;VS35;abbreviation\\nE0113;VS36;abbreviation\\nE0114;VS37;abbreviation\\nE0115;VS38;abbreviation\\nE0116;VS39;abbreviation\\nE0117;VS40;abbreviation\\nE0118;VS41;abbreviation\\nE0119;VS42;abbreviation\\nE011A;VS43;abbreviation\\nE011B;VS44;abbreviation\\nE011C;VS45;abbreviation\\nE011D;VS46;abbreviation\\nE011E;VS47;abbreviation\\nE011F;VS48;abbreviation\\nE0120;VS49;abbreviation\\nE0121;VS50;abbreviation\\nE0122;VS51;abbreviation\\nE0123;VS52;abbreviation\\nE0124;VS53;abbreviation\\nE0125;VS54;abbreviation\\nE0126;VS55;abbreviation\\nE0127;VS56;abbreviation\\nE0128;VS57;abbreviation\\nE0129;VS58;abbreviation\\nE012A;VS59;abbreviation\\nE012B;VS60;abbreviation\\nE012C;VS61;abbreviation\\nE012D;VS62;abbreviation\\nE012E;VS63;abbreviation\\nE012F;VS64;abbreviation\\nE0130;VS65;abbreviation\\nE0131;VS66;abbreviation\\nE0132;VS67;abbreviation\\nE0133;VS68;abbreviation\\nE0134;VS69;abbreviation\\nE0135;VS70;abbreviation\\nE0136;VS71;abbreviation\\nE0137;VS72;abbreviation\\nE0138;VS73;abbreviation\\nE0139;VS74;abbreviation\\nE013A;VS75;abbreviation\\nE013B;VS76;abbreviation\\nE013C;VS77;abbreviation\\nE013D;VS78;abbreviation\\nE013E;VS79;abbreviation\\nE013F;VS80;abbreviation\\nE0140;VS81;abbreviation\\nE0141;VS82;abbreviation\\nE0142;VS83;abbreviation\\nE0143;VS84;abbreviation\\nE0144;VS85;abbreviation\\nE0145;VS86;abbreviation\\nE0146;VS87;abbreviation\\nE0147;VS88;abbreviation\\nE0148;VS89;abbreviation\\nE0149;VS90;abbreviation\\nE014A;VS91;abbreviation\\nE014B;VS92;abbreviation\\nE014C;VS93;abbreviation\\nE014D;VS94;abbreviation\\nE014E;VS95;abbreviation\\nE014F;VS96;abbreviation\\nE0150;VS97;abbreviation\\nE0151;VS98;abbreviation\\nE0152;VS99;abbreviation\\nE0153;VS100;abbreviation\\nE0154;VS101;abbreviation\\nE0155;VS102;abbreviation\\nE0156;VS103;abbreviation\\nE0157;VS104;abbreviation\\nE0158;VS105;abbreviation\\nE0159;VS106;abbreviation\\nE015A;VS107;abbreviation\\nE015B;VS108;abbreviation\\nE015C;VS109;abbreviation\\nE015D;VS110;abbreviation\\nE015E;VS111;abbreviation\\nE015F;VS112;abbreviation\\nE0160;VS113;abbreviation\\nE0161;VS114;abbreviation\\nE0162;VS115;abbreviation\\nE0163;VS116;abbreviation\\nE0164;VS117;abbreviation\\nE0165;VS118;abbreviation\\nE0166;VS119;abbreviation\\nE0167;VS120;abbreviation\\nE0168;VS121;abbreviation\\nE0169;VS122;abbreviation\\nE016A;VS123;abbreviation\\nE016B;VS124;abbreviation\\nE016C;VS125;abbreviation\\nE016D;VS126;abbreviation\\nE016E;VS127;abbreviation\\nE016F;VS128;abbreviation\\nE0170;VS129;abbreviation\\nE0171;VS130;abbreviation\\nE0172;VS131;abbreviation\\nE0173;VS132;abbreviation\\nE0174;VS133;abbreviation\\nE0175;VS134;abbreviation\\nE0176;VS135;abbreviation\\nE0177;VS136;abbreviation\\nE0178;VS137;abbreviation\\nE0179;VS138;abbreviation\\nE017A;VS139;abbreviation\\nE017B;VS140;abbreviation\\nE017C;VS141;abbreviation\\nE017D;VS142;abbreviation\\nE017E;VS143;abbreviation\\nE017F;VS144;abbreviation\\nE0180;VS145;abbreviation\\nE0181;VS146;abbreviation\\nE0182;VS147;abbreviation\\nE0183;VS148;abbreviation\\nE0184;VS149;abbreviation\\nE0185;VS150;abbreviation\\nE0186;VS151;abbreviation\\nE0187;VS152;abbreviation\\nE0188;VS153;abbreviation\\nE0189;VS154;abbreviation\\nE018A;VS155;abbreviation\\nE018B;VS156;abbreviation\\nE018C;VS157;abbreviation\\nE018D;VS158;abbreviation\\nE018E;VS159;abbreviation\\nE018F;VS160;abbreviation\\nE0190;VS161;abbreviation\\nE0191;VS162;abbreviation\\nE0192;VS163;abbreviation\\nE0193;VS164;abbreviation\\nE0194;VS165;abbreviation\\nE0195;VS166;abbreviation\\nE0196;VS167;abbreviation\\nE0197;VS168;abbreviation\\nE0198;VS169;abbreviation\\nE0199;VS170;abbreviation\\nE019A;VS171;abbreviation\\nE019B;VS172;abbreviation\\nE019C;VS173;abbreviation\\nE019D;VS174;abbreviation\\nE019E;VS175;abbreviation\\nE019F;VS176;abbreviation\\nE01A0;VS177;abbreviation\\nE01A1;VS178;abbreviation\\nE01A2;VS179;abbreviation\\nE01A3;VS180;abbreviation\\nE01A4;VS181;abbreviation\\nE01A5;VS182;abbreviation\\nE01A6;VS183;abbreviation\\nE01A7;VS184;abbreviation\\nE01A8;VS185;abbreviation\\nE01A9;VS186;abbreviation\\nE01AA;VS187;abbreviation\\nE01AB;VS188;abbreviation\\nE01AC;VS189;abbreviation\\nE01AD;VS190;abbreviation\\nE01AE;VS191;abbreviation\\nE01AF;VS192;abbreviation\\nE01B0;VS193;abbreviation\\nE01B1;VS194;abbreviation\\nE01B2;VS195;abbreviation\\nE01B3;VS196;abbreviation\\nE01B4;VS197;abbreviation\\nE01B5;VS198;abbreviation\\nE01B6;VS199;abbreviation\\nE01B7;VS200;abbreviation\\nE01B8;VS201;abbreviation\\nE01B9;VS202;abbreviation\\nE01BA;VS203;abbreviation\\nE01BB;VS204;abbreviation\\nE01BC;VS205;abbreviation\\nE01BD;VS206;abbreviation\\nE01BE;VS207;abbreviation\\nE01BF;VS208;abbreviation\\nE01C0;VS209;abbreviation\\nE01C1;VS210;abbreviation\\nE01C2;VS211;abbreviation\\nE01C3;VS212;abbreviation\\nE01C4;VS213;abbreviation\\nE01C5;VS214;abbreviation\\nE01C6;VS215;abbreviation\\nE01C7;VS216;abbreviation\\nE01C8;VS217;abbreviation\\nE01C9;VS218;abbreviation\\nE01CA;VS219;abbreviation\\nE01CB;VS220;abbreviation\\nE01CC;VS221;abbreviation\\nE01CD;VS222;abbreviation\\nE01CE;VS223;abbreviation\\nE01CF;VS224;abbreviation\\nE01D0;VS225;abbreviation\\nE01D1;VS226;abbreviation\\nE01D2;VS227;abbreviation\\nE01D3;VS228;abbreviation\\nE01D4;VS229;abbreviation\\nE01D5;VS230;abbreviation\\nE01D6;VS231;abbreviation\\nE01D7;VS232;abbreviation\\nE01D8;VS233;abbreviation\\nE01D9;VS234;abbreviation\\nE01DA;VS235;abbreviation\\nE01DB;VS236;abbreviation\\nE01DC;VS237;abbreviation\\nE01DD;VS238;abbreviation\\nE01DE;VS239;abbreviation\\nE01DF;VS240;abbreviation\\nE01E0;VS241;abbreviation\\nE01E1;VS242;abbreviation\\nE01E2;VS243;abbreviation\\nE01E3;VS244;abbreviation\\nE01E4;VS245;abbreviation\\nE01E5;VS246;abbreviation\\nE01E6;VS247;abbreviation\\nE01E7;VS248;abbreviation\\nE01E8;VS249;abbreviation\\nE01E9;VS250;abbreviation\\nE01EA;VS251;abbreviation\\nE01EB;VS252;abbreviation\\nE01EC;VS253;abbreviation\\nE01ED;VS254;abbreviation\\nE01EE;VS255;abbreviation\\nE01EF;VS256;abbreviation\\n\\n# EOF\\n";\n ALIAS_MAP = (function() {\n var ρσ_anonfunc = function () {\n var ans, line, parts, code_point;\n ans = {};\n var ρσ_Iter10 = ρσ_Iterable(DB.split("\\n"));\n for (var ρσ_Index10 = 0; ρσ_Index10 < ρσ_Iter10.length; ρσ_Index10++) {\n line = ρσ_Iter10[ρσ_Index10];\n line = line.trim();\n if (!line || line[0] === "#") {\n continue;\n }\n parts = line.split(";");\n if (parts.length >= 2) {\n code_point = parseInt(parts[0], 16);\n if (code_point !== undefined && parts[1]) {\n ans[ρσ_bound_index(parts[1].toLowerCase(), ans)] = code_point;\n }\n }\n }\n return ans;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "unicode_aliases"}\n });\n return ρσ_anonfunc;\n })()();\n ρσ_modules.unicode_aliases.DB = DB;\n ρσ_modules.unicode_aliases.ALIAS_MAP = ALIAS_MAP;\n })();\n\n (function(){\n var __name__ = "ast";\n var noop = ρσ_modules.utils.noop;\n\n function is_node_type(node, typ) {\n return node instanceof typ;\n };\n if (!is_node_type.__argnames__) Object.defineProperties(is_node_type, {\n __argnames__ : {value: ["node", "typ"]},\n __module__ : {value: "ast"}\n });\n\n function AST() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST.prototype.__init__.apply(this, arguments);\n }\n AST.prototype.__init__ = function __init__(initializer) {\n var self = this;\n var obj;\n if (initializer) {\n obj = self;\n while (true) {\n obj = Object.getPrototypeOf(obj);\n if (obj === null) {\n break;\n }\n for (var i in obj.properties) {\n self[i] = initializer[i];\n }\n }\n }\n };\n if (!AST.prototype.__init__.__argnames__) Object.defineProperties(AST.prototype.__init__, {\n __argnames__ : {value: ["initializer"]},\n __module__ : {value: "ast"}\n });\n AST.__argnames__ = AST.prototype.__init__.__argnames__;\n AST.__handles_kwarg_interpolation__ = AST.prototype.__init__.__handles_kwarg_interpolation__;\n AST.prototype.clone = function clone() {\n var self = this;\n return new self.constructor(self);\n };\n if (!AST.prototype.clone.__module__) Object.defineProperties(AST.prototype.clone, {\n __module__ : {value: "ast"}\n });\n AST.prototype.__repr__ = function __repr__ () {\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST.prototype.__str__ = function __str__ () {\n return this.__repr__();\n };\n Object.defineProperty(AST.prototype, "__bases__", {value: []});\n AST.prototype.properties = Object.create(null);\n\n function AST_Token() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Token.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Token, AST);\n AST_Token.prototype.__init__ = function __init__ () {\n AST.prototype.__init__ && AST.prototype.__init__.apply(this, arguments);\n };\n AST_Token.prototype.__repr__ = function __repr__ () {\n if(AST.prototype.__repr__) return AST.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Token.prototype.__str__ = function __str__ () {\n if(AST.prototype.__str__) return AST.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Token.prototype, "__bases__", {value: [AST]});\n AST_Token.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["type"] = "The type of the token";\n ρσ_d["value"] = "The value of the token";\n ρσ_d["line"] = "The line number at which the token occurs";\n ρσ_d["col"] = "The column number at which the token occurs";\n ρσ_d["pos"] = "";\n ρσ_d["endpos"] = "";\n ρσ_d["nlb"] = "True iff there was a newline before this token";\n ρσ_d["comments_before"] = "True iff there were comments before this token";\n ρσ_d["file"] = "The filename in which this token occurs";\n ρσ_d["leading_whitespace"] = "The leading whitespace for the line on which this token occurs";\n return ρσ_d;\n }).call(this);\n\n function AST_Node() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Node.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Node, AST);\n AST_Node.prototype.__init__ = function __init__ () {\n AST.prototype.__init__ && AST.prototype.__init__.apply(this, arguments);\n };\n AST_Node.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self);\n };\n if (!AST_Node.prototype._walk.__argnames__) Object.defineProperties(AST_Node.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Node.prototype.walk = function walk(visitor) {\n var self = this;\n return self._walk(visitor);\n };\n if (!AST_Node.prototype.walk.__argnames__) Object.defineProperties(AST_Node.prototype.walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Node.prototype._dump = function _dump() {\n var self = this;\n var depth = (arguments[0] === undefined || ( 0 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? _dump.__defaults__.depth : arguments[0];\n var omit = (arguments[1] === undefined || ( 1 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? _dump.__defaults__.omit : arguments[1];\n var offset = (arguments[2] === undefined || ( 2 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? _dump.__defaults__.offset : arguments[2];\n var include_name = (arguments[3] === undefined || ( 3 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? _dump.__defaults__.include_name : arguments[3];\n var ρσ_kwargs_obj = arguments[arguments.length-1];\n if (ρσ_kwargs_obj === null || typeof ρσ_kwargs_obj !== "object" || ρσ_kwargs_obj [ρσ_kwargs_symbol] !== true) ρσ_kwargs_obj = {};\n if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "depth")){\n depth = ρσ_kwargs_obj.depth;\n }\n if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "omit")){\n omit = ρσ_kwargs_obj.omit;\n }\n if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "offset")){\n offset = ρσ_kwargs_obj.offset;\n }\n if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "include_name")){\n include_name = ρσ_kwargs_obj.include_name;\n }\n var p, reset, yellow, blue, green, red, magenta, pad, element, tname, property, key;\n p = console.log;\n reset = "\\u001b[0m";\n yellow = "\\u001b[33m";\n blue = "\\u001b[34m";\n green = "\\u001b[32m";\n red = "\\u001b[31m";\n magenta = "\\u001b[35m";\n pad = new Array(offset + 1).join(" ");\n if (include_name) {\n p(pad + yellow + self.constructor.name.slice(4) + reset);\n }\n var ρσ_Iter11 = ρσ_Iterable(self);\n for (var ρσ_Index11 = 0; ρσ_Index11 < ρσ_Iter11.length; ρσ_Index11++) {\n key = ρσ_Iter11[ρσ_Index11];\n if (ρσ_in(key, omit)) {\n continue;\n }\n if (Array.isArray(self[(typeof key === "number" && key < 0) ? self.length + key : key])) {\n if (self[(typeof key === "number" && key < 0) ? self.length + key : key].length) {\n p(pad + " " + blue + key + ": " + reset + "[");\n if (depth > 1) {\n var ρσ_Iter12 = ρσ_Iterable(self[(typeof key === "number" && key < 0) ? self.length + key : key]);\n for (var ρσ_Index12 = 0; ρσ_Index12 < ρσ_Iter12.length; ρσ_Index12++) {\n element = ρσ_Iter12[ρσ_Index12];\n element._dump(depth - 1, omit, offset + 1, true);\n }\n } else {\n var ρσ_Iter13 = ρσ_Iterable(self[(typeof key === "number" && key < 0) ? self.length + key : key]);\n for (var ρσ_Index13 = 0; ρσ_Index13 < ρσ_Iter13.length; ρσ_Index13++) {\n element = ρσ_Iter13[ρσ_Index13];\n p(pad + " " + yellow + element.constructor.name.slice(4) + reset);\n }\n }\n p(pad + " ]");\n } else {\n p(pad + " " + blue + key + ": " + reset + "[]");\n }\n } else if (self[(typeof key === "number" && key < 0) ? self.length + key : key]) {\n if (is_node_type(self[(typeof key === "number" && key < 0) ? self.length + key : key], AST)) {\n tname = self[(typeof key === "number" && key < 0) ? self.length + key : key].constructor.name.slice(4);\n if (tname === "Token") {\n p(pad + " " + blue + key + ": " + magenta + tname + reset);\n var ρσ_Iter14 = ρσ_Iterable(self[(typeof key === "number" && key < 0) ? self.length + key : key]);\n for (var ρσ_Index14 = 0; ρσ_Index14 < ρσ_Iter14.length; ρσ_Index14++) {\n property = ρσ_Iter14[ρσ_Index14];\n p(pad + " " + blue + property + ": " + reset + (ρσ_expr_temp = self[(typeof key === "number" && key < 0) ? self.length + key : key])[(typeof property === "number" && property < 0) ? ρσ_expr_temp.length + property : property]);\n }\n } else {\n p(pad + " " + blue + key + ": " + yellow + tname + reset);\n if (depth > 1) {\n self[(typeof key === "number" && key < 0) ? self.length + key : key]._dump(depth - 1, omit, offset + 1, false);\n }\n }\n } else if (typeof self[(typeof key === "number" && key < 0) ? self.length + key : key] === "string") {\n p(pad + " " + blue + key + ": " + green + "\\"" + self[(typeof key === "number" && key < 0) ? self.length + key : key] + "\\"" + reset);\n } else if (typeof self[(typeof key === "number" && key < 0) ? self.length + key : key] === "number") {\n p(pad + " " + blue + key + ": " + green + self[(typeof key === "number" && key < 0) ? self.length + key : key] + reset);\n } else {\n p(pad + " " + blue + key + ": " + red + self[(typeof key === "number" && key < 0) ? self.length + key : key] + reset);\n }\n } else {\n p(pad + " " + blue + key + ": " + reset + self[(typeof key === "number" && key < 0) ? self.length + key : key]);\n }\n }\n };\n if (!AST_Node.prototype._dump.__defaults__) Object.defineProperties(AST_Node.prototype._dump, {\n __defaults__ : {value: {depth:100, omit:(function(){\n var s = ρσ_set();\n s.jsset.add("start");\n s.jsset.add("end");\n return s;\n })(), offset:0, include_name:true}},\n __handles_kwarg_interpolation__ : {value: true},\n __argnames__ : {value: ["depth", "omit", "offset", "include_name"]},\n __module__ : {value: "ast"}\n });\n AST_Node.prototype.dump = function dump() {\n var self = this;\n var depth = (arguments[0] === undefined || ( 0 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? dump.__defaults__.depth : arguments[0];\n var omit = (arguments[1] === undefined || ( 1 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? dump.__defaults__.omit : arguments[1];\n var ρσ_kwargs_obj = arguments[arguments.length-1];\n if (ρσ_kwargs_obj === null || typeof ρσ_kwargs_obj !== "object" || ρσ_kwargs_obj [ρσ_kwargs_symbol] !== true) ρσ_kwargs_obj = {};\n if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "depth")){\n depth = ρσ_kwargs_obj.depth;\n }\n if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "omit")){\n omit = ρσ_kwargs_obj.omit;\n }\n return self._dump(depth, omit, 0, true);\n };\n if (!AST_Node.prototype.dump.__defaults__) Object.defineProperties(AST_Node.prototype.dump, {\n __defaults__ : {value: {depth:2, omit:Object.create(null)}},\n __handles_kwarg_interpolation__ : {value: true},\n __argnames__ : {value: ["depth", "omit"]},\n __module__ : {value: "ast"}\n });\n AST_Node.prototype.__repr__ = function __repr__ () {\n if(AST.prototype.__repr__) return AST.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Node.prototype.__str__ = function __str__ () {\n if(AST.prototype.__str__) return AST.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Node.prototype, "__bases__", {value: [AST]});\n AST_Node.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = "[AST_Token] The first token of this node";\n ρσ_d["end"] = "[AST_Token] The last token of this node";\n return ρσ_d;\n }).call(this);\n\n function AST_Statement() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Statement.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Statement, AST_Node);\n AST_Statement.prototype.__init__ = function __init__ () {\n AST_Node.prototype.__init__ && AST_Node.prototype.__init__.apply(this, arguments);\n };\n AST_Statement.prototype.__repr__ = function __repr__ () {\n if(AST_Node.prototype.__repr__) return AST_Node.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Statement.prototype.__str__ = function __str__ () {\n if(AST_Node.prototype.__str__) return AST_Node.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Statement.prototype, "__bases__", {value: [AST_Node]});\n\n function AST_Debugger() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Debugger.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Debugger, AST_Statement);\n AST_Debugger.prototype.__init__ = function __init__ () {\n AST_Statement.prototype.__init__ && AST_Statement.prototype.__init__.apply(this, arguments);\n };\n AST_Debugger.prototype.__repr__ = function __repr__ () {\n if(AST_Statement.prototype.__repr__) return AST_Statement.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Debugger.prototype.__str__ = function __str__ () {\n if(AST_Statement.prototype.__str__) return AST_Statement.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Debugger.prototype, "__bases__", {value: [AST_Statement]});\n\n function AST_Directive() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Directive.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Directive, AST_Statement);\n AST_Directive.prototype.__init__ = function __init__ () {\n AST_Statement.prototype.__init__ && AST_Statement.prototype.__init__.apply(this, arguments);\n };\n AST_Directive.prototype.__repr__ = function __repr__ () {\n if(AST_Statement.prototype.__repr__) return AST_Statement.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Directive.prototype.__str__ = function __str__ () {\n if(AST_Statement.prototype.__str__) return AST_Statement.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Directive.prototype, "__bases__", {value: [AST_Statement]});\n AST_Directive.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["value"] = "[string] The value of this directive as a plain string (it\'s not an AST_String!)";\n ρσ_d["scope"] = "[AST_Scope/S] The scope that this directive affects";\n return ρσ_d;\n }).call(this);\n\n function AST_SimpleStatement() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_SimpleStatement.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_SimpleStatement, AST_Statement);\n AST_SimpleStatement.prototype.__init__ = function __init__ () {\n AST_Statement.prototype.__init__ && AST_Statement.prototype.__init__.apply(this, arguments);\n };\n AST_SimpleStatement.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.body._walk(visitor);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_SimpleStatement.prototype._walk.__argnames__) Object.defineProperties(AST_SimpleStatement.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_SimpleStatement.prototype.__repr__ = function __repr__ () {\n if(AST_Statement.prototype.__repr__) return AST_Statement.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_SimpleStatement.prototype.__str__ = function __str__ () {\n if(AST_Statement.prototype.__str__) return AST_Statement.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_SimpleStatement.prototype, "__bases__", {value: [AST_Statement]});\n AST_SimpleStatement.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["body"] = "[AST_Node] an expression node (should not be instanceof AST_Statement)";\n return ρσ_d;\n }).call(this);\n\n function AST_Assert() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Assert.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Assert, AST_Statement);\n AST_Assert.prototype.__init__ = function __init__ () {\n AST_Statement.prototype.__init__ && AST_Statement.prototype.__init__.apply(this, arguments);\n };\n AST_Assert.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.condition._walk(visitor);\n if (self.message) {\n self.message._walk(visitor);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Assert.prototype._walk.__argnames__) Object.defineProperties(AST_Assert.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Assert.prototype.__repr__ = function __repr__ () {\n if(AST_Statement.prototype.__repr__) return AST_Statement.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Assert.prototype.__str__ = function __str__ () {\n if(AST_Statement.prototype.__str__) return AST_Statement.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Assert.prototype, "__bases__", {value: [AST_Statement]});\n AST_Assert.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["condition"] = "[AST_Node] the expression that should be tested";\n ρσ_d["message"] = "[AST_Node*] the expression that is the error message or None";\n return ρσ_d;\n }).call(this);\n\n function walk_body(node, visitor) {\n var stat;\n if (is_node_type(node.body, AST_Statement)) {\n node.body._walk(visitor);\n } else if (node.body) {\n var ρσ_Iter15 = ρσ_Iterable(node.body);\n for (var ρσ_Index15 = 0; ρσ_Index15 < ρσ_Iter15.length; ρσ_Index15++) {\n stat = ρσ_Iter15[ρσ_Index15];\n stat._walk(visitor);\n }\n }\n };\n if (!walk_body.__argnames__) Object.defineProperties(walk_body, {\n __argnames__ : {value: ["node", "visitor"]},\n __module__ : {value: "ast"}\n });\n\n function AST_Block() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Block.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Block, AST_Statement);\n AST_Block.prototype.__init__ = function __init__ () {\n AST_Statement.prototype.__init__ && AST_Statement.prototype.__init__.apply(this, arguments);\n };\n AST_Block.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n walk_body(self, visitor);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Block.prototype._walk.__argnames__) Object.defineProperties(AST_Block.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Block.prototype.__repr__ = function __repr__ () {\n if(AST_Statement.prototype.__repr__) return AST_Statement.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Block.prototype.__str__ = function __str__ () {\n if(AST_Statement.prototype.__str__) return AST_Statement.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Block.prototype, "__bases__", {value: [AST_Statement]});\n AST_Block.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["body"] = "[AST_Statement*] an array of statements";\n return ρσ_d;\n }).call(this);\n\n function AST_BlockStatement() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_BlockStatement.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_BlockStatement, AST_Block);\n AST_BlockStatement.prototype.__init__ = function __init__ () {\n AST_Block.prototype.__init__ && AST_Block.prototype.__init__.apply(this, arguments);\n };\n AST_BlockStatement.prototype.__repr__ = function __repr__ () {\n if(AST_Block.prototype.__repr__) return AST_Block.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_BlockStatement.prototype.__str__ = function __str__ () {\n if(AST_Block.prototype.__str__) return AST_Block.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_BlockStatement.prototype, "__bases__", {value: [AST_Block]});\n\n function AST_EmptyStatement() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_EmptyStatement.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_EmptyStatement, AST_Statement);\n AST_EmptyStatement.prototype.__init__ = function __init__ () {\n AST_Statement.prototype.__init__ && AST_Statement.prototype.__init__.apply(this, arguments);\n };\n AST_EmptyStatement.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self);\n };\n if (!AST_EmptyStatement.prototype._walk.__argnames__) Object.defineProperties(AST_EmptyStatement.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_EmptyStatement.prototype.__repr__ = function __repr__ () {\n if(AST_Statement.prototype.__repr__) return AST_Statement.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_EmptyStatement.prototype.__str__ = function __str__ () {\n if(AST_Statement.prototype.__str__) return AST_Statement.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_EmptyStatement.prototype, "__bases__", {value: [AST_Statement]});\n AST_EmptyStatement.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["stype"] = "[string] the type of empty statement. Is ; for semicolons";\n return ρσ_d;\n }).call(this);\n\n function AST_StatementWithBody() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_StatementWithBody.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_StatementWithBody, AST_Statement);\n AST_StatementWithBody.prototype.__init__ = function __init__ () {\n AST_Statement.prototype.__init__ && AST_Statement.prototype.__init__.apply(this, arguments);\n };\n AST_StatementWithBody.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.body._walk(visitor);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_StatementWithBody.prototype._walk.__argnames__) Object.defineProperties(AST_StatementWithBody.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_StatementWithBody.prototype.__repr__ = function __repr__ () {\n if(AST_Statement.prototype.__repr__) return AST_Statement.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_StatementWithBody.prototype.__str__ = function __str__ () {\n if(AST_Statement.prototype.__str__) return AST_Statement.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_StatementWithBody.prototype, "__bases__", {value: [AST_Statement]});\n AST_StatementWithBody.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["body"] = "[AST_Statement] the body; this should always be present, even if it\'s an AST_EmptyStatement";\n return ρσ_d;\n }).call(this);\n\n function AST_DWLoop() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_DWLoop.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_DWLoop, AST_StatementWithBody);\n AST_DWLoop.prototype.__init__ = function __init__ () {\n AST_StatementWithBody.prototype.__init__ && AST_StatementWithBody.prototype.__init__.apply(this, arguments);\n };\n AST_DWLoop.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.condition._walk(visitor);\n self.body._walk(visitor);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_DWLoop.prototype._walk.__argnames__) Object.defineProperties(AST_DWLoop.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_DWLoop.prototype.__repr__ = function __repr__ () {\n if(AST_StatementWithBody.prototype.__repr__) return AST_StatementWithBody.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_DWLoop.prototype.__str__ = function __str__ () {\n if(AST_StatementWithBody.prototype.__str__) return AST_StatementWithBody.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_DWLoop.prototype, "__bases__", {value: [AST_StatementWithBody]});\n AST_DWLoop.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["condition"] = "[AST_Node] the loop condition. Should not be instanceof AST_Statement";\n return ρσ_d;\n }).call(this);\n\n function AST_Do() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Do.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Do, AST_DWLoop);\n AST_Do.prototype.__init__ = function __init__ () {\n AST_DWLoop.prototype.__init__ && AST_DWLoop.prototype.__init__.apply(this, arguments);\n };\n AST_Do.prototype.__repr__ = function __repr__ () {\n if(AST_DWLoop.prototype.__repr__) return AST_DWLoop.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Do.prototype.__str__ = function __str__ () {\n if(AST_DWLoop.prototype.__str__) return AST_DWLoop.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Do.prototype, "__bases__", {value: [AST_DWLoop]});\n\n function AST_While() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_While.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_While, AST_DWLoop);\n AST_While.prototype.__init__ = function __init__ () {\n AST_DWLoop.prototype.__init__ && AST_DWLoop.prototype.__init__.apply(this, arguments);\n };\n AST_While.prototype.__repr__ = function __repr__ () {\n if(AST_DWLoop.prototype.__repr__) return AST_DWLoop.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_While.prototype.__str__ = function __str__ () {\n if(AST_DWLoop.prototype.__str__) return AST_DWLoop.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_While.prototype, "__bases__", {value: [AST_DWLoop]});\n\n function AST_ForIn() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_ForIn.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_ForIn, AST_StatementWithBody);\n AST_ForIn.prototype.__init__ = function __init__ () {\n AST_StatementWithBody.prototype.__init__ && AST_StatementWithBody.prototype.__init__.apply(this, arguments);\n };\n AST_ForIn.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.init._walk(visitor);\n if (self.name) self.name._walk(visitor);\n self.object._walk(visitor);\n if (self.body) {\n self.body._walk(visitor);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_ForIn.prototype._walk.__argnames__) Object.defineProperties(AST_ForIn.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_ForIn.prototype.__repr__ = function __repr__ () {\n if(AST_StatementWithBody.prototype.__repr__) return AST_StatementWithBody.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_ForIn.prototype.__str__ = function __str__ () {\n if(AST_StatementWithBody.prototype.__str__) return AST_StatementWithBody.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_ForIn.prototype, "__bases__", {value: [AST_StatementWithBody]});\n AST_ForIn.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["init"] = "[AST_Node] the `for/in` initialization code";\n ρσ_d["name"] = "[AST_SymbolRef?] the loop variable, only if `init` is AST_Var";\n ρσ_d["object"] = "[AST_Node] the object that we\'re looping through";\n return ρσ_d;\n }).call(this);\n\n function AST_ForJS() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_ForJS.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_ForJS, AST_StatementWithBody);\n AST_ForJS.prototype.__init__ = function __init__ () {\n AST_StatementWithBody.prototype.__init__ && AST_StatementWithBody.prototype.__init__.apply(this, arguments);\n };\n AST_ForJS.prototype.__repr__ = function __repr__ () {\n if(AST_StatementWithBody.prototype.__repr__) return AST_StatementWithBody.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_ForJS.prototype.__str__ = function __str__ () {\n if(AST_StatementWithBody.prototype.__str__) return AST_StatementWithBody.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_ForJS.prototype, "__bases__", {value: [AST_StatementWithBody]});\n AST_ForJS.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["condition"] = "[AST_Verbatim] raw JavaScript conditional";\n return ρσ_d;\n }).call(this);\n\n function AST_ListComprehension() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_ListComprehension.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_ListComprehension, AST_ForIn);\n AST_ListComprehension.prototype.__init__ = function __init__ () {\n AST_ForIn.prototype.__init__ && AST_ForIn.prototype.__init__.apply(this, arguments);\n };\n AST_ListComprehension.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.init._walk(visitor);\n self.object._walk(visitor);\n self.statement._walk(visitor);\n if (self.condition) self.condition._walk(visitor);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_ListComprehension.prototype._walk.__argnames__) Object.defineProperties(AST_ListComprehension.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_ListComprehension.prototype.__repr__ = function __repr__ () {\n if(AST_ForIn.prototype.__repr__) return AST_ForIn.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_ListComprehension.prototype.__str__ = function __str__ () {\n if(AST_ForIn.prototype.__str__) return AST_ForIn.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_ListComprehension.prototype, "__bases__", {value: [AST_ForIn]});\n AST_ListComprehension.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["condition"] = "[AST_Node] the `if` condition";\n ρσ_d["statement"] = "[AST_Node] statement to perform on each element before returning it";\n return ρσ_d;\n }).call(this);\n\n function AST_SetComprehension() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_SetComprehension.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_SetComprehension, AST_ListComprehension);\n AST_SetComprehension.prototype.__init__ = function __init__ () {\n AST_ListComprehension.prototype.__init__ && AST_ListComprehension.prototype.__init__.apply(this, arguments);\n };\n AST_SetComprehension.prototype.__repr__ = function __repr__ () {\n if(AST_ListComprehension.prototype.__repr__) return AST_ListComprehension.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_SetComprehension.prototype.__str__ = function __str__ () {\n if(AST_ListComprehension.prototype.__str__) return AST_ListComprehension.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_SetComprehension.prototype, "__bases__", {value: [AST_ListComprehension]});\n\n function AST_DictComprehension() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_DictComprehension.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_DictComprehension, AST_ListComprehension);\n AST_DictComprehension.prototype.__init__ = function __init__ () {\n AST_ListComprehension.prototype.__init__ && AST_ListComprehension.prototype.__init__.apply(this, arguments);\n };\n AST_DictComprehension.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.init._walk(visitor);\n self.object._walk(visitor);\n self.statement._walk(visitor);\n self.value_statement._walk(visitor);\n if (self.condition) self.condition._walk(visitor);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_DictComprehension.prototype._walk.__argnames__) Object.defineProperties(AST_DictComprehension.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_DictComprehension.prototype.__repr__ = function __repr__ () {\n if(AST_ListComprehension.prototype.__repr__) return AST_ListComprehension.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_DictComprehension.prototype.__str__ = function __str__ () {\n if(AST_ListComprehension.prototype.__str__) return AST_ListComprehension.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_DictComprehension.prototype, "__bases__", {value: [AST_ListComprehension]});\n AST_DictComprehension.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["value_statement"] = "[AST_Node] statement to perform on each value before returning it";\n ρσ_d["is_pydict"] = "[bool] True if this comprehension is for a python dict";\n ρσ_d["is_jshash"] = "[bool] True if this comprehension is for a js hash";\n return ρσ_d;\n }).call(this);\n\n function AST_GeneratorComprehension() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_GeneratorComprehension.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_GeneratorComprehension, AST_ListComprehension);\n AST_GeneratorComprehension.prototype.__init__ = function __init__ () {\n AST_ListComprehension.prototype.__init__ && AST_ListComprehension.prototype.__init__.apply(this, arguments);\n };\n AST_GeneratorComprehension.prototype.__repr__ = function __repr__ () {\n if(AST_ListComprehension.prototype.__repr__) return AST_ListComprehension.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_GeneratorComprehension.prototype.__str__ = function __str__ () {\n if(AST_ListComprehension.prototype.__str__) return AST_ListComprehension.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_GeneratorComprehension.prototype, "__bases__", {value: [AST_ListComprehension]});\n\n function AST_With() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_With.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_With, AST_StatementWithBody);\n AST_With.prototype.__init__ = function __init__ () {\n AST_StatementWithBody.prototype.__init__ && AST_StatementWithBody.prototype.__init__.apply(this, arguments);\n };\n AST_With.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n var exp;\n var ρσ_Iter16 = ρσ_Iterable(self.clauses);\n for (var ρσ_Index16 = 0; ρσ_Index16 < ρσ_Iter16.length; ρσ_Index16++) {\n exp = ρσ_Iter16[ρσ_Index16];\n exp._walk(visitor);\n }\n self.body._walk(visitor);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_With.prototype._walk.__argnames__) Object.defineProperties(AST_With.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_With.prototype.__repr__ = function __repr__ () {\n if(AST_StatementWithBody.prototype.__repr__) return AST_StatementWithBody.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_With.prototype.__str__ = function __str__ () {\n if(AST_StatementWithBody.prototype.__str__) return AST_StatementWithBody.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_With.prototype, "__bases__", {value: [AST_StatementWithBody]});\n AST_With.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["clauses"] = "[AST_WithClause*] the `with` clauses (comma separated)";\n return ρσ_d;\n }).call(this);\n\n function AST_WithClause() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_WithClause.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_WithClause, AST_Node);\n AST_WithClause.prototype.__init__ = function __init__ () {\n AST_Node.prototype.__init__ && AST_Node.prototype.__init__.apply(this, arguments);\n };\n AST_WithClause.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.expression._walk(visitor);\n if (self.alias) {\n self.alias._walk(visitor);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_WithClause.prototype._walk.__argnames__) Object.defineProperties(AST_WithClause.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_WithClause.prototype.__repr__ = function __repr__ () {\n if(AST_Node.prototype.__repr__) return AST_Node.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_WithClause.prototype.__str__ = function __str__ () {\n if(AST_Node.prototype.__str__) return AST_Node.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_WithClause.prototype, "__bases__", {value: [AST_Node]});\n AST_WithClause.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["expression"] = "[AST_Node] the expression";\n ρσ_d["alias"] = "[AST_SymbolAlias?] optional alias for this expression";\n return ρσ_d;\n }).call(this);\n\n function AST_Scope() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Scope.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Scope, AST_Block);\n AST_Scope.prototype.__init__ = function __init__ () {\n AST_Block.prototype.__init__ && AST_Block.prototype.__init__.apply(this, arguments);\n };\n AST_Scope.prototype.__repr__ = function __repr__ () {\n if(AST_Block.prototype.__repr__) return AST_Block.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Scope.prototype.__str__ = function __str__ () {\n if(AST_Block.prototype.__str__) return AST_Block.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Scope.prototype, "__bases__", {value: [AST_Block]});\n AST_Scope.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["localvars"] = "[SymbolDef*] list of variables local to this scope";\n ρσ_d["docstrings"] = "[AST_String*] list of docstrings for this scope";\n return ρσ_d;\n }).call(this);\n\n function AST_Toplevel() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Toplevel.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Toplevel, AST_Scope);\n AST_Toplevel.prototype.__init__ = function __init__ () {\n AST_Scope.prototype.__init__ && AST_Scope.prototype.__init__.apply(this, arguments);\n };\n AST_Toplevel.prototype.__repr__ = function __repr__ () {\n if(AST_Scope.prototype.__repr__) return AST_Scope.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Toplevel.prototype.__str__ = function __str__ () {\n if(AST_Scope.prototype.__str__) return AST_Scope.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Toplevel.prototype, "__bases__", {value: [AST_Scope]});\n AST_Toplevel.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["globals"] = "[Object/S] a map of name -> SymbolDef for all undeclared names";\n ρσ_d["baselib"] = "[Object/s] a collection of used parts of baselib";\n ρσ_d["imports"] = "[Object/S] a map of module_id->AST_Toplevel for all imported modules (this represents all imported modules across all source files)";\n ρσ_d["imported_module_ids"] = "[string*] a list of module ids that were imported by this module, specifically";\n ρσ_d["nonlocalvars"] = "[String*] a list of all non-local variable names (names that come from the global scope)";\n ρσ_d["shebang"] = "[string] If #! line is present, it will be stored here";\n ρσ_d["import_order"] = "[number] The global order in which this scope was imported";\n ρσ_d["module_id"] = "[string] The id of this module";\n ρσ_d["exports"] = "[SymbolDef*] list of names exported from this module";\n ρσ_d["classes"] = "[Object/S] a map of class names to AST_Class for classes defined in this module";\n ρσ_d["filename"] = "[string] The absolute path to the file from which this module was read";\n ρσ_d["srchash"] = "[string] SHA1 hash of source code, used for caching";\n ρσ_d["comments_after"] = "[array] True iff there were comments before this token";\n return ρσ_d;\n }).call(this);\n\n function AST_Import() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Import.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Import, AST_Statement);\n AST_Import.prototype.__init__ = function __init__ () {\n AST_Statement.prototype.__init__ && AST_Statement.prototype.__init__.apply(this, arguments);\n };\n AST_Import.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n var arg;\n if (self.alias) {\n self.alias._walk(visitor);\n }\n if (self.argnames) {\n var ρσ_Iter17 = ρσ_Iterable(self.argnames);\n for (var ρσ_Index17 = 0; ρσ_Index17 < ρσ_Iter17.length; ρσ_Index17++) {\n arg = ρσ_Iter17[ρσ_Index17];\n arg._walk(visitor);\n }\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Import.prototype._walk.__argnames__) Object.defineProperties(AST_Import.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Import.prototype.__repr__ = function __repr__ () {\n if(AST_Statement.prototype.__repr__) return AST_Statement.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Import.prototype.__str__ = function __str__ () {\n if(AST_Statement.prototype.__str__) return AST_Statement.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Import.prototype, "__bases__", {value: [AST_Statement]});\n AST_Import.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["module"] = "[AST_SymbolVar] name of the module we\'re importing";\n ρσ_d["key"] = "[string] The key by which this module is stored in the global modules mapping";\n ρσ_d["alias"] = "[AST_SymbolAlias] The name this module is imported as, can be None. For import x as y statements.";\n ρσ_d["argnames"] = "[AST_ImportedVar*] names of objects to be imported";\n ρσ_d["body"] = "[AST_TopLevel] parsed contents of the imported file";\n return ρσ_d;\n }).call(this);\n\n function AST_Imports() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Imports.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Imports, AST_Statement);\n AST_Imports.prototype.__init__ = function __init__ () {\n AST_Statement.prototype.__init__ && AST_Statement.prototype.__init__.apply(this, arguments);\n };\n AST_Imports.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n var imp;\n var ρσ_Iter18 = ρσ_Iterable(self.imports);\n for (var ρσ_Index18 = 0; ρσ_Index18 < ρσ_Iter18.length; ρσ_Index18++) {\n imp = ρσ_Iter18[ρσ_Index18];\n imp._walk(visitor);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Imports.prototype._walk.__argnames__) Object.defineProperties(AST_Imports.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Imports.prototype.__repr__ = function __repr__ () {\n if(AST_Statement.prototype.__repr__) return AST_Statement.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Imports.prototype.__str__ = function __str__ () {\n if(AST_Statement.prototype.__str__) return AST_Statement.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Imports.prototype, "__bases__", {value: [AST_Statement]});\n AST_Imports.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["imports"] = "[AST_Import+] array of imports";\n return ρσ_d;\n }).call(this);\n\n function AST_Decorator() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Decorator.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Decorator, AST_Node);\n AST_Decorator.prototype.__init__ = function __init__ () {\n AST_Node.prototype.__init__ && AST_Node.prototype.__init__.apply(this, arguments);\n };\n AST_Decorator.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n if (self.expression) {\n self.expression.walk(visitor);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Decorator.prototype._walk.__argnames__) Object.defineProperties(AST_Decorator.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Decorator.prototype.__repr__ = function __repr__ () {\n if(AST_Node.prototype.__repr__) return AST_Node.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Decorator.prototype.__str__ = function __str__ () {\n if(AST_Node.prototype.__str__) return AST_Node.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Decorator.prototype, "__bases__", {value: [AST_Node]});\n AST_Decorator.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["expression"] = "[AST_Node] the decorator expression";\n return ρσ_d;\n }).call(this);\n\n function AST_Lambda() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Lambda.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Lambda, AST_Scope);\n AST_Lambda.prototype.__init__ = function __init__ () {\n AST_Scope.prototype.__init__ && AST_Scope.prototype.__init__.apply(this, arguments);\n };\n AST_Lambda.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n var d, arg;\n if (self.decorators) {\n var ρσ_Iter19 = ρσ_Iterable(self.decorators);\n for (var ρσ_Index19 = 0; ρσ_Index19 < ρσ_Iter19.length; ρσ_Index19++) {\n d = ρσ_Iter19[ρσ_Index19];\n d.walk(visitor);\n }\n }\n if (self.name) {\n self.name._walk(visitor);\n }\n var ρσ_Iter20 = ρσ_Iterable(self.argnames);\n for (var ρσ_Index20 = 0; ρσ_Index20 < ρσ_Iter20.length; ρσ_Index20++) {\n arg = ρσ_Iter20[ρσ_Index20];\n arg._walk(visitor);\n }\n if (self.argnames.starargs) {\n self.argnames.starargs._walk(visitor);\n }\n if (self.argnames.kwargs) {\n self.argnames.kwargs._walk(visitor);\n }\n walk_body(self, visitor);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Lambda.prototype._walk.__argnames__) Object.defineProperties(AST_Lambda.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Lambda.prototype.__repr__ = function __repr__ () {\n if(AST_Scope.prototype.__repr__) return AST_Scope.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Lambda.prototype.__str__ = function __str__ () {\n if(AST_Scope.prototype.__str__) return AST_Scope.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Lambda.prototype, "__bases__", {value: [AST_Scope]});\n AST_Lambda.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = "[AST_SymbolDeclaration?] the name of this function";\n ρσ_d["argnames"] = "[AST_SymbolFunarg*] array of function arguments";\n ρσ_d["decorators"] = "[AST_Decorator*] function decorators, if any";\n ρσ_d["is_generator"] = "[bool*] True iff this function is a generator";\n ρσ_d["is_expression"] = "[bool*] True iff this function is a function expression";\n ρσ_d["is_anonymous"] = "[bool*] True iff this function is an anonymous function";\n ρσ_d["return_annotation"] = "[AST_Node?] The return type annotation provided (if any)";\n return ρσ_d;\n }).call(this);\n\n function AST_Function() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Function.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Function, AST_Lambda);\n AST_Function.prototype.__init__ = function __init__ () {\n AST_Lambda.prototype.__init__ && AST_Lambda.prototype.__init__.apply(this, arguments);\n };\n AST_Function.prototype.__repr__ = function __repr__ () {\n if(AST_Lambda.prototype.__repr__) return AST_Lambda.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Function.prototype.__str__ = function __str__ () {\n if(AST_Lambda.prototype.__str__) return AST_Lambda.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Function.prototype, "__bases__", {value: [AST_Lambda]});\n\n function AST_Class() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Class.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Class, AST_Scope);\n AST_Class.prototype.__init__ = function __init__ () {\n AST_Scope.prototype.__init__ && AST_Scope.prototype.__init__.apply(this, arguments);\n };\n AST_Class.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n var d;\n if (self.decorators) {\n var ρσ_Iter21 = ρσ_Iterable(self.decorators);\n for (var ρσ_Index21 = 0; ρσ_Index21 < ρσ_Iter21.length; ρσ_Index21++) {\n d = ρσ_Iter21[ρσ_Index21];\n d.walk(visitor);\n }\n }\n self.name._walk(visitor);\n walk_body(self, visitor);\n if (self.parent) self.parent._walk(visitor);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Class.prototype._walk.__argnames__) Object.defineProperties(AST_Class.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Class.prototype.__repr__ = function __repr__ () {\n if(AST_Scope.prototype.__repr__) return AST_Scope.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Class.prototype.__str__ = function __str__ () {\n if(AST_Scope.prototype.__str__) return AST_Scope.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Class.prototype, "__bases__", {value: [AST_Scope]});\n AST_Class.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = "[AST_SymbolDeclaration?] the name of this class";\n ρσ_d["init"] = "[AST_Function] constructor for the class";\n ρσ_d["parent"] = "[AST_Symbol?] parent class this class inherits from";\n ρσ_d["bases"] = "[AST_Symbol*] list of base classes this class inherits from";\n ρσ_d["static"] = "[dict] A hash whose keys are names of static methods for this class";\n ρσ_d["external"] = "[boolean] true if class is declared elsewhere, but will be within current scope at runtime";\n ρσ_d["bound"] = "[string*] list of methods that need to be bound to self";\n ρσ_d["decorators"] = "[AST_Decorator*] function decorators, if any";\n ρσ_d["module_id"] = "[string] The id of the module this class is defined in";\n ρσ_d["statements"] = "[AST_Node*] list of statements in the class scope (excluding method definitions)";\n ρσ_d["dynamic_properties"] = "[dict] map of dynamic property names to property descriptors of the form {getter:AST_Method, setter:AST_Method";\n ρσ_d["classvars"] = "[dict] map containing all class variables as keys, to be used to easily test for existence of a class variable";\n return ρσ_d;\n }).call(this);\n\n function AST_Method() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Method.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Method, AST_Lambda);\n AST_Method.prototype.__init__ = function __init__ () {\n AST_Lambda.prototype.__init__ && AST_Lambda.prototype.__init__.apply(this, arguments);\n };\n AST_Method.prototype.__repr__ = function __repr__ () {\n if(AST_Lambda.prototype.__repr__) return AST_Lambda.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Method.prototype.__str__ = function __str__ () {\n if(AST_Lambda.prototype.__str__) return AST_Lambda.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Method.prototype, "__bases__", {value: [AST_Lambda]});\n AST_Method.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["static"] = "[boolean] true if method is static";\n ρσ_d["is_getter"] = "[boolean] true if method is a property getter";\n ρσ_d["is_setter"] = "[boolean] true if method is a property setter";\n return ρσ_d;\n }).call(this);\n\n function AST_Jump() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Jump.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Jump, AST_Statement);\n AST_Jump.prototype.__init__ = function __init__ () {\n AST_Statement.prototype.__init__ && AST_Statement.prototype.__init__.apply(this, arguments);\n };\n AST_Jump.prototype.__repr__ = function __repr__ () {\n if(AST_Statement.prototype.__repr__) return AST_Statement.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Jump.prototype.__str__ = function __str__ () {\n if(AST_Statement.prototype.__str__) return AST_Statement.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Jump.prototype, "__bases__", {value: [AST_Statement]});\n\n function AST_Exit() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Exit.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Exit, AST_Jump);\n AST_Exit.prototype.__init__ = function __init__ () {\n AST_Jump.prototype.__init__ && AST_Jump.prototype.__init__.apply(this, arguments);\n };\n AST_Exit.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n if (self.value) {\n self.value._walk(visitor);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Exit.prototype._walk.__argnames__) Object.defineProperties(AST_Exit.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Exit.prototype.__repr__ = function __repr__ () {\n if(AST_Jump.prototype.__repr__) return AST_Jump.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Exit.prototype.__str__ = function __str__ () {\n if(AST_Jump.prototype.__str__) return AST_Jump.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Exit.prototype, "__bases__", {value: [AST_Jump]});\n AST_Exit.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["value"] = "[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return";\n return ρσ_d;\n }).call(this);\n\n function AST_Return() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Return.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Return, AST_Exit);\n AST_Return.prototype.__init__ = function __init__ () {\n AST_Exit.prototype.__init__ && AST_Exit.prototype.__init__.apply(this, arguments);\n };\n AST_Return.prototype.__repr__ = function __repr__ () {\n if(AST_Exit.prototype.__repr__) return AST_Exit.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Return.prototype.__str__ = function __str__ () {\n if(AST_Exit.prototype.__str__) return AST_Exit.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Return.prototype, "__bases__", {value: [AST_Exit]});\n\n function AST_Yield() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Yield.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Yield, AST_Return);\n AST_Yield.prototype.__init__ = function __init__ () {\n AST_Return.prototype.__init__ && AST_Return.prototype.__init__.apply(this, arguments);\n };\n AST_Yield.prototype.__repr__ = function __repr__ () {\n if(AST_Return.prototype.__repr__) return AST_Return.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Yield.prototype.__str__ = function __str__ () {\n if(AST_Return.prototype.__str__) return AST_Return.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Yield.prototype, "__bases__", {value: [AST_Return]});\n AST_Yield.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["is_yield_from"] = "[bool] True iff this is a yield from, False otherwise";\n return ρσ_d;\n }).call(this);\n\n function AST_Throw() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Throw.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Throw, AST_Exit);\n AST_Throw.prototype.__init__ = function __init__ () {\n AST_Exit.prototype.__init__ && AST_Exit.prototype.__init__.apply(this, arguments);\n };\n AST_Throw.prototype.__repr__ = function __repr__ () {\n if(AST_Exit.prototype.__repr__) return AST_Exit.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Throw.prototype.__str__ = function __str__ () {\n if(AST_Exit.prototype.__str__) return AST_Exit.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Throw.prototype, "__bases__", {value: [AST_Exit]});\n\n function AST_LoopControl() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_LoopControl.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_LoopControl, AST_Jump);\n AST_LoopControl.prototype.__init__ = function __init__ () {\n AST_Jump.prototype.__init__ && AST_Jump.prototype.__init__.apply(this, arguments);\n };\n AST_LoopControl.prototype.__repr__ = function __repr__ () {\n if(AST_Jump.prototype.__repr__) return AST_Jump.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_LoopControl.prototype.__str__ = function __str__ () {\n if(AST_Jump.prototype.__str__) return AST_Jump.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_LoopControl.prototype, "__bases__", {value: [AST_Jump]});\n\n function AST_Break() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Break.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Break, AST_LoopControl);\n AST_Break.prototype.__init__ = function __init__ () {\n AST_LoopControl.prototype.__init__ && AST_LoopControl.prototype.__init__.apply(this, arguments);\n };\n AST_Break.prototype.__repr__ = function __repr__ () {\n if(AST_LoopControl.prototype.__repr__) return AST_LoopControl.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Break.prototype.__str__ = function __str__ () {\n if(AST_LoopControl.prototype.__str__) return AST_LoopControl.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Break.prototype, "__bases__", {value: [AST_LoopControl]});\n\n function AST_Continue() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Continue.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Continue, AST_LoopControl);\n AST_Continue.prototype.__init__ = function __init__ () {\n AST_LoopControl.prototype.__init__ && AST_LoopControl.prototype.__init__.apply(this, arguments);\n };\n AST_Continue.prototype.__repr__ = function __repr__ () {\n if(AST_LoopControl.prototype.__repr__) return AST_LoopControl.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Continue.prototype.__str__ = function __str__ () {\n if(AST_LoopControl.prototype.__str__) return AST_LoopControl.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Continue.prototype, "__bases__", {value: [AST_LoopControl]});\n\n function AST_If() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_If.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_If, AST_StatementWithBody);\n AST_If.prototype.__init__ = function __init__ () {\n AST_StatementWithBody.prototype.__init__ && AST_StatementWithBody.prototype.__init__.apply(this, arguments);\n };\n AST_If.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.condition._walk(visitor);\n self.body._walk(visitor);\n if (self.alternative) {\n self.alternative._walk(visitor);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_If.prototype._walk.__argnames__) Object.defineProperties(AST_If.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_If.prototype.__repr__ = function __repr__ () {\n if(AST_StatementWithBody.prototype.__repr__) return AST_StatementWithBody.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_If.prototype.__str__ = function __str__ () {\n if(AST_StatementWithBody.prototype.__str__) return AST_StatementWithBody.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_If.prototype, "__bases__", {value: [AST_StatementWithBody]});\n AST_If.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["condition"] = "[AST_Node] the `if` condition";\n ρσ_d["alternative"] = "[AST_Statement?] the `else` part, or null if not present";\n return ρσ_d;\n }).call(this);\n\n function AST_Try() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Try.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Try, AST_Block);\n AST_Try.prototype.__init__ = function __init__ () {\n AST_Block.prototype.__init__ && AST_Block.prototype.__init__.apply(this, arguments);\n };\n AST_Try.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n walk_body(self, visitor);\n if (self.bcatch) {\n self.bcatch._walk(visitor);\n }\n if (self.belse) {\n self.belse._walk(visitor);\n }\n if (self.bfinally) {\n self.bfinally._walk(visitor);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Try.prototype._walk.__argnames__) Object.defineProperties(AST_Try.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Try.prototype.__repr__ = function __repr__ () {\n if(AST_Block.prototype.__repr__) return AST_Block.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Try.prototype.__str__ = function __str__ () {\n if(AST_Block.prototype.__str__) return AST_Block.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Try.prototype, "__bases__", {value: [AST_Block]});\n AST_Try.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["bcatch"] = "[AST_Catch?] the catch block, or null if not present";\n ρσ_d["bfinally"] = "[AST_Finally?] the finally block, or null if not present";\n ρσ_d["belse"] = "[AST_Else?] the else block for null if not present";\n return ρσ_d;\n }).call(this);\n\n function AST_Catch() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Catch.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Catch, AST_Block);\n AST_Catch.prototype.__init__ = function __init__ () {\n AST_Block.prototype.__init__ && AST_Block.prototype.__init__.apply(this, arguments);\n };\n AST_Catch.prototype.__repr__ = function __repr__ () {\n if(AST_Block.prototype.__repr__) return AST_Block.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Catch.prototype.__str__ = function __str__ () {\n if(AST_Block.prototype.__str__) return AST_Block.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Catch.prototype, "__bases__", {value: [AST_Block]});\n\n function AST_Except() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Except.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Except, AST_Block);\n AST_Except.prototype.__init__ = function __init__ () {\n AST_Block.prototype.__init__ && AST_Block.prototype.__init__.apply(this, arguments);\n };\n AST_Except.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(this, (function() {\n var ρσ_anonfunc = function () {\n var e;\n if (self.argname) {\n self.argname.walk(visitor);\n }\n if (self.errors) {\n var ρσ_Iter22 = ρσ_Iterable(self.errors);\n for (var ρσ_Index22 = 0; ρσ_Index22 < ρσ_Iter22.length; ρσ_Index22++) {\n e = ρσ_Iter22[ρσ_Index22];\n e.walk(visitor);\n }\n }\n walk_body(self, visitor);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Except.prototype._walk.__argnames__) Object.defineProperties(AST_Except.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Except.prototype.__repr__ = function __repr__ () {\n if(AST_Block.prototype.__repr__) return AST_Block.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Except.prototype.__str__ = function __str__ () {\n if(AST_Block.prototype.__str__) return AST_Block.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Except.prototype, "__bases__", {value: [AST_Block]});\n AST_Except.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["argname"] = "[AST_SymbolCatch] symbol for the exception";\n ρσ_d["errors"] = "[AST_SymbolVar*] error classes to catch in this block";\n return ρσ_d;\n }).call(this);\n\n function AST_Finally() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Finally.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Finally, AST_Block);\n AST_Finally.prototype.__init__ = function __init__ () {\n AST_Block.prototype.__init__ && AST_Block.prototype.__init__.apply(this, arguments);\n };\n AST_Finally.prototype.__repr__ = function __repr__ () {\n if(AST_Block.prototype.__repr__) return AST_Block.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Finally.prototype.__str__ = function __str__ () {\n if(AST_Block.prototype.__str__) return AST_Block.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Finally.prototype, "__bases__", {value: [AST_Block]});\n\n function AST_Else() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Else.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Else, AST_Block);\n AST_Else.prototype.__init__ = function __init__ () {\n AST_Block.prototype.__init__ && AST_Block.prototype.__init__.apply(this, arguments);\n };\n AST_Else.prototype.__repr__ = function __repr__ () {\n if(AST_Block.prototype.__repr__) return AST_Block.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Else.prototype.__str__ = function __str__ () {\n if(AST_Block.prototype.__str__) return AST_Block.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Else.prototype, "__bases__", {value: [AST_Block]});\n\n function AST_Definitions() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Definitions.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Definitions, AST_Statement);\n AST_Definitions.prototype.__init__ = function __init__ () {\n AST_Statement.prototype.__init__ && AST_Statement.prototype.__init__.apply(this, arguments);\n };\n AST_Definitions.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n var def_;\n var ρσ_Iter23 = ρσ_Iterable(self.definitions);\n for (var ρσ_Index23 = 0; ρσ_Index23 < ρσ_Iter23.length; ρσ_Index23++) {\n def_ = ρσ_Iter23[ρσ_Index23];\n def_._walk(visitor);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Definitions.prototype._walk.__argnames__) Object.defineProperties(AST_Definitions.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Definitions.prototype.__repr__ = function __repr__ () {\n if(AST_Statement.prototype.__repr__) return AST_Statement.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Definitions.prototype.__str__ = function __str__ () {\n if(AST_Statement.prototype.__str__) return AST_Statement.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Definitions.prototype, "__bases__", {value: [AST_Statement]});\n AST_Definitions.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["definitions"] = "[AST_VarDef*] array of variable definitions";\n return ρσ_d;\n }).call(this);\n\n function AST_Var() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Var.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Var, AST_Definitions);\n AST_Var.prototype.__init__ = function __init__ () {\n AST_Definitions.prototype.__init__ && AST_Definitions.prototype.__init__.apply(this, arguments);\n };\n AST_Var.prototype.__repr__ = function __repr__ () {\n if(AST_Definitions.prototype.__repr__) return AST_Definitions.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Var.prototype.__str__ = function __str__ () {\n if(AST_Definitions.prototype.__str__) return AST_Definitions.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Var.prototype, "__bases__", {value: [AST_Definitions]});\n\n function AST_VarDef() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_VarDef.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_VarDef, AST_Node);\n AST_VarDef.prototype.__init__ = function __init__ () {\n AST_Node.prototype.__init__ && AST_Node.prototype.__init__.apply(this, arguments);\n };\n AST_VarDef.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.name._walk(visitor);\n if (self.value) {\n self.value._walk(visitor);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_VarDef.prototype._walk.__argnames__) Object.defineProperties(AST_VarDef.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_VarDef.prototype.__repr__ = function __repr__ () {\n if(AST_Node.prototype.__repr__) return AST_Node.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_VarDef.prototype.__str__ = function __str__ () {\n if(AST_Node.prototype.__str__) return AST_Node.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_VarDef.prototype, "__bases__", {value: [AST_Node]});\n AST_VarDef.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = "[AST_SymbolVar|AST_SymbolNonlocal] name of the variable";\n ρσ_d["value"] = "[AST_Node?] initializer, or null if there\'s no initializer";\n return ρσ_d;\n }).call(this);\n\n function AST_BaseCall() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_BaseCall.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_BaseCall, AST_Node);\n AST_BaseCall.prototype.__init__ = function __init__ () {\n AST_Node.prototype.__init__ && AST_Node.prototype.__init__.apply(this, arguments);\n };\n AST_BaseCall.prototype.__repr__ = function __repr__ () {\n if(AST_Node.prototype.__repr__) return AST_Node.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_BaseCall.prototype.__str__ = function __str__ () {\n if(AST_Node.prototype.__str__) return AST_Node.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_BaseCall.prototype, "__bases__", {value: [AST_Node]});\n AST_BaseCall.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["args"] = "[AST_Node*] array of arguments";\n return ρσ_d;\n }).call(this);\n\n function AST_Call() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Call.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Call, AST_BaseCall);\n AST_Call.prototype.__init__ = function __init__ () {\n AST_BaseCall.prototype.__init__ && AST_BaseCall.prototype.__init__.apply(this, arguments);\n };\n AST_Call.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n var arg;\n self.expression._walk(visitor);\n var ρσ_Iter24 = ρσ_Iterable(self.args);\n for (var ρσ_Index24 = 0; ρσ_Index24 < ρσ_Iter24.length; ρσ_Index24++) {\n arg = ρσ_Iter24[ρσ_Index24];\n arg._walk(visitor);\n }\n if (self.args.kwargs) {\n var ρσ_Iter25 = ρσ_Iterable(self.args.kwargs);\n for (var ρσ_Index25 = 0; ρσ_Index25 < ρσ_Iter25.length; ρσ_Index25++) {\n arg = ρσ_Iter25[ρσ_Index25];\n arg[0]._walk(visitor);\n arg[1]._walk(visitor);\n }\n }\n if (self.args.kwarg_items) {\n var ρσ_Iter26 = ρσ_Iterable(self.args.kwarg_items);\n for (var ρσ_Index26 = 0; ρσ_Index26 < ρσ_Iter26.length; ρσ_Index26++) {\n arg = ρσ_Iter26[ρσ_Index26];\n arg._walk(visitor);\n }\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Call.prototype._walk.__argnames__) Object.defineProperties(AST_Call.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Call.prototype.__repr__ = function __repr__ () {\n if(AST_BaseCall.prototype.__repr__) return AST_BaseCall.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Call.prototype.__str__ = function __str__ () {\n if(AST_BaseCall.prototype.__str__) return AST_BaseCall.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Call.prototype, "__bases__", {value: [AST_BaseCall]});\n AST_Call.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["expression"] = "[AST_Node] expression to invoke as function";\n return ρσ_d;\n }).call(this);\n\n function AST_ClassCall() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_ClassCall.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_ClassCall, AST_BaseCall);\n AST_ClassCall.prototype.__init__ = function __init__ () {\n AST_BaseCall.prototype.__init__ && AST_BaseCall.prototype.__init__.apply(this, arguments);\n };\n AST_ClassCall.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n var arg;\n if (self.expression) self.expression._walk(visitor);\n var ρσ_Iter27 = ρσ_Iterable(self.args);\n for (var ρσ_Index27 = 0; ρσ_Index27 < ρσ_Iter27.length; ρσ_Index27++) {\n arg = ρσ_Iter27[ρσ_Index27];\n arg._walk(visitor);\n }\n var ρσ_Iter28 = ρσ_Iterable(self.args.kwargs);\n for (var ρσ_Index28 = 0; ρσ_Index28 < ρσ_Iter28.length; ρσ_Index28++) {\n arg = ρσ_Iter28[ρσ_Index28];\n arg[0]._walk(visitor);\n arg[1]._walk(visitor);\n }\n var ρσ_Iter29 = ρσ_Iterable(self.args.kwarg_items);\n for (var ρσ_Index29 = 0; ρσ_Index29 < ρσ_Iter29.length; ρσ_Index29++) {\n arg = ρσ_Iter29[ρσ_Index29];\n arg._walk(visitor);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_ClassCall.prototype._walk.__argnames__) Object.defineProperties(AST_ClassCall.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_ClassCall.prototype.__repr__ = function __repr__ () {\n if(AST_BaseCall.prototype.__repr__) return AST_BaseCall.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_ClassCall.prototype.__str__ = function __str__ () {\n if(AST_BaseCall.prototype.__str__) return AST_BaseCall.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_ClassCall.prototype, "__bases__", {value: [AST_BaseCall]});\n AST_ClassCall.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["class"] = "[string] name of the class method belongs to";\n ρσ_d["method"] = "[string] class method being called";\n ρσ_d["static"] = "[boolean] defines whether the method is static";\n return ρσ_d;\n }).call(this);\n\n function AST_New() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_New.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_New, AST_Call);\n AST_New.prototype.__init__ = function __init__ () {\n AST_Call.prototype.__init__ && AST_Call.prototype.__init__.apply(this, arguments);\n };\n AST_New.prototype.__repr__ = function __repr__ () {\n if(AST_Call.prototype.__repr__) return AST_Call.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_New.prototype.__str__ = function __str__ () {\n if(AST_Call.prototype.__str__) return AST_Call.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_New.prototype, "__bases__", {value: [AST_Call]});\n\n function AST_Seq() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Seq.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Seq, AST_Node);\n AST_Seq.prototype.__init__ = function __init__ () {\n AST_Node.prototype.__init__ && AST_Node.prototype.__init__.apply(this, arguments);\n };\n AST_Seq.prototype.to_array = function to_array() {\n var self = this;\n var p, a;\n p = self;\n a = ρσ_list_decorate([]);\n while (p) {\n a.push(p.car);\n if (p.cdr && !(is_node_type(p.cdr, AST_Seq))) {\n a.push(p.cdr);\n break;\n }\n p = p.cdr;\n }\n return a;\n };\n if (!AST_Seq.prototype.to_array.__module__) Object.defineProperties(AST_Seq.prototype.to_array, {\n __module__ : {value: "ast"}\n });\n AST_Seq.prototype.add = function add(node) {\n var self = this;\n var p, cell;\n p = self;\n while (p) {\n if (!(is_node_type(p.cdr, AST_Seq))) {\n cell = AST_Seq.prototype.cons.call(p.cdr, node);\n return p.cdr = cell;\n }\n p = p.cdr;\n }\n };\n if (!AST_Seq.prototype.add.__argnames__) Object.defineProperties(AST_Seq.prototype.add, {\n __argnames__ : {value: ["node"]},\n __module__ : {value: "ast"}\n });\n AST_Seq.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.car._walk(visitor);\n if (self.cdr) {\n self.cdr._walk(visitor);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Seq.prototype._walk.__argnames__) Object.defineProperties(AST_Seq.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Seq.prototype.cons = function cons(x, y) {\n var self = this;\n var seq;\n seq = new AST_Seq(x);\n seq.car = x;\n seq.cdr = y;\n return seq;\n };\n if (!AST_Seq.prototype.cons.__argnames__) Object.defineProperties(AST_Seq.prototype.cons, {\n __argnames__ : {value: ["x", "y"]},\n __module__ : {value: "ast"}\n });\n AST_Seq.prototype.from_array = function from_array(array) {\n var self = this;\n var ans, i, p;\n if (array.length === 0) {\n return null;\n }\n if (array.length === 1) {\n return array[0].clone();\n }\n ans = null;\n for (var ρσ_Index30 = array.length - 1; ρσ_Index30 > -1; ρσ_Index30-=1) {\n i = ρσ_Index30;\n ans = AST_Seq.prototype.cons.call(array[(typeof i === "number" && i < 0) ? array.length + i : i], ans);\n }\n p = ans;\n while (p) {\n if (p.cdr && !p.cdr.cdr) {\n p.cdr = p.cdr.car;\n break;\n }\n p = p.cdr;\n }\n return ans;\n };\n if (!AST_Seq.prototype.from_array.__argnames__) Object.defineProperties(AST_Seq.prototype.from_array, {\n __argnames__ : {value: ["array"]},\n __module__ : {value: "ast"}\n });\n AST_Seq.prototype.__repr__ = function __repr__ () {\n if(AST_Node.prototype.__repr__) return AST_Node.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Seq.prototype.__str__ = function __str__ () {\n if(AST_Node.prototype.__str__) return AST_Node.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Seq.prototype, "__bases__", {value: [AST_Node]});\n AST_Seq.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["car"] = "[AST_Node] first element in sequence";\n ρσ_d["cdr"] = "[AST_Node] second element in sequence";\n return ρσ_d;\n }).call(this);\n\n function AST_PropAccess() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_PropAccess.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_PropAccess, AST_Node);\n AST_PropAccess.prototype.__init__ = function __init__ () {\n AST_Node.prototype.__init__ && AST_Node.prototype.__init__.apply(this, arguments);\n };\n AST_PropAccess.prototype.__repr__ = function __repr__ () {\n if(AST_Node.prototype.__repr__) return AST_Node.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_PropAccess.prototype.__str__ = function __str__ () {\n if(AST_Node.prototype.__str__) return AST_Node.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_PropAccess.prototype, "__bases__", {value: [AST_Node]});\n AST_PropAccess.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["expression"] = "[AST_Node] the “container” expression";\n ρσ_d["property"] = "[AST_Node|string] the property to access. For AST_Dot this is always a plain string, while for AST_Sub it\'s an arbitrary AST_Node";\n return ρσ_d;\n }).call(this);\n\n function AST_Dot() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Dot.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Dot, AST_PropAccess);\n AST_Dot.prototype.__init__ = function __init__ () {\n AST_PropAccess.prototype.__init__ && AST_PropAccess.prototype.__init__.apply(this, arguments);\n };\n AST_Dot.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.expression._walk(visitor);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Dot.prototype._walk.__argnames__) Object.defineProperties(AST_Dot.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Dot.prototype.__repr__ = function __repr__ () {\n if(AST_PropAccess.prototype.__repr__) return AST_PropAccess.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Dot.prototype.__str__ = function __str__ () {\n if(AST_PropAccess.prototype.__str__) return AST_PropAccess.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Dot.prototype, "__bases__", {value: [AST_PropAccess]});\n\n function AST_Sub() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Sub.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Sub, AST_PropAccess);\n AST_Sub.prototype.__init__ = function __init__ () {\n AST_PropAccess.prototype.__init__ && AST_PropAccess.prototype.__init__.apply(this, arguments);\n };\n AST_Sub.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.expression._walk(visitor);\n self.property._walk(visitor);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Sub.prototype._walk.__argnames__) Object.defineProperties(AST_Sub.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Sub.prototype.__repr__ = function __repr__ () {\n if(AST_PropAccess.prototype.__repr__) return AST_PropAccess.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Sub.prototype.__str__ = function __str__ () {\n if(AST_PropAccess.prototype.__str__) return AST_PropAccess.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Sub.prototype, "__bases__", {value: [AST_PropAccess]});\n\n function AST_ItemAccess() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_ItemAccess.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_ItemAccess, AST_PropAccess);\n AST_ItemAccess.prototype.__init__ = function __init__ () {\n AST_PropAccess.prototype.__init__ && AST_PropAccess.prototype.__init__.apply(this, arguments);\n };\n AST_ItemAccess.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.expression._walk(visitor);\n self.property._walk(visitor);\n if (self.assignment) {\n self.assignment._walk(visitor);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_ItemAccess.prototype._walk.__argnames__) Object.defineProperties(AST_ItemAccess.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_ItemAccess.prototype.__repr__ = function __repr__ () {\n if(AST_PropAccess.prototype.__repr__) return AST_PropAccess.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_ItemAccess.prototype.__str__ = function __str__ () {\n if(AST_PropAccess.prototype.__str__) return AST_PropAccess.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_ItemAccess.prototype, "__bases__", {value: [AST_PropAccess]});\n AST_ItemAccess.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["assignment"] = "[AST_Node or None] Not None if this is an assignment (a[x] = y) rather than a simple access";\n ρσ_d["assign_operator"] = "[String] The operator for a assignment like += or empty string if plain assignment";\n return ρσ_d;\n }).call(this);\n\n function AST_Splice() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Splice.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Splice, AST_PropAccess);\n AST_Splice.prototype.__init__ = function __init__ () {\n AST_PropAccess.prototype.__init__ && AST_PropAccess.prototype.__init__.apply(this, arguments);\n };\n AST_Splice.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.expression._walk(visitor);\n self.property._walk(visitor);\n self.property2._walk(visitor);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Splice.prototype._walk.__argnames__) Object.defineProperties(AST_Splice.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Splice.prototype.__repr__ = function __repr__ () {\n if(AST_PropAccess.prototype.__repr__) return AST_PropAccess.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Splice.prototype.__str__ = function __str__ () {\n if(AST_PropAccess.prototype.__str__) return AST_PropAccess.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Splice.prototype, "__bases__", {value: [AST_PropAccess]});\n AST_Splice.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["property2"] = "[AST_Node] the 2nd property to access - typically ending index for the array.";\n ρσ_d["assignment"] = "[AST_Node] The data being spliced in.";\n return ρσ_d;\n }).call(this);\n\n function AST_Unary() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Unary.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Unary, AST_Node);\n AST_Unary.prototype.__init__ = function __init__ () {\n AST_Node.prototype.__init__ && AST_Node.prototype.__init__.apply(this, arguments);\n };\n AST_Unary.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.expression._walk(visitor);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Unary.prototype._walk.__argnames__) Object.defineProperties(AST_Unary.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Unary.prototype.__repr__ = function __repr__ () {\n if(AST_Node.prototype.__repr__) return AST_Node.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Unary.prototype.__str__ = function __str__ () {\n if(AST_Node.prototype.__str__) return AST_Node.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Unary.prototype, "__bases__", {value: [AST_Node]});\n AST_Unary.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["operator"] = "[string] the operator";\n ρσ_d["expression"] = "[AST_Node] expression that this unary operator applies to";\n ρσ_d["parenthesized"] = "[bool] Whether this unary expression was parenthesized";\n return ρσ_d;\n }).call(this);\n\n function AST_UnaryPrefix() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_UnaryPrefix.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_UnaryPrefix, AST_Unary);\n AST_UnaryPrefix.prototype.__init__ = function __init__ () {\n AST_Unary.prototype.__init__ && AST_Unary.prototype.__init__.apply(this, arguments);\n };\n AST_UnaryPrefix.prototype.__repr__ = function __repr__ () {\n if(AST_Unary.prototype.__repr__) return AST_Unary.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_UnaryPrefix.prototype.__str__ = function __str__ () {\n if(AST_Unary.prototype.__str__) return AST_Unary.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_UnaryPrefix.prototype, "__bases__", {value: [AST_Unary]});\n\n function AST_Binary() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Binary.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Binary, AST_Node);\n AST_Binary.prototype.__init__ = function __init__ () {\n AST_Node.prototype.__init__ && AST_Node.prototype.__init__.apply(this, arguments);\n };\n AST_Binary.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.left._walk(visitor);\n self.right._walk(visitor);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Binary.prototype._walk.__argnames__) Object.defineProperties(AST_Binary.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Binary.prototype.__repr__ = function __repr__ () {\n if(AST_Node.prototype.__repr__) return AST_Node.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Binary.prototype.__str__ = function __str__ () {\n if(AST_Node.prototype.__str__) return AST_Node.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Binary.prototype, "__bases__", {value: [AST_Node]});\n AST_Binary.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["left"] = "[AST_Node] left-hand side expression";\n ρσ_d["operator"] = "[string] the operator";\n ρσ_d["right"] = "[AST_Node] right-hand side expression";\n return ρσ_d;\n }).call(this);\n\n function AST_Existential() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Existential.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Existential, AST_Node);\n AST_Existential.prototype.__init__ = function __init__ () {\n AST_Node.prototype.__init__ && AST_Node.prototype.__init__.apply(this, arguments);\n };\n AST_Existential.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.expression._walk(visitor);\n if (self.after !== null && typeof self.after === "object") {\n self.after._walk(visitor);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Existential.prototype._walk.__argnames__) Object.defineProperties(AST_Existential.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Existential.prototype.__repr__ = function __repr__ () {\n if(AST_Node.prototype.__repr__) return AST_Node.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Existential.prototype.__str__ = function __str__ () {\n if(AST_Node.prototype.__str__) return AST_Node.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Existential.prototype, "__bases__", {value: [AST_Node]});\n AST_Existential.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["expression"] = "[AST_Node] The expression whose existence we need to check";\n ρσ_d["after"] = "[None|string|AST_Node] is None when there is nothing following this operator, is a string when there is as AST_PropAccess following this operator, is an AST_Node if it is used a a shorthand for the conditional ternary, i.e. a ? b == a if a? else b";\n return ρσ_d;\n }).call(this);\n\n function AST_Conditional() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Conditional.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Conditional, AST_Node);\n AST_Conditional.prototype.__init__ = function __init__ () {\n AST_Node.prototype.__init__ && AST_Node.prototype.__init__.apply(this, arguments);\n };\n AST_Conditional.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.condition._walk(visitor);\n self.consequent._walk(visitor);\n self.alternative._walk(visitor);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Conditional.prototype._walk.__argnames__) Object.defineProperties(AST_Conditional.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Conditional.prototype.__repr__ = function __repr__ () {\n if(AST_Node.prototype.__repr__) return AST_Node.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Conditional.prototype.__str__ = function __str__ () {\n if(AST_Node.prototype.__str__) return AST_Node.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Conditional.prototype, "__bases__", {value: [AST_Node]});\n AST_Conditional.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["condition"] = "[AST_Node]";\n ρσ_d["consequent"] = "[AST_Node]";\n ρσ_d["alternative"] = "[AST_Node]";\n return ρσ_d;\n }).call(this);\n\n function AST_Assign() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Assign.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Assign, AST_Binary);\n AST_Assign.prototype.__init__ = function __init__ () {\n AST_Binary.prototype.__init__ && AST_Binary.prototype.__init__.apply(this, arguments);\n };\n AST_Assign.prototype.is_chained = function is_chained() {\n var self = this;\n return is_node_type(self.right, AST_Assign) || is_node_type(self.right, AST_Seq) && (is_node_type(self.right.car, AST_Assign) || is_node_type(self.right.cdr, AST_Assign));\n };\n if (!AST_Assign.prototype.is_chained.__module__) Object.defineProperties(AST_Assign.prototype.is_chained, {\n __module__ : {value: "ast"}\n });\n AST_Assign.prototype.traverse_chain = function traverse_chain() {\n var self = this;\n var right, left_hand_sides, next, assign;\n right = self.right;\n while (true) {\n if (is_node_type(right, AST_Assign)) {\n right = right.right;\n continue;\n }\n if (is_node_type(right, AST_Seq)) {\n if (is_node_type(right.car, AST_Assign)) {\n right = new AST_Seq((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["car"] = right.car.right;\n ρσ_d["cdr"] = right.cdr;\n return ρσ_d;\n }).call(this));\n continue;\n }\n if (is_node_type(right.cdr, AST_Assign)) {\n right = right.cdr.right;\n continue;\n }\n }\n break;\n }\n left_hand_sides = [self.left];\n next = self.right;\n while (true) {\n if (is_node_type(next, AST_Assign)) {\n left_hand_sides.push(next.left);\n next = next.right;\n continue;\n }\n if (is_node_type(next, AST_Seq)) {\n if (is_node_type(next.cdr, AST_Assign)) {\n assign = next.cdr;\n left_hand_sides.push(new AST_Seq((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["car"] = next.car;\n ρσ_d["cdr"] = assign.left;\n return ρσ_d;\n }).call(this)));\n next = assign.right;\n continue;\n }\n }\n break;\n }\n return [left_hand_sides, right];\n };\n if (!AST_Assign.prototype.traverse_chain.__module__) Object.defineProperties(AST_Assign.prototype.traverse_chain, {\n __module__ : {value: "ast"}\n });\n AST_Assign.prototype.__repr__ = function __repr__ () {\n if(AST_Binary.prototype.__repr__) return AST_Binary.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Assign.prototype.__str__ = function __str__ () {\n if(AST_Binary.prototype.__str__) return AST_Binary.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Assign.prototype, "__bases__", {value: [AST_Binary]});\n\n function AST_Array() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Array.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Array, AST_Node);\n AST_Array.prototype.__init__ = function __init__ () {\n AST_Node.prototype.__init__ && AST_Node.prototype.__init__.apply(this, arguments);\n };\n AST_Array.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n var el;\n var ρσ_Iter31 = ρσ_Iterable(self.elements);\n for (var ρσ_Index31 = 0; ρσ_Index31 < ρσ_Iter31.length; ρσ_Index31++) {\n el = ρσ_Iter31[ρσ_Index31];\n el._walk(visitor);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Array.prototype._walk.__argnames__) Object.defineProperties(AST_Array.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Array.prototype.flatten = function flatten() {\n var self = this;\n function flatten(arr) {\n var ans, value;\n ans = ρσ_list_decorate([]);\n var ρσ_Iter32 = ρσ_Iterable(arr);\n for (var ρσ_Index32 = 0; ρσ_Index32 < ρσ_Iter32.length; ρσ_Index32++) {\n value = ρσ_Iter32[ρσ_Index32];\n if (is_node_type(value, AST_Seq)) {\n value = value.to_array();\n } else if (is_node_type(value, AST_Array)) {\n value = value.elements;\n }\n if (Array.isArray(value)) {\n ans = ans.concat(flatten(value));\n } else {\n ans.push(value);\n }\n }\n return ans;\n };\n if (!flatten.__argnames__) Object.defineProperties(flatten, {\n __argnames__ : {value: ["arr"]},\n __module__ : {value: "ast"}\n });\n\n return flatten(self.elements);\n };\n if (!AST_Array.prototype.flatten.__module__) Object.defineProperties(AST_Array.prototype.flatten, {\n __module__ : {value: "ast"}\n });\n AST_Array.prototype.__repr__ = function __repr__ () {\n if(AST_Node.prototype.__repr__) return AST_Node.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Array.prototype.__str__ = function __str__ () {\n if(AST_Node.prototype.__str__) return AST_Node.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Array.prototype, "__bases__", {value: [AST_Node]});\n AST_Array.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["elements"] = "[AST_Node*] array of elements";\n return ρσ_d;\n }).call(this);\n\n function AST_Object() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Object.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Object, AST_Node);\n AST_Object.prototype.__init__ = function __init__ () {\n AST_Node.prototype.__init__ && AST_Node.prototype.__init__.apply(this, arguments);\n };\n AST_Object.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n var prop;\n var ρσ_Iter33 = ρσ_Iterable(self.properties);\n for (var ρσ_Index33 = 0; ρσ_Index33 < ρσ_Iter33.length; ρσ_Index33++) {\n prop = ρσ_Iter33[ρσ_Index33];\n prop._walk(visitor);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Object.prototype._walk.__argnames__) Object.defineProperties(AST_Object.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Object.prototype.__repr__ = function __repr__ () {\n if(AST_Node.prototype.__repr__) return AST_Node.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Object.prototype.__str__ = function __str__ () {\n if(AST_Node.prototype.__str__) return AST_Node.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Object.prototype, "__bases__", {value: [AST_Node]});\n AST_Object.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["properties"] = "[AST_ObjectProperty*] array of properties";\n ρσ_d["is_pydict"] = "[bool] True if this object is a python dict literal";\n ρσ_d["is_jshash"] = "[bool] True if this object is a js hash literal";\n return ρσ_d;\n }).call(this);\n\n function AST_ExpressiveObject() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_ExpressiveObject.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_ExpressiveObject, AST_Object);\n AST_ExpressiveObject.prototype.__init__ = function __init__ () {\n AST_Object.prototype.__init__ && AST_Object.prototype.__init__.apply(this, arguments);\n };\n AST_ExpressiveObject.prototype.__repr__ = function __repr__ () {\n if(AST_Object.prototype.__repr__) return AST_Object.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_ExpressiveObject.prototype.__str__ = function __str__ () {\n if(AST_Object.prototype.__str__) return AST_Object.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_ExpressiveObject.prototype, "__bases__", {value: [AST_Object]});\n\n function AST_ObjectProperty() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_ObjectProperty.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_ObjectProperty, AST_Node);\n AST_ObjectProperty.prototype.__init__ = function __init__ () {\n AST_Node.prototype.__init__ && AST_Node.prototype.__init__.apply(this, arguments);\n };\n AST_ObjectProperty.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.key._walk(visitor);\n self.value._walk(visitor);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_ObjectProperty.prototype._walk.__argnames__) Object.defineProperties(AST_ObjectProperty.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_ObjectProperty.prototype.__repr__ = function __repr__ () {\n if(AST_Node.prototype.__repr__) return AST_Node.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_ObjectProperty.prototype.__str__ = function __str__ () {\n if(AST_Node.prototype.__str__) return AST_Node.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_ObjectProperty.prototype, "__bases__", {value: [AST_Node]});\n AST_ObjectProperty.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["key"] = "[AST_Node] the property expression";\n ρσ_d["value"] = "[AST_Node] property value. For setters and getters this is an AST_Function.";\n ρσ_d["quoted"] = "";\n return ρσ_d;\n }).call(this);\n\n function AST_ObjectKeyVal() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_ObjectKeyVal.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_ObjectKeyVal, AST_ObjectProperty);\n AST_ObjectKeyVal.prototype.__init__ = function __init__ () {\n AST_ObjectProperty.prototype.__init__ && AST_ObjectProperty.prototype.__init__.apply(this, arguments);\n };\n AST_ObjectKeyVal.prototype.__repr__ = function __repr__ () {\n if(AST_ObjectProperty.prototype.__repr__) return AST_ObjectProperty.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_ObjectKeyVal.prototype.__str__ = function __str__ () {\n if(AST_ObjectProperty.prototype.__str__) return AST_ObjectProperty.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_ObjectKeyVal.prototype, "__bases__", {value: [AST_ObjectProperty]});\n\n function AST_Set() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Set.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Set, AST_Node);\n AST_Set.prototype.__init__ = function __init__ () {\n AST_Node.prototype.__init__ && AST_Node.prototype.__init__.apply(this, arguments);\n };\n AST_Set.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n var prop;\n var ρσ_Iter34 = ρσ_Iterable(self.items);\n for (var ρσ_Index34 = 0; ρσ_Index34 < ρσ_Iter34.length; ρσ_Index34++) {\n prop = ρσ_Iter34[ρσ_Index34];\n prop._walk(visitor);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_Set.prototype._walk.__argnames__) Object.defineProperties(AST_Set.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_Set.prototype.__repr__ = function __repr__ () {\n if(AST_Node.prototype.__repr__) return AST_Node.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Set.prototype.__str__ = function __str__ () {\n if(AST_Node.prototype.__str__) return AST_Node.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Set.prototype, "__bases__", {value: [AST_Node]});\n AST_Set.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["items"] = "[AST_SetItem*] array of items";\n return ρσ_d;\n }).call(this);\n\n function AST_SetItem() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_SetItem.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_SetItem, AST_Node);\n AST_SetItem.prototype.__init__ = function __init__ () {\n AST_Node.prototype.__init__ && AST_Node.prototype.__init__.apply(this, arguments);\n };\n AST_SetItem.prototype._walk = function _walk(visitor) {\n var self = this;\n return visitor._visit(self, (function() {\n var ρσ_anonfunc = function () {\n self.value._walk(visitor);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!AST_SetItem.prototype._walk.__argnames__) Object.defineProperties(AST_SetItem.prototype._walk, {\n __argnames__ : {value: ["visitor"]},\n __module__ : {value: "ast"}\n });\n AST_SetItem.prototype.__repr__ = function __repr__ () {\n if(AST_Node.prototype.__repr__) return AST_Node.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_SetItem.prototype.__str__ = function __str__ () {\n if(AST_Node.prototype.__str__) return AST_Node.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_SetItem.prototype, "__bases__", {value: [AST_Node]});\n AST_SetItem.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["value"] = "[AST_Node] The value of this item";\n return ρσ_d;\n }).call(this);\n\n function AST_Symbol() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Symbol.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Symbol, AST_Node);\n AST_Symbol.prototype.__init__ = function __init__ () {\n AST_Node.prototype.__init__ && AST_Node.prototype.__init__.apply(this, arguments);\n };\n AST_Symbol.prototype.__repr__ = function __repr__ () {\n if(AST_Node.prototype.__repr__) return AST_Node.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Symbol.prototype.__str__ = function __str__ () {\n if(AST_Node.prototype.__str__) return AST_Node.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Symbol.prototype, "__bases__", {value: [AST_Node]});\n AST_Symbol.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = "[string] name of this symbol";\n ρσ_d["scope"] = "[AST_Scope/S] the current scope (not necessarily the definition scope)";\n ρσ_d["thedef"] = "[SymbolDef/S] the definition of this symbol";\n return ρσ_d;\n }).call(this);\n\n function AST_SymbolAlias() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_SymbolAlias.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_SymbolAlias, AST_Symbol);\n AST_SymbolAlias.prototype.__init__ = function __init__ () {\n AST_Symbol.prototype.__init__ && AST_Symbol.prototype.__init__.apply(this, arguments);\n };\n AST_SymbolAlias.prototype.__repr__ = function __repr__ () {\n if(AST_Symbol.prototype.__repr__) return AST_Symbol.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_SymbolAlias.prototype.__str__ = function __str__ () {\n if(AST_Symbol.prototype.__str__) return AST_Symbol.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_SymbolAlias.prototype, "__bases__", {value: [AST_Symbol]});\n\n function AST_SymbolDeclaration() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_SymbolDeclaration.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_SymbolDeclaration, AST_Symbol);\n AST_SymbolDeclaration.prototype.__init__ = function __init__ () {\n AST_Symbol.prototype.__init__ && AST_Symbol.prototype.__init__.apply(this, arguments);\n };\n AST_SymbolDeclaration.prototype.__repr__ = function __repr__ () {\n if(AST_Symbol.prototype.__repr__) return AST_Symbol.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_SymbolDeclaration.prototype.__str__ = function __str__ () {\n if(AST_Symbol.prototype.__str__) return AST_Symbol.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_SymbolDeclaration.prototype, "__bases__", {value: [AST_Symbol]});\n AST_SymbolDeclaration.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["init"] = "[AST_Node*/S] array of initializers for this declaration.";\n return ρσ_d;\n }).call(this);\n\n function AST_SymbolVar() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_SymbolVar.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_SymbolVar, AST_SymbolDeclaration);\n AST_SymbolVar.prototype.__init__ = function __init__ () {\n AST_SymbolDeclaration.prototype.__init__ && AST_SymbolDeclaration.prototype.__init__.apply(this, arguments);\n };\n AST_SymbolVar.prototype.__repr__ = function __repr__ () {\n if(AST_SymbolDeclaration.prototype.__repr__) return AST_SymbolDeclaration.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_SymbolVar.prototype.__str__ = function __str__ () {\n if(AST_SymbolDeclaration.prototype.__str__) return AST_SymbolDeclaration.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_SymbolVar.prototype, "__bases__", {value: [AST_SymbolDeclaration]});\n\n function AST_ImportedVar() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_ImportedVar.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_ImportedVar, AST_SymbolVar);\n AST_ImportedVar.prototype.__init__ = function __init__ () {\n AST_SymbolVar.prototype.__init__ && AST_SymbolVar.prototype.__init__.apply(this, arguments);\n };\n AST_ImportedVar.prototype.__repr__ = function __repr__ () {\n if(AST_SymbolVar.prototype.__repr__) return AST_SymbolVar.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_ImportedVar.prototype.__str__ = function __str__ () {\n if(AST_SymbolVar.prototype.__str__) return AST_SymbolVar.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_ImportedVar.prototype, "__bases__", {value: [AST_SymbolVar]});\n AST_ImportedVar.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["alias"] = "AST_SymbolAlias the alias for this imported symbol";\n return ρσ_d;\n }).call(this);\n\n function AST_SymbolNonlocal() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_SymbolNonlocal.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_SymbolNonlocal, AST_SymbolDeclaration);\n AST_SymbolNonlocal.prototype.__init__ = function __init__ () {\n AST_SymbolDeclaration.prototype.__init__ && AST_SymbolDeclaration.prototype.__init__.apply(this, arguments);\n };\n AST_SymbolNonlocal.prototype.__repr__ = function __repr__ () {\n if(AST_SymbolDeclaration.prototype.__repr__) return AST_SymbolDeclaration.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_SymbolNonlocal.prototype.__str__ = function __str__ () {\n if(AST_SymbolDeclaration.prototype.__str__) return AST_SymbolDeclaration.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_SymbolNonlocal.prototype, "__bases__", {value: [AST_SymbolDeclaration]});\n\n function AST_SymbolFunarg() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_SymbolFunarg.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_SymbolFunarg, AST_SymbolVar);\n AST_SymbolFunarg.prototype.__init__ = function __init__ () {\n AST_SymbolVar.prototype.__init__ && AST_SymbolVar.prototype.__init__.apply(this, arguments);\n };\n AST_SymbolFunarg.prototype.__repr__ = function __repr__ () {\n if(AST_SymbolVar.prototype.__repr__) return AST_SymbolVar.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_SymbolFunarg.prototype.__str__ = function __str__ () {\n if(AST_SymbolVar.prototype.__str__) return AST_SymbolVar.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_SymbolFunarg.prototype, "__bases__", {value: [AST_SymbolVar]});\n AST_SymbolFunarg.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["annotation"] = "[AST_Node?] The annotation provided for this argument (if any)";\n return ρσ_d;\n }).call(this);\n\n function AST_SymbolDefun() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_SymbolDefun.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_SymbolDefun, AST_SymbolDeclaration);\n AST_SymbolDefun.prototype.__init__ = function __init__ () {\n AST_SymbolDeclaration.prototype.__init__ && AST_SymbolDeclaration.prototype.__init__.apply(this, arguments);\n };\n AST_SymbolDefun.prototype.__repr__ = function __repr__ () {\n if(AST_SymbolDeclaration.prototype.__repr__) return AST_SymbolDeclaration.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_SymbolDefun.prototype.__str__ = function __str__ () {\n if(AST_SymbolDeclaration.prototype.__str__) return AST_SymbolDeclaration.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_SymbolDefun.prototype, "__bases__", {value: [AST_SymbolDeclaration]});\n\n function AST_SymbolLambda() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_SymbolLambda.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_SymbolLambda, AST_SymbolDeclaration);\n AST_SymbolLambda.prototype.__init__ = function __init__ () {\n AST_SymbolDeclaration.prototype.__init__ && AST_SymbolDeclaration.prototype.__init__.apply(this, arguments);\n };\n AST_SymbolLambda.prototype.__repr__ = function __repr__ () {\n if(AST_SymbolDeclaration.prototype.__repr__) return AST_SymbolDeclaration.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_SymbolLambda.prototype.__str__ = function __str__ () {\n if(AST_SymbolDeclaration.prototype.__str__) return AST_SymbolDeclaration.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_SymbolLambda.prototype, "__bases__", {value: [AST_SymbolDeclaration]});\n\n function AST_SymbolCatch() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_SymbolCatch.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_SymbolCatch, AST_SymbolDeclaration);\n AST_SymbolCatch.prototype.__init__ = function __init__ () {\n AST_SymbolDeclaration.prototype.__init__ && AST_SymbolDeclaration.prototype.__init__.apply(this, arguments);\n };\n AST_SymbolCatch.prototype.__repr__ = function __repr__ () {\n if(AST_SymbolDeclaration.prototype.__repr__) return AST_SymbolDeclaration.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_SymbolCatch.prototype.__str__ = function __str__ () {\n if(AST_SymbolDeclaration.prototype.__str__) return AST_SymbolDeclaration.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_SymbolCatch.prototype, "__bases__", {value: [AST_SymbolDeclaration]});\n\n function AST_SymbolRef() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_SymbolRef.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_SymbolRef, AST_Symbol);\n AST_SymbolRef.prototype.__init__ = function __init__ () {\n AST_Symbol.prototype.__init__ && AST_Symbol.prototype.__init__.apply(this, arguments);\n };\n AST_SymbolRef.prototype.__repr__ = function __repr__ () {\n if(AST_Symbol.prototype.__repr__) return AST_Symbol.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_SymbolRef.prototype.__str__ = function __str__ () {\n if(AST_Symbol.prototype.__str__) return AST_Symbol.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_SymbolRef.prototype, "__bases__", {value: [AST_Symbol]});\n AST_SymbolRef.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["parens"] = "[boolean/S] if true, this variable is wrapped in parentheses";\n return ρσ_d;\n }).call(this);\n\n function AST_This() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_This.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_This, AST_Symbol);\n AST_This.prototype.__init__ = function __init__ () {\n AST_Symbol.prototype.__init__ && AST_Symbol.prototype.__init__.apply(this, arguments);\n };\n AST_This.prototype.__repr__ = function __repr__ () {\n if(AST_Symbol.prototype.__repr__) return AST_Symbol.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_This.prototype.__str__ = function __str__ () {\n if(AST_Symbol.prototype.__str__) return AST_Symbol.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_This.prototype, "__bases__", {value: [AST_Symbol]});\n\n function AST_Constant() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Constant.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Constant, AST_Node);\n AST_Constant.prototype.__init__ = function __init__ () {\n AST_Node.prototype.__init__ && AST_Node.prototype.__init__.apply(this, arguments);\n };\n AST_Constant.prototype.__repr__ = function __repr__ () {\n if(AST_Node.prototype.__repr__) return AST_Node.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Constant.prototype.__str__ = function __str__ () {\n if(AST_Node.prototype.__str__) return AST_Node.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Constant.prototype, "__bases__", {value: [AST_Node]});\n\n function AST_String() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_String.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_String, AST_Constant);\n AST_String.prototype.__init__ = function __init__ () {\n AST_Constant.prototype.__init__ && AST_Constant.prototype.__init__.apply(this, arguments);\n };\n AST_String.prototype.__repr__ = function __repr__ () {\n if(AST_Constant.prototype.__repr__) return AST_Constant.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_String.prototype.__str__ = function __str__ () {\n if(AST_Constant.prototype.__str__) return AST_Constant.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_String.prototype, "__bases__", {value: [AST_Constant]});\n AST_String.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["value"] = "[string] the contents of this string";\n return ρσ_d;\n }).call(this);\n\n function AST_Verbatim() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Verbatim.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Verbatim, AST_Constant);\n AST_Verbatim.prototype.__init__ = function __init__ () {\n AST_Constant.prototype.__init__ && AST_Constant.prototype.__init__.apply(this, arguments);\n };\n AST_Verbatim.prototype.__repr__ = function __repr__ () {\n if(AST_Constant.prototype.__repr__) return AST_Constant.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Verbatim.prototype.__str__ = function __str__ () {\n if(AST_Constant.prototype.__str__) return AST_Constant.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Verbatim.prototype, "__bases__", {value: [AST_Constant]});\n AST_Verbatim.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["value"] = "[string] A string of raw JS code";\n return ρσ_d;\n }).call(this);\n\n function AST_Number() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Number.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Number, AST_Constant);\n AST_Number.prototype.__init__ = function __init__ () {\n AST_Constant.prototype.__init__ && AST_Constant.prototype.__init__.apply(this, arguments);\n };\n AST_Number.prototype.__repr__ = function __repr__ () {\n if(AST_Constant.prototype.__repr__) return AST_Constant.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Number.prototype.__str__ = function __str__ () {\n if(AST_Constant.prototype.__str__) return AST_Constant.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Number.prototype, "__bases__", {value: [AST_Constant]});\n AST_Number.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["value"] = "[number] the numeric value";\n return ρσ_d;\n }).call(this);\n\n function AST_RegExp() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_RegExp.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_RegExp, AST_Constant);\n AST_RegExp.prototype.__init__ = function __init__ () {\n AST_Constant.prototype.__init__ && AST_Constant.prototype.__init__.apply(this, arguments);\n };\n AST_RegExp.prototype.__repr__ = function __repr__ () {\n if(AST_Constant.prototype.__repr__) return AST_Constant.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_RegExp.prototype.__str__ = function __str__ () {\n if(AST_Constant.prototype.__str__) return AST_Constant.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_RegExp.prototype, "__bases__", {value: [AST_Constant]});\n AST_RegExp.prototype.properties = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["value"] = "[RegExp] the actual regexp";\n return ρσ_d;\n }).call(this);\n\n function AST_Atom() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Atom.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Atom, AST_Constant);\n AST_Atom.prototype.__init__ = function __init__(initializer) {\n var self = this;\n if (initializer) {\n self.start = initializer.start;\n self.end = initializer.end;\n }\n };\n if (!AST_Atom.prototype.__init__.__argnames__) Object.defineProperties(AST_Atom.prototype.__init__, {\n __argnames__ : {value: ["initializer"]},\n __module__ : {value: "ast"}\n });\n AST_Atom.__argnames__ = AST_Atom.prototype.__init__.__argnames__;\n AST_Atom.__handles_kwarg_interpolation__ = AST_Atom.prototype.__init__.__handles_kwarg_interpolation__;\n AST_Atom.prototype.__repr__ = function __repr__ () {\n if(AST_Constant.prototype.__repr__) return AST_Constant.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Atom.prototype.__str__ = function __str__ () {\n if(AST_Constant.prototype.__str__) return AST_Constant.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Atom.prototype, "__bases__", {value: [AST_Constant]});\n\n function AST_Null() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Null.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Null, AST_Atom);\n AST_Null.prototype.__init__ = function __init__ () {\n AST_Atom.prototype.__init__ && AST_Atom.prototype.__init__.apply(this, arguments);\n };\n AST_Null.prototype.__repr__ = function __repr__ () {\n if(AST_Atom.prototype.__repr__) return AST_Atom.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Null.prototype.__str__ = function __str__ () {\n if(AST_Atom.prototype.__str__) return AST_Atom.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Null.prototype, "__bases__", {value: [AST_Atom]});\n AST_Null.prototype.value = null;\n\n function AST_NaN() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_NaN.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_NaN, AST_Atom);\n AST_NaN.prototype.__init__ = function __init__ () {\n AST_Atom.prototype.__init__ && AST_Atom.prototype.__init__.apply(this, arguments);\n };\n AST_NaN.prototype.__repr__ = function __repr__ () {\n if(AST_Atom.prototype.__repr__) return AST_Atom.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_NaN.prototype.__str__ = function __str__ () {\n if(AST_Atom.prototype.__str__) return AST_Atom.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_NaN.prototype, "__bases__", {value: [AST_Atom]});\n AST_NaN.prototype.value = NaN;\n\n function AST_Undefined() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Undefined.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Undefined, AST_Atom);\n AST_Undefined.prototype.__init__ = function __init__ () {\n AST_Atom.prototype.__init__ && AST_Atom.prototype.__init__.apply(this, arguments);\n };\n AST_Undefined.prototype.__repr__ = function __repr__ () {\n if(AST_Atom.prototype.__repr__) return AST_Atom.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Undefined.prototype.__str__ = function __str__ () {\n if(AST_Atom.prototype.__str__) return AST_Atom.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Undefined.prototype, "__bases__", {value: [AST_Atom]});\n AST_Undefined.prototype.value = undefined;\n\n function AST_Hole() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Hole.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Hole, AST_Atom);\n AST_Hole.prototype.__init__ = function __init__ () {\n AST_Atom.prototype.__init__ && AST_Atom.prototype.__init__.apply(this, arguments);\n };\n AST_Hole.prototype.__repr__ = function __repr__ () {\n if(AST_Atom.prototype.__repr__) return AST_Atom.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Hole.prototype.__str__ = function __str__ () {\n if(AST_Atom.prototype.__str__) return AST_Atom.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Hole.prototype, "__bases__", {value: [AST_Atom]});\n AST_Hole.prototype.value = undefined;\n\n function AST_Infinity() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Infinity.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Infinity, AST_Atom);\n AST_Infinity.prototype.__init__ = function __init__ () {\n AST_Atom.prototype.__init__ && AST_Atom.prototype.__init__.apply(this, arguments);\n };\n AST_Infinity.prototype.__repr__ = function __repr__ () {\n if(AST_Atom.prototype.__repr__) return AST_Atom.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Infinity.prototype.__str__ = function __str__ () {\n if(AST_Atom.prototype.__str__) return AST_Atom.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Infinity.prototype, "__bases__", {value: [AST_Atom]});\n AST_Infinity.prototype.value = Infinity;\n\n function AST_Boolean() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_Boolean.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_Boolean, AST_Atom);\n AST_Boolean.prototype.__init__ = function __init__ () {\n AST_Atom.prototype.__init__ && AST_Atom.prototype.__init__.apply(this, arguments);\n };\n AST_Boolean.prototype.__repr__ = function __repr__ () {\n if(AST_Atom.prototype.__repr__) return AST_Atom.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_Boolean.prototype.__str__ = function __str__ () {\n if(AST_Atom.prototype.__str__) return AST_Atom.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_Boolean.prototype, "__bases__", {value: [AST_Atom]});\n\n function AST_False() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_False.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_False, AST_Boolean);\n AST_False.prototype.__init__ = function __init__ () {\n AST_Boolean.prototype.__init__ && AST_Boolean.prototype.__init__.apply(this, arguments);\n };\n AST_False.prototype.__repr__ = function __repr__ () {\n if(AST_Boolean.prototype.__repr__) return AST_Boolean.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_False.prototype.__str__ = function __str__ () {\n if(AST_Boolean.prototype.__str__) return AST_Boolean.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_False.prototype, "__bases__", {value: [AST_Boolean]});\n AST_False.prototype.value = false;\n\n function AST_True() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AST_True.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(AST_True, AST_Boolean);\n AST_True.prototype.__init__ = function __init__ () {\n AST_Boolean.prototype.__init__ && AST_Boolean.prototype.__init__.apply(this, arguments);\n };\n AST_True.prototype.__repr__ = function __repr__ () {\n if(AST_Boolean.prototype.__repr__) return AST_Boolean.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n AST_True.prototype.__str__ = function __str__ () {\n if(AST_Boolean.prototype.__str__) return AST_Boolean.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(AST_True.prototype, "__bases__", {value: [AST_Boolean]});\n AST_True.prototype.value = true;\n\n function TreeWalker() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n TreeWalker.prototype.__init__.apply(this, arguments);\n }\n TreeWalker.prototype.__init__ = function __init__(callback) {\n var self = this;\n self.visit = callback;\n self.stack = ρσ_list_decorate([]);\n };\n if (!TreeWalker.prototype.__init__.__argnames__) Object.defineProperties(TreeWalker.prototype.__init__, {\n __argnames__ : {value: ["callback"]},\n __module__ : {value: "ast"}\n });\n TreeWalker.__argnames__ = TreeWalker.prototype.__init__.__argnames__;\n TreeWalker.__handles_kwarg_interpolation__ = TreeWalker.prototype.__init__.__handles_kwarg_interpolation__;\n TreeWalker.prototype._visit = function _visit(node, descend) {\n var self = this;\n var ret;\n self.stack.push(node);\n ret = self.visit(node, (descend) ? (function() {\n var ρσ_anonfunc = function () {\n descend.call(node);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })() : noop);\n if (!ret && descend) {\n descend.call(node);\n }\n self.stack.pop();\n return ret;\n };\n if (!TreeWalker.prototype._visit.__argnames__) Object.defineProperties(TreeWalker.prototype._visit, {\n __argnames__ : {value: ["node", "descend"]},\n __module__ : {value: "ast"}\n });\n TreeWalker.prototype.parent = function parent(n) {\n var self = this;\n return (ρσ_expr_temp = self.stack)[ρσ_bound_index(self.stack.length - 2 - (n || 0), ρσ_expr_temp)];\n };\n if (!TreeWalker.prototype.parent.__argnames__) Object.defineProperties(TreeWalker.prototype.parent, {\n __argnames__ : {value: ["n"]},\n __module__ : {value: "ast"}\n });\n TreeWalker.prototype.push = function push(node) {\n var self = this;\n self.stack.push(node);\n };\n if (!TreeWalker.prototype.push.__argnames__) Object.defineProperties(TreeWalker.prototype.push, {\n __argnames__ : {value: ["node"]},\n __module__ : {value: "ast"}\n });\n TreeWalker.prototype.pop = function pop() {\n var self = this;\n return self.stack.pop();\n };\n if (!TreeWalker.prototype.pop.__module__) Object.defineProperties(TreeWalker.prototype.pop, {\n __module__ : {value: "ast"}\n });\n TreeWalker.prototype.self = function self() {\n var s = this;\n return (ρσ_expr_temp = s.stack)[ρσ_bound_index(s.stack.length - 1, ρσ_expr_temp)];\n };\n if (!TreeWalker.prototype.self.__module__) Object.defineProperties(TreeWalker.prototype.self, {\n __module__ : {value: "ast"}\n });\n TreeWalker.prototype.find_parent = function find_parent(type) {\n var self = this;\n var stack, x, i;\n stack = self.stack;\n for (var ρσ_Index35 = stack.length - 1; ρσ_Index35 > -1; ρσ_Index35-=1) {\n i = ρσ_Index35;\n x = stack[(typeof i === "number" && i < 0) ? stack.length + i : i];\n if (is_node_type(x, type)) {\n return x;\n }\n }\n };\n if (!TreeWalker.prototype.find_parent.__argnames__) Object.defineProperties(TreeWalker.prototype.find_parent, {\n __argnames__ : {value: ["type"]},\n __module__ : {value: "ast"}\n });\n TreeWalker.prototype.in_boolean_context = function in_boolean_context() {\n var self = this;\n var stack, i, p;\n stack = self.stack;\n i = stack.length;\n self = stack[ρσ_bound_index(i -= 1, stack)];\n while (i > 0) {\n p = stack[ρσ_bound_index(i -= 1, stack)];\n if (is_node_type(p, AST_If) && p.condition === self || is_node_type(p, AST_Conditional) && p.condition === self || is_node_type(p, AST_DWLoop) && p.condition === self || is_node_type(p, AST_UnaryPrefix) && p.operator === "!" && p.expression === self) {\n return true;\n }\n if (!((is_node_type(p, AST_Binary) && (p.operator === "&&" || p.operator === "||")))) {\n return false;\n }\n self = p;\n }\n };\n if (!TreeWalker.prototype.in_boolean_context.__module__) Object.defineProperties(TreeWalker.prototype.in_boolean_context, {\n __module__ : {value: "ast"}\n });\n TreeWalker.prototype.__repr__ = function __repr__ () {\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n TreeWalker.prototype.__str__ = function __str__ () {\n return this.__repr__();\n };\n Object.defineProperty(TreeWalker.prototype, "__bases__", {value: []});\n\n function Found() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n Found.prototype.__init__.apply(this, arguments);\n }\n ρσ_extends(Found, Exception);\n Found.prototype.__init__ = function __init__ () {\n Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);\n };\n Found.prototype.__repr__ = function __repr__ () {\n if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n Found.prototype.__str__ = function __str__ () {\n if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);\nreturn this.__repr__();\n };\n Object.defineProperty(Found.prototype, "__bases__", {value: [Exception]});\n \n\n function has_calls(expression) {\n if (!expression) {\n return false;\n }\n try {\n expression.walk(new TreeWalker((function() {\n var ρσ_anonfunc = function (node) {\n if (is_node_type(node, AST_BaseCall) || is_node_type(node, AST_ItemAccess)) {\n throw new Found;\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["node"]},\n __module__ : {value: "ast"}\n });\n return ρσ_anonfunc;\n })()));\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n if (ρσ_Exception instanceof Found) {\n return true;\n } else {\n throw ρσ_Exception;\n }\n }\n return false;\n };\n if (!has_calls.__argnames__) Object.defineProperties(has_calls, {\n __argnames__ : {value: ["expression"]},\n __module__ : {value: "ast"}\n });\n\n ρσ_modules.ast.is_node_type = is_node_type;\n ρσ_modules.ast.AST = AST;\n ρσ_modules.ast.AST_Token = AST_Token;\n ρσ_modules.ast.AST_Node = AST_Node;\n ρσ_modules.ast.AST_Statement = AST_Statement;\n ρσ_modules.ast.AST_Debugger = AST_Debugger;\n ρσ_modules.ast.AST_Directive = AST_Directive;\n ρσ_modules.ast.AST_SimpleStatement = AST_SimpleStatement;\n ρσ_modules.ast.AST_Assert = AST_Assert;\n ρσ_modules.ast.walk_body = walk_body;\n ρσ_modules.ast.AST_Block = AST_Block;\n ρσ_modules.ast.AST_BlockStatement = AST_BlockStatement;\n ρσ_modules.ast.AST_EmptyStatement = AST_EmptyStatement;\n ρσ_modules.ast.AST_StatementWithBody = AST_StatementWithBody;\n ρσ_modules.ast.AST_DWLoop = AST_DWLoop;\n ρσ_modules.ast.AST_Do = AST_Do;\n ρσ_modules.ast.AST_While = AST_While;\n ρσ_modules.ast.AST_ForIn = AST_ForIn;\n ρσ_modules.ast.AST_ForJS = AST_ForJS;\n ρσ_modules.ast.AST_ListComprehension = AST_ListComprehension;\n ρσ_modules.ast.AST_SetComprehension = AST_SetComprehension;\n ρσ_modules.ast.AST_DictComprehension = AST_DictComprehension;\n ρσ_modules.ast.AST_GeneratorComprehension = AST_GeneratorComprehension;\n ρσ_modules.ast.AST_With = AST_With;\n ρσ_modules.ast.AST_WithClause = AST_WithClause;\n ρσ_modules.ast.AST_Scope = AST_Scope;\n ρσ_modules.ast.AST_Toplevel = AST_Toplevel;\n ρσ_modules.ast.AST_Import = AST_Import;\n ρσ_modules.ast.AST_Imports = AST_Imports;\n ρσ_modules.ast.AST_Decorator = AST_Decorator;\n ρσ_modules.ast.AST_Lambda = AST_Lambda;\n ρσ_modules.ast.AST_Function = AST_Function;\n ρσ_modules.ast.AST_Class = AST_Class;\n ρσ_modules.ast.AST_Method = AST_Method;\n ρσ_modules.ast.AST_Jump = AST_Jump;\n ρσ_modules.ast.AST_Exit = AST_Exit;\n ρσ_modules.ast.AST_Return = AST_Return;\n ρσ_modules.ast.AST_Yield = AST_Yield;\n ρσ_modules.ast.AST_Throw = AST_Throw;\n ρσ_modules.ast.AST_LoopControl = AST_LoopControl;\n ρσ_modules.ast.AST_Break = AST_Break;\n ρσ_modules.ast.AST_Continue = AST_Continue;\n ρσ_modules.ast.AST_If = AST_If;\n ρσ_modules.ast.AST_Try = AST_Try;\n ρσ_modules.ast.AST_Catch = AST_Catch;\n ρσ_modules.ast.AST_Except = AST_Except;\n ρσ_modules.ast.AST_Finally = AST_Finally;\n ρσ_modules.ast.AST_Else = AST_Else;\n ρσ_modules.ast.AST_Definitions = AST_Definitions;\n ρσ_modules.ast.AST_Var = AST_Var;\n ρσ_modules.ast.AST_VarDef = AST_VarDef;\n ρσ_modules.ast.AST_BaseCall = AST_BaseCall;\n ρσ_modules.ast.AST_Call = AST_Call;\n ρσ_modules.ast.AST_ClassCall = AST_ClassCall;\n ρσ_modules.ast.AST_New = AST_New;\n ρσ_modules.ast.AST_Seq = AST_Seq;\n ρσ_modules.ast.AST_PropAccess = AST_PropAccess;\n ρσ_modules.ast.AST_Dot = AST_Dot;\n ρσ_modules.ast.AST_Sub = AST_Sub;\n ρσ_modules.ast.AST_ItemAccess = AST_ItemAccess;\n ρσ_modules.ast.AST_Splice = AST_Splice;\n ρσ_modules.ast.AST_Unary = AST_Unary;\n ρσ_modules.ast.AST_UnaryPrefix = AST_UnaryPrefix;\n ρσ_modules.ast.AST_Binary = AST_Binary;\n ρσ_modules.ast.AST_Existential = AST_Existential;\n ρσ_modules.ast.AST_Conditional = AST_Conditional;\n ρσ_modules.ast.AST_Assign = AST_Assign;\n ρσ_modules.ast.AST_Array = AST_Array;\n ρσ_modules.ast.AST_Object = AST_Object;\n ρσ_modules.ast.AST_ExpressiveObject = AST_ExpressiveObject;\n ρσ_modules.ast.AST_ObjectProperty = AST_ObjectProperty;\n ρσ_modules.ast.AST_ObjectKeyVal = AST_ObjectKeyVal;\n ρσ_modules.ast.AST_Set = AST_Set;\n ρσ_modules.ast.AST_SetItem = AST_SetItem;\n ρσ_modules.ast.AST_Symbol = AST_Symbol;\n ρσ_modules.ast.AST_SymbolAlias = AST_SymbolAlias;\n ρσ_modules.ast.AST_SymbolDeclaration = AST_SymbolDeclaration;\n ρσ_modules.ast.AST_SymbolVar = AST_SymbolVar;\n ρσ_modules.ast.AST_ImportedVar = AST_ImportedVar;\n ρσ_modules.ast.AST_SymbolNonlocal = AST_SymbolNonlocal;\n ρσ_modules.ast.AST_SymbolFunarg = AST_SymbolFunarg;\n ρσ_modules.ast.AST_SymbolDefun = AST_SymbolDefun;\n ρσ_modules.ast.AST_SymbolLambda = AST_SymbolLambda;\n ρσ_modules.ast.AST_SymbolCatch = AST_SymbolCatch;\n ρσ_modules.ast.AST_SymbolRef = AST_SymbolRef;\n ρσ_modules.ast.AST_This = AST_This;\n ρσ_modules.ast.AST_Constant = AST_Constant;\n ρσ_modules.ast.AST_String = AST_String;\n ρσ_modules.ast.AST_Verbatim = AST_Verbatim;\n ρσ_modules.ast.AST_Number = AST_Number;\n ρσ_modules.ast.AST_RegExp = AST_RegExp;\n ρσ_modules.ast.AST_Atom = AST_Atom;\n ρσ_modules.ast.AST_Null = AST_Null;\n ρσ_modules.ast.AST_NaN = AST_NaN;\n ρσ_modules.ast.AST_Undefined = AST_Undefined;\n ρσ_modules.ast.AST_Hole = AST_Hole;\n ρσ_modules.ast.AST_Infinity = AST_Infinity;\n ρσ_modules.ast.AST_Boolean = AST_Boolean;\n ρσ_modules.ast.AST_False = AST_False;\n ρσ_modules.ast.AST_True = AST_True;\n ρσ_modules.ast.TreeWalker = TreeWalker;\n ρσ_modules.ast.Found = Found;\n ρσ_modules.ast.has_calls = has_calls;\n })();\n\n (function(){\n var __name__ = "string_interpolation";\n function quoted_string(x) {\n return "\\"" + x.replace(/\\\\/g, "\\\\\\\\").replace(/"/g, "\\\\\\"").replace(/\\n/g, "\\\\n") + "\\"";\n };\n if (!quoted_string.__argnames__) Object.defineProperties(quoted_string, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "string_interpolation"}\n });\n\n function render_markup(markup) {\n var ρσ_unpack, pos, key, ch, fmtspec, prefix;\n ρσ_unpack = [0, ""];\n pos = ρσ_unpack[0];\n key = ρσ_unpack[1];\n while (pos < markup.length) {\n ch = markup[(typeof pos === "number" && pos < 0) ? markup.length + pos : pos];\n if (ch === "!" || ch === ":") {\n break;\n }\n key += ch;\n pos += 1;\n }\n fmtspec = markup.slice(pos);\n prefix = "";\n if (key.endsWith("=")) {\n prefix = key;\n key = key.slice(0, -1);\n }\n return "ρσ_str.format(\\"" + prefix + "{" + fmtspec + "}\\", " + key + ")";\n };\n if (!render_markup.__argnames__) Object.defineProperties(render_markup, {\n __argnames__ : {value: ["markup"]},\n __module__ : {value: "string_interpolation"}\n });\n\n function interpolate(template, raise_error) {\n var pos, in_brace, markup, ans, ch;\n pos = in_brace = 0;\n markup = "";\n ans = [""];\n while (pos < template.length) {\n ch = template[(typeof pos === "number" && pos < 0) ? template.length + pos : pos];\n if (in_brace) {\n if (ch === "{") {\n in_brace += 1;\n markup += "{";\n } else if (ch === "}") {\n in_brace -= 1;\n if (in_brace > 0) {\n markup += "}";\n } else {\n ans.push([markup]);\n ans.push("");\n }\n } else {\n markup += ch;\n }\n } else {\n if (ch === "{") {\n if (template[ρσ_bound_index(pos + 1, template)] === "{") {\n pos += 1;\n ans[ans.length-1] += "{";\n } else {\n in_brace = 1;\n markup = "";\n }\n } else if (ch === "}") {\n if (template[ρσ_bound_index(pos + 1, template)] === "}") {\n pos += 1;\n ans[ans.length-1] += "}";\n } else {\n raise_error("f-string: single \'}\' is not allowed");\n }\n } else {\n ans[ans.length-1] += ch;\n }\n }\n pos += 1;\n }\n if (in_brace) {\n raise_error("expected \'}\' before end of string");\n }\n if (ans[ans.length-1] === "+") {\n ans[ans.length-1] = "";\n }\n for (var i = 0; i < ans.length; i++) {\n if (typeof ans[(typeof i === "number" && i < 0) ? ans.length + i : i] === "string") {\n ans[(typeof i === "number" && i < 0) ? ans.length + i : i] = quoted_string(ans[(typeof i === "number" && i < 0) ? ans.length + i : i]);\n } else {\n ans[(typeof i === "number" && i < 0) ? ans.length + i : i] = "+" + render_markup.apply(this, ans[(typeof i === "number" && i < 0) ? ans.length + i : i]) + "+";\n }\n }\n return ans.join("");\n };\n if (!interpolate.__argnames__) Object.defineProperties(interpolate, {\n __argnames__ : {value: ["template", "raise_error"]},\n __module__ : {value: "string_interpolation"}\n });\n\n ρσ_modules.string_interpolation.quoted_string = quoted_string;\n ρσ_modules.string_interpolation.render_markup = render_markup;\n ρσ_modules.string_interpolation.interpolate = interpolate;\n })();\n\n (function(){\n var __name__ = "tokenizer";\n var RE_HEX_NUMBER, RE_OCT_NUMBER, RE_DEC_NUMBER, OPERATOR_CHARS, ASCII_CONTROL_CHARS, HEX_PAT, NAME_PAT, OPERATORS, OP_MAP, WHITESPACE_CHARS, PUNC_BEFORE_EXPRESSION, PUNC_CHARS, KEYWORDS, KEYWORDS_ATOM, RESERVED_WORDS, KEYWORDS_BEFORE_EXPRESSION, ALL_KEYWORDS, IDENTIFIER_PAT, UNICODE, EX_EOF;\n var ALIAS_MAP = ρσ_modules.unicode_aliases.ALIAS_MAP;\n\n var make_predicate = ρσ_modules.utils.make_predicate;\n var characters = ρσ_modules.utils.characters;\n\n var AST_Token = ρσ_modules.ast.AST_Token;\n\n var SyntaxError = ρσ_modules.errors.SyntaxError;\n\n var interpolate = ρσ_modules.string_interpolation.interpolate;\n\n RE_HEX_NUMBER = /^0x[0-9a-f]+$/i;\n RE_OCT_NUMBER = /^0[0-7]+$/;\n RE_DEC_NUMBER = /^\\d*\\.?\\d*(?:e[+-]?\\d*(?:\\d\\.?|\\.?\\d)\\d*)?$/i;\n OPERATOR_CHARS = make_predicate(characters("+-*&%=<>!?|~^@"));\n ASCII_CONTROL_CHARS = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["a"] = 7;\n ρσ_d["b"] = 8;\n ρσ_d["f"] = 12;\n ρσ_d["n"] = 10;\n ρσ_d["r"] = 13;\n ρσ_d["t"] = 9;\n ρσ_d["v"] = 11;\n return ρσ_d;\n }).call(this);\n HEX_PAT = /[a-fA-F0-9]/;\n NAME_PAT = /[a-zA-Z ]/;\n OPERATORS = make_predicate(ρσ_list_decorate([ "in", "instanceof", "typeof", "new", "void", "del", "+", "-", "not", "~", "&", "|", "^", "**", "*", "//", "/", "%", ">>", "<<", ">>>", "<", ">", "<=", ">=", "==", "is", "!=", "=", "+=", "-=", "//=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=", "and", "or", "@", "->" ]));\n OP_MAP = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["or"] = "||";\n ρσ_d["and"] = "&&";\n ρσ_d["not"] = "!";\n ρσ_d["del"] = "delete";\n ρσ_d["None"] = "null";\n ρσ_d["is"] = "===";\n return ρσ_d;\n }).call(this);\n WHITESPACE_CHARS = make_predicate(characters("  \\n\\r\\t\\f\\u000b​᠎           \\u202f  "));\n PUNC_BEFORE_EXPRESSION = make_predicate(characters("[{(,.;:"));\n PUNC_CHARS = make_predicate(characters("[]{}(),;:?"));\n KEYWORDS = "as assert break class continue def del do elif else except finally for from global if import in is new nonlocal pass raise return yield try while with or and not";\n KEYWORDS_ATOM = "False None True";\n RESERVED_WORDS = "break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof new return super switch this throw try typeof var void while with yield enum implements static private package let public protected interface await null true false";\n KEYWORDS_BEFORE_EXPRESSION = "return yield new del raise elif else if";\n ALL_KEYWORDS = KEYWORDS + " " + KEYWORDS_ATOM;\n KEYWORDS = make_predicate(KEYWORDS);\n RESERVED_WORDS = make_predicate(RESERVED_WORDS);\n KEYWORDS_BEFORE_EXPRESSION = make_predicate(KEYWORDS_BEFORE_EXPRESSION);\n KEYWORDS_ATOM = make_predicate(KEYWORDS_ATOM);\n IDENTIFIER_PAT = /^[a-z_$][_a-z0-9$]*$/i;\n function is_string_modifier(val) {\n var ch;\n var ρσ_Iter36 = ρσ_Iterable(val);\n for (var ρσ_Index36 = 0; ρσ_Index36 < ρσ_Iter36.length; ρσ_Index36++) {\n ch = ρσ_Iter36[ρσ_Index36];\n if ("vrufVRUF".indexOf(ch) === -1) {\n return false;\n }\n }\n return true;\n };\n if (!is_string_modifier.__argnames__) Object.defineProperties(is_string_modifier, {\n __argnames__ : {value: ["val"]},\n __module__ : {value: "tokenizer"}\n });\n\n function is_letter(code) {\n return code >= 97 && code <= 122 || code >= 65 && code <= 90 || code >= 170 && UNICODE.letter.test(String.fromCharCode(code));\n };\n if (!is_letter.__argnames__) Object.defineProperties(is_letter, {\n __argnames__ : {value: ["code"]},\n __module__ : {value: "tokenizer"}\n });\n\n function is_digit(code) {\n return code >= 48 && code <= 57;\n };\n if (!is_digit.__argnames__) Object.defineProperties(is_digit, {\n __argnames__ : {value: ["code"]},\n __module__ : {value: "tokenizer"}\n });\n\n function is_alphanumeric_char(code) {\n return is_digit(code) || is_letter(code);\n };\n if (!is_alphanumeric_char.__argnames__) Object.defineProperties(is_alphanumeric_char, {\n __argnames__ : {value: ["code"]},\n __module__ : {value: "tokenizer"}\n });\n\n function is_unicode_combining_mark(ch) {\n return UNICODE.non_spacing_mark.test(ch) || UNICODE.space_combining_mark.test(ch);\n };\n if (!is_unicode_combining_mark.__argnames__) Object.defineProperties(is_unicode_combining_mark, {\n __argnames__ : {value: ["ch"]},\n __module__ : {value: "tokenizer"}\n });\n\n function is_unicode_connector_punctuation(ch) {\n return UNICODE.connector_punctuation.test(ch);\n };\n if (!is_unicode_connector_punctuation.__argnames__) Object.defineProperties(is_unicode_connector_punctuation, {\n __argnames__ : {value: ["ch"]},\n __module__ : {value: "tokenizer"}\n });\n\n function is_identifier(name) {\n return !RESERVED_WORDS[(typeof name === "number" && name < 0) ? RESERVED_WORDS.length + name : name] && !KEYWORDS[(typeof name === "number" && name < 0) ? KEYWORDS.length + name : name] && !KEYWORDS_ATOM[(typeof name === "number" && name < 0) ? KEYWORDS_ATOM.length + name : name] && IDENTIFIER_PAT.test(name);\n };\n if (!is_identifier.__argnames__) Object.defineProperties(is_identifier, {\n __argnames__ : {value: ["name"]},\n __module__ : {value: "tokenizer"}\n });\n\n function is_identifier_start(code) {\n return code === 36 || code === 95 || is_letter(code);\n };\n if (!is_identifier_start.__argnames__) Object.defineProperties(is_identifier_start, {\n __argnames__ : {value: ["code"]},\n __module__ : {value: "tokenizer"}\n });\n\n function is_identifier_char(ch) {\n var code;\n code = ch.charCodeAt(0);\n return is_identifier_start(code) || is_digit(code) || code === 8204 || code === 8205 || is_unicode_combining_mark(ch) || is_unicode_connector_punctuation(ch);\n };\n if (!is_identifier_char.__argnames__) Object.defineProperties(is_identifier_char, {\n __argnames__ : {value: ["ch"]},\n __module__ : {value: "tokenizer"}\n });\n\n function parse_js_number(num) {\n if (RE_HEX_NUMBER.test(num)) {\n return parseInt(num.substr(2), 16);\n } else if (RE_OCT_NUMBER.test(num)) {\n return parseInt(num.substr(1), 8);\n } else if (RE_DEC_NUMBER.test(num)) {\n return parseFloat(num);\n }\n };\n if (!parse_js_number.__argnames__) Object.defineProperties(parse_js_number, {\n __argnames__ : {value: ["num"]},\n __module__ : {value: "tokenizer"}\n });\n\n UNICODE = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["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]");\n ρσ_d["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]");\n ρσ_d["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]");\n ρσ_d["connector_punctuation"] = new RegExp("[\\\\u005F\\\\u203F\\\\u2040\\\\u2054\\\\uFE33\\\\uFE34\\\\uFE4D-\\\\uFE4F\\\\uFF3F]");\n return ρσ_d;\n }).call(this);\n function is_token(token, type, val) {\n return token.type === type && (val === null || val === undefined || token.value === val);\n };\n if (!is_token.__argnames__) Object.defineProperties(is_token, {\n __argnames__ : {value: ["token", "type", "val"]},\n __module__ : {value: "tokenizer"}\n });\n\n EX_EOF = Object.create(null);\n function tokenizer(raw_text, filename) {\n var S, read_string, read_regexp;\n S = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["text"] = raw_text.replace(/\\r\\n?|[\\n\\u2028\\u2029]/g, "\\n").replace(/\\uFEFF/g, "");\n ρσ_d["filename"] = filename;\n ρσ_d["pos"] = 0;\n ρσ_d["tokpos"] = 0;\n ρσ_d["line"] = 1;\n ρσ_d["tokline"] = 0;\n ρσ_d["col"] = 0;\n ρσ_d["tokcol"] = 0;\n ρσ_d["newline_before"] = false;\n ρσ_d["regex_allowed"] = false;\n ρσ_d["comments_before"] = [];\n ρσ_d["whitespace_before"] = [];\n ρσ_d["newblock"] = false;\n ρσ_d["endblock"] = false;\n ρσ_d["indentation_matters"] = [ true ];\n ρσ_d["cached_whitespace"] = "";\n ρσ_d["prev"] = undefined;\n ρσ_d["index_or_slice"] = [ false ];\n ρσ_d["expecting_object_literal_key"] = false;\n return ρσ_d;\n }).call(this);\n function peek() {\n return S.text.charAt(S.pos);\n };\n if (!peek.__module__) Object.defineProperties(peek, {\n __module__ : {value: "tokenizer"}\n });\n\n function prevChar() {\n return S.text.charAt(S.tokpos - 1);\n };\n if (!prevChar.__module__) Object.defineProperties(prevChar, {\n __module__ : {value: "tokenizer"}\n });\n\n function next(signal_eof, in_string) {\n var ch;\n ch = S.text.charAt(S.pos);\n S.pos += 1;\n if (signal_eof && !ch) {\n throw EX_EOF;\n }\n if (ch === "\\n") {\n S.newline_before = S.newline_before || !in_string;\n S.line += 1;\n S.col = 0;\n } else {\n S.col += 1;\n }\n return ch;\n };\n if (!next.__argnames__) Object.defineProperties(next, {\n __argnames__ : {value: ["signal_eof", "in_string"]},\n __module__ : {value: "tokenizer"}\n });\n\n function find(what, signal_eof) {\n var pos;\n pos = S.text.indexOf(what, S.pos);\n if (signal_eof && pos === -1) {\n throw EX_EOF;\n }\n return pos;\n };\n if (!find.__argnames__) Object.defineProperties(find, {\n __argnames__ : {value: ["what", "signal_eof"]},\n __module__ : {value: "tokenizer"}\n });\n\n function start_token() {\n S.tokline = S.line;\n S.tokcol = S.col;\n S.tokpos = S.pos;\n };\n if (!start_token.__module__) Object.defineProperties(start_token, {\n __module__ : {value: "tokenizer"}\n });\n\n function token(type, value, is_comment, keep_newline) {\n var ret, i;\n S.regex_allowed = type === "operator" || type === "keyword" && KEYWORDS_BEFORE_EXPRESSION[(typeof value === "number" && value < 0) ? KEYWORDS_BEFORE_EXPRESSION.length + value : value] || type === "punc" && PUNC_BEFORE_EXPRESSION[(typeof value === "number" && value < 0) ? PUNC_BEFORE_EXPRESSION.length + value : value];\n if (type === "operator" && value === "is" && S.text.substr(S.pos).trimLeft().substr(0, 4).trimRight() === "not") {\n next_token();\n value = "!==";\n }\n if (type === "operator" && OP_MAP[(typeof value === "number" && value < 0) ? OP_MAP.length + value : value]) {\n value = OP_MAP[(typeof value === "number" && value < 0) ? OP_MAP.length + value : value];\n }\n ret = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["type"] = type;\n ρσ_d["value"] = value;\n ρσ_d["line"] = S.tokline;\n ρσ_d["col"] = S.tokcol;\n ρσ_d["pos"] = S.tokpos;\n ρσ_d["endpos"] = S.pos;\n ρσ_d["nlb"] = S.newline_before;\n ρσ_d["file"] = filename;\n ρσ_d["leading_whitespace"] = (ρσ_expr_temp = S.whitespace_before)[ρσ_expr_temp.length-1] || "";\n return ρσ_d;\n }).call(this);\n if (!is_comment) {\n ret.comments_before = S.comments_before;\n S.comments_before = [];\n for (var ρσ_Index37 = 0; ρσ_Index37 < ret.comments_before.length; ρσ_Index37++) {\n i = ρσ_Index37;\n ret.nlb = ret.nlb || (ρσ_expr_temp = ret.comments_before)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i].nlb;\n }\n }\n if (!keep_newline) {\n S.newline_before = false;\n }\n if (type === "punc") {\n if (value === ":" && !(ρσ_expr_temp = S.index_or_slice)[ρσ_expr_temp.length-1] && !S.expecting_object_literal_key && (!S.text.substring(S.pos + 1, find("\\n")).trim() || !S.text.substring(S.pos + 1, find("#")).trim())) {\n S.newblock = true;\n S.indentation_matters.push(true);\n }\n if (value === "[") {\n if (S.prev && (S.prev.type === "name" || S.prev.type === "punc" && ")]".indexOf(S.prev.value) !== -1)) {\n S.index_or_slice.push(true);\n } else {\n S.index_or_slice.push(false);\n }\n S.indentation_matters.push(false);\n } else if (value === "{" || value === "(") {\n S.indentation_matters.push(false);\n } else if (value === "]") {\n S.index_or_slice.pop();\n S.indentation_matters.pop();\n } else if (value === "}" || value === ")") {\n S.indentation_matters.pop();\n }\n }\n S.prev = new AST_Token(ret);\n return S.prev;\n };\n if (!token.__argnames__) Object.defineProperties(token, {\n __argnames__ : {value: ["type", "value", "is_comment", "keep_newline"]},\n __module__ : {value: "tokenizer"}\n });\n\n function parse_whitespace() {\n var leading_whitespace, whitespace_exists, ch;\n leading_whitespace = "";\n whitespace_exists = false;\n while (WHITESPACE_CHARS[ρσ_bound_index(peek(), WHITESPACE_CHARS)]) {\n whitespace_exists = true;\n ch = next();\n if (ch === "\\n") {\n leading_whitespace = "";\n } else {\n leading_whitespace += ch;\n }\n }\n if (peek() !== "#") {\n if (!whitespace_exists) {\n leading_whitespace = S.cached_whitespace;\n } else {\n S.cached_whitespace = leading_whitespace;\n }\n if (S.newline_before || S.endblock) {\n return test_indent_token(leading_whitespace);\n }\n }\n };\n if (!parse_whitespace.__module__) Object.defineProperties(parse_whitespace, {\n __module__ : {value: "tokenizer"}\n });\n\n function test_indent_token(leading_whitespace) {\n var most_recent;\n most_recent = (ρσ_expr_temp = S.whitespace_before)[ρσ_expr_temp.length-1] || "";\n S.endblock = false;\n if ((ρσ_expr_temp = S.indentation_matters)[ρσ_expr_temp.length-1] && leading_whitespace !== most_recent) {\n if (S.newblock && leading_whitespace && leading_whitespace.indexOf(most_recent) === 0) {\n S.newblock = false;\n S.whitespace_before.push(leading_whitespace);\n return 1;\n } else if (most_recent && most_recent.indexOf(leading_whitespace) === 0) {\n S.endblock = true;\n S.whitespace_before.pop();\n return -1;\n } else {\n parse_error("Inconsistent indentation");\n }\n }\n return 0;\n };\n if (!test_indent_token.__argnames__) Object.defineProperties(test_indent_token, {\n __argnames__ : {value: ["leading_whitespace"]},\n __module__ : {value: "tokenizer"}\n });\n\n function read_while(pred) {\n var ret, i, ch;\n ret = "";\n i = 0;\n ch = "";\n while ((ch = peek()) && pred(ch, i)) {\n i += 1;\n ret += next();\n }\n return ret;\n };\n if (!read_while.__argnames__) Object.defineProperties(read_while, {\n __argnames__ : {value: ["pred"]},\n __module__ : {value: "tokenizer"}\n });\n\n function parse_error(err, is_eof) {\n throw new SyntaxError(err, filename, S.tokline, S.tokcol, S.tokpos, is_eof);\n };\n if (!parse_error.__argnames__) Object.defineProperties(parse_error, {\n __argnames__ : {value: ["err", "is_eof"]},\n __module__ : {value: "tokenizer"}\n });\n\n function read_num(prefix) {\n var has_e, has_x, has_dot, num, valid, seen;\n has_e = false;\n has_x = false;\n has_dot = prefix === ".";\n if (!prefix && peek() === "0" && S.text.charAt(S.pos + 1) === "b") {\n [next(), next()];\n num = read_while((function() {\n var ρσ_anonfunc = function (ch) {\n return ch === "0" || ch === "1";\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["ch"]},\n __module__ : {value: "tokenizer"}\n });\n return ρσ_anonfunc;\n })());\n valid = parseInt(num, 2);\n if (isNaN(valid)) {\n parse_error("Invalid syntax for a binary number");\n }\n return token("num", valid);\n }\n seen = [];\n num = read_while((function() {\n var ρσ_anonfunc = function (ch, i) {\n seen.push(ch);\n if (ch === "x" || ch === "X") {\n if (has_x || seen.length !== 2 || seen[0] !== "0") {\n return false;\n }\n has_x = true;\n return true;\n } else if (ch === "e" || ch === "E") {\n if (has_x) {\n return true;\n }\n if (has_e || (i === 0 || typeof i === "object" && ρσ_equals(i, 0))) {\n return false;\n }\n has_e = true;\n return true;\n } else if (ch === "-") {\n if (i === 0 && !prefix) {\n return true;\n }\n if (has_e && seen[ρσ_bound_index(i - 1, seen)].toLowerCase() === "e") {\n return true;\n }\n return false;\n } else if (ch === "+") {\n if (has_e && seen[ρσ_bound_index(i - 1, seen)].toLowerCase() === "e") {\n return true;\n }\n return false;\n } else if (ch === ".") {\n return (!has_dot && !has_x && !has_e) ? has_dot = true : false;\n }\n return is_alphanumeric_char(ch.charCodeAt(0));\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["ch", "i"]},\n __module__ : {value: "tokenizer"}\n });\n return ρσ_anonfunc;\n })());\n if (prefix) {\n num = prefix + num;\n }\n valid = parse_js_number(num);\n if (!isNaN(valid)) {\n return token("num", valid);\n } else {\n parse_error("Invalid syntax: " + num);\n }\n };\n if (!read_num.__argnames__) Object.defineProperties(read_num, {\n __argnames__ : {value: ["prefix"]},\n __module__ : {value: "tokenizer"}\n });\n\n function read_hex_digits(count) {\n var ans, nval;\n ans = "";\n while (count > 0) {\n count -= 1;\n if (!HEX_PAT.test(peek())) {\n return ans;\n }\n ans += next();\n }\n nval = parseInt(ans, 16);\n if (nval > 1114111) {\n return ans;\n }\n return nval;\n };\n if (!read_hex_digits.__argnames__) Object.defineProperties(read_hex_digits, {\n __argnames__ : {value: ["count"]},\n __module__ : {value: "tokenizer"}\n });\n\n function read_escape_sequence() {\n var q, octal, code, name, key;\n q = next(true);\n if (q === "\\n") {\n return "";\n }\n if (q === "\\\\") {\n return q;\n }\n if ("\\"\'".indexOf(q) !== -1) {\n return q;\n }\n if (ASCII_CONTROL_CHARS[(typeof q === "number" && q < 0) ? ASCII_CONTROL_CHARS.length + q : q]) {\n return String.fromCharCode(ASCII_CONTROL_CHARS[(typeof q === "number" && q < 0) ? ASCII_CONTROL_CHARS.length + q : q]);\n }\n if ("0" <= q && q <= "7") {\n octal = q;\n if ("0" <= (ρσ_cond_temp = peek()) && ρσ_cond_temp <= "7") {\n octal += next();\n }\n if ("0" <= (ρσ_cond_temp = peek()) && ρσ_cond_temp <= "7") {\n octal += next();\n }\n code = parseInt(octal, 8);\n if (isNaN(code)) {\n return "\\\\" + octal;\n }\n return String.fromCharCode(code);\n }\n if (q === "x") {\n code = read_hex_digits(2);\n if (typeof code === "number") {\n return String.fromCharCode(code);\n }\n return "\\\\x" + code;\n }\n if (q === "u") {\n code = read_hex_digits(4);\n if (typeof code === "number") {\n return String.fromCharCode(code);\n }\n return "\\\\u" + code;\n }\n if (q === "U") {\n code = read_hex_digits(8);\n if (typeof code === "number") {\n if (code <= 65535) {\n return String.fromCharCode(code);\n }\n code -= 65536;\n return String.fromCharCode(55296 + (code >> 10), 56320 + (code & 1023));\n }\n return "\\\\U" + code;\n }\n if (q === "N" && peek() === "{") {\n next();\n name = read_while((function() {\n var ρσ_anonfunc = function (ch) {\n return NAME_PAT.test(ch);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["ch"]},\n __module__ : {value: "tokenizer"}\n });\n return ρσ_anonfunc;\n })());\n if (peek() !== "}") {\n return "\\\\N{" + name;\n }\n next();\n key = (name || "").toLowerCase();\n if (!name || !Object.prototype.hasOwnProperty.call(ALIAS_MAP, key)) {\n return "\\\\N{" + name + "}";\n }\n code = ALIAS_MAP[(typeof key === "number" && key < 0) ? ALIAS_MAP.length + key : key];\n if (code <= 65535) {\n return String.fromCharCode(code);\n }\n code -= 65536;\n return String.fromCharCode(55296 + (code >> 10), 56320 + (code & 1023));\n }\n return "\\\\" + q;\n };\n if (!read_escape_sequence.__module__) Object.defineProperties(read_escape_sequence, {\n __module__ : {value: "tokenizer"}\n });\n\n function with_eof_error(eof_error, cont) {\n return (function() {\n var ρσ_anonfunc = function () {\n try {\n return cont.apply(null, arguments);\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n {\n var ex = ρσ_Exception;\n if (ex === EX_EOF) {\n parse_error(eof_error, true);\n } else {\n throw ρσ_Exception;\n }\n } \n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "tokenizer"}\n });\n return ρσ_anonfunc;\n })();\n };\n if (!with_eof_error.__argnames__) Object.defineProperties(with_eof_error, {\n __argnames__ : {value: ["eof_error", "cont"]},\n __module__ : {value: "tokenizer"}\n });\n\n read_string = with_eof_error("Unterminated string constant", (function() {\n var ρσ_anonfunc = function (is_raw_literal, is_js_literal) {\n var quote, tok_type, ret, is_multiline, ch;\n quote = next();\n tok_type = (is_js_literal) ? "js" : "string";\n ret = "";\n is_multiline = false;\n if (peek() === quote) {\n next(true);\n if (peek() === quote) {\n next(true);\n is_multiline = true;\n } else {\n return token(tok_type, "");\n }\n }\n while (true) {\n ch = next(true, true);\n if (!ch) {\n break;\n }\n if (ch === "\\n" && !is_multiline) {\n parse_error("End of line while scanning string literal");\n }\n if (ch === "\\\\") {\n ret += (is_raw_literal) ? "\\\\" + next(true) : read_escape_sequence();\n continue;\n }\n if (ch === quote) {\n if (!is_multiline) {\n break;\n }\n if (peek() === quote) {\n next();\n if (peek() === quote) {\n next();\n break;\n } else {\n ch += quote;\n }\n }\n }\n ret += ch;\n }\n return token(tok_type, ret);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["is_raw_literal", "is_js_literal"]},\n __module__ : {value: "tokenizer"}\n });\n return ρσ_anonfunc;\n })());\n function handle_interpolated_string(string, start_tok) {\n function raise_error(err) {\n throw new SyntaxError(err, filename, start_tok.line, start_tok.col, start_tok.pos, false);\n };\n if (!raise_error.__argnames__) Object.defineProperties(raise_error, {\n __argnames__ : {value: ["err"]},\n __module__ : {value: "tokenizer"}\n });\n\n S.text = S.text.slice(0, S.pos) + "(" + interpolate(string, raise_error) + ")" + S.text.slice(S.pos);\n return token("punc", next());\n };\n if (!handle_interpolated_string.__argnames__) Object.defineProperties(handle_interpolated_string, {\n __argnames__ : {value: ["string", "start_tok"]},\n __module__ : {value: "tokenizer"}\n });\n\n function read_line_comment(shebang) {\n var i, ret;\n if (!shebang) {\n next();\n }\n i = find("\\n");\n if (i === -1) {\n ret = S.text.substr(S.pos);\n S.pos = S.text.length;\n } else {\n ret = S.text.substring(S.pos, i);\n S.pos = i;\n }\n return token((shebang) ? "shebang" : "comment1", ret, true);\n };\n if (!read_line_comment.__argnames__) Object.defineProperties(read_line_comment, {\n __argnames__ : {value: ["shebang"]},\n __module__ : {value: "tokenizer"}\n });\n\n function read_name() {\n var name, ch;\n name = ch = "";\n while ((ch = peek()) !== null) {\n if (ch === "\\\\") {\n if (S.text.charAt(S.pos + 1) === "\\n") {\n S.pos += 2;\n continue;\n }\n break;\n } else if (is_identifier_char(ch)) {\n name += next();\n } else {\n break;\n }\n }\n return name;\n };\n if (!read_name.__module__) Object.defineProperties(read_name, {\n __module__ : {value: "tokenizer"}\n });\n\n read_regexp = with_eof_error("Unterminated regular expression", (function() {\n var ρσ_anonfunc = function () {\n var prev_backslash, regexp, ch, in_class, verbose_regexp, in_comment, mods;\n prev_backslash = false;\n regexp = ch = "";\n in_class = false;\n verbose_regexp = false;\n in_comment = false;\n if (peek() === "/") {\n next(true);\n if (peek() === "/") {\n verbose_regexp = true;\n next(true);\n } else {\n mods = read_name();\n return token("regexp", new RegExp(regexp, mods));\n }\n }\n while (true) {\n ch = next(true);\n if (!ch) {\n break;\n }\n if (in_comment) {\n if (ch === "\\n") {\n in_comment = false;\n }\n continue;\n }\n if (prev_backslash) {\n regexp += "\\\\" + ch;\n prev_backslash = false;\n } else if (ch === "[") {\n in_class = true;\n regexp += ch;\n } else if (ch === "]" && in_class) {\n in_class = false;\n regexp += ch;\n } else if (ch === "/" && !in_class) {\n if (verbose_regexp) {\n if (peek() !== "/") {\n regexp += "\\\\/";\n continue;\n }\n next(true);\n if (peek() !== "/") {\n regexp += "\\\\/\\\\/";\n continue;\n }\n next(true);\n }\n break;\n } else if (ch === "\\\\") {\n prev_backslash = true;\n } else if (verbose_regexp && !in_class && " \\n\\r\\t".indexOf(ch) !== -1) {\n } else if (verbose_regexp && !in_class && ch === "#") {\n in_comment = true;\n } else {\n regexp += ch;\n }\n }\n mods = read_name();\n return token("regexp", new RegExp(regexp, mods));\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "tokenizer"}\n });\n return ρσ_anonfunc;\n })());\n function read_operator(prefix) {\n var op;\n function grow(op) {\n var bigger;\n if (!peek()) {\n return op;\n }\n bigger = op + peek();\n if (OPERATORS[(typeof bigger === "number" && bigger < 0) ? OPERATORS.length + bigger : bigger]) {\n next();\n return grow(bigger);\n } else {\n return op;\n }\n };\n if (!grow.__argnames__) Object.defineProperties(grow, {\n __argnames__ : {value: ["op"]},\n __module__ : {value: "tokenizer"}\n });\n\n op = grow(prefix || next());\n if (op === "->") {\n return token("punc", op);\n }\n return token("operator", op);\n };\n if (!read_operator.__argnames__) Object.defineProperties(read_operator, {\n __argnames__ : {value: ["prefix"]},\n __module__ : {value: "tokenizer"}\n });\n\n function handle_slash() {\n next();\n return (S.regex_allowed) ? read_regexp("") : read_operator("/");\n };\n if (!handle_slash.__module__) Object.defineProperties(handle_slash, {\n __module__ : {value: "tokenizer"}\n });\n\n function handle_dot() {\n next();\n return (is_digit(peek().charCodeAt(0))) ? read_num(".") : token("punc", ".");\n };\n if (!handle_dot.__module__) Object.defineProperties(handle_dot, {\n __module__ : {value: "tokenizer"}\n });\n\n function read_word() {\n var word;\n word = read_name();\n return (KEYWORDS_ATOM[(typeof word === "number" && word < 0) ? KEYWORDS_ATOM.length + word : word]) ? token("atom", word) : (!KEYWORDS[(typeof word === "number" && word < 0) ? KEYWORDS.length + word : word]) ? token("name", word) : (OPERATORS[(typeof word === "number" && word < 0) ? OPERATORS.length + word : word] && prevChar() !== ".") ? token("operator", word) : token("keyword", word);\n };\n if (!read_word.__module__) Object.defineProperties(read_word, {\n __module__ : {value: "tokenizer"}\n });\n\n function next_token() {\n var indent, ch, code, tmp_, regex_allowed, tok, mods, start_pos_for_string, stok;\n indent = parse_whitespace();\n if (indent === -1) {\n return token("punc", "}", false, true);\n }\n start_token();\n ch = peek();\n if (!ch) {\n return token("eof");\n }\n code = ch.charCodeAt(0);\n tmp_ = code;\n if (tmp_ === 34 || tmp_ === 39) {\n return read_string(false);\n } else if (tmp_ === 35) {\n if (S.pos === 0 && S.text.charAt(1) === "!") {\n return read_line_comment(true);\n }\n regex_allowed = S.regex_allowed;\n S.comments_before.push(read_line_comment());\n S.regex_allowed = regex_allowed;\n return next_token();\n } else if (tmp_ === 46) {\n return handle_dot();\n } else if (tmp_ === 47) {\n return handle_slash();\n }\n if (is_digit(code)) {\n return read_num();\n }\n if (PUNC_CHARS[(typeof ch === "number" && ch < 0) ? PUNC_CHARS.length + ch : ch]) {\n return token("punc", next());\n }\n if (OPERATOR_CHARS[(typeof ch === "number" && ch < 0) ? OPERATOR_CHARS.length + ch : ch]) {\n return read_operator();\n }\n if (code === 92 && S.text.charAt(S.pos + 1) === "\\n") {\n next();\n next();\n S.newline_before = false;\n return next_token();\n }\n if (is_identifier_start(code)) {\n tok = read_word();\n if ("\'\\"".indexOf(peek()) !== -1 && is_string_modifier(tok.value)) {\n mods = tok.value.toLowerCase();\n start_pos_for_string = S.tokpos;\n stok = read_string(mods.indexOf("r") !== -1, mods.indexOf("v") !== -1);\n tok.endpos = stok.endpos;\n if (stok.type !== "js" && mods.indexOf("f") !== -1) {\n tok.col += start_pos_for_string - tok.pos;\n return handle_interpolated_string(stok.value, tok);\n }\n tok.value = stok.value;\n tok.type = stok.type;\n }\n return tok;\n }\n parse_error("Unexpected character «" + ch + "»");\n };\n if (!next_token.__module__) Object.defineProperties(next_token, {\n __module__ : {value: "tokenizer"}\n });\n\n next_token.context = (function() {\n var ρσ_anonfunc = function (nc) {\n if (nc) {\n S = nc;\n }\n return S;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["nc"]},\n __module__ : {value: "tokenizer"}\n });\n return ρσ_anonfunc;\n })();\n return next_token;\n };\n if (!tokenizer.__argnames__) Object.defineProperties(tokenizer, {\n __argnames__ : {value: ["raw_text", "filename"]},\n __module__ : {value: "tokenizer"}\n });\n\n ρσ_modules.tokenizer.RE_HEX_NUMBER = RE_HEX_NUMBER;\n ρσ_modules.tokenizer.RE_OCT_NUMBER = RE_OCT_NUMBER;\n ρσ_modules.tokenizer.RE_DEC_NUMBER = RE_DEC_NUMBER;\n ρσ_modules.tokenizer.OPERATOR_CHARS = OPERATOR_CHARS;\n ρσ_modules.tokenizer.ASCII_CONTROL_CHARS = ASCII_CONTROL_CHARS;\n ρσ_modules.tokenizer.HEX_PAT = HEX_PAT;\n ρσ_modules.tokenizer.NAME_PAT = NAME_PAT;\n ρσ_modules.tokenizer.OPERATORS = OPERATORS;\n ρσ_modules.tokenizer.OP_MAP = OP_MAP;\n ρσ_modules.tokenizer.WHITESPACE_CHARS = WHITESPACE_CHARS;\n ρσ_modules.tokenizer.PUNC_BEFORE_EXPRESSION = PUNC_BEFORE_EXPRESSION;\n ρσ_modules.tokenizer.PUNC_CHARS = PUNC_CHARS;\n ρσ_modules.tokenizer.KEYWORDS = KEYWORDS;\n ρσ_modules.tokenizer.KEYWORDS_ATOM = KEYWORDS_ATOM;\n ρσ_modules.tokenizer.RESERVED_WORDS = RESERVED_WORDS;\n ρσ_modules.tokenizer.KEYWORDS_BEFORE_EXPRESSION = KEYWORDS_BEFORE_EXPRESSION;\n ρσ_modules.tokenizer.ALL_KEYWORDS = ALL_KEYWORDS;\n ρσ_modules.tokenizer.IDENTIFIER_PAT = IDENTIFIER_PAT;\n ρσ_modules.tokenizer.UNICODE = UNICODE;\n ρσ_modules.tokenizer.EX_EOF = EX_EOF;\n ρσ_modules.tokenizer.is_string_modifier = is_string_modifier;\n ρσ_modules.tokenizer.is_letter = is_letter;\n ρσ_modules.tokenizer.is_digit = is_digit;\n ρσ_modules.tokenizer.is_alphanumeric_char = is_alphanumeric_char;\n ρσ_modules.tokenizer.is_unicode_combining_mark = is_unicode_combining_mark;\n ρσ_modules.tokenizer.is_unicode_connector_punctuation = is_unicode_connector_punctuation;\n ρσ_modules.tokenizer.is_identifier = is_identifier;\n ρσ_modules.tokenizer.is_identifier_start = is_identifier_start;\n ρσ_modules.tokenizer.is_identifier_char = is_identifier_char;\n ρσ_modules.tokenizer.parse_js_number = parse_js_number;\n ρσ_modules.tokenizer.is_token = is_token;\n ρσ_modules.tokenizer.tokenizer = tokenizer;\n })();\n\n (function(){\n var __name__ = "parse";\n var COMPILER_VERSION, PYTHON_FLAGS, NATIVE_CLASSES, ERROR_CLASSES, COMMON_STATIC, FORBIDDEN_CLASS_VARS, UNARY_PREFIX, ASSIGNMENT, PRECEDENCE, STATEMENTS_WITH_LABELS, ATOMIC_START_TOKEN, compile_time_decorators;\n var make_predicate = ρσ_modules.utils.make_predicate;\n var array_to_hash = ρσ_modules.utils.array_to_hash;\n var defaults = ρσ_modules.utils.defaults;\n var has_prop = ρσ_modules.utils.has_prop;\n var cache_file_name = ρσ_modules.utils.cache_file_name;\n\n var SyntaxError = ρσ_modules.errors.SyntaxError;\n var ImportError = ρσ_modules.errors.ImportError;\n\n var AST_Array = ρσ_modules.ast.AST_Array;\n var AST_Assign = ρσ_modules.ast.AST_Assign;\n var AST_Binary = ρσ_modules.ast.AST_Binary;\n var AST_BlockStatement = ρσ_modules.ast.AST_BlockStatement;\n var AST_Break = ρσ_modules.ast.AST_Break;\n var AST_Call = ρσ_modules.ast.AST_Call;\n var AST_Catch = ρσ_modules.ast.AST_Catch;\n var AST_Class = ρσ_modules.ast.AST_Class;\n var AST_ClassCall = ρσ_modules.ast.AST_ClassCall;\n var AST_Conditional = ρσ_modules.ast.AST_Conditional;\n var AST_Constant = ρσ_modules.ast.AST_Constant;\n var AST_Continue = ρσ_modules.ast.AST_Continue;\n var AST_DWLoop = ρσ_modules.ast.AST_DWLoop;\n var AST_Debugger = ρσ_modules.ast.AST_Debugger;\n var AST_Decorator = ρσ_modules.ast.AST_Decorator;\n var AST_Definitions = ρσ_modules.ast.AST_Definitions;\n var AST_DictComprehension = ρσ_modules.ast.AST_DictComprehension;\n var AST_Directive = ρσ_modules.ast.AST_Directive;\n var AST_Do = ρσ_modules.ast.AST_Do;\n var AST_Dot = ρσ_modules.ast.AST_Dot;\n var AST_Else = ρσ_modules.ast.AST_Else;\n var AST_EmptyStatement = ρσ_modules.ast.AST_EmptyStatement;\n var AST_Except = ρσ_modules.ast.AST_Except;\n var AST_ExpressiveObject = ρσ_modules.ast.AST_ExpressiveObject;\n var AST_False = ρσ_modules.ast.AST_False;\n var AST_Finally = ρσ_modules.ast.AST_Finally;\n var AST_ForIn = ρσ_modules.ast.AST_ForIn;\n var AST_ForJS = ρσ_modules.ast.AST_ForJS;\n var AST_Function = ρσ_modules.ast.AST_Function;\n var AST_GeneratorComprehension = ρσ_modules.ast.AST_GeneratorComprehension;\n var AST_Hole = ρσ_modules.ast.AST_Hole;\n var AST_If = ρσ_modules.ast.AST_If;\n var AST_Import = ρσ_modules.ast.AST_Import;\n var AST_ImportedVar = ρσ_modules.ast.AST_ImportedVar;\n var AST_Imports = ρσ_modules.ast.AST_Imports;\n var AST_ListComprehension = ρσ_modules.ast.AST_ListComprehension;\n var AST_Method = ρσ_modules.ast.AST_Method;\n var AST_New = ρσ_modules.ast.AST_New;\n var AST_Null = ρσ_modules.ast.AST_Null;\n var AST_Number = ρσ_modules.ast.AST_Number;\n var AST_Object = ρσ_modules.ast.AST_Object;\n var AST_ObjectKeyVal = ρσ_modules.ast.AST_ObjectKeyVal;\n var AST_PropAccess = ρσ_modules.ast.AST_PropAccess;\n var AST_RegExp = ρσ_modules.ast.AST_RegExp;\n var AST_Return = ρσ_modules.ast.AST_Return;\n var AST_Scope = ρσ_modules.ast.AST_Scope;\n var AST_Set = ρσ_modules.ast.AST_Set;\n var AST_SetComprehension = ρσ_modules.ast.AST_SetComprehension;\n var AST_SetItem = ρσ_modules.ast.AST_SetItem;\n var AST_Seq = ρσ_modules.ast.AST_Seq;\n var AST_SimpleStatement = ρσ_modules.ast.AST_SimpleStatement;\n var AST_Splice = ρσ_modules.ast.AST_Splice;\n var AST_String = ρσ_modules.ast.AST_String;\n var AST_Sub = ρσ_modules.ast.AST_Sub;\n var AST_ItemAccess = ρσ_modules.ast.AST_ItemAccess;\n var AST_SymbolAlias = ρσ_modules.ast.AST_SymbolAlias;\n var AST_SymbolCatch = ρσ_modules.ast.AST_SymbolCatch;\n var AST_SymbolDefun = ρσ_modules.ast.AST_SymbolDefun;\n var AST_SymbolFunarg = ρσ_modules.ast.AST_SymbolFunarg;\n var AST_SymbolLambda = ρσ_modules.ast.AST_SymbolLambda;\n var AST_SymbolNonlocal = ρσ_modules.ast.AST_SymbolNonlocal;\n var AST_SymbolRef = ρσ_modules.ast.AST_SymbolRef;\n var AST_SymbolVar = ρσ_modules.ast.AST_SymbolVar;\n var AST_This = ρσ_modules.ast.AST_This;\n var AST_Throw = ρσ_modules.ast.AST_Throw;\n var AST_Toplevel = ρσ_modules.ast.AST_Toplevel;\n var AST_True = ρσ_modules.ast.AST_True;\n var AST_Try = ρσ_modules.ast.AST_Try;\n var AST_UnaryPrefix = ρσ_modules.ast.AST_UnaryPrefix;\n var AST_Undefined = ρσ_modules.ast.AST_Undefined;\n var AST_Var = ρσ_modules.ast.AST_Var;\n var AST_VarDef = ρσ_modules.ast.AST_VarDef;\n var AST_Verbatim = ρσ_modules.ast.AST_Verbatim;\n var AST_While = ρσ_modules.ast.AST_While;\n var AST_With = ρσ_modules.ast.AST_With;\n var AST_WithClause = ρσ_modules.ast.AST_WithClause;\n var AST_Yield = ρσ_modules.ast.AST_Yield;\n var AST_Assert = ρσ_modules.ast.AST_Assert;\n var AST_Existential = ρσ_modules.ast.AST_Existential;\n var is_node_type = ρσ_modules.ast.is_node_type;\n\n var tokenizer = ρσ_modules.tokenizer.tokenizer;\n var is_token = ρσ_modules.tokenizer.is_token;\n var RESERVED_WORDS = ρσ_modules.tokenizer.RESERVED_WORDS;\n\n COMPILER_VERSION = "3f763668d2b35556d88849ef0433f00bcc2a5cb6";\n PYTHON_FLAGS = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["dict_literals"] = true;\n ρσ_d["overload_getitem"] = true;\n ρσ_d["bound_methods"] = true;\n ρσ_d["hash_literals"] = true;\n return ρσ_d;\n }).call(this);\n function get_compiler_version() {\n return COMPILER_VERSION;\n };\n if (!get_compiler_version.__module__) Object.defineProperties(get_compiler_version, {\n __module__ : {value: "parse"}\n });\n\n function static_predicate(names) {\n return (function() {\n var ρσ_Iter = ρσ_Iterable(names.split(" ")), ρσ_Result = Object.create(null), k;\n for (var ρσ_Index = 0; ρσ_Index < ρσ_Iter.length; ρσ_Index++) {\n k = ρσ_Iter[ρσ_Index];\n ρσ_Result[k] = (true);\n }\n return ρσ_Result;\n })();\n };\n if (!static_predicate.__argnames__) Object.defineProperties(static_predicate, {\n __argnames__ : {value: ["names"]},\n __module__ : {value: "parse"}\n });\n\n NATIVE_CLASSES = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["Image"] = Object.create(null);\n ρσ_d["FileReader"] = Object.create(null);\n ρσ_d["RegExp"] = Object.create(null);\n ρσ_d["Error"] = Object.create(null);\n ρσ_d["EvalError"] = Object.create(null);\n ρσ_d["InternalError"] = Object.create(null);\n ρσ_d["RangeError"] = Object.create(null);\n ρσ_d["ReferenceError"] = Object.create(null);\n ρσ_d["SyntaxError"] = Object.create(null);\n ρσ_d["TypeError"] = Object.create(null);\n ρσ_d["URIError"] = Object.create(null);\n ρσ_d["Object"] = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["static"] = static_predicate("getOwnPropertyNames getOwnPropertyDescriptor getOwnPropertyDescriptors getOwnPropertySymbols keys entries values create defineProperty defineProperties getPrototypeOf setPrototypeOf assign seal isSealed is preventExtensions isExtensible freeze isFrozen");\n return ρσ_d;\n }).call(this);\n ρσ_d["String"] = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["static"] = static_predicate("fromCharCode");\n return ρσ_d;\n }).call(this);\n ρσ_d["Array"] = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["static"] = static_predicate("isArray from of");\n return ρσ_d;\n }).call(this);\n ρσ_d["Function"] = Object.create(null);\n ρσ_d["Date"] = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["static"] = static_predicate("UTC now parse");\n return ρσ_d;\n }).call(this);\n ρσ_d["ArrayBuffer"] = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["static"] = static_predicate("isView transfer");\n return ρσ_d;\n }).call(this);\n ρσ_d["DataView"] = Object.create(null);\n ρσ_d["Float32Array"] = Object.create(null);\n ρσ_d["Float64Array"] = Object.create(null);\n ρσ_d["Int16Array"] = Object.create(null);\n ρσ_d["Int32Array"] = Object.create(null);\n ρσ_d["Int8Array"] = Object.create(null);\n ρσ_d["Uint16Array"] = Object.create(null);\n ρσ_d["Uint32Array"] = Object.create(null);\n ρσ_d["Uint8Array"] = Object.create(null);\n ρσ_d["Uint8ClampedArray"] = Object.create(null);\n ρσ_d["Map"] = Object.create(null);\n ρσ_d["WeakMap"] = Object.create(null);\n ρσ_d["Proxy"] = Object.create(null);\n ρσ_d["Set"] = Object.create(null);\n ρσ_d["WeakSet"] = Object.create(null);\n ρσ_d["Promise"] = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["static"] = static_predicate("all race reject resolve");\n return ρσ_d;\n }).call(this);\n ρσ_d["WebSocket"] = Object.create(null);\n ρσ_d["XMLHttpRequest"] = Object.create(null);\n ρσ_d["TextEncoder"] = Object.create(null);\n ρσ_d["TextDecoder"] = Object.create(null);\n ρσ_d["MouseEvent"] = Object.create(null);\n ρσ_d["Event"] = Object.create(null);\n ρσ_d["CustomEvent"] = Object.create(null);\n ρσ_d["Blob"] = Object.create(null);\n return ρσ_d;\n }).call(this);\n ERROR_CLASSES = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["Exception"] = Object.create(null);\n ρσ_d["AttributeError"] = Object.create(null);\n ρσ_d["IndexError"] = Object.create(null);\n ρσ_d["KeyError"] = Object.create(null);\n ρσ_d["ValueError"] = Object.create(null);\n ρσ_d["UnicodeDecodeError"] = Object.create(null);\n ρσ_d["AssertionError"] = Object.create(null);\n ρσ_d["ZeroDivisionError"] = Object.create(null);\n return ρσ_d;\n }).call(this);\n COMMON_STATIC = static_predicate("call apply bind toString");\n FORBIDDEN_CLASS_VARS = "prototype constructor".split(" ");\n UNARY_PREFIX = make_predicate("typeof void delete ~ - + ! @");\n ASSIGNMENT = make_predicate("= += -= /= //= *= %= >>= <<= >>>= |= ^= &=");\n PRECEDENCE = (function() {\n var ρσ_anonfunc = function (a, ret) {\n var b, j, i;\n for (var ρσ_Index38 = 0; ρσ_Index38 < a.length; ρσ_Index38++) {\n i = ρσ_Index38;\n b = a[(typeof i === "number" && i < 0) ? a.length + i : i];\n for (var ρσ_Index39 = 0; ρσ_Index39 < b.length; ρσ_Index39++) {\n j = ρσ_Index39;\n ret[ρσ_bound_index(b[(typeof j === "number" && j < 0) ? b.length + j : j], ret)] = i + 1;\n }\n }\n return ret;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["a", "ret"]},\n __module__ : {value: "parse"}\n });\n return ρσ_anonfunc;\n })()(ρσ_list_decorate([ ρσ_list_decorate([ "||" ]), ρσ_list_decorate([ "&&" ]), ρσ_list_decorate([ "|" ]), ρσ_list_decorate([ "^" ]), ρσ_list_decorate([ "&" ]), ρσ_list_decorate([ "==", "===", "!=", "!==" ]), ρσ_list_decorate([ "<", ">", "<=", ">=", "in", "nin", "instanceof" ]), ρσ_list_decorate([ ">>", "<<", ">>>" ]), ρσ_list_decorate([ "+", "-" ]), ρσ_list_decorate([ "*", "/", "//", "%" ]), ρσ_list_decorate([ "**" ]) ]), Object.create(null));\n STATEMENTS_WITH_LABELS = array_to_hash(ρσ_list_decorate([ "for", "do", "while", "switch" ]));\n ATOMIC_START_TOKEN = array_to_hash(ρσ_list_decorate([ "atom", "num", "string", "regexp", "name", "js" ]));\n compile_time_decorators = ρσ_list_decorate([ "staticmethod", "external", "property" ]);\n function has_simple_decorator(decorators, name) {\n var remove, s;\n remove = [];\n for (var i = 0; i < decorators.length; i++) {\n s = decorators[(typeof i === "number" && i < 0) ? decorators.length + i : i];\n if (is_node_type(s, AST_SymbolRef) && !s.parens && s.name === name) {\n remove.push(i);\n }\n }\n if (remove.length) {\n remove.reverse();\n for (var i = 0; i < remove.length; i++) {\n decorators.splice(remove[(typeof i === "number" && i < 0) ? remove.length + i : i], 1);\n }\n return true;\n }\n return false;\n };\n if (!has_simple_decorator.__argnames__) Object.defineProperties(has_simple_decorator, {\n __argnames__ : {value: ["decorators", "name"]},\n __module__ : {value: "parse"}\n });\n\n function has_setter_decorator(decorators, name) {\n var remove, s;\n remove = [];\n for (var i = 0; i < decorators.length; i++) {\n s = decorators[(typeof i === "number" && i < 0) ? decorators.length + i : i];\n if (is_node_type(s, AST_Dot) && is_node_type(s.expression, AST_SymbolRef) && s.expression.name === name && s.property === "setter") {\n remove.push(i);\n }\n }\n if (remove.length) {\n remove.reverse();\n for (var i = 0; i < remove.length; i++) {\n decorators.splice(remove[(typeof i === "number" && i < 0) ? remove.length + i : i], 1);\n }\n return true;\n }\n return false;\n };\n if (!has_setter_decorator.__argnames__) Object.defineProperties(has_setter_decorator, {\n __argnames__ : {value: ["decorators", "name"]},\n __module__ : {value: "parse"}\n });\n\n function create_parser_ctx(S, import_dirs, module_id, baselib_items, imported_module_ids, imported_modules, importing_modules, options) {\n function next() {\n S.prev = S.token;\n if (S.peeked.length) {\n S.token = S.peeked.shift();\n } else {\n S.token = S.input();\n }\n return S.token;\n };\n if (!next.__module__) Object.defineProperties(next, {\n __module__ : {value: "parse"}\n });\n\n function is_(type, value) {\n return is_token(S.token, type, value);\n };\n if (!is_.__argnames__) Object.defineProperties(is_, {\n __argnames__ : {value: ["type", "value"]},\n __module__ : {value: "parse"}\n });\n\n function peek() {\n if (!S.peeked.length) {\n S.peeked.push(S.input());\n }\n return S.peeked[0];\n };\n if (!peek.__module__) Object.defineProperties(peek, {\n __module__ : {value: "parse"}\n });\n\n function prev() {\n return S.prev;\n };\n if (!prev.__module__) Object.defineProperties(prev, {\n __module__ : {value: "parse"}\n });\n\n function croak(msg, line, col, pos, is_eof) {\n var ctx;\n ctx = S.input.context();\n throw new SyntaxError(msg, ctx.filename, (line !== undefined) ? line : ctx.tokline, (col !== undefined) ? col : ctx.tokcol, (pos !== undefined) ? pos : ctx.tokpos, is_eof);\n };\n if (!croak.__argnames__) Object.defineProperties(croak, {\n __argnames__ : {value: ["msg", "line", "col", "pos", "is_eof"]},\n __module__ : {value: "parse"}\n });\n\n function token_error(token, msg) {\n var is_eof;\n is_eof = token.type === "eof";\n croak(msg, token.line, token.col, undefined, is_eof);\n };\n if (!token_error.__argnames__) Object.defineProperties(token_error, {\n __argnames__ : {value: ["token", "msg"]},\n __module__ : {value: "parse"}\n });\n\n function unexpected(token) {\n if (token === undefined) {\n token = S.token;\n }\n token_error(token, "Unexpected token: " + token.type + " «" + token.value + "»");\n };\n if (!unexpected.__argnames__) Object.defineProperties(unexpected, {\n __argnames__ : {value: ["token"]},\n __module__ : {value: "parse"}\n });\n\n function expect_token(type, val) {\n if (is_(type, val)) {\n return next();\n }\n token_error(S.token, "Unexpected token " + S.token.type + " «" + S.token.value + "»" + ", expected " + type + " «" + val + "»");\n };\n if (!expect_token.__argnames__) Object.defineProperties(expect_token, {\n __argnames__ : {value: ["type", "val"]},\n __module__ : {value: "parse"}\n });\n\n function expect(punc) {\n return expect_token("punc", punc);\n };\n if (!expect.__argnames__) Object.defineProperties(expect, {\n __argnames__ : {value: ["punc"]},\n __module__ : {value: "parse"}\n });\n\n function semicolon() {\n if (is_("punc", ";")) {\n next();\n S.token.nlb = true;\n }\n };\n if (!semicolon.__module__) Object.defineProperties(semicolon, {\n __module__ : {value: "parse"}\n });\n\n function embed_tokens(parser) {\n function with_embedded_tokens() {\n var start, expr, end;\n start = S.token;\n expr = parser();\n if (expr === undefined) {\n unexpected();\n }\n end = prev();\n expr.start = start;\n expr.end = end;\n return expr;\n };\n if (!with_embedded_tokens.__module__) Object.defineProperties(with_embedded_tokens, {\n __module__ : {value: "parse"}\n });\n\n return with_embedded_tokens;\n };\n if (!embed_tokens.__argnames__) Object.defineProperties(embed_tokens, {\n __argnames__ : {value: ["parser"]},\n __module__ : {value: "parse"}\n });\n\n function scan_for_top_level_callables(body) {\n var ans, opt, x, obj;\n ans = [];\n if (Array.isArray(body)) {\n var ρσ_Iter40 = ρσ_Iterable(body);\n for (var ρσ_Index40 = 0; ρσ_Index40 < ρσ_Iter40.length; ρσ_Index40++) {\n obj = ρσ_Iter40[ρσ_Index40];\n if (is_node_type(obj, AST_Function) || is_node_type(obj, AST_Class)) {\n if (obj.name) {\n ans.push(obj.name.name);\n } else {\n token_error(obj.start, "Top-level functions must have names");\n }\n } else {\n if (is_node_type(obj, AST_Scope)) {\n continue;\n }\n var ρσ_Iter41 = ρσ_Iterable(ρσ_list_decorate([ "body", "alternative" ]));\n for (var ρσ_Index41 = 0; ρσ_Index41 < ρσ_Iter41.length; ρσ_Index41++) {\n x = ρσ_Iter41[ρσ_Index41];\n opt = obj[(typeof x === "number" && x < 0) ? obj.length + x : x];\n if (opt) {\n ans = ans.concat(scan_for_top_level_callables(opt));\n }\n if (is_node_type(opt, AST_Assign) && !(is_node_type(opt.right, AST_Scope))) {\n ans = ans.concat(scan_for_top_level_callables(opt.right));\n }\n }\n }\n }\n } else if (body.body) {\n ans = ans.concat(scan_for_top_level_callables(body.body));\n if (body.alternative) {\n ans = ans.concat(scan_for_top_level_callables(body.alternative));\n }\n }\n return ans;\n };\n if (!scan_for_top_level_callables.__argnames__) Object.defineProperties(scan_for_top_level_callables, {\n __argnames__ : {value: ["body"]},\n __module__ : {value: "parse"}\n });\n\n function scan_for_classes(body) {\n var ans, obj;\n ans = Object.create(null);\n var ρσ_Iter42 = ρσ_Iterable(body);\n for (var ρσ_Index42 = 0; ρσ_Index42 < ρσ_Iter42.length; ρσ_Index42++) {\n obj = ρσ_Iter42[ρσ_Index42];\n if (is_node_type(obj, AST_Class)) {\n ans[ρσ_bound_index(obj.name.name, ans)] = obj;\n }\n }\n return ans;\n };\n if (!scan_for_classes.__argnames__) Object.defineProperties(scan_for_classes, {\n __argnames__ : {value: ["body"]},\n __module__ : {value: "parse"}\n });\n\n function scan_for_local_vars(body) {\n var localvars, seen, opt, option, clause, stmt, is_compound_assign, lhs;\n localvars = [];\n seen = Object.create(null);\n function push(x) {\n if (has_prop(seen, x)) {\n return;\n }\n seen[(typeof x === "number" && x < 0) ? seen.length + x : x] = true;\n localvars.push(x);\n };\n if (!push.__argnames__) Object.defineProperties(push, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "parse"}\n });\n\n function extend(arr) {\n var x;\n var ρσ_Iter43 = ρσ_Iterable(arr);\n for (var ρσ_Index43 = 0; ρσ_Index43 < ρσ_Iter43.length; ρσ_Index43++) {\n x = ρσ_Iter43[ρσ_Index43];\n push(x);\n }\n };\n if (!extend.__argnames__) Object.defineProperties(extend, {\n __argnames__ : {value: ["arr"]},\n __module__ : {value: "parse"}\n });\n\n function scan_in_array(arr) {\n var x;\n var ρσ_Iter44 = ρσ_Iterable(arr);\n for (var ρσ_Index44 = 0; ρσ_Index44 < ρσ_Iter44.length; ρσ_Index44++) {\n x = ρσ_Iter44[ρσ_Index44];\n if (is_node_type(x, AST_Seq)) {\n x = x.to_array();\n } else if (is_node_type(x, AST_Array)) {\n x = x.elements;\n }\n if (Array.isArray(x)) {\n scan_in_array(x);\n } else {\n if (!is_node_type(x, AST_PropAccess)) {\n push(x.name);\n }\n }\n }\n };\n if (!scan_in_array.__argnames__) Object.defineProperties(scan_in_array, {\n __argnames__ : {value: ["arr"]},\n __module__ : {value: "parse"}\n });\n\n function add_assign_lhs(lhs) {\n if (is_node_type(lhs, AST_Seq)) {\n lhs = new AST_Array((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["elements"] = lhs.to_array();\n return ρσ_d;\n }).call(this));\n }\n if (is_node_type(lhs, AST_Array)) {\n push("ρσ_unpack");\n scan_in_array(lhs.elements);\n } else if (lhs.name) {\n push(lhs.name);\n }\n };\n if (!add_assign_lhs.__argnames__) Object.defineProperties(add_assign_lhs, {\n __argnames__ : {value: ["lhs"]},\n __module__ : {value: "parse"}\n });\n\n function add_for_in(stmt) {\n if (is_node_type(stmt.init, AST_Array)) {\n push("ρσ_unpack");\n scan_in_array(stmt.init.elements);\n } else {\n push(stmt.init.name);\n }\n };\n if (!add_for_in.__argnames__) Object.defineProperties(add_for_in, {\n __argnames__ : {value: ["stmt"]},\n __module__ : {value: "parse"}\n });\n\n if (Array.isArray(body)) {\n var ρσ_Iter45 = ρσ_Iterable(body);\n for (var ρσ_Index45 = 0; ρσ_Index45 < ρσ_Iter45.length; ρσ_Index45++) {\n stmt = ρσ_Iter45[ρσ_Index45];\n if (is_node_type(stmt, AST_Scope)) {\n continue;\n }\n var ρσ_Iter46 = ρσ_Iterable(ρσ_list_decorate([ "body", "alternative", "bcatch", "condition" ]));\n for (var ρσ_Index46 = 0; ρσ_Index46 < ρσ_Iter46.length; ρσ_Index46++) {\n option = ρσ_Iter46[ρσ_Index46];\n opt = stmt[(typeof option === "number" && option < 0) ? stmt.length + option : option];\n if (opt) {\n extend(scan_for_local_vars(opt));\n }\n if (is_node_type(opt, AST_Assign) && !(is_node_type(opt.right, AST_Scope))) {\n extend(scan_for_local_vars(opt.right));\n }\n }\n if (is_node_type(stmt, AST_ForIn)) {\n add_for_in(stmt);\n } else if (is_node_type(stmt, AST_DWLoop)) {\n extend(scan_for_local_vars(stmt));\n } else if (is_node_type(stmt, AST_With)) {\n [push("ρσ_with_exception"), push("ρσ_with_suppress")];\n var ρσ_Iter47 = ρσ_Iterable(stmt.clauses);\n for (var ρσ_Index47 = 0; ρσ_Index47 < ρσ_Iter47.length; ρσ_Index47++) {\n clause = ρσ_Iter47[ρσ_Index47];\n if (clause.alias) {\n push(clause.alias.name);\n }\n }\n }\n }\n } else if (body.body) {\n extend(scan_for_local_vars(body.body));\n if (body.alternative) {\n extend(scan_for_local_vars(body.alternative));\n }\n } else if (is_node_type(body, AST_Assign)) {\n if (body.is_chained()) {\n is_compound_assign = false;\n var ρσ_Iter48 = ρσ_Iterable(body.traverse_chain()[0]);\n for (var ρσ_Index48 = 0; ρσ_Index48 < ρσ_Iter48.length; ρσ_Index48++) {\n lhs = ρσ_Iter48[ρσ_Index48];\n add_assign_lhs(lhs);\n if (is_node_type(lhs, AST_Seq) || is_node_type(lhs, AST_Array)) {\n is_compound_assign = true;\n break;\n }\n }\n if (is_compound_assign) {\n push("ρσ_chain_assign_temp");\n }\n } else {\n add_assign_lhs(body.left);\n }\n if (!is_node_type(body.right, AST_Scope)) {\n extend(scan_for_local_vars(body.right));\n }\n } else if (is_node_type(body, AST_ForIn)) {\n add_for_in(body);\n }\n return localvars;\n };\n if (!scan_for_local_vars.__argnames__) Object.defineProperties(scan_for_local_vars, {\n __argnames__ : {value: ["body"]},\n __module__ : {value: "parse"}\n });\n\n function scan_for_nonlocal_defs(body) {\n var vardef, opt, option, stmt;\n vars = [];\n if (Array.isArray(body)) {\n var ρσ_Iter49 = ρσ_Iterable(body);\n for (var ρσ_Index49 = 0; ρσ_Index49 < ρσ_Iter49.length; ρσ_Index49++) {\n stmt = ρσ_Iter49[ρσ_Index49];\n if (is_node_type(stmt, AST_Scope)) {\n continue;\n }\n if (is_node_type(stmt, AST_Definitions)) {\n var ρσ_Iter50 = ρσ_Iterable(stmt.definitions);\n for (var ρσ_Index50 = 0; ρσ_Index50 < ρσ_Iter50.length; ρσ_Index50++) {\n vardef = ρσ_Iter50[ρσ_Index50];\n vars.push(vardef.name.name);\n }\n }\n var ρσ_Iter51 = ρσ_Iterable(ρσ_list_decorate([ "body", "alternative" ]));\n for (var ρσ_Index51 = 0; ρσ_Index51 < ρσ_Iter51.length; ρσ_Index51++) {\n option = ρσ_Iter51[ρσ_Index51];\n var vars;\n opt = stmt[(typeof option === "number" && option < 0) ? stmt.length + option : option];\n if (opt) {\n vars = vars.concat(scan_for_nonlocal_defs(opt));\n }\n }\n }\n } else if (body.body) {\n vars = vars.concat(scan_for_nonlocal_defs(body.body));\n if (body.alternative) {\n vars = vars.concat(scan_for_nonlocal_defs(body.alternative));\n }\n }\n return vars;\n };\n if (!scan_for_nonlocal_defs.__argnames__) Object.defineProperties(scan_for_nonlocal_defs, {\n __argnames__ : {value: ["body"]},\n __module__ : {value: "parse"}\n });\n\n function return_() {\n var value, is_end_of_statement;\n if (is_("punc", ";")) {\n semicolon();\n value = null;\n } else {\n is_end_of_statement = S.token.nlb || is_("eof") || is_("punc", "}");\n if (is_end_of_statement) {\n value = null;\n } else {\n value = expression(true);\n semicolon();\n }\n }\n return value;\n };\n if (!return_.__module__) Object.defineProperties(return_, {\n __module__ : {value: "parse"}\n });\n\n \n var statement = embed_tokens((function() {\n var ρσ_anonfunc = function statement() {\n var tmp_, p, while_cond, start, func, chain, cond, msg, tmp;\n if (S.token.type === "operator" && S.token.value.substr(0, 1) === "/") {\n token_error(S.token, "RapydScript does not support statements starting with regexp literals");\n }\n S.statement_starting_token = S.token;\n tmp_ = S.token.type;\n p = prev();\n if (p && !S.token.nlb && ATOMIC_START_TOKEN[ρσ_bound_index(p.type, ATOMIC_START_TOKEN)] && !is_("punc", ":")) {\n unexpected();\n }\n if (tmp_ === "string") {\n return simple_statement();\n } else if (tmp_ === "shebang") {\n tmp_ = S.token.value;\n next();\n return new AST_Directive((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["value"] = tmp_;\n return ρσ_d;\n }).call(this));\n } else if (tmp_ === "num" || tmp_ === "regexp" || tmp_ === "operator" || tmp_ === "atom" || tmp_ === "js") {\n return simple_statement();\n } else if (tmp_ === "punc") {\n tmp_ = S.token.value;\n if (tmp_ === ":") {\n return new AST_BlockStatement((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = S.token;\n ρσ_d["body"] = block_();\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this));\n } else if (tmp_ === "{" || tmp_ === "[" || tmp_ === "(") {\n return simple_statement();\n } else if (tmp_ === ";") {\n next();\n return new AST_EmptyStatement((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["stype"] = ";";\n ρσ_d["start"] = prev();\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this));\n } else {\n unexpected();\n }\n } else if (tmp_ === "name") {\n if (is_token(peek(), "punc", ":")) token_error(peek(), "invalid syntax, colon not allowed here");\n return simple_statement();\n } else if (tmp_ === "keyword") {\n tmp_ = S.token.value;\n next();\n if (tmp_ === "break") {\n return break_cont(AST_Break);\n } else if (tmp_ === "continue") {\n return break_cont(AST_Continue);\n } else if (tmp_ === "debugger") {\n semicolon();\n return new AST_Debugger;\n } else if (tmp_ === "do") {\n return new AST_Do((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["body"] = in_loop(statement);\n ρσ_d["condition"] = (function() {\n var ρσ_anonfunc = function () {\n var tmp;\n expect(".");\n expect_token("keyword", "while");\n tmp = expression(true);\n if (is_node_type(tmp, AST_Assign)) {\n croak("Assignments in do loop conditions are not allowed");\n }\n semicolon();\n return tmp;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "parse"}\n });\n return ρσ_anonfunc;\n })()();\n return ρσ_d;\n }).call(this));\n } else if (tmp_ === "while") {\n while_cond = expression(true);\n if (is_node_type(while_cond, AST_Assign)) {\n croak("Assignments in while loop conditions are not allowed");\n }\n if (!is_("punc", ":")) {\n croak("Expected a colon after the while statement");\n }\n return new AST_While((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["condition"] = while_cond;\n ρσ_d["body"] = in_loop(statement);\n return ρσ_d;\n }).call(this));\n } else if (tmp_ === "for") {\n if (is_("js")) {\n return for_js();\n }\n return for_();\n } else if (tmp_ === "from") {\n return import_(true);\n } else if (tmp_ === "import") {\n return import_(false);\n } else if (tmp_ === "class") {\n return class_();\n } else if (tmp_ === "def") {\n start = prev();\n func = function_((ρσ_expr_temp = S.in_class)[ρσ_expr_temp.length-1], false);\n func.start = start;\n func.end = prev();\n chain = subscripts(func, true);\n if (chain === func) {\n return func;\n } else {\n return new AST_SimpleStatement((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["body"] = chain;\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this));\n }\n } else if (tmp_ === "assert") {\n start = prev();\n cond = expression(false);\n msg = null;\n if (is_("punc", ",")) {\n next();\n msg = expression(false);\n }\n return new AST_Assert((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["condition"] = cond;\n ρσ_d["message"] = msg;\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this));\n } else if (tmp_ === "if") {\n return if_();\n } else if (tmp_ === "pass") {\n semicolon();\n return new AST_EmptyStatement((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["stype"] = "pass";\n ρσ_d["start"] = prev();\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this));\n } else if (tmp_ === "return") {\n if (S.in_function === 0) {\n croak("\'return\' outside of function");\n }\n if ((ρσ_expr_temp = S.functions)[ρσ_expr_temp.length-1].is_generator) {\n croak("\'return\' not allowed in a function with yield");\n }\n (ρσ_expr_temp = S.functions)[ρσ_expr_temp.length-1].is_generator = false;\n return new AST_Return((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["value"] = return_();\n return ρσ_d;\n }).call(this));\n } else if (tmp_ === "yield") {\n return yield_();\n } else if (tmp_ === "raise") {\n if (S.token.nlb) {\n return new AST_Throw((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["value"] = new AST_SymbolCatch((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = "ρσ_Exception";\n return ρσ_d;\n }).call(this));\n return ρσ_d;\n }).call(this));\n }\n tmp = expression(true);\n semicolon();\n return new AST_Throw((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["value"] = tmp;\n return ρσ_d;\n }).call(this));\n } else if (tmp_ === "try") {\n return try_();\n } else if (tmp_ === "nonlocal") {\n tmp = nonlocal_();\n semicolon();\n return tmp;\n } else if (tmp_ === "global") {\n tmp = nonlocal_(true);\n semicolon();\n return tmp;\n } else if (tmp_ === "with") {\n return with_();\n } else {\n unexpected();\n }\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "parse"}\n });\n return ρσ_anonfunc;\n })());\n\n function with_() {\n var clauses, start, expr, alias, body;\n clauses = [];\n start = S.token;\n while (true) {\n if (is_("eof")) {\n unexpected();\n }\n expr = expression();\n alias = null;\n if (is_("keyword", "as")) {\n next();\n alias = as_symbol(AST_SymbolAlias);\n }\n clauses.push(new AST_WithClause((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["expression"] = expr;\n ρσ_d["alias"] = alias;\n return ρσ_d;\n }).call(this)));\n if (is_("punc", ",")) {\n next();\n continue;\n }\n if (!is_("punc", ":")) {\n unexpected();\n }\n break;\n }\n if (!clauses.length) {\n token_error(start, "with statement must have at least one clause");\n }\n body = statement();\n return new AST_With((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["clauses"] = clauses;\n ρσ_d["body"] = body;\n return ρσ_d;\n }).call(this));\n };\n if (!with_.__module__) Object.defineProperties(with_, {\n __module__ : {value: "parse"}\n });\n\n function simple_statement(tmp) {\n tmp = expression(true);\n semicolon();\n return new AST_SimpleStatement((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["body"] = tmp;\n return ρσ_d;\n }).call(this));\n };\n if (!simple_statement.__argnames__) Object.defineProperties(simple_statement, {\n __argnames__ : {value: ["tmp"]},\n __module__ : {value: "parse"}\n });\n\n function break_cont(t) {\n if (S.in_loop === 0) {\n croak(t.name.slice(4) + " not inside a loop or switch");\n }\n semicolon();\n return new t;\n };\n if (!break_cont.__argnames__) Object.defineProperties(break_cont, {\n __argnames__ : {value: ["t"]},\n __module__ : {value: "parse"}\n });\n\n function yield_() {\n var is_yield_from;\n if (S.in_function === 0) {\n croak("\'yield\' outside of function");\n }\n if ((ρσ_expr_temp = S.functions)[ρσ_expr_temp.length-1].is_generator === false) {\n croak("\'yield\' not allowed in a function with return");\n }\n (ρσ_expr_temp = S.functions)[ρσ_expr_temp.length-1].is_generator = true;\n is_yield_from = is_("keyword", "from");\n if (is_yield_from) {\n next();\n }\n return new AST_Yield((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["is_yield_from"] = is_yield_from;\n ρσ_d["value"] = return_();\n return ρσ_d;\n }).call(this));\n };\n if (!yield_.__module__) Object.defineProperties(yield_, {\n __module__ : {value: "parse"}\n });\n\n function for_(list_comp) {\n var init, tmp;\n init = null;\n if (!is_("punc", ";")) {\n init = expression(true, true);\n if (is_node_type(init, AST_Seq)) {\n if (is_node_type(init.car, AST_SymbolRef) && is_node_type(init.cdr, AST_SymbolRef)) {\n tmp = init.to_array();\n } else {\n tmp = ρσ_list_decorate([ init ]);\n }\n init = new AST_Array((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = init.start;\n ρσ_d["elements"] = tmp;\n ρσ_d["end"] = init.end;\n return ρσ_d;\n }).call(this));\n }\n if (is_("operator", "in")) {\n if (is_node_type(init, AST_Var) && init.definitions.length > 1) {\n croak("Only one variable declaration allowed in for..in loop");\n }\n next();\n return for_in(init, list_comp);\n }\n }\n unexpected();\n };\n if (!for_.__argnames__) Object.defineProperties(for_, {\n __argnames__ : {value: ["list_comp"]},\n __module__ : {value: "parse"}\n });\n\n function for_in(init, list_comp) {\n var lhs, obj;\n lhs = (is_node_type(init, AST_Var)) ? init.definitions[0].name : null;\n obj = expression(true);\n if (list_comp) {\n return (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["init"] = init;\n ρσ_d["name"] = lhs;\n ρσ_d["object"] = obj;\n return ρσ_d;\n }).call(this);\n }\n return new AST_ForIn((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["init"] = init;\n ρσ_d["name"] = lhs;\n ρσ_d["object"] = obj;\n ρσ_d["body"] = in_loop(statement);\n return ρσ_d;\n }).call(this));\n };\n if (!for_in.__argnames__) Object.defineProperties(for_in, {\n __argnames__ : {value: ["init", "list_comp"]},\n __module__ : {value: "parse"}\n });\n\n function for_js() {\n var condition;\n condition = as_atom_node();\n return new AST_ForJS((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["condition"] = condition;\n ρσ_d["body"] = in_loop(statement);\n return ρσ_d;\n }).call(this));\n };\n if (!for_js.__module__) Object.defineProperties(for_js, {\n __module__ : {value: "parse"}\n });\n\n function get_class_in_scope(expr) {\n var s, referenced_path, class_name;\n if (is_node_type(expr, AST_SymbolRef)) {\n if (has_prop(NATIVE_CLASSES, expr.name)) {\n return NATIVE_CLASSES[ρσ_bound_index(expr.name, NATIVE_CLASSES)];\n }\n if (has_prop(ERROR_CLASSES, expr.name)) {\n return ERROR_CLASSES[ρσ_bound_index(expr.name, ERROR_CLASSES)];\n }\n for (var ρσ_Index52 = S.classes.length - 1; ρσ_Index52 > -1; ρσ_Index52-=1) {\n s = ρσ_Index52;\n if (has_prop((ρσ_expr_temp = S.classes)[(typeof s === "number" && s < 0) ? ρσ_expr_temp.length + s : s], expr.name)) {\n return (ρσ_expr_temp = (ρσ_expr_temp = S.classes)[(typeof s === "number" && s < 0) ? ρσ_expr_temp.length + s : s])[ρσ_bound_index(expr.name, ρσ_expr_temp)];\n }\n }\n } else if (is_node_type(expr, AST_Dot)) {\n referenced_path = ρσ_list_decorate([]);\n while (is_node_type(expr, AST_Dot)) {\n referenced_path.unshift(expr.property);\n expr = expr.expression;\n }\n if (is_node_type(expr, AST_SymbolRef)) {\n referenced_path.unshift(expr.name);\n if (len(referenced_path) > 1) {\n class_name = referenced_path.join(".");\n for (var ρσ_Index53 = S.classes.length - 1; ρσ_Index53 > -1; ρσ_Index53-=1) {\n s = ρσ_Index53;\n if (has_prop((ρσ_expr_temp = S.classes)[(typeof s === "number" && s < 0) ? ρσ_expr_temp.length + s : s], class_name)) {\n return (ρσ_expr_temp = (ρσ_expr_temp = S.classes)[(typeof s === "number" && s < 0) ? ρσ_expr_temp.length + s : s])[(typeof class_name === "number" && class_name < 0) ? ρσ_expr_temp.length + class_name : class_name];\n }\n }\n }\n }\n }\n return false;\n };\n if (!get_class_in_scope.__argnames__) Object.defineProperties(get_class_in_scope, {\n __argnames__ : {value: ["expr"]},\n __module__ : {value: "parse"}\n });\n\n function import_error(message) {\n var ctx;\n ctx = S.input.context();\n throw new ImportError(message, ctx.filename, ctx.tokline, ctx.tokcol, ctx.tokpos);\n };\n if (!import_error.__argnames__) Object.defineProperties(import_error, {\n __argnames__ : {value: ["message"]},\n __module__ : {value: "parse"}\n });\n\n function do_import(key) {\n var package_module_id, src_code, filename, modpath, ρσ_unpack, data, location, cached, srchash, ikey, bitem;\n if (has_prop(imported_modules, key)) {\n return;\n }\n if (has_prop(importing_modules, key) && importing_modules[(typeof key === "number" && key < 0) ? importing_modules.length + key : key]) {\n import_error("Detected a recursive import of: " + key + " while importing: " + module_id);\n }\n package_module_id = key.split(".").slice(0, -1).join(".");\n if (len(package_module_id) > 0) {\n do_import(package_module_id);\n }\n if (options.for_linting) {\n imported_modules[(typeof key === "number" && key < 0) ? imported_modules.length + key : key] = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["is_cached"] = true;\n ρσ_d["classes"] = Object.create(null);\n ρσ_d["module_id"] = key;\n ρσ_d["exports"] = ρσ_list_decorate([]);\n ρσ_d["nonlocalvars"] = ρσ_list_decorate([]);\n ρσ_d["baselib"] = Object.create(null);\n ρσ_d["outputs"] = Object.create(null);\n ρσ_d["discard_asserts"] = options.discard_asserts;\n return ρσ_d;\n }).call(this);\n return;\n }\n function safe_read(base_path) {\n var ρσ_unpack, i, path;\n var ρσ_Iter54 = ρσ_Iterable(enumerate(ρσ_list_decorate([ base_path + ".pyj", base_path + "/__init__.pyj" ])));\n for (var ρσ_Index54 = 0; ρσ_Index54 < ρσ_Iter54.length; ρσ_Index54++) {\n ρσ_unpack = ρσ_Iter54[ρσ_Index54];\n i = ρσ_unpack[0];\n path = ρσ_unpack[1];\n try {\n return ρσ_list_decorate([ readfile(path, "utf-8"), path ]);\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n {\n var e = ρσ_Exception;\n if (e.code === "ENOENT" || e.code === "EPERM" || e.code === "EACCESS") {\n if (i === 1) {\n return [null, null];\n }\n }\n if (i === 1) {\n throw ρσ_Exception;\n }\n } \n }\n }\n };\n if (!safe_read.__argnames__) Object.defineProperties(safe_read, {\n __argnames__ : {value: ["base_path"]},\n __module__ : {value: "parse"}\n });\n\n src_code = filename = null;\n modpath = key.replace(/\\./g, "/");\n var ρσ_Iter55 = ρσ_Iterable(import_dirs);\n for (var ρσ_Index55 = 0; ρσ_Index55 < ρσ_Iter55.length; ρσ_Index55++) {\n location = ρσ_Iter55[ρσ_Index55];\n if (location) {\n ρσ_unpack = safe_read(location + "/" + modpath);\nρσ_unpack = ρσ_unpack_asarray(2, ρσ_unpack);\n data = ρσ_unpack[0];\n filename = ρσ_unpack[1];\n if (data !== null) {\n src_code = data;\n break;\n }\n }\n }\n if (src_code === null) {\n import_error("Failed Import: \'" + key + "\' module doesn\'t exist in any of the import directories: " + import_dirs.join(":"));\n }\n try {\n cached = JSON.parse(readfile(cache_file_name(filename, options.module_cache_dir), "utf-8"));\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n {\n cached = null;\n } \n }\n srchash = sha1sum(src_code);\n if (cached && cached.version === COMPILER_VERSION && cached.signature === srchash && cached.discard_asserts === !!options.discard_asserts) {\n var ρσ_Iter56 = ρσ_Iterable(cached.imported_module_ids);\n for (var ρσ_Index56 = 0; ρσ_Index56 < ρσ_Iter56.length; ρσ_Index56++) {\n ikey = ρσ_Iter56[ρσ_Index56];\n do_import(ikey);\n }\n imported_modules[(typeof key === "number" && key < 0) ? imported_modules.length + key : key] = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["is_cached"] = true;\n ρσ_d["classes"] = cached.classes;\n ρσ_d["outputs"] = cached.outputs;\n ρσ_d["module_id"] = key;\n ρσ_d["import_order"] = Object.keys(imported_modules).length;\n ρσ_d["nonlocalvars"] = cached.nonlocalvars;\n ρσ_d["baselib"] = cached.baselib;\n ρσ_d["exports"] = cached.exports;\n ρσ_d["discard_asserts"] = options.discard_asserts;\n ρσ_d["imported_module_ids"] = cached.imported_module_ids;\n return ρσ_d;\n }).call(this);\n } else {\n parse(src_code, (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["filename"] = filename;\n ρσ_d["toplevel"] = null;\n ρσ_d["basedir"] = options.basedir;\n ρσ_d["libdir"] = options.libdir;\n ρσ_d["import_dirs"] = options.import_dirs;\n ρσ_d["module_id"] = key;\n ρσ_d["imported_modules"] = imported_modules;\n ρσ_d["importing_modules"] = importing_modules;\n ρσ_d["discard_asserts"] = options.discard_asserts;\n ρσ_d["module_cache_dir"] = options.module_cache_dir;\n return ρσ_d;\n }).call(this));\n }\n imported_modules[(typeof key === "number" && key < 0) ? imported_modules.length + key : key].srchash = srchash;\n var ρσ_Iter57 = ρσ_Iterable(Object.keys(imported_modules[(typeof key === "number" && key < 0) ? imported_modules.length + key : key].baselib));\n for (var ρσ_Index57 = 0; ρσ_Index57 < ρσ_Iter57.length; ρσ_Index57++) {\n bitem = ρσ_Iter57[ρσ_Index57];\n baselib_items[(typeof bitem === "number" && bitem < 0) ? baselib_items.length + bitem : bitem] = true;\n }\n };\n if (!do_import.__argnames__) Object.defineProperties(do_import, {\n __argnames__ : {value: ["key"]},\n __module__ : {value: "parse"}\n });\n\n function read_python_flags() {\n var bracketed, name, val;\n expect_token("keyword", "import");\n bracketed = is_("punc", "(");\n if (bracketed) {\n next();\n }\n while (true) {\n if (!is_("name")) {\n croak("Name expected");\n }\n name = S.token.value;\n val = (name.startsWith("no_")) ? false : true;\n if (!val) {\n name = name.slice(3);\n }\n if (!PYTHON_FLAGS) {\n croak("Unknown __python__ flag: " + name);\n }\n S.scoped_flags.set(name, val);\n next();\n if (is_("punc", ",")) {\n next();\n } else {\n if (bracketed) {\n if (is_("punc", ")")) {\n next();\n } else {\n continue;\n }\n }\n break;\n }\n }\n return new AST_EmptyStatement((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["stype"] = "scoped_flags";\n ρσ_d["start"] = prev();\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this));\n };\n if (!read_python_flags.__module__) Object.defineProperties(read_python_flags, {\n __module__ : {value: "parse"}\n });\n\n function import_(from_import) {\n var ans, tok, tmp, name, last_tok, key, alias, aimp, ρσ_unpack, classes, argnames, bracketed, exports, symdef, aname, obj, argvar, cname, imp;\n ans = new AST_Imports((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["imports"] = ρσ_list_decorate([]);\n return ρσ_d;\n }).call(this));\n while (true) {\n tok = tmp = name = last_tok = expression(false);\n key = "";\n while (is_node_type(tmp, AST_Dot)) {\n key = "." + tmp.property + key;\n tmp = last_tok = tmp.expression;\n }\n key = tmp.name + key;\n if (from_import && key === "__python__") {\n return read_python_flags();\n }\n alias = null;\n if (!from_import && is_("keyword", "as")) {\n next();\n alias = as_symbol(AST_SymbolAlias);\n }\n aimp = new AST_Import((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["module"] = name;\n ρσ_d["key"] = key;\n ρσ_d["alias"] = alias;\n ρσ_d["argnames"] = null;\n ρσ_d["body"] = (function() {\n var ρσ_anonfunc = function () {\n return imported_modules[(typeof key === "number" && key < 0) ? imported_modules.length + key : key];\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "parse"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this));\n ρσ_unpack = [tok.start, last_tok.end];\n aimp.start = ρσ_unpack[0];\n aimp.end = ρσ_unpack[1];\n ans.imports.push(aimp);\n if (from_import) {\n break;\n }\n if (is_("punc", ",")) {\n next();\n } else {\n break;\n }\n }\n var ρσ_Iter58 = ρσ_Iterable(ans["imports"]);\n for (var ρσ_Index58 = 0; ρσ_Index58 < ρσ_Iter58.length; ρσ_Index58++) {\n imp = ρσ_Iter58[ρσ_Index58];\n do_import(imp.key);\n if (imported_module_ids.indexOf(imp.key) === -1) {\n imported_module_ids.push(imp.key);\n }\n classes = imported_modules[(typeof key === "number" && key < 0) ? imported_modules.length + key : key].classes;\n if (from_import) {\n expect_token("keyword", "import");\n imp.argnames = argnames = ρσ_list_decorate([]);\n bracketed = is_("punc", "(");\n if (bracketed) {\n next();\n }\n exports = Object.create(null);\n var ρσ_Iter59 = ρσ_Iterable(imported_modules[(typeof key === "number" && key < 0) ? imported_modules.length + key : key].exports);\n for (var ρσ_Index59 = 0; ρσ_Index59 < ρσ_Iter59.length; ρσ_Index59++) {\n symdef = ρσ_Iter59[ρσ_Index59];\n exports[ρσ_bound_index(symdef.name, exports)] = true;\n }\n while (true) {\n aname = as_symbol(AST_ImportedVar);\n if (!options.for_linting && !has_prop(exports, aname.name)) {\n import_error("The symbol \\"" + aname.name + "\\" is not exported from the module: " + key);\n }\n if (is_("keyword", "as")) {\n next();\n aname.alias = as_symbol(AST_SymbolAlias);\n }\n argnames.push(aname);\n if (is_("punc", ",")) {\n next();\n } else {\n if (bracketed) {\n if (is_("punc", ")")) {\n next();\n } else {\n continue;\n }\n }\n break;\n }\n }\n var ρσ_Iter60 = ρσ_Iterable(argnames);\n for (var ρσ_Index60 = 0; ρσ_Index60 < ρσ_Iter60.length; ρσ_Index60++) {\n argvar = ρσ_Iter60[ρσ_Index60];\n obj = classes[ρσ_bound_index(argvar.name, classes)];\n if (obj) {\n key = (argvar.alias) ? argvar.alias.name : argvar.name;\n (ρσ_expr_temp = (ρσ_expr_temp = S.classes)[ρσ_expr_temp.length-1])[(typeof key === "number" && key < 0) ? ρσ_expr_temp.length + key : key] = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["static"] = obj.static;\n ρσ_d["bound"] = obj.bound;\n ρσ_d["classvars"] = obj.classvars;\n return ρσ_d;\n }).call(this);\n }\n }\n } else {\n var ρσ_Iter61 = ρσ_Iterable(Object.keys(classes));\n for (var ρσ_Index61 = 0; ρσ_Index61 < ρσ_Iter61.length; ρσ_Index61++) {\n cname = ρσ_Iter61[ρσ_Index61];\n obj = classes[(typeof cname === "number" && cname < 0) ? classes.length + cname : cname];\n key = (imp.alias) ? imp.alias.name : imp.key;\n (ρσ_expr_temp = (ρσ_expr_temp = S.classes)[ρσ_expr_temp.length-1])[ρσ_bound_index(key + "." + obj.name.name, ρσ_expr_temp)] = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["static"] = obj.static;\n ρσ_d["bound"] = obj.bound;\n ρσ_d["classvars"] = obj.classvars;\n return ρσ_d;\n }).call(this);\n }\n }\n }\n return ans;\n };\n if (!import_.__argnames__) Object.defineProperties(import_, {\n __argnames__ : {value: ["from_import"]},\n __module__ : {value: "parse"}\n });\n\n function class_() {\n var name, externaldecorator, class_details, bases, class_parent, a, docstrings, definition, descriptor, stmt, class_var_names, visitor;\n name = as_symbol(AST_SymbolDefun);\n if (!name) {\n unexpected();\n }\n externaldecorator = has_simple_decorator(S.decorators, "external");\n class_details = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["static"] = Object.create(null);\n ρσ_d["bound"] = [];\n ρσ_d["classvars"] = Object.create(null);\n ρσ_d["processing"] = name.name;\n ρσ_d["provisional_classvars"] = Object.create(null);\n return ρσ_d;\n }).call(this);\n bases = [];\n class_parent = null;\n if (is_("punc", "(")) {\n S.in_parenthesized_expr = true;\n next();\n while (true) {\n if (is_("punc", ")")) {\n S.in_parenthesized_expr = false;\n next();\n break;\n }\n a = expr_atom(false);\n if (class_parent === null) {\n class_parent = a;\n }\n bases.push(a);\n if (is_("punc", ",")) {\n next();\n continue;\n }\n }\n }\n docstrings = [];\n definition = new AST_Class((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = name;\n ρσ_d["docstrings"] = docstrings;\n ρσ_d["module_id"] = module_id;\n ρσ_d["dynamic_properties"] = Object.create(null);\n ρσ_d["parent"] = class_parent;\n ρσ_d["bases"] = bases;\n ρσ_d["localvars"] = ρσ_list_decorate([]);\n ρσ_d["classvars"] = class_details.classvars;\n ρσ_d["static"] = class_details.static;\n ρσ_d["external"] = externaldecorator;\n ρσ_d["bound"] = class_details.bound;\n ρσ_d["statements"] = ρσ_list_decorate([]);\n ρσ_d["decorators"] = (function() {\n var ρσ_anonfunc = function () {\n var d, decorator;\n d = ρσ_list_decorate([]);\n var ρσ_Iter62 = ρσ_Iterable(S.decorators);\n for (var ρσ_Index62 = 0; ρσ_Index62 < ρσ_Iter62.length; ρσ_Index62++) {\n decorator = ρσ_Iter62[ρσ_Index62];\n d.push(new AST_Decorator((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["expression"] = decorator;\n return ρσ_d;\n }).call(this)));\n }\n S.decorators = [];\n return d;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "parse"}\n });\n return ρσ_anonfunc;\n })()();\n ρσ_d["body"] = (function() {\n var ρσ_anonfunc = function (loop, labels) {\n var a;\n S.in_class.push(name.name);\n (ρσ_expr_temp = (ρσ_expr_temp = S.classes)[ρσ_bound_index(S.classes.length - 1, ρσ_expr_temp)])[ρσ_bound_index(name.name, ρσ_expr_temp)] = class_details;\n S.classes.push(Object.create(null));\n S.scoped_flags.push();\n S.in_function += 1;\n S.in_loop = 0;\n S.labels = ρσ_list_decorate([]);\n a = block_(docstrings);\n S.in_function -= 1;\n S.scoped_flags.pop();\n S.classes.pop();\n S.in_class.pop();\n S.in_loop = loop;\n S.labels = labels;\n return a;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["loop", "labels"]},\n __module__ : {value: "parse"}\n });\n return ρσ_anonfunc;\n })()(S.in_loop, S.labels);\n return ρσ_d;\n }).call(this));\n class_details.processing = false;\n var ρσ_Iter63 = ρσ_Iterable(definition.body);\n for (var ρσ_Index63 = 0; ρσ_Index63 < ρσ_Iter63.length; ρσ_Index63++) {\n stmt = ρσ_Iter63[ρσ_Index63];\n if (is_node_type(stmt, AST_Method)) {\n if (stmt.is_getter || stmt.is_setter) {\n descriptor = (ρσ_expr_temp = definition.dynamic_properties)[ρσ_bound_index(stmt.name.name, ρσ_expr_temp)];\n if (!descriptor) {\n descriptor = (ρσ_expr_temp = definition.dynamic_properties)[ρσ_bound_index(stmt.name.name, ρσ_expr_temp)] = Object.create(null);\n }\n descriptor[ρσ_bound_index((stmt.is_getter) ? "getter" : "setter", descriptor)] = stmt;\n } else if (stmt.name.name === "__init__") {\n definition.init = stmt;\n }\n }\n }\n class_var_names = Object.create(null);\n function walker() {\n function visit_node(node, descend) {\n var varname;\n if (is_node_type(node, AST_Method)) {\n class_var_names[ρσ_bound_index(node.name.name, class_var_names)] = true;\n return;\n }\n if (is_node_type(node, AST_Function)) {\n return;\n }\n if (is_node_type(node, AST_Assign) && is_node_type(node.left, AST_SymbolRef)) {\n varname = node.left.name;\n if (FORBIDDEN_CLASS_VARS.indexOf(varname) !== -1) {\n token_error(node.left.start, varname + " is not allowed as a class variable name");\n }\n class_var_names[(typeof varname === "number" && varname < 0) ? class_var_names.length + varname : varname] = true;\n (ρσ_expr_temp = definition.classvars)[(typeof varname === "number" && varname < 0) ? ρσ_expr_temp.length + varname : varname] = true;\n } else if (is_node_type(node, AST_SymbolRef) && has_prop(class_var_names, node.name)) {\n node.thedef = new AST_SymbolDefun((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = name.name + ".prototype." + node.name;\n return ρσ_d;\n }).call(this));\n }\n if (descend) {\n descend.call(node);\n }\n };\n if (!visit_node.__argnames__) Object.defineProperties(visit_node, {\n __argnames__ : {value: ["node", "descend"]},\n __module__ : {value: "parse"}\n });\n\n this._visit = visit_node;\n };\n if (!walker.__module__) Object.defineProperties(walker, {\n __module__ : {value: "parse"}\n });\n\n visitor = new walker;\n var ρσ_Iter64 = ρσ_Iterable(definition.body);\n for (var ρσ_Index64 = 0; ρσ_Index64 < ρσ_Iter64.length; ρσ_Index64++) {\n stmt = ρσ_Iter64[ρσ_Index64];\n if (!is_node_type(stmt, AST_Class)) {\n stmt.walk(visitor);\n definition.statements.push(stmt);\n }\n }\n return definition;\n };\n if (!class_.__module__) Object.defineProperties(class_, {\n __module__ : {value: "parse"}\n });\n\n function function_(in_class, is_expression) {\n var name, is_anonymous, staticmethod, property_getter, property_setter, staticloc, ctor, return_annotation, is_generator, docstrings, definition, assignments, j, i, nonlocals;\n name = (is_("name")) ? as_symbol((in_class) ? AST_SymbolDefun : AST_SymbolLambda) : null;\n if (in_class && !name) {\n croak("Cannot use anonymous function as class methods");\n }\n is_anonymous = !name;\n staticmethod = property_getter = property_setter = false;\n if (in_class) {\n staticloc = has_simple_decorator(S.decorators, "staticmethod");\n property_getter = has_simple_decorator(S.decorators, "property");\n property_setter = has_setter_decorator(S.decorators, name.name);\n if (staticloc) {\n if (property_getter || property_setter) {\n croak("A method cannot be both static and a property getter/setter");\n }\n (ρσ_expr_temp = (ρσ_expr_temp = (ρσ_expr_temp = S.classes)[ρσ_bound_index(S.classes.length - 2, ρσ_expr_temp)])[(typeof in_class === "number" && in_class < 0) ? ρσ_expr_temp.length + in_class : in_class].static)[ρσ_bound_index(name.name, ρσ_expr_temp)] = true;\n staticmethod = true;\n } else if (name.name !== "__init__" && S.scoped_flags.get("bound_methods")) {\n (ρσ_expr_temp = (ρσ_expr_temp = S.classes)[ρσ_bound_index(S.classes.length - 2, ρσ_expr_temp)])[(typeof in_class === "number" && in_class < 0) ? ρσ_expr_temp.length + in_class : in_class].bound.push(name.name);\n }\n }\n expect("(");\n S.in_parenthesized_expr = true;\n ctor = (in_class) ? AST_Method : AST_Function;\n return_annotation = null;\n is_generator = [];\n docstrings = [];\n definition = new ctor((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = name;\n ρσ_d["is_expression"] = is_expression;\n ρσ_d["is_anonymous"] = is_anonymous;\n ρσ_d["argnames"] = (function() {\n var ρσ_anonfunc = function (a) {\n var defaults, first, seen_names, def_line, current_arg_name, name_token;\n defaults = Object.create(null);\n first = true;\n seen_names = Object.create(null);\n def_line = S.input.context().tokline;\n current_arg_name = null;\n name_token = null;\n function get_arg() {\n var name_ctx, ntok, annotation, sym;\n current_arg_name = S.token.value;\n if (has_prop(seen_names, current_arg_name)) {\n token_error(prev(), "Can\'t repeat parameter names");\n }\n if (current_arg_name === "arguments") {\n token_error(prev(), "Can\'t use the name arguments as a parameter name, it is reserved by JavaScript");\n }\n seen_names[(typeof current_arg_name === "number" && current_arg_name < 0) ? seen_names.length + current_arg_name : current_arg_name] = true;\n name_token = S.token;\n name_ctx = S.input.context();\n ntok = peek();\n if (ntok.type === "punc" && ntok.value === ":") {\n next();\n expect(":");\n annotation = maybe_conditional();\n if (!is_token(name_token, "name")) {\n croak("Name expected", name_ctx.tokline);\n return null;\n }\n sym = new AST_SymbolFunarg((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = name_token.value;\n ρσ_d["start"] = S.token;\n ρσ_d["end"] = S.token;\n ρσ_d["annotation"] = annotation;\n return ρσ_d;\n }).call(this));\n return sym;\n } else {\n if (!is_("name")) {\n if (S.input.context().tokline !== def_line) {\n croak("Name expected", def_line);\n } else {\n croak("Name expected");\n }\n return null;\n }\n sym = new AST_SymbolFunarg((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = current_arg_name;\n ρσ_d["start"] = S.token;\n ρσ_d["end"] = S.token;\n ρσ_d["annotation"] = null;\n return ρσ_d;\n }).call(this));\n next();\n return sym;\n }\n };\n if (!get_arg.__module__) Object.defineProperties(get_arg, {\n __module__ : {value: "parse"}\n });\n\n while (!is_("punc", ")")) {\n if (first) {\n first = false;\n } else {\n expect(",");\n if (is_("punc", ")")) {\n break;\n }\n }\n if (is_("operator", "**")) {\n next();\n if (a.kwargs) {\n token_error(name_token, "Can\'t define multiple **kwargs in function definition");\n }\n a.kwargs = get_arg();\n } else if (is_("operator", "*")) {\n next();\n if (a.starargs) {\n token_error(name_token, "Can\'t define multiple *args in function definition");\n }\n if (a.kwargs) {\n token_error(name_token, "Can\'t define *args after **kwargs in function definition");\n }\n a.starargs = get_arg();\n } else {\n if (a.starargs || a.kwargs) {\n token_error(name_token, "Can\'t define a formal parameter after *args or **kwargs");\n }\n a.push(get_arg());\n if (is_("operator", "=")) {\n if (a.kwargs) {\n token_error(name_token, "Can\'t define an optional formal parameter after **kwargs");\n }\n next();\n defaults[(typeof current_arg_name === "number" && current_arg_name < 0) ? defaults.length + current_arg_name : current_arg_name] = expression(false);\n a.has_defaults = true;\n } else {\n if (a.has_defaults) {\n token_error(name_token, "Can\'t define required formal parameters after optional formal parameters");\n }\n }\n }\n }\n next();\n if (is_("punc", "->")) {\n next();\n return_annotation = maybe_conditional();\n }\n S.in_parenthesized_expr = false;\n a.defaults = defaults;\n a.is_simple_func = !a.starargs && !a.kwargs && !a.has_defaults;\n return a;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["a"]},\n __module__ : {value: "parse"}\n });\n return ρσ_anonfunc;\n })()([]);\n ρσ_d["localvars"] = ρσ_list_decorate([]);\n ρσ_d["decorators"] = (function() {\n var ρσ_anonfunc = function () {\n var d, decorator;\n d = [];\n var ρσ_Iter65 = ρσ_Iterable(S.decorators);\n for (var ρσ_Index65 = 0; ρσ_Index65 < ρσ_Iter65.length; ρσ_Index65++) {\n decorator = ρσ_Iter65[ρσ_Index65];\n d.push(new AST_Decorator((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["expression"] = decorator;\n return ρσ_d;\n }).call(this)));\n }\n S.decorators = [];\n return d;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "parse"}\n });\n return ρσ_anonfunc;\n })()();\n ρσ_d["docstrings"] = docstrings;\n ρσ_d["body"] = (function() {\n var ρσ_anonfunc = function (loop, labels) {\n var a;\n S.in_class.push(false);\n S.classes.push(Object.create(null));\n S.scoped_flags.push();\n S.in_function += 1;\n S.functions.push(Object.create(null));\n S.in_loop = 0;\n S.labels = ρσ_list_decorate([]);\n a = block_(docstrings);\n S.in_function -= 1;\n S.scoped_flags.pop();\n is_generator.push(bool(S.functions.pop().is_generator));\n S.classes.pop();\n S.in_class.pop();\n S.in_loop = loop;\n S.labels = labels;\n return a;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["loop", "labels"]},\n __module__ : {value: "parse"}\n });\n return ρσ_anonfunc;\n })()(S.in_loop, S.labels);\n return ρσ_d;\n }).call(this));\n definition.return_annotation = return_annotation;\n definition.is_generator = is_generator[0];\n if (is_node_type(definition, AST_Method)) {\n definition.static = staticmethod;\n definition.is_getter = property_getter;\n definition.is_setter = property_setter;\n if (definition.argnames.length < 1 && !definition.static) {\n croak("Methods of a class must have at least one argument, traditionally named self");\n }\n if (definition.name && definition.name.name === "__init__") {\n if (definition.is_generator) {\n croak("The __init__ method of a class cannot be a generator (yield not allowed)");\n }\n if (property_getter || property_setter) {\n croak("The __init__ method of a class cannot be a property getter/setter");\n }\n }\n }\n if (definition.is_generator) {\n baselib_items["yield"] = true;\n }\n assignments = scan_for_local_vars(definition.body);\n for (var ρσ_Index66 = 0; ρσ_Index66 < assignments.length; ρσ_Index66++) {\n i = ρσ_Index66;\n for (var ρσ_Index67 = 0; ρσ_Index67 < definition.argnames.length + 1; ρσ_Index67++) {\n j = ρσ_Index67;\n if (j === definition.argnames.length) {\n definition.localvars.push(new_symbol(AST_SymbolVar, assignments[(typeof i === "number" && i < 0) ? assignments.length + i : i]));\n } else if (j < definition.argnames.length && assignments[(typeof i === "number" && i < 0) ? assignments.length + i : i] === (ρσ_expr_temp = definition.argnames)[(typeof j === "number" && j < 0) ? ρσ_expr_temp.length + j : j].name) {\n break;\n }\n }\n }\n nonlocals = scan_for_nonlocal_defs(definition.body);\n nonlocals = (function() {\n var ρσ_Iter = ρσ_Iterable(nonlocals), ρσ_Result = ρσ_set(), name;\n for (var ρσ_Index = 0; ρσ_Index < ρσ_Iter.length; ρσ_Index++) {\n name = ρσ_Iter[ρσ_Index];\n ρσ_Result.add(name);\n }\n return ρσ_Result;\n })();\n definition.localvars = definition.localvars.filter((function() {\n var ρσ_anonfunc = function (v) {\n return !nonlocals.has(v.name);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["v"]},\n __module__ : {value: "parse"}\n });\n return ρσ_anonfunc;\n })());\n return definition;\n };\n if (!function_.__argnames__) Object.defineProperties(function_, {\n __argnames__ : {value: ["in_class", "is_expression"]},\n __module__ : {value: "parse"}\n });\n\n function if_() {\n var cond, body, belse;\n cond = expression(true);\n body = statement();\n belse = null;\n if (is_("keyword", "elif") || is_("keyword", "else")) {\n if (is_("keyword", "else")) {\n next();\n } else {\n S.token.value = "if";\n }\n belse = statement();\n }\n return new AST_If((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["condition"] = cond;\n ρσ_d["body"] = body;\n ρσ_d["alternative"] = belse;\n return ρσ_d;\n }).call(this));\n };\n if (!if_.__module__) Object.defineProperties(if_, {\n __module__ : {value: "parse"}\n });\n\n function is_docstring(stmt) {\n if (is_node_type(stmt, AST_SimpleStatement)) {\n if (is_node_type(stmt.body, AST_String)) {\n return stmt.body;\n }\n }\n return false;\n };\n if (!is_docstring.__argnames__) Object.defineProperties(is_docstring, {\n __argnames__ : {value: ["stmt"]},\n __module__ : {value: "parse"}\n });\n\n function block_(docstrings) {\n var prev_whitespace, a, stmt, ds, current_whitespace;\n prev_whitespace = S.token.leading_whitespace;\n expect(":");\n a = [];\n if (!S.token.nlb) {\n while (!S.token.nlb) {\n if (is_("eof")) {\n unexpected();\n }\n stmt = statement();\n if (docstrings) {\n ds = is_docstring(stmt);\n if (ds) {\n docstrings.push(ds);\n continue;\n }\n }\n a.push(stmt);\n }\n } else {\n current_whitespace = S.token.leading_whitespace;\n if (current_whitespace.length === 0 || prev_whitespace === current_whitespace) {\n croak("Expected an indented block");\n }\n while (!is_("punc", "}")) {\n if (is_("eof")) {\n return a;\n }\n stmt = statement();\n if (docstrings) {\n ds = is_docstring(stmt);\n if (ds) {\n docstrings.push(ds);\n continue;\n }\n }\n a.push(stmt);\n }\n next();\n }\n return a;\n };\n if (!block_.__argnames__) Object.defineProperties(block_, {\n __argnames__ : {value: ["docstrings"]},\n __module__ : {value: "parse"}\n });\n\n function try_() {\n var body, bcatch, bfinally, belse, start, exceptions, name;\n body = block_();\n bcatch = [];\n bfinally = null;\n belse = null;\n while (is_("keyword", "except")) {\n start = S.token;\n next();\n exceptions = ρσ_list_decorate([]);\n if (!is_("punc", ":") && !is_("keyword", "as")) {\n exceptions.push(as_symbol(AST_SymbolVar));\n while (is_("punc", ",")) {\n next();\n exceptions.push(as_symbol(AST_SymbolVar));\n }\n }\n name = null;\n if (is_("keyword", "as")) {\n next();\n name = as_symbol(AST_SymbolCatch);\n }\n bcatch.push(new AST_Except((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["argname"] = name;\n ρσ_d["errors"] = exceptions;\n ρσ_d["body"] = block_();\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this)));\n }\n if (is_("keyword", "else")) {\n start = S.token;\n next();\n belse = new AST_Else((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["body"] = block_();\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this));\n }\n if (is_("keyword", "finally")) {\n start = S.token;\n next();\n bfinally = new AST_Finally((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["body"] = block_();\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this));\n }\n if (!bcatch.length && !bfinally) {\n croak("Missing except/finally blocks");\n }\n return new AST_Try((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["body"] = body;\n ρσ_d["bcatch"] = (bcatch.length) ? new AST_Catch((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["body"] = bcatch;\n return ρσ_d;\n }).call(this)) : null;\n ρσ_d["bfinally"] = bfinally;\n ρσ_d["belse"] = belse;\n return ρσ_d;\n }).call(this));\n };\n if (!try_.__module__) Object.defineProperties(try_, {\n __module__ : {value: "parse"}\n });\n\n function vardefs(symbol_class) {\n var a;\n a = ρσ_list_decorate([]);\n while (true) {\n a.push(new AST_VarDef((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = S.token;\n ρσ_d["name"] = as_symbol(symbol_class);\n ρσ_d["value"] = (is_("operator", "=")) ? (next(), expression(false)) : null;\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this)));\n if (!is_("punc", ",")) {\n break;\n }\n next();\n }\n return a;\n };\n if (!vardefs.__argnames__) Object.defineProperties(vardefs, {\n __argnames__ : {value: ["symbol_class"]},\n __module__ : {value: "parse"}\n });\n\n function nonlocal_(is_global) {\n var defs, vardef;\n defs = vardefs(AST_SymbolNonlocal);\n if (is_global) {\n var ρσ_Iter68 = ρσ_Iterable(defs);\n for (var ρσ_Index68 = 0; ρσ_Index68 < ρσ_Iter68.length; ρσ_Index68++) {\n vardef = ρσ_Iter68[ρσ_Index68];\n S.globals.push(vardef.name.name);\n }\n }\n return new AST_Var((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = prev();\n ρσ_d["definitions"] = defs;\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this));\n };\n if (!nonlocal_.__argnames__) Object.defineProperties(nonlocal_, {\n __argnames__ : {value: ["is_global"]},\n __module__ : {value: "parse"}\n });\n\n function new_() {\n var start, newexp, args;\n start = S.token;\n expect_token("operator", "new");\n newexp = expr_atom(false);\n if (is_("punc", "(")) {\n S.in_parenthesized_expr = true;\n next();\n args = func_call_list();\n S.in_parenthesized_expr = false;\n } else {\n args = func_call_list(true);\n }\n return subscripts(new AST_New((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["expression"] = newexp;\n ρσ_d["args"] = args;\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this)), true);\n };\n if (!new_.__module__) Object.defineProperties(new_, {\n __module__ : {value: "parse"}\n });\n\n function string_() {\n var strings, start;\n strings = [];\n start = S.token;\n while (true) {\n strings.push(S.token.value);\n if (peek().type !== "string") {\n break;\n }\n next();\n }\n return new AST_String((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["end"] = S.token;\n ρσ_d["value"] = strings.join("");\n return ρσ_d;\n }).call(this));\n };\n if (!string_.__module__) Object.defineProperties(string_, {\n __module__ : {value: "parse"}\n });\n\n function token_as_atom_node() {\n var tok, tmp_, tmp__;\n tok = S.token;\n tmp_ = tok.type;\n if (tmp_ === "name") {\n return token_as_symbol(tok, AST_SymbolRef);\n } else if (tmp_ === "num") {\n return new AST_Number((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = tok;\n ρσ_d["end"] = tok;\n ρσ_d["value"] = tok.value;\n return ρσ_d;\n }).call(this));\n } else if (tmp_ === "string") {\n return string_();\n } else if (tmp_ === "regexp") {\n return new AST_RegExp((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = tok;\n ρσ_d["end"] = tok;\n ρσ_d["value"] = tok.value;\n return ρσ_d;\n }).call(this));\n } else if (tmp_ === "atom") {\n tmp__ = tok.value;\n if (tmp__ === "False") {\n return new AST_False((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = tok;\n ρσ_d["end"] = tok;\n return ρσ_d;\n }).call(this));\n } else if (tmp__ === "True") {\n return new AST_True((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = tok;\n ρσ_d["end"] = tok;\n return ρσ_d;\n }).call(this));\n } else if (tmp__ === "None") {\n return new AST_Null((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = tok;\n ρσ_d["end"] = tok;\n return ρσ_d;\n }).call(this));\n }\n } else if (tmp_ === "js") {\n return new AST_Verbatim((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = tok;\n ρσ_d["end"] = tok;\n ρσ_d["value"] = tok.value;\n return ρσ_d;\n }).call(this));\n }\n token_error(tok, "Expecting an atomic token (number/string/bool/regexp/js/None)");\n };\n if (!token_as_atom_node.__module__) Object.defineProperties(token_as_atom_node, {\n __module__ : {value: "parse"}\n });\n\n function as_atom_node() {\n var ret;\n ret = token_as_atom_node();\n next();\n return ret;\n };\n if (!as_atom_node.__module__) Object.defineProperties(as_atom_node, {\n __module__ : {value: "parse"}\n });\n\n function expr_atom(allow_calls) {\n var start, tmp_, ex, ret, cls, func;\n if (is_("operator", "new")) {\n return new_();\n }\n start = S.token;\n if (is_("punc")) {\n tmp_ = start.value;\n if (tmp_ === "(") {\n S.in_parenthesized_expr = true;\n next();\n if (is_("punc", ")")) {\n next();\n return new AST_Array((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["elements"] = ρσ_list_decorate([]);\n return ρσ_d;\n }).call(this));\n }\n ex = expression(true);\n if (is_("keyword", "for")) {\n ret = read_comprehension(new AST_GeneratorComprehension((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["statement"] = ex;\n return ρσ_d;\n }).call(this)), ")");\n S.in_parenthesized_expr = false;\n return ret;\n }\n ex.start = start;\n ex.end = S.token;\n if (is_node_type(ex, AST_SymbolRef)) {\n ex.parens = true;\n }\n if (!is_node_type(ex, AST_GeneratorComprehension)) {\n expect(")");\n }\n if (is_node_type(ex, AST_UnaryPrefix)) {\n ex.parenthesized = true;\n }\n S.in_parenthesized_expr = false;\n return subscripts(ex, allow_calls);\n } else if (tmp_ === "[") {\n return subscripts(array_(), allow_calls);\n } else if (tmp_ === "{") {\n return subscripts(object_(), allow_calls);\n }\n unexpected();\n }\n if (is_("keyword", "class")) {\n next();\n cls = class_();\n cls.start = start;\n cls.end = prev();\n return subscripts(cls, allow_calls);\n }\n if (is_("keyword", "def")) {\n next();\n func = function_(false, true);\n func.start = start;\n func.end = prev();\n return subscripts(func, allow_calls);\n }\n if (is_("keyword", "yield")) {\n next();\n return yield_();\n }\n if (ATOMIC_START_TOKEN[ρσ_bound_index(S.token.type, ATOMIC_START_TOKEN)]) {\n return subscripts(as_atom_node(), allow_calls);\n }\n unexpected();\n };\n if (!expr_atom.__argnames__) Object.defineProperties(expr_atom, {\n __argnames__ : {value: ["allow_calls"]},\n __module__ : {value: "parse"}\n });\n\n function expr_list(closing, allow_trailing_comma, allow_empty, func_call) {\n var first, a, saw_starargs, tmp, arg;\n first = true;\n a = ρσ_list_decorate([]);\n saw_starargs = false;\n while (!is_("punc", closing)) {\n if (saw_starargs) {\n token_error(prev(), "*args must be the last argument in a function call");\n }\n if (first) {\n first = false;\n } else {\n expect(",");\n }\n if (allow_trailing_comma && is_("punc", closing)) {\n break;\n }\n if (is_("operator", "*") && func_call) {\n saw_starargs = true;\n next();\n }\n if (is_("punc", ",") && allow_empty) {\n a.push(new AST_Hole((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = S.token;\n ρσ_d["end"] = S.token;\n return ρσ_d;\n }).call(this)));\n } else {\n a.push(expression(false));\n }\n }\n if (func_call) {\n tmp = ρσ_list_decorate([]);\n tmp.kwargs = ρσ_list_decorate([]);\n var ρσ_Iter69 = ρσ_Iterable(a);\n for (var ρσ_Index69 = 0; ρσ_Index69 < ρσ_Iter69.length; ρσ_Index69++) {\n arg = ρσ_Iter69[ρσ_Index69];\n if (is_node_type(arg, AST_Assign)) {\n tmp.kwargs.push(ρσ_list_decorate([ arg.left, arg.right ]));\n } else {\n tmp.push(arg);\n }\n }\n a = tmp;\n }\n next();\n if (saw_starargs) {\n a.starargs = true;\n }\n return a;\n };\n if (!expr_list.__argnames__) Object.defineProperties(expr_list, {\n __argnames__ : {value: ["closing", "allow_trailing_comma", "allow_empty", "func_call"]},\n __module__ : {value: "parse"}\n });\n\n function func_call_list(empty) {\n var a, first, single_comprehension, arg;\n a = [];\n first = true;\n a.kwargs = [];\n a.kwarg_items = [];\n a.starargs = false;\n if (empty) {\n return a;\n }\n single_comprehension = false;\n while (!is_("punc", ")") && !is_("eof")) {\n if (!first) {\n expect(",");\n if (is_("punc", ")")) {\n break;\n }\n }\n if (is_("operator", "*")) {\n next();\n arg = expression(false);\n arg.is_array = true;\n a.push(arg);\n a.starargs = true;\n } else if (is_("operator", "**")) {\n next();\n a.kwarg_items.push(as_symbol(AST_SymbolRef, false));\n a.starargs = true;\n } else {\n arg = expression(false);\n if (is_node_type(arg, AST_Assign)) {\n a.kwargs.push(ρσ_list_decorate([ arg.left, arg.right ]));\n } else {\n if (is_("keyword", "for")) {\n if (!first) {\n croak("Generator expression must be parenthesized if not sole argument");\n }\n a.push(read_comprehension(new AST_GeneratorComprehension((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["statement"] = arg;\n return ρσ_d;\n }).call(this)), ")"));\n single_comprehension = true;\n break;\n }\n a.push(arg);\n }\n }\n first = false;\n }\n if (!single_comprehension) {\n next();\n }\n return a;\n };\n if (!func_call_list.__argnames__) Object.defineProperties(func_call_list, {\n __argnames__ : {value: ["empty"]},\n __module__ : {value: "parse"}\n });\n\n \n var array_ = embed_tokens((function() {\n var ρσ_anonfunc = function array_() {\n var expr;\n expect("[");\n expr = ρσ_list_decorate([]);\n if (!is_("punc", "]")) {\n expr.push(expression(false));\n if (is_("keyword", "for")) {\n return read_comprehension(new AST_ListComprehension((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["statement"] = expr[0];\n return ρσ_d;\n }).call(this)), "]");\n }\n if (!is_("punc", "]")) {\n expect(",");\n }\n }\n return new AST_Array((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["elements"] = expr.concat(expr_list("]", true, true));\n return ρσ_d;\n }).call(this));\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "parse"}\n });\n return ρσ_anonfunc;\n })());\n\n \n var object_ = embed_tokens((function() {\n var ρσ_anonfunc = function object_() {\n var first, has_non_const_keys, is_pydict, is_jshash, a, start, ctx, orig, left, end;\n expect("{");\n first = true;\n has_non_const_keys = false;\n is_pydict = S.scoped_flags.get("dict_literals", false);\n is_jshash = S.scoped_flags.get("hash_literals", false);\n a = ρσ_list_decorate([]);\n while (!is_("punc", "}")) {\n if (!first) {\n expect(",");\n }\n if (is_("punc", "}")) {\n break;\n }\n first = false;\n start = S.token;\n ctx = S.input.context();\n orig = ctx.expecting_object_literal_key;\n ctx.expecting_object_literal_key = true;\n try {\n left = expression(false);\n } finally {\n ctx.expecting_object_literal_key = orig;\n }\n if (is_("keyword", "for")) {\n return read_comprehension(new AST_SetComprehension((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["statement"] = left;\n return ρσ_d;\n }).call(this)), "}");\n }\n if (a.length === 0 && (is_("punc", ",") || is_("punc", "}"))) {\n end = prev();\n return set_(start, end, left);\n }\n if (!is_node_type(left, AST_Constant)) {\n has_non_const_keys = true;\n }\n expect(":");\n a.push(new AST_ObjectKeyVal((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["key"] = left;\n ρσ_d["value"] = expression(false);\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this)));\n if (a.length === 1 && is_("keyword", "for")) {\n return dict_comprehension(a, is_pydict, is_jshash);\n }\n }\n next();\n return new ((has_non_const_keys) ? AST_ExpressiveObject : AST_Object)((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["properties"] = a;\n ρσ_d["is_pydict"] = is_pydict;\n ρσ_d["is_jshash"] = is_jshash;\n return ρσ_d;\n }).call(this));\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "parse"}\n });\n return ρσ_anonfunc;\n })());\n\n function set_(start, end, expr) {\n var ostart, a;\n ostart = start;\n a = ρσ_list_decorate([ new AST_SetItem((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["end"] = end;\n ρσ_d["value"] = expr;\n return ρσ_d;\n }).call(this)) ]);\n while (!is_("punc", "}")) {\n expect(",");\n start = S.token;\n if (is_("punc", "}")) {\n break;\n }\n a.push(new AST_SetItem((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["value"] = expression(false);\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this)));\n }\n next();\n return new AST_Set((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["items"] = a;\n ρσ_d["start"] = ostart;\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this));\n };\n if (!set_.__argnames__) Object.defineProperties(set_, {\n __argnames__ : {value: ["start", "end", "expr"]},\n __module__ : {value: "parse"}\n });\n\n function read_comprehension(obj, terminator) {\n var forloop;\n if (is_node_type(obj, AST_GeneratorComprehension)) {\n baselib_items["yield"] = true;\n }\n S.in_comprehension = true;\n S.in_parenthesized_expr = false;\n expect_token("keyword", "for");\n forloop = for_(true);\n obj.init = forloop.init;\n obj.name = forloop.name;\n obj.object = forloop.object;\n obj.condition = (is_("punc", terminator)) ? null : (expect_token("keyword", "if"), \n expression(true));\n expect(terminator);\n S.in_comprehension = false;\n return obj;\n };\n if (!read_comprehension.__argnames__) Object.defineProperties(read_comprehension, {\n __argnames__ : {value: ["obj", "terminator"]},\n __module__ : {value: "parse"}\n });\n\n function dict_comprehension(a, is_pydict, is_jshash) {\n var ρσ_unpack, left, right;\n if (a.length) {\n ρσ_unpack = [a[0].key, a[0].value];\n left = ρσ_unpack[0];\n right = ρσ_unpack[1];\n } else {\n left = expression(false);\n if (!is_("punc", ":")) {\n return read_comprehension(new AST_SetComprehension((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["statement"] = left;\n return ρσ_d;\n }).call(this)), "}");\n }\n expect(":");\n right = expression(false);\n }\n return read_comprehension(new AST_DictComprehension((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["statement"] = left;\n ρσ_d["value_statement"] = right;\n ρσ_d["is_pydict"] = is_pydict;\n ρσ_d["is_jshash"] = is_jshash;\n return ρσ_d;\n }).call(this)), "}");\n };\n if (!dict_comprehension.__argnames__) Object.defineProperties(dict_comprehension, {\n __argnames__ : {value: ["a", "is_pydict", "is_jshash"]},\n __module__ : {value: "parse"}\n });\n\n function as_name() {\n var tmp, tmp_;\n tmp = S.token;\n next();\n tmp_ = tmp.type;\n if (tmp_ === "name" || tmp_ === "operator" || tmp_ === "keyword" || tmp_ === "atom") {\n return tmp.value;\n } else {\n unexpected();\n }\n };\n if (!as_name.__module__) Object.defineProperties(as_name, {\n __module__ : {value: "parse"}\n });\n\n function token_as_symbol(tok, ttype) {\n var name;\n name = tok.value;\n if (RESERVED_WORDS[(typeof name === "number" && name < 0) ? RESERVED_WORDS.length + name : name] && name !== "this") {\n croak(name + " is a reserved word");\n }\n return new ((name === "this") ? AST_This : ttype)((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = String(tok.value);\n ρσ_d["start"] = tok;\n ρσ_d["end"] = tok;\n return ρσ_d;\n }).call(this));\n };\n if (!token_as_symbol.__argnames__) Object.defineProperties(token_as_symbol, {\n __argnames__ : {value: ["tok", "ttype"]},\n __module__ : {value: "parse"}\n });\n\n function as_symbol(ttype, noerror) {\n var sym;\n if (!is_("name")) {\n if (!noerror) {\n croak("Name expected");\n }\n return null;\n }\n sym = token_as_symbol(S.token, ttype);\n next();\n return sym;\n };\n if (!as_symbol.__argnames__) Object.defineProperties(as_symbol, {\n __argnames__ : {value: ["ttype", "noerror"]},\n __module__ : {value: "parse"}\n });\n\n function new_symbol(type, name) {\n var sym;\n sym = new ((name === "this") ? AST_This : type)((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = String(name);\n ρσ_d["start"] = null;\n ρσ_d["end"] = null;\n return ρσ_d;\n }).call(this));\n return sym;\n };\n if (!new_symbol.__argnames__) Object.defineProperties(new_symbol, {\n __argnames__ : {value: ["type", "name"]},\n __module__ : {value: "parse"}\n });\n\n function is_static_method(cls, method) {\n if (has_prop(COMMON_STATIC, method) || cls.static && has_prop(cls.static, method)) {\n return true;\n } else {\n return false;\n }\n };\n if (!is_static_method.__argnames__) Object.defineProperties(is_static_method, {\n __argnames__ : {value: ["cls", "method"]},\n __module__ : {value: "parse"}\n });\n\n function getitem(expr, allow_calls) {\n var start, is_py_sub, slice_bounds, is_slice, i, assignment, assign_operator;\n start = expr.start;\n next();\n is_py_sub = S.scoped_flags.get("overload_getitem", false);\n slice_bounds = [];\n is_slice = false;\n if (is_("punc", ":")) {\n slice_bounds.push(null);\n } else {\n slice_bounds.push(expression(false));\n }\n if (is_("punc", ":")) {\n is_slice = true;\n next();\n if (is_("punc", ":")) {\n slice_bounds.push(null);\n } else if (!is_("punc", "]")) {\n slice_bounds.push(expression(false));\n }\n }\n if (is_("punc", ":")) {\n next();\n if (is_("punc", "]")) {\n unexpected();\n } else {\n slice_bounds.push(expression(false));\n }\n }\n expect("]");\n if (is_slice) {\n if (is_("operator", "=")) {\n next();\n return subscripts(new AST_Splice((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["expression"] = expr;\n ρσ_d["property"] = slice_bounds[0] || new AST_Number((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["value"] = 0;\n return ρσ_d;\n }).call(this));\n ρσ_d["property2"] = slice_bounds[1];\n ρσ_d["assignment"] = expression(true);\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this)), allow_calls);\n } else if (slice_bounds.length === 3) {\n slice_bounds.unshift(slice_bounds.pop());\n if (!slice_bounds[slice_bounds.length-1]) {\n slice_bounds.pop();\n if (!slice_bounds[slice_bounds.length-1]) {\n slice_bounds.pop();\n }\n } else if (!slice_bounds[slice_bounds.length-2]) {\n slice_bounds[slice_bounds.length-2] = new AST_Undefined;\n }\n return subscripts(new AST_Call((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["expression"] = new AST_SymbolRef((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = (S.in_delete) ? "ρσ_delslice" : "ρσ_eslice";\n return ρσ_d;\n }).call(this));\n ρσ_d["args"] = ρσ_list_decorate([ expr ]).concat(slice_bounds);\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this)), allow_calls);\n } else {\n slice_bounds = (function() {\n var ρσ_Iter = ρσ_Iterable(slice_bounds), ρσ_Result = [], i;\n for (var ρσ_Index = 0; ρσ_Index < ρσ_Iter.length; ρσ_Index++) {\n i = ρσ_Iter[ρσ_Index];\n ρσ_Result.push((i === null) ? new AST_Number((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["value"] = 0;\n return ρσ_d;\n }).call(this)) : i);\n }\n ρσ_Result = ρσ_list_constructor(ρσ_Result);\n return ρσ_Result;\n })();\n if (S.in_delete) {\n return subscripts(new AST_Call((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["expression"] = new AST_SymbolRef((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = "ρσ_delslice";\n return ρσ_d;\n }).call(this));\n ρσ_d["args"] = ρσ_list_decorate([ expr, new AST_Number((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["value"] = 1;\n return ρσ_d;\n }).call(this)) ]).concat(slice_bounds);\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this)), allow_calls);\n }\n return subscripts(new AST_Call((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["expression"] = new AST_Dot((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["expression"] = expr;\n ρσ_d["property"] = "slice";\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this));\n ρσ_d["args"] = slice_bounds;\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this)), allow_calls);\n }\n } else {\n if (is_py_sub) {\n assignment = null;\n assign_operator = "";\n if (is_("operator") && ASSIGNMENT[ρσ_bound_index(S.token.value, ASSIGNMENT)]) {\n assign_operator = S.token.value.slice(0, -1);\n next();\n assignment = expression(true);\n }\n return subscripts(new AST_ItemAccess((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["expression"] = expr;\n ρσ_d["property"] = slice_bounds[0] || new AST_Number((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["value"] = 0;\n return ρσ_d;\n }).call(this));\n ρσ_d["assignment"] = assignment;\n ρσ_d["assign_operator"] = assign_operator;\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this)), allow_calls);\n }\n return subscripts(new AST_Sub((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["expression"] = expr;\n ρσ_d["property"] = slice_bounds[0] || new AST_Number((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["value"] = 0;\n return ρσ_d;\n }).call(this));\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this)), allow_calls);\n }\n };\n if (!getitem.__argnames__) Object.defineProperties(getitem, {\n __argnames__ : {value: ["expr", "allow_calls"]},\n __module__ : {value: "parse"}\n });\n\n function call_(expr) {\n var start, ret, c, funcname, tmp_, args;\n start = expr.start;\n S.in_parenthesized_expr = true;\n next();\n if (!expr.parens && get_class_in_scope(expr)) {\n ret = subscripts(new AST_New((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["expression"] = expr;\n ρσ_d["args"] = func_call_list();\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this)), true);\n S.in_parenthesized_expr = false;\n return ret;\n } else {\n if (is_node_type(expr, AST_Dot)) {\n c = get_class_in_scope(expr.expression);\n }\n if (c) {\n funcname = expr;\n ret = subscripts(new AST_ClassCall((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["class"] = expr.expression;\n ρσ_d["method"] = funcname.property;\n ρσ_d["static"] = is_static_method(c, funcname.property);\n ρσ_d["args"] = func_call_list();\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this)), true);\n S.in_parenthesized_expr = false;\n return ret;\n } else if (is_node_type(expr, AST_SymbolRef)) {\n tmp_ = expr.name;\n if (tmp_ === "jstype") {\n ret = new AST_UnaryPrefix((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["operator"] = "typeof";\n ρσ_d["expression"] = func_call_list()[0];\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this));\n S.in_parenthesized_expr = false;\n return ret;\n } else if (tmp_ === "isinstance") {\n args = func_call_list();\n if (args.length !== 2) {\n croak("isinstance() must be called with exactly two arguments");\n }\n ret = new AST_Binary((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["left"] = args[0];\n ρσ_d["operator"] = "instanceof";\n ρσ_d["right"] = args[1];\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this));\n S.in_parenthesized_expr = false;\n return ret;\n }\n }\n ret = subscripts(new AST_Call((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["expression"] = expr;\n ρσ_d["args"] = func_call_list();\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this)), true);\n S.in_parenthesized_expr = false;\n return ret;\n }\n };\n if (!call_.__argnames__) Object.defineProperties(call_, {\n __argnames__ : {value: ["expr"]},\n __module__ : {value: "parse"}\n });\n\n function get_attr(expr, allow_calls) {\n var prop, c, classvars;\n next();\n prop = as_name();\n c = get_class_in_scope(expr);\n if (c) {\n classvars = (c.processing) ? c.provisional_classvars : c.classvars;\n if (classvars && classvars[prop]) {\n prop = "prototype." + prop;\n }\n }\n return subscripts(new AST_Dot((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = expr.start;\n ρσ_d["expression"] = expr;\n ρσ_d["property"] = prop;\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this)), allow_calls);\n };\n if (!get_attr.__argnames__) Object.defineProperties(get_attr, {\n __argnames__ : {value: ["expr", "allow_calls"]},\n __module__ : {value: "parse"}\n });\n\n function existential(expr, allow_calls) {\n var ans, ttype, val, is_py_sub;\n ans = new AST_Existential((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = expr.start;\n ρσ_d["end"] = S.token;\n ρσ_d["expression"] = expr;\n return ρσ_d;\n }).call(this));\n next();\n ttype = S.token.type;\n val = S.token.value;\n if (S.token.nlb || ttype === "keyword" || ttype === "operator" || ttype === "eof") {\n ans.after = null;\n return ans;\n }\n if (ttype === "punc") {\n if (val === ".") {\n ans.after = ".";\n } else if (val === "[") {\n is_py_sub = S.scoped_flags.get("overload_getitem", false);\n ans.after = (is_py_sub) ? "g" : "[";\n } else if (val === "(") {\n if (!allow_calls) {\n unexpected();\n }\n ans.after = "(";\n } else {\n ans.after = null;\n return ans;\n }\n return subscripts(ans, allow_calls);\n }\n ans.after = expression();\n return ans;\n };\n if (!existential.__argnames__) Object.defineProperties(existential, {\n __argnames__ : {value: ["expr", "allow_calls"]},\n __module__ : {value: "parse"}\n });\n\n function subscripts(expr, allow_calls) {\n if (is_("punc", ".")) {\n return get_attr(expr, allow_calls);\n }\n if (is_("punc", "[") && !S.token.nlb) {\n return getitem(expr, allow_calls);\n }\n if (allow_calls && is_("punc", "(") && !S.token.nlb) {\n return call_(expr);\n }\n if (is_("punc", "?")) {\n return existential(expr, allow_calls);\n }\n return expr;\n };\n if (!subscripts.__argnames__) Object.defineProperties(subscripts, {\n __argnames__ : {value: ["expr", "allow_calls"]},\n __module__ : {value: "parse"}\n });\n\n function maybe_unary(allow_calls) {\n var start, expr, is_parenthesized, ex, val;\n start = S.token;\n if (is_("operator", "@")) {\n if (S.parsing_decorator) {\n croak("Nested decorators are not allowed");\n }\n next();\n S.parsing_decorator = true;\n expr = expression();\n S.parsing_decorator = false;\n S.decorators.push(expr);\n return new AST_EmptyStatement((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["stype"] = "@";\n ρσ_d["start"] = prev();\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this));\n }\n if (is_("operator") && UNARY_PREFIX[ρσ_bound_index(start.value, UNARY_PREFIX)]) {\n next();\n is_parenthesized = is_("punc", "(");\n S.in_delete = start.value === "delete";\n expr = maybe_unary(allow_calls);\n S.in_delete = false;\n ex = make_unary(AST_UnaryPrefix, start.value, expr, is_parenthesized);\n ex.start = start;\n ex.end = prev();\n return ex;\n }\n val = expr_atom(allow_calls);\n return val;\n };\n if (!maybe_unary.__argnames__) Object.defineProperties(maybe_unary, {\n __argnames__ : {value: ["allow_calls"]},\n __module__ : {value: "parse"}\n });\n\n function make_unary(ctor, op, expr, is_parenthesized) {\n return new ctor((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["operator"] = op;\n ρσ_d["expression"] = expr;\n ρσ_d["parenthesized"] = is_parenthesized;\n return ρσ_d;\n }).call(this));\n };\n if (!make_unary.__argnames__) Object.defineProperties(make_unary, {\n __argnames__ : {value: ["ctor", "op", "expr", "is_parenthesized"]},\n __module__ : {value: "parse"}\n });\n\n function expr_op(left, min_prec, no_in) {\n var op, prec, right, ret;\n op = (is_("operator")) ? S.token.value : null;\n if (op === "!" && peek().type === "operator" && peek().value === "in") {\n next();\n S.token.value = op = "nin";\n }\n if (no_in && (op === "in" || op === "nin")) {\n op = null;\n }\n prec = (op !== null) ? PRECEDENCE[(typeof op === "number" && op < 0) ? PRECEDENCE.length + op : op] : null;\n if (prec !== null && prec > min_prec) {\n next();\n right = expr_op(maybe_unary(true), prec, no_in);\n ret = new AST_Binary((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = left.start;\n ρσ_d["left"] = left;\n ρσ_d["operator"] = op;\n ρσ_d["right"] = right;\n ρσ_d["end"] = right.end;\n return ρσ_d;\n }).call(this));\n return expr_op(ret, min_prec, no_in);\n }\n return left;\n };\n if (!expr_op.__argnames__) Object.defineProperties(expr_op, {\n __argnames__ : {value: ["left", "min_prec", "no_in"]},\n __module__ : {value: "parse"}\n });\n\n function expr_ops(no_in) {\n return expr_op(maybe_unary(true), 0, no_in);\n };\n if (!expr_ops.__argnames__) Object.defineProperties(expr_ops, {\n __argnames__ : {value: ["no_in"]},\n __module__ : {value: "parse"}\n });\n\n function maybe_conditional(no_in) {\n var start, expr, ne, conditional;\n start = S.token;\n expr = expr_ops(no_in);\n if (is_("keyword", "if") && (S.in_parenthesized_expr || S.statement_starting_token !== S.token && !S.in_comprehension && !S.token.nlb)) {\n next();\n ne = expression(false);\n expect_token("keyword", "else");\n conditional = new AST_Conditional((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["condition"] = ne;\n ρσ_d["consequent"] = expr;\n ρσ_d["alternative"] = expression(false, no_in);\n ρσ_d["end"] = peek();\n return ρσ_d;\n }).call(this));\n return conditional;\n }\n return expr;\n };\n if (!maybe_conditional.__argnames__) Object.defineProperties(maybe_conditional, {\n __argnames__ : {value: ["no_in"]},\n __module__ : {value: "parse"}\n });\n\n function create_assign(data) {\n var ans, class_name, c, lhs;\n if (data.right && is_node_type(data.right, AST_Seq) && (is_node_type(data.right.car, AST_Assign) || is_node_type(data.right.cdr, AST_Assign)) && data.operator !== "=") {\n token_error(data.start, "Invalid assignment operator for chained assignment: " + data.operator);\n }\n ans = new AST_Assign(data);\n if (S.in_class.length && (ρσ_expr_temp = S.in_class)[ρσ_expr_temp.length-1]) {\n class_name = (ρσ_expr_temp = S.in_class)[ρσ_expr_temp.length-1];\n if (is_node_type(ans.left, AST_SymbolRef) && S.classes.length > 1) {\n c = (ρσ_expr_temp = (ρσ_expr_temp = S.classes)[ρσ_expr_temp.length-2])[(typeof class_name === "number" && class_name < 0) ? ρσ_expr_temp.length + class_name : class_name];\n if (c) {\n if (ans.is_chained()) {\n var ρσ_Iter70 = ρσ_Iterable(ans.traverse_chain()[0]);\n for (var ρσ_Index70 = 0; ρσ_Index70 < ρσ_Iter70.length; ρσ_Index70++) {\n lhs = ρσ_Iter70[ρσ_Index70];\n (ρσ_expr_temp = c.provisional_classvars)[ρσ_bound_index(lhs.name, ρσ_expr_temp)] = true;\n }\n } else {\n (ρσ_expr_temp = c.provisional_classvars)[ρσ_bound_index(ans.left.name, ρσ_expr_temp)] = true;\n }\n }\n }\n }\n return ans;\n };\n if (!create_assign.__argnames__) Object.defineProperties(create_assign, {\n __argnames__ : {value: ["data"]},\n __module__ : {value: "parse"}\n });\n\n function maybe_assign(no_in, only_plain_assignment) {\n var start, left, val;\n start = S.token;\n left = maybe_conditional(no_in);\n val = S.token.value;\n if (is_("operator") && ASSIGNMENT[(typeof val === "number" && val < 0) ? ASSIGNMENT.length + val : val]) {\n if (only_plain_assignment && val !== "=") {\n croak("Invalid assignment operator for chained assignment: " + val);\n }\n next();\n return create_assign((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["left"] = left;\n ρσ_d["operator"] = val;\n ρσ_d["right"] = maybe_assign(no_in, true);\n ρσ_d["end"] = prev();\n return ρσ_d;\n }).call(this));\n }\n return left;\n };\n if (!maybe_assign.__argnames__) Object.defineProperties(maybe_assign, {\n __argnames__ : {value: ["no_in", "only_plain_assignment"]},\n __module__ : {value: "parse"}\n });\n\n function expression(commas, no_in) {\n var start, expr, left;\n start = S.token;\n expr = maybe_assign(no_in);\n function build_seq(a) {\n if (a.length === 1) {\n return a[0];\n }\n return new AST_Seq((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["car"] = a.shift();\n ρσ_d["cdr"] = build_seq(a);\n ρσ_d["end"] = peek();\n return ρσ_d;\n }).call(this));\n };\n if (!build_seq.__argnames__) Object.defineProperties(build_seq, {\n __argnames__ : {value: ["a"]},\n __module__ : {value: "parse"}\n });\n\n if (commas) {\n left = [ expr ];\n while (is_("punc", ",") && !peek().nlb) {\n next();\n if (is_node_type(expr, AST_Assign)) {\n left[left.length-1] = left[left.length-1].left;\n return create_assign((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["left"] = (left.length === 1) ? left[0] : new AST_Array((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["elements"] = left;\n return ρσ_d;\n }).call(this));\n ρσ_d["operator"] = expr.operator;\n ρσ_d["right"] = new AST_Seq((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["car"] = expr.right;\n ρσ_d["cdr"] = expression(true, no_in);\n return ρσ_d;\n }).call(this));\n ρσ_d["end"] = peek();\n return ρσ_d;\n }).call(this));\n }\n expr = maybe_assign(no_in);\n left.push(expr);\n }\n if (left.length > 1 && is_node_type(left[left.length-1], AST_Assign)) {\n left[left.length-1] = left[left.length-1].left;\n return create_assign((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["left"] = new AST_Array((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["elements"] = left;\n return ρσ_d;\n }).call(this));\n ρσ_d["operator"] = expr.operator;\n ρσ_d["right"] = expr.right;\n ρσ_d["end"] = peek();\n return ρσ_d;\n }).call(this));\n }\n return build_seq(left);\n }\n return expr;\n };\n if (!expression.__argnames__) Object.defineProperties(expression, {\n __argnames__ : {value: ["commas", "no_in"]},\n __module__ : {value: "parse"}\n });\n\n function in_loop(cont) {\n var ret;\n S.in_loop += 1;\n ret = cont();\n S.in_loop -= 1;\n return ret;\n };\n if (!in_loop.__argnames__) Object.defineProperties(in_loop, {\n __argnames__ : {value: ["cont"]},\n __module__ : {value: "parse"}\n });\n\n function run_parser() {\n var start, body, docstrings, first_token, toplevel, element, shebang, ds, end, seen_exports, item;\n start = S.token = next();\n body = [];\n docstrings = [];\n first_token = true;\n toplevel = options.toplevel;\n while (!is_("eof")) {\n element = statement();\n if (first_token && is_node_type(element, AST_Directive) && element.value.indexOf("#!") === 0) {\n shebang = element.value;\n } else {\n ds = !toplevel && is_docstring(element);\n if (ds) {\n docstrings.push(ds);\n } else {\n body.push(element);\n }\n }\n first_token = false;\n }\n end = prev();\n if (toplevel) {\n toplevel.body = toplevel.body.concat(body);\n toplevel.end = end;\n toplevel.docstrings;\n } else {\n toplevel = new AST_Toplevel((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["start"] = start;\n ρσ_d["body"] = body;\n ρσ_d["shebang"] = shebang;\n ρσ_d["end"] = end;\n ρσ_d["docstrings"] = docstrings;\n return ρσ_d;\n }).call(this));\n }\n toplevel.nonlocalvars = scan_for_nonlocal_defs(toplevel.body).concat(S.globals);\n toplevel.localvars = ρσ_list_decorate([]);\n toplevel.exports = ρσ_list_decorate([]);\n seen_exports = Object.create(null);\n function add_item(item, isvar) {\n var symbol;\n if (toplevel.nonlocalvars.indexOf(item) < 0) {\n symbol = new_symbol(AST_SymbolVar, item);\n if (isvar) {\n toplevel.localvars.push(symbol);\n }\n if (!has_prop(seen_exports, item)) {\n toplevel.exports.push(symbol);\n seen_exports[(typeof item === "number" && item < 0) ? seen_exports.length + item : item] = true;\n }\n }\n };\n if (!add_item.__argnames__) Object.defineProperties(add_item, {\n __argnames__ : {value: ["item", "isvar"]},\n __module__ : {value: "parse"}\n });\n\n var ρσ_Iter71 = ρσ_Iterable(scan_for_local_vars(toplevel.body));\n for (var ρσ_Index71 = 0; ρσ_Index71 < ρσ_Iter71.length; ρσ_Index71++) {\n item = ρσ_Iter71[ρσ_Index71];\n add_item(item, true);\n }\n var ρσ_Iter72 = ρσ_Iterable(scan_for_top_level_callables(toplevel.body));\n for (var ρσ_Index72 = 0; ρσ_Index72 < ρσ_Iter72.length; ρσ_Index72++) {\n item = ρσ_Iter72[ρσ_Index72];\n add_item(item, false);\n }\n toplevel.filename = options.filename;\n toplevel.imported_module_ids = imported_module_ids;\n toplevel.classes = scan_for_classes(toplevel.body);\n toplevel.import_order = Object.keys(imported_modules).length;\n toplevel.module_id = module_id;\n imported_modules[(typeof module_id === "number" && module_id < 0) ? imported_modules.length + module_id : module_id] = toplevel;\n toplevel.imports = imported_modules;\n toplevel.baselib = baselib_items;\n toplevel.scoped_flags = S.scoped_flags.stack[0];\n importing_modules[(typeof module_id === "number" && module_id < 0) ? importing_modules.length + module_id : module_id] = false;\n toplevel.comments_after = S.token.comments_before || [];\n return toplevel;\n };\n if (!run_parser.__module__) Object.defineProperties(run_parser, {\n __module__ : {value: "parse"}\n });\n\n return run_parser;\n };\n if (!create_parser_ctx.__argnames__) Object.defineProperties(create_parser_ctx, {\n __argnames__ : {value: ["S", "import_dirs", "module_id", "baselib_items", "imported_module_ids", "imported_modules", "importing_modules", "options"]},\n __module__ : {value: "parse"}\n });\n\n function parse(text, options) {\n var import_dirs, x, location, module_id, baselib_items, imported_module_ids, imported_modules, importing_modules, S, obj, cname;\n options = defaults(options, (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["filename"] = null;\n ρσ_d["module_id"] = "__main__";\n ρσ_d["toplevel"] = null;\n ρσ_d["for_linting"] = false;\n ρσ_d["import_dirs"] = [];\n ρσ_d["classes"] = undefined;\n ρσ_d["scoped_flags"] = Object.create(null);\n ρσ_d["discard_asserts"] = false;\n ρσ_d["module_cache_dir"] = "";\n return ρσ_d;\n }).call(this));\n import_dirs = (function() {\n var ρσ_Iter = ρσ_Iterable(options.import_dirs), ρσ_Result = [], x;\n for (var ρσ_Index = 0; ρσ_Index < ρσ_Iter.length; ρσ_Index++) {\n x = ρσ_Iter[ρσ_Index];\n ρσ_Result.push(x);\n }\n ρσ_Result = ρσ_list_constructor(ρσ_Result);\n return ρσ_Result;\n })();\n var ρσ_Iter73 = ρσ_Iterable([options.libdir, options.basedir]);\n for (var ρσ_Index73 = 0; ρσ_Index73 < ρσ_Iter73.length; ρσ_Index73++) {\n location = ρσ_Iter73[ρσ_Index73];\n if (location) {\n import_dirs.push(location);\n }\n }\n module_id = options.module_id;\n baselib_items = Object.create(null);\n imported_module_ids = ρσ_list_decorate([]);\n imported_modules = options.imported_modules || Object.create(null);\n importing_modules = options.importing_modules || Object.create(null);\n importing_modules[(typeof module_id === "number" && module_id < 0) ? importing_modules.length + module_id : module_id] = true;\n S = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["input"] = (typeof text === "string") ? tokenizer(text, options.filename) : text;\n ρσ_d["token"] = null;\n ρσ_d["prev"] = null;\n ρσ_d["peeked"] = ρσ_list_decorate([]);\n ρσ_d["in_function"] = 0;\n ρσ_d["statement_starting_token"] = null;\n ρσ_d["in_comprehension"] = false;\n ρσ_d["in_parenthesized_expr"] = false;\n ρσ_d["in_delete"] = false;\n ρσ_d["in_loop"] = 0;\n ρσ_d["in_class"] = ρσ_list_decorate([ false ]);\n ρσ_d["classes"] = ρσ_list_decorate([ Object.create(null) ]);\n ρσ_d["functions"] = ρσ_list_decorate([ Object.create(null) ]);\n ρσ_d["labels"] = ρσ_list_decorate([]);\n ρσ_d["decorators"] = [];\n ρσ_d["parsing_decorator"] = false;\n ρσ_d["globals"] = [];\n ρσ_d["scoped_flags"] = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["stack"] = [options.scoped_flags || Object.create(null)];\n ρσ_d["push"] = (function() {\n var ρσ_anonfunc = function () {\n this.stack.push(Object.create(null));\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "parse"}\n });\n return ρσ_anonfunc;\n })();\n ρσ_d["pop"] = (function() {\n var ρσ_anonfunc = function () {\n this.stack.pop();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "parse"}\n });\n return ρσ_anonfunc;\n })();\n ρσ_d["get"] = (function() {\n var ρσ_anonfunc = function (name, defval) {\n var d, q;\n for (var i = this.stack.length - 1; i >= 0; i--) {\n d = (ρσ_expr_temp = this.stack)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i];\n q = d[(typeof name === "number" && name < 0) ? d.length + name : name];\n if (q) {\n return q;\n }\n }\n return defval;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["name", "defval"]},\n __module__ : {value: "parse"}\n });\n return ρσ_anonfunc;\n })();\n ρσ_d["set"] = (function() {\n var ρσ_anonfunc = function (name, val) {\n (ρσ_expr_temp = (ρσ_expr_temp = this.stack)[ρσ_expr_temp.length-1])[(typeof name === "number" && name < 0) ? ρσ_expr_temp.length + name : name] = val;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["name", "val"]},\n __module__ : {value: "parse"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this);\n return ρσ_d;\n }).call(this);\n if (options.classes) {\n var ρσ_Iter74 = ρσ_Iterable(options.classes);\n for (var ρσ_Index74 = 0; ρσ_Index74 < ρσ_Iter74.length; ρσ_Index74++) {\n cname = ρσ_Iter74[ρσ_Index74];\n obj = (ρσ_expr_temp = options.classes)[(typeof cname === "number" && cname < 0) ? ρσ_expr_temp.length + cname : cname];\n (ρσ_expr_temp = S.classes[0])[(typeof cname === "number" && cname < 0) ? ρσ_expr_temp.length + cname : cname] = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["static"] = obj.static;\n ρσ_d["bound"] = obj.bound;\n ρσ_d["classvars"] = obj.classvars;\n return ρσ_d;\n }).call(this);\n }\n }\n return create_parser_ctx(S, import_dirs, module_id, baselib_items, imported_module_ids, imported_modules, importing_modules, options)();\n };\n if (!parse.__argnames__) Object.defineProperties(parse, {\n __argnames__ : {value: ["text", "options"]},\n __module__ : {value: "parse"}\n });\n\n ρσ_modules.parse.COMPILER_VERSION = COMPILER_VERSION;\n ρσ_modules.parse.PYTHON_FLAGS = PYTHON_FLAGS;\n ρσ_modules.parse.NATIVE_CLASSES = NATIVE_CLASSES;\n ρσ_modules.parse.ERROR_CLASSES = ERROR_CLASSES;\n ρσ_modules.parse.COMMON_STATIC = COMMON_STATIC;\n ρσ_modules.parse.FORBIDDEN_CLASS_VARS = FORBIDDEN_CLASS_VARS;\n ρσ_modules.parse.UNARY_PREFIX = UNARY_PREFIX;\n ρσ_modules.parse.ASSIGNMENT = ASSIGNMENT;\n ρσ_modules.parse.PRECEDENCE = PRECEDENCE;\n ρσ_modules.parse.STATEMENTS_WITH_LABELS = STATEMENTS_WITH_LABELS;\n ρσ_modules.parse.ATOMIC_START_TOKEN = ATOMIC_START_TOKEN;\n ρσ_modules.parse.compile_time_decorators = compile_time_decorators;\n ρσ_modules.parse.get_compiler_version = get_compiler_version;\n ρσ_modules.parse.static_predicate = static_predicate;\n ρσ_modules.parse.has_simple_decorator = has_simple_decorator;\n ρσ_modules.parse.has_setter_decorator = has_setter_decorator;\n ρσ_modules.parse.create_parser_ctx = create_parser_ctx;\n ρσ_modules.parse.parse = parse;\n })();\n\n (function(){\n var __name__ = "output";\n\n })();\n\n (function(){\n var __name__ = "output.stream";\n var DANGEROUS, require_semi_colon_chars, output_stream_defaults;\n var make_predicate = ρσ_modules.utils.make_predicate;\n var defaults = ρσ_modules.utils.defaults;\n var repeat_string = ρσ_modules.utils.repeat_string;\n\n var is_identifier_char = ρσ_modules.tokenizer.is_identifier_char;\n\n DANGEROUS = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n function as_hex(code, sz) {\n var val;\n val = code.toString(16);\n if (val.length < sz) {\n val = "0".repeat(sz - val.length) + val;\n }\n return val;\n };\n if (!as_hex.__argnames__) Object.defineProperties(as_hex, {\n __argnames__ : {value: ["code", "sz"]},\n __module__ : {value: "output.stream"}\n });\n\n function to_ascii(str_, identifier) {\n return str_.replace(/[\\u0080-\\uffff]/g, (function() {\n var ρσ_anonfunc = function (ch) {\n var code;\n code = ch.charCodeAt(0).toString(16);\n if (code.length <= 2 && !identifier) {\n return "\\\\x" + as_hex(code, 2);\n } else {\n return "\\\\u" + as_hex(code, 4);\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["ch"]},\n __module__ : {value: "output.stream"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!to_ascii.__argnames__) Object.defineProperties(to_ascii, {\n __argnames__ : {value: ["str_", "identifier"]},\n __module__ : {value: "output.stream"}\n });\n\n function encode_string(str_) {\n return JSON.stringify(str_).replace(DANGEROUS, (function() {\n var ρσ_anonfunc = function (a) {\n return "\\\\u" + as_hex(a.charCodeAt(0), 4);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["a"]},\n __module__ : {value: "output.stream"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!encode_string.__argnames__) Object.defineProperties(encode_string, {\n __argnames__ : {value: ["str_"]},\n __module__ : {value: "output.stream"}\n });\n\n require_semi_colon_chars = make_predicate("( [ + * / - , .");\n output_stream_defaults = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["indent_start"] = 0;\n ρσ_d["indent_level"] = 4;\n ρσ_d["quote_keys"] = false;\n ρσ_d["space_colon"] = true;\n ρσ_d["ascii_only"] = false;\n ρσ_d["width"] = 80;\n ρσ_d["max_line_len"] = 32e3;\n ρσ_d["ie_proof"] = true;\n ρσ_d["beautify"] = false;\n ρσ_d["source_map"] = null;\n ρσ_d["bracketize"] = false;\n ρσ_d["semicolons"] = true;\n ρσ_d["comments"] = false;\n ρσ_d["preserve_line"] = false;\n ρσ_d["omit_baselib"] = false;\n ρσ_d["baselib_plain"] = null;\n ρσ_d["private_scope"] = true;\n ρσ_d["keep_docstrings"] = false;\n ρσ_d["discard_asserts"] = false;\n ρσ_d["module_cache_dir"] = "";\n ρσ_d["js_version"] = 5;\n ρσ_d["write_name"] = true;\n return ρσ_d;\n }).call(this);\n function OutputStream() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n OutputStream.prototype.__init__.apply(this, arguments);\n }\n OutputStream.prototype.__init__ = function __init__(options) {\n var self = this;\n self.options = defaults(options, output_stream_defaults, true);\n self._indentation = 0;\n self.current_col = 0;\n self.current_line = 1;\n self.current_pos = 0;\n self.OUTPUT = "";\n self.might_need_space = false;\n self.might_need_semicolon = false;\n self._last = null;\n self._stack = ρσ_list_decorate([]);\n self.index_counter = 0;\n self.with_counter = 0;\n self.try_else_counter = 0;\n };\n if (!OutputStream.prototype.__init__.__argnames__) Object.defineProperties(OutputStream.prototype.__init__, {\n __argnames__ : {value: ["options"]},\n __module__ : {value: "output.stream"}\n });\n OutputStream.__argnames__ = OutputStream.prototype.__init__.__argnames__;\n OutputStream.__handles_kwarg_interpolation__ = OutputStream.prototype.__init__.__handles_kwarg_interpolation__;\n OutputStream.prototype.new_try_else_counter = function new_try_else_counter() {\n var self = this;\n self.try_else_counter += 1;\n return "ρσ_try_else_" + self.try_else_counter;\n };\n if (!OutputStream.prototype.new_try_else_counter.__module__) Object.defineProperties(OutputStream.prototype.new_try_else_counter, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.make_name = function make_name(name) {\n var self = this;\n name = name.toString();\n if (self.options.ascii_only) {\n name = to_ascii(name, true);\n }\n return name;\n };\n if (!OutputStream.prototype.make_name.__argnames__) Object.defineProperties(OutputStream.prototype.make_name, {\n __argnames__ : {value: ["name"]},\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.print_name = function print_name(name) {\n var self = this;\n self.print(self.make_name(name));\n };\n if (!OutputStream.prototype.print_name.__argnames__) Object.defineProperties(OutputStream.prototype.print_name, {\n __argnames__ : {value: ["name"]},\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.make_indent = function make_indent(back) {\n var self = this;\n return repeat_string(" ", self.options.indent_start + self._indentation - back * self.options.indent_level);\n };\n if (!OutputStream.prototype.make_indent.__argnames__) Object.defineProperties(OutputStream.prototype.make_indent, {\n __argnames__ : {value: ["back"]},\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.last_char = function last_char() {\n var self = this;\n return self._last.charAt(self._last.length - 1);\n };\n if (!OutputStream.prototype.last_char.__module__) Object.defineProperties(OutputStream.prototype.last_char, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.maybe_newline = function maybe_newline() {\n var self = this;\n if (self.options.max_line_len && self.current_col > self.options.max_line_len) {\n self.print("\\n");\n }\n };\n if (!OutputStream.prototype.maybe_newline.__module__) Object.defineProperties(OutputStream.prototype.maybe_newline, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.print = function print(str_) {\n var self = this;\n var ch, target_line, prev, a, n;\n str_ = String(str_);\n ch = str_.charAt(0);\n if (self.might_need_semicolon) {\n if ((!ch || ";}".indexOf(ch) < 0) && !/[;]$/.test(self._last)) {\n if (self.options.semicolons || require_semi_colon_chars[(typeof ch === "number" && ch < 0) ? require_semi_colon_chars.length + ch : ch]) {\n self.OUTPUT += ";";\n self.current_col += 1;\n self.current_pos += 1;\n } else {\n self.OUTPUT += "\\n";\n self.current_pos += 1;\n self.current_line += 1;\n self.current_col = 0;\n }\n if (!self.options.beautify) {\n self.might_need_space = false;\n }\n }\n self.might_need_semicolon = false;\n self.maybe_newline();\n }\n if (!self.options.beautify && self.options.preserve_line && (ρσ_expr_temp = self._stack)[ρσ_bound_index(self._stack.length - 1, ρσ_expr_temp)]) {\n target_line = (ρσ_expr_temp = self._stack)[ρσ_bound_index(self._stack.length - 1, ρσ_expr_temp)].start.line;\n while (self.current_line < target_line) {\n self.OUTPUT += "\\n";\n self.current_pos += 1;\n self.current_line += 1;\n self.current_col = 0;\n self.might_need_space = false;\n }\n }\n if (self.might_need_space) {\n prev = self.last_char();\n if (is_identifier_char(prev) && (is_identifier_char(ch) || ch === "\\\\") || /^[\\+\\-\\/]$/.test(ch) && ch === prev) {\n self.OUTPUT += " ";\n self.current_col += 1;\n self.current_pos += 1;\n }\n self.might_need_space = false;\n }\n a = str_.split(/\\r?\\n/);\n n = a.length - 1;\n self.current_line += n;\n if (n === 0) {\n self.current_col += a[(typeof n === "number" && n < 0) ? a.length + n : n].length;\n } else {\n self.current_col = a[(typeof n === "number" && n < 0) ? a.length + n : n].length;\n }\n self.current_pos += str_.length;\n self._last = str_;\n self.OUTPUT += str_;\n };\n if (!OutputStream.prototype.print.__argnames__) Object.defineProperties(OutputStream.prototype.print, {\n __argnames__ : {value: ["str_"]},\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.space = function space() {\n var self = this;\n if (self.options.beautify) {\n self.print(" ");\n } else {\n self.might_need_space = true;\n }\n };\n if (!OutputStream.prototype.space.__module__) Object.defineProperties(OutputStream.prototype.space, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.indent = function indent(half) {\n var self = this;\n if (self.options.beautify) {\n self.print(self.make_indent((half) ? .5 : 0));\n }\n };\n if (!OutputStream.prototype.indent.__argnames__) Object.defineProperties(OutputStream.prototype.indent, {\n __argnames__ : {value: ["half"]},\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.with_indent = function with_indent(col, proceed) {\n var self = this;\n var save_indentation, ret;\n if (self.options.beautify) {\n if (col === true) {\n col = self.next_indent();\n }\n save_indentation = self._indentation;\n self._indentation = col;\n ret = proceed();\n self._indentation = save_indentation;\n return ret;\n } else {\n return proceed();\n }\n };\n if (!OutputStream.prototype.with_indent.__argnames__) Object.defineProperties(OutputStream.prototype.with_indent, {\n __argnames__ : {value: ["col", "proceed"]},\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.indentation = function indentation() {\n var self = this;\n return self._indentation;\n };\n if (!OutputStream.prototype.indentation.__module__) Object.defineProperties(OutputStream.prototype.indentation, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.set_indentation = function set_indentation(val) {\n var self = this;\n if (self.options.beautify) {\n self._indentation = val;\n }\n };\n if (!OutputStream.prototype.set_indentation.__argnames__) Object.defineProperties(OutputStream.prototype.set_indentation, {\n __argnames__ : {value: ["val"]},\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.newline = function newline() {\n var self = this;\n if (self.options.beautify) {\n self.print("\\n");\n }\n };\n if (!OutputStream.prototype.newline.__module__) Object.defineProperties(OutputStream.prototype.newline, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.semicolon = function semicolon() {\n var self = this;\n if (self.options.beautify) {\n self.print(";");\n } else {\n self.might_need_semicolon = true;\n }\n };\n if (!OutputStream.prototype.semicolon.__module__) Object.defineProperties(OutputStream.prototype.semicolon, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.force_semicolon = function force_semicolon() {\n var self = this;\n self.might_need_semicolon = false;\n self.print(";");\n };\n if (!OutputStream.prototype.force_semicolon.__module__) Object.defineProperties(OutputStream.prototype.force_semicolon, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.next_indent = function next_indent() {\n var self = this;\n return self._indentation + self.options.indent_level;\n };\n if (!OutputStream.prototype.next_indent.__module__) Object.defineProperties(OutputStream.prototype.next_indent, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.spaced = function spaced() {\n var self = this;\n for (var i=0; i < arguments.length; i++) {\n if (i > 0) {\n self.space();\n }\n if (typeof arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i].print === "function") {\n arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i].print(self);\n } else {\n self.print(arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i]);\n }\n }\n };\n if (!OutputStream.prototype.spaced.__module__) Object.defineProperties(OutputStream.prototype.spaced, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.end_statement = function end_statement() {\n var self = this;\n self.semicolon();\n self.newline();\n };\n if (!OutputStream.prototype.end_statement.__module__) Object.defineProperties(OutputStream.prototype.end_statement, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.with_block = function with_block(cont) {\n var self = this;\n var ret;\n ret = null;\n self.print("{");\n self.newline();\n self.with_indent(self.next_indent(), (function() {\n var ρσ_anonfunc = function () {\n ret = cont();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.stream"}\n });\n return ρσ_anonfunc;\n })());\n self.indent();\n self.print("}");\n return ret;\n };\n if (!OutputStream.prototype.with_block.__argnames__) Object.defineProperties(OutputStream.prototype.with_block, {\n __argnames__ : {value: ["cont"]},\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.with_parens = function with_parens(cont) {\n var self = this;\n var ret;\n self.print("(");\n ret = cont();\n self.print(")");\n return ret;\n };\n if (!OutputStream.prototype.with_parens.__argnames__) Object.defineProperties(OutputStream.prototype.with_parens, {\n __argnames__ : {value: ["cont"]},\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.with_square = function with_square(cont) {\n var self = this;\n var ret;\n self.print("[");\n ret = cont();\n self.print("]");\n return ret;\n };\n if (!OutputStream.prototype.with_square.__argnames__) Object.defineProperties(OutputStream.prototype.with_square, {\n __argnames__ : {value: ["cont"]},\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.comma = function comma() {\n var self = this;\n self.print(",");\n self.space();\n };\n if (!OutputStream.prototype.comma.__module__) Object.defineProperties(OutputStream.prototype.comma, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.colon = function colon() {\n var self = this;\n self.print(":");\n if (self.options.space_colon) {\n self.space();\n }\n };\n if (!OutputStream.prototype.colon.__module__) Object.defineProperties(OutputStream.prototype.colon, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.dump_yield = function dump_yield() {\n var self = this;\n var code, ci;\n self.indent();\n self.spaced("var", "ρσ_regenerator", "=", "{}");\n self.end_statement();\n code = "ρσ_regenerator.regeneratorRuntime = " + regenerate(false, self.options.beautify);\n if (self.options.beautify) {\n code = code.replace(/\\/\\/.*$/gm, "\\n").replace(/^\\s*$/gm, "");\n ci = self.make_indent(0);\n code = (function() {\n var ρσ_Iter = ρσ_Iterable(code.split("\\n")), ρσ_Result = [], x;\n for (var ρσ_Index = 0; ρσ_Index < ρσ_Iter.length; ρσ_Index++) {\n x = ρσ_Iter[ρσ_Index];\n ρσ_Result.push(ci + x);\n }\n ρσ_Result = ρσ_list_constructor(ρσ_Result);\n return ρσ_Result;\n })().join("\\n");\n }\n self.print(code + "})(ρσ_regenerator)");\n self.end_statement();\n };\n if (!OutputStream.prototype.dump_yield.__module__) Object.defineProperties(OutputStream.prototype.dump_yield, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.get = function get() {\n var self = this;\n return self.OUTPUT;\n };\n if (!OutputStream.prototype.get.__module__) Object.defineProperties(OutputStream.prototype.get, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.assign = function assign(name) {\n var self = this;\n if (typeof name === "string") {\n self.print(name);\n } else {\n name.print(self);\n }\n self.space();\n self.print("=");\n self.space();\n };\n if (!OutputStream.prototype.assign.__argnames__) Object.defineProperties(OutputStream.prototype.assign, {\n __argnames__ : {value: ["name"]},\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.current_width = function current_width() {\n var self = this;\n return self.current_col - self._indentation;\n };\n if (!OutputStream.prototype.current_width.__module__) Object.defineProperties(OutputStream.prototype.current_width, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.should_break = function should_break() {\n var self = this;\n return self.options.width && self.current_width() >= self.options.width;\n };\n if (!OutputStream.prototype.should_break.__module__) Object.defineProperties(OutputStream.prototype.should_break, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.last = function last() {\n var self = this;\n return self._last;\n };\n if (!OutputStream.prototype.last.__module__) Object.defineProperties(OutputStream.prototype.last, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.print_string = function print_string(str_) {\n var self = this;\n self.print(encode_string(str_));\n };\n if (!OutputStream.prototype.print_string.__argnames__) Object.defineProperties(OutputStream.prototype.print_string, {\n __argnames__ : {value: ["str_"]},\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.line = function line() {\n var self = this;\n return self.current_line;\n };\n if (!OutputStream.prototype.line.__module__) Object.defineProperties(OutputStream.prototype.line, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.col = function col() {\n var self = this;\n return self.current_col;\n };\n if (!OutputStream.prototype.col.__module__) Object.defineProperties(OutputStream.prototype.col, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.pos = function pos() {\n var self = this;\n return self.current_pos;\n };\n if (!OutputStream.prototype.pos.__module__) Object.defineProperties(OutputStream.prototype.pos, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.push_node = function push_node(node) {\n var self = this;\n self._stack.push(node);\n };\n if (!OutputStream.prototype.push_node.__argnames__) Object.defineProperties(OutputStream.prototype.push_node, {\n __argnames__ : {value: ["node"]},\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.pop_node = function pop_node() {\n var self = this;\n return self._stack.pop();\n };\n if (!OutputStream.prototype.pop_node.__module__) Object.defineProperties(OutputStream.prototype.pop_node, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.stack = function stack() {\n var self = this;\n return self._stack;\n };\n if (!OutputStream.prototype.stack.__module__) Object.defineProperties(OutputStream.prototype.stack, {\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.parent = function parent(n) {\n var self = this;\n return (ρσ_expr_temp = self._stack)[ρσ_bound_index(self._stack.length - 2 - (n || 0), ρσ_expr_temp)];\n };\n if (!OutputStream.prototype.parent.__argnames__) Object.defineProperties(OutputStream.prototype.parent, {\n __argnames__ : {value: ["n"]},\n __module__ : {value: "output.stream"}\n });\n OutputStream.prototype.__repr__ = function __repr__ () {\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n };\n OutputStream.prototype.__str__ = function __str__ () {\n return this.__repr__();\n };\n Object.defineProperty(OutputStream.prototype, "__bases__", {value: []});\n OutputStream.prototype.toString = OutputStream.prototype.get;\n\n ρσ_modules["output.stream"].DANGEROUS = DANGEROUS;\n ρσ_modules["output.stream"].require_semi_colon_chars = require_semi_colon_chars;\n ρσ_modules["output.stream"].output_stream_defaults = output_stream_defaults;\n ρσ_modules["output.stream"].as_hex = as_hex;\n ρσ_modules["output.stream"].to_ascii = to_ascii;\n ρσ_modules["output.stream"].encode_string = encode_string;\n ρσ_modules["output.stream"].OutputStream = OutputStream;\n })();\n\n (function(){\n var __name__ = "output.statements";\n var AST_Definitions = ρσ_modules.ast.AST_Definitions;\n var AST_Scope = ρσ_modules.ast.AST_Scope;\n var AST_Method = ρσ_modules.ast.AST_Method;\n var AST_Except = ρσ_modules.ast.AST_Except;\n var AST_EmptyStatement = ρσ_modules.ast.AST_EmptyStatement;\n var AST_Statement = ρσ_modules.ast.AST_Statement;\n var AST_Seq = ρσ_modules.ast.AST_Seq;\n var AST_BaseCall = ρσ_modules.ast.AST_BaseCall;\n var AST_Dot = ρσ_modules.ast.AST_Dot;\n var AST_Sub = ρσ_modules.ast.AST_Sub;\n var AST_ItemAccess = ρσ_modules.ast.AST_ItemAccess;\n var AST_Conditional = ρσ_modules.ast.AST_Conditional;\n var AST_Binary = ρσ_modules.ast.AST_Binary;\n var AST_BlockStatement = ρσ_modules.ast.AST_BlockStatement;\n var is_node_type = ρσ_modules.ast.is_node_type;\n\n function force_statement(stat, output) {\n if (output.options.bracketize) {\n if (!stat || is_node_type(stat, AST_EmptyStatement)) {\n output.print("{}");\n } else if (is_node_type(stat, AST_BlockStatement)) {\n stat.print(output);\n } else {\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n output.indent();\n stat.print(output);\n output.newline();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.statements"}\n });\n return ρσ_anonfunc;\n })());\n }\n } else {\n if (!stat || is_node_type(stat, AST_EmptyStatement)) {\n output.force_semicolon();\n } else {\n stat.print(output);\n }\n }\n };\n if (!force_statement.__argnames__) Object.defineProperties(force_statement, {\n __argnames__ : {value: ["stat", "output"]},\n __module__ : {value: "output.statements"}\n });\n\n function first_in_statement(output) {\n var a, i, node, p;\n a = output.stack();\n i = a.length;\n node = a[ρσ_bound_index(i -= 1, a)];\n p = a[ρσ_bound_index(i -= 1, a)];\n while (i > 0) {\n if (is_node_type(p, AST_Statement) && p.body === node) {\n return true;\n }\n if (is_node_type(p, AST_Seq) && p.car === node || is_node_type(p, AST_BaseCall) && p.expression === node || is_node_type(p, AST_Dot) && p.expression === node || is_node_type(p, AST_Sub) && p.expression === node || is_node_type(p, AST_ItemAccess) && p.expression === node || is_node_type(p, AST_Conditional) && p.condition === node || is_node_type(p, AST_Binary) && p.left === node) {\n node = p;\n p = a[ρσ_bound_index(i -= 1, a)];\n } else {\n return false;\n }\n }\n };\n if (!first_in_statement.__argnames__) Object.defineProperties(first_in_statement, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.statements"}\n });\n\n function declare_vars(vars, output) {\n var ρσ_unpack, i, arg;\n if (vars.length) {\n output.indent();\n output.print("var");\n output.space();\n var ρσ_Iter75 = ρσ_Iterable(enumerate(vars));\n for (var ρσ_Index75 = 0; ρσ_Index75 < ρσ_Iter75.length; ρσ_Index75++) {\n ρσ_unpack = ρσ_Iter75[ρσ_Index75];\n i = ρσ_unpack[0];\n arg = ρσ_unpack[1];\n if (i) {\n output.comma();\n }\n arg.print(output);\n }\n output.semicolon();\n output.newline();\n }\n };\n if (!declare_vars.__argnames__) Object.defineProperties(declare_vars, {\n __argnames__ : {value: ["vars", "output"]},\n __module__ : {value: "output.statements"}\n });\n\n function display_body(body, is_toplevel, output) {\n var last, ρσ_unpack, i, stmt;\n last = body.length - 1;\n var ρσ_Iter76 = ρσ_Iterable(enumerate(body));\n for (var ρσ_Index76 = 0; ρσ_Index76 < ρσ_Iter76.length; ρσ_Index76++) {\n ρσ_unpack = ρσ_Iter76[ρσ_Index76];\n i = ρσ_unpack[0];\n stmt = ρσ_unpack[1];\n if (!(is_node_type(stmt, AST_EmptyStatement)) && !(is_node_type(stmt, AST_Definitions))) {\n output.indent();\n stmt.print(output);\n if (!((i === last && is_toplevel))) {\n output.newline();\n }\n }\n }\n };\n if (!display_body.__argnames__) Object.defineProperties(display_body, {\n __argnames__ : {value: ["body", "is_toplevel", "output"]},\n __module__ : {value: "output.statements"}\n });\n\n function display_complex_body(node, is_toplevel, output, function_preamble) {\n var offset;\n offset = 0;\n if (is_node_type(node, AST_Method) && !node.static) {\n output.indent();\n output.print("var");\n output.space();\n output.assign(node.argnames[0]);\n output.print("this");\n output.semicolon();\n output.newline();\n offset += 1;\n }\n if (is_node_type(node, AST_Scope)) {\n function_preamble(node, output, offset);\n declare_vars(node.localvars, output);\n } else if (is_node_type(node, AST_Except)) {\n if (node.argname) {\n output.indent();\n output.print("var");\n output.space();\n output.assign(node.argname);\n output.print("ρσ_Exception");\n output.semicolon();\n output.newline();\n }\n }\n display_body(node.body, is_toplevel, output);\n };\n if (!display_complex_body.__argnames__) Object.defineProperties(display_complex_body, {\n __argnames__ : {value: ["node", "is_toplevel", "output", "function_preamble"]},\n __module__ : {value: "output.statements"}\n });\n\n function print_bracketed(node, output, complex, function_preamble, before, after) {\n if (node.body.length > 0) {\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n if (before) {\n before(output);\n }\n if (complex) {\n display_complex_body(node, false, output, function_preamble);\n } else {\n display_body(node.body, false, output);\n }\n if (after) {\n after(output);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.statements"}\n });\n return ρσ_anonfunc;\n })());\n } else {\n if (before || after) {\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n if (before) {\n before(output);\n }\n if (after) {\n after(output);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.statements"}\n });\n return ρσ_anonfunc;\n })());\n } else {\n output.print("{}");\n }\n }\n };\n if (!print_bracketed.__argnames__) Object.defineProperties(print_bracketed, {\n __argnames__ : {value: ["node", "output", "complex", "function_preamble", "before", "after"]},\n __module__ : {value: "output.statements"}\n });\n\n function print_with(self, output) {\n var exits, clause_name, clause;\n exits = [];\n [output.assign("ρσ_with_exception"), output.print("undefined"), output.end_statement()];\n var ρσ_Iter77 = ρσ_Iterable(self.clauses);\n for (var ρσ_Index77 = 0; ρσ_Index77 < ρσ_Iter77.length; ρσ_Index77++) {\n clause = ρσ_Iter77[ρσ_Index77];\n output.with_counter += 1;\n clause_name = "ρσ_with_clause_" + output.with_counter;\n exits.push(clause_name);\n [output.indent(), output.print("var "), output.assign(clause_name)];\n clause.expression.print(output);\n output.end_statement();\n output.indent();\n if (clause.alias) {\n output.assign(clause.alias.name);\n }\n output.print(clause_name + ".__enter__()");\n output.end_statement();\n }\n [output.indent(), output.print("try"), output.space()];\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n output.indent();\n self._do_print_body(output);\n output.newline();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.statements"}\n });\n return ρσ_anonfunc;\n })());\n [output.space(), output.print("catch(e)")];\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n [output.indent(), output.assign("ρσ_with_exception"), output.print("e"), output.end_statement()];\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.statements"}\n });\n return ρσ_anonfunc;\n })());\n [output.newline(), output.indent(), output.spaced("if", "(ρσ_with_exception", "===", "undefined)")];\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n var clause;\n var ρσ_Iter78 = ρσ_Iterable(exits);\n for (var ρσ_Index78 = 0; ρσ_Index78 < ρσ_Iter78.length; ρσ_Index78++) {\n clause = ρσ_Iter78[ρσ_Index78];\n [output.indent(), output.print(clause + ".__exit__()"), output.end_statement()];\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.statements"}\n });\n return ρσ_anonfunc;\n })());\n [output.space(), output.print("else"), output.space()];\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n var clause;\n [output.indent(), output.assign("ρσ_with_suppress"), output.print("false"), output.end_statement()];\n var ρσ_Iter79 = ρσ_Iterable(exits);\n for (var ρσ_Index79 = 0; ρσ_Index79 < ρσ_Iter79.length; ρσ_Index79++) {\n clause = ρσ_Iter79[ρσ_Index79];\n output.indent();\n output.spaced("ρσ_with_suppress", "|=", "ρσ_bool(" + clause + ".__exit__(ρσ_with_exception.constructor,", "ρσ_with_exception,", "ρσ_with_exception.stack))");\n output.end_statement();\n }\n [output.indent(), output.spaced("if", "(!ρσ_with_suppress)", "throw ρσ_with_exception"), \n output.end_statement()];\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.statements"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!print_with.__argnames__) Object.defineProperties(print_with, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.statements"}\n });\n\n function print_assert(self, output) {\n if (output.options.discard_asserts) {\n return;\n }\n [output.spaced("if", "(!("), self.condition.print(output), output.spaced("))", "throw new AssertionError")];\n if (self.message) {\n output.print("(");\n self.message.print(output);\n output.print(")");\n }\n output.end_statement();\n };\n if (!print_assert.__argnames__) Object.defineProperties(print_assert, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.statements"}\n });\n\n ρσ_modules["output.statements"].force_statement = force_statement;\n ρσ_modules["output.statements"].first_in_statement = first_in_statement;\n ρσ_modules["output.statements"].declare_vars = declare_vars;\n ρσ_modules["output.statements"].display_body = display_body;\n ρσ_modules["output.statements"].display_complex_body = display_complex_body;\n ρσ_modules["output.statements"].print_bracketed = print_bracketed;\n ρσ_modules["output.statements"].print_with = print_with;\n ρσ_modules["output.statements"].print_assert = print_assert;\n })();\n\n (function(){\n var __name__ = "output.exceptions";\n var print_bracketed = ρσ_modules["output.statements"].print_bracketed;\n\n function print_try(self, output) {\n var else_var_name;\n else_var_name = null;\n function update_output_var(output) {\n [output.indent(), output.assign(else_var_name), output.print("true"), output.end_statement()];\n };\n if (!update_output_var.__argnames__) Object.defineProperties(update_output_var, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.exceptions"}\n });\n\n if (self.belse) {\n else_var_name = output.new_try_else_counter();\n [output.assign("var " + else_var_name), output.print("false"), output.end_statement(), \n output.indent()];\n }\n output.print("try");\n output.space();\n print_bracketed(self, output, false, null, null, (else_var_name) ? update_output_var : null);\n if (self.bcatch) {\n output.space();\n print_catch(self.bcatch, output);\n }\n if (self.bfinally) {\n output.space();\n print_finally(self.bfinally, output, self.belse, else_var_name);\n } else if (self.belse) {\n output.newline();\n print_else(self.belse, else_var_name, output);\n }\n };\n if (!print_try.__argnames__) Object.defineProperties(print_try, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.exceptions"}\n });\n\n function print_catch(self, output) {\n output.print("catch");\n output.space();\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n output.print("ρσ_Exception");\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.exceptions"}\n });\n return ρσ_anonfunc;\n })());\n output.space();\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n var no_default, ρσ_unpack, i, exception;\n output.indent();\n [output.spaced("ρσ_last_exception", "=", "ρσ_Exception"), output.end_statement()];\n output.indent();\n no_default = true;\n var ρσ_Iter80 = ρσ_Iterable(enumerate(self.body));\n for (var ρσ_Index80 = 0; ρσ_Index80 < ρσ_Iter80.length; ρσ_Index80++) {\n ρσ_unpack = ρσ_Iter80[ρσ_Index80];\n i = ρσ_unpack[0];\n exception = ρσ_unpack[1];\n if (i) {\n output.print("else ");\n }\n if (exception.errors.length) {\n output.print("if");\n output.space();\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n var ρσ_unpack, i, err;\n var ρσ_Iter81 = ρσ_Iterable(enumerate(exception.errors));\n for (var ρσ_Index81 = 0; ρσ_Index81 < ρσ_Iter81.length; ρσ_Index81++) {\n ρσ_unpack = ρσ_Iter81[ρσ_Index81];\n i = ρσ_unpack[0];\n err = ρσ_unpack[1];\n if (i) {\n output.newline();\n output.indent();\n output.print("||");\n output.space();\n }\n output.print("ρσ_Exception");\n output.space();\n output.print("instanceof");\n output.space();\n if (err.name === "Exception") {\n output.print("Error");\n } else {\n err.print(output);\n }\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.exceptions"}\n });\n return ρσ_anonfunc;\n })());\n output.space();\n } else {\n no_default = false;\n }\n print_bracketed(exception, output, true);\n output.space();\n }\n if (no_default) {\n output.print("else");\n output.space();\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n output.indent();\n output.print("throw");\n output.space();\n output.print("ρσ_Exception");\n output.semicolon();\n output.newline();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.exceptions"}\n });\n return ρσ_anonfunc;\n })());\n }\n output.newline();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.exceptions"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!print_catch.__argnames__) Object.defineProperties(print_catch, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.exceptions"}\n });\n\n function print_finally(self, output, belse, else_var_name) {\n output.print("finally");\n output.space();\n if (else_var_name) {\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n [output.indent(), output.print("try")];\n output.space();\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n print_else(belse, else_var_name, output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.exceptions"}\n });\n return ρσ_anonfunc;\n })());\n print_finally(self, output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.exceptions"}\n });\n return ρσ_anonfunc;\n })());\n } else {\n print_bracketed(self, output);\n }\n };\n if (!print_finally.__argnames__) Object.defineProperties(print_finally, {\n __argnames__ : {value: ["self", "output", "belse", "else_var_name"]},\n __module__ : {value: "output.exceptions"}\n });\n\n function print_else(self, else_var_name, output) {\n [output.indent(), output.spaced("if", "(" + else_var_name + ")")];\n output.space();\n print_bracketed(self, output);\n };\n if (!print_else.__argnames__) Object.defineProperties(print_else, {\n __argnames__ : {value: ["self", "else_var_name", "output"]},\n __module__ : {value: "output.exceptions"}\n });\n\n ρσ_modules["output.exceptions"].print_try = print_try;\n ρσ_modules["output.exceptions"].print_catch = print_catch;\n ρσ_modules["output.exceptions"].print_finally = print_finally;\n ρσ_modules["output.exceptions"].print_else = print_else;\n })();\n\n (function(){\n var __name__ = "output.utils";\n var AST_BlockStatement = ρσ_modules.ast.AST_BlockStatement;\n var is_node_type = ρσ_modules.ast.is_node_type;\n\n function best_of(a) {\n var best, len_, i;\n best = a[0];\n len_ = best.length;\n for (var ρσ_Index82 = 1; ρσ_Index82 < a.length; ρσ_Index82++) {\n i = ρσ_Index82;\n if (a[(typeof i === "number" && i < 0) ? a.length + i : i].length < len_) {\n best = a[(typeof i === "number" && i < 0) ? a.length + i : i];\n len_ = best.length;\n }\n }\n return best;\n };\n if (!best_of.__argnames__) Object.defineProperties(best_of, {\n __argnames__ : {value: ["a"]},\n __module__ : {value: "output.utils"}\n });\n\n function make_num(num) {\n var str_, a, m;\n str_ = num.toString(10);\n a = ρσ_list_decorate([ str_.replace(/^0\\./, ".").replace("e+", "e") ]);\n m = null;\n if (Math.floor(num) === num) {\n if (num >= 0) {\n a.push("0x" + num.toString(16).toLowerCase(), "0" + num.toString(8));\n } else {\n a.push("-0x" + (-(num)).toString(16).toLowerCase(), "-0" + (-(num)).toString(8));\n }\n if (m = /^(.*?)(0+)$/.exec(num)) {\n a.push(m[1] + "e" + m[2].length);\n }\n } else if (m = /^0?\\.(0+)(.*)$/.exec(num)) {\n a.push(m[2] + "e-" + (m[1].length + m[2].length), str_.substr(str_.indexOf(".")));\n }\n return best_of(a);\n };\n if (!make_num.__argnames__) Object.defineProperties(make_num, {\n __argnames__ : {value: ["num"]},\n __module__ : {value: "output.utils"}\n });\n\n function make_block(stmt, output) {\n if (is_node_type(stmt, AST_BlockStatement)) {\n stmt.print(output);\n return;\n }\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n output.indent();\n stmt.print(output);\n output.newline();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.utils"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!make_block.__argnames__) Object.defineProperties(make_block, {\n __argnames__ : {value: ["stmt", "output"]},\n __module__ : {value: "output.utils"}\n });\n\n function create_doctring(docstrings) {\n var ans, ds, lines, min_leading_whitespace, r, leading_whitespace, line, lw, ρσ_unpack, l;\n ans = [];\n var ρσ_Iter83 = ρσ_Iterable(docstrings);\n for (var ρσ_Index83 = 0; ρσ_Index83 < ρσ_Iter83.length; ρσ_Index83++) {\n ds = ρσ_Iter83[ρσ_Index83];\n ds = str.rstrip(ds.value);\n lines = [];\n min_leading_whitespace = "";\n var ρσ_Iter84 = ρσ_Iterable(ds.split(/$/gm));\n for (var ρσ_Index84 = 0; ρσ_Index84 < ρσ_Iter84.length; ρσ_Index84++) {\n line = ρσ_Iter84[ρσ_Index84];\n r = /^\\s+/.exec(line);\n leading_whitespace = "";\n if (r) {\n leading_whitespace = (r) ? r[0].replace(/[\\n\\r]/g, "") : "";\n line = line.slice(r[0].length);\n }\n if (!str.strip(line)) {\n lines.push(["", ""]);\n } else {\n leading_whitespace = leading_whitespace.replace(/\\t/g, " ");\n if (leading_whitespace && (!min_leading_whitespace || leading_whitespace.length < min_leading_whitespace.length)) {\n min_leading_whitespace = leading_whitespace;\n }\n lines.push([leading_whitespace, line]);\n }\n }\n var ρσ_Iter85 = ρσ_Iterable(lines);\n for (var ρσ_Index85 = 0; ρσ_Index85 < ρσ_Iter85.length; ρσ_Index85++) {\n ρσ_unpack = ρσ_Iter85[ρσ_Index85];\n lw = ρσ_unpack[0];\n l = ρσ_unpack[1];\n if (min_leading_whitespace) {\n lw = lw.slice(min_leading_whitespace.length);\n }\n ans.push(lw + l);\n }\n ans.push("");\n }\n return str.rstrip(ans.join("\\n"));\n };\n if (!create_doctring.__argnames__) Object.defineProperties(create_doctring, {\n __argnames__ : {value: ["docstrings"]},\n __module__ : {value: "output.utils"}\n });\n\n ρσ_modules["output.utils"].best_of = best_of;\n ρσ_modules["output.utils"].make_num = make_num;\n ρσ_modules["output.utils"].make_block = make_block;\n ρσ_modules["output.utils"].create_doctring = create_doctring;\n })();\n\n (function(){\n var __name__ = "output.loops";\n var AST_BaseCall = ρσ_modules.ast.AST_BaseCall;\n var AST_SymbolRef = ρσ_modules.ast.AST_SymbolRef;\n var AST_Array = ρσ_modules.ast.AST_Array;\n var AST_Unary = ρσ_modules.ast.AST_Unary;\n var AST_Number = ρσ_modules.ast.AST_Number;\n var has_calls = ρσ_modules.ast.has_calls;\n var AST_Seq = ρσ_modules.ast.AST_Seq;\n var AST_ListComprehension = ρσ_modules.ast.AST_ListComprehension;\n var is_node_type = ρσ_modules.ast.is_node_type;\n\n var OutputStream = ρσ_modules["output.stream"].OutputStream;\n\n function unpack_tuple(elems, output, in_statement) {\n var ρσ_unpack, i, elem;\n var ρσ_Iter86 = ρσ_Iterable(enumerate(elems));\n for (var ρσ_Index86 = 0; ρσ_Index86 < ρσ_Iter86.length; ρσ_Index86++) {\n ρσ_unpack = ρσ_Iter86[ρσ_Index86];\n i = ρσ_unpack[0];\n elem = ρσ_unpack[1];\n output.indent();\n output.assign(elem);\n output.print("ρσ_unpack");\n output.with_square((function() {\n var ρσ_anonfunc = function () {\n output.print(i);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n if (!in_statement || i < elems.length - 1) {\n output.semicolon();\n output.newline();\n }\n }\n };\n if (!unpack_tuple.__argnames__) Object.defineProperties(unpack_tuple, {\n __argnames__ : {value: ["elems", "output", "in_statement"]},\n __module__ : {value: "output.loops"}\n });\n\n function print_do_loop(self, output) {\n output.print("do");\n output.space();\n self._do_print_body(output);\n output.space();\n output.print("while");\n output.space();\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n self.condition.print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n output.semicolon();\n };\n if (!print_do_loop.__argnames__) Object.defineProperties(print_do_loop, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.loops"}\n });\n\n function print_while_loop(self, output) {\n output.print("while");\n output.space();\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n self.condition.print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n output.space();\n self._do_print_body(output);\n };\n if (!print_while_loop.__argnames__) Object.defineProperties(print_while_loop, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.loops"}\n });\n\n function is_simple_for_in(self) {\n if (is_node_type(self.object, AST_BaseCall) && is_node_type(self.object.expression, AST_SymbolRef) && self.object.expression.name === "dir" && self.object.args.length === 1) {\n return true;\n }\n return false;\n };\n if (!is_simple_for_in.__argnames__) Object.defineProperties(is_simple_for_in, {\n __argnames__ : {value: ["self"]},\n __module__ : {value: "output.loops"}\n });\n\n function is_simple_for(self) {\n var a, l;\n if (is_node_type(self.object, AST_BaseCall) && is_node_type(self.object.expression, AST_SymbolRef) && self.object.expression.name === "range" && !(is_node_type(self.init, AST_Array))) {\n a = self.object.args;\n l = a.length;\n if (l < 3 || is_node_type(a[2], AST_Number) || is_node_type(a[2], AST_Unary) && a[2].operator === "-" && is_node_type(a[2].expression, AST_Number)) {\n if (l === 1 && !has_calls(a[0]) || l > 1 && !has_calls(a[1])) {\n return true;\n }\n }\n }\n return false;\n };\n if (!is_simple_for.__argnames__) Object.defineProperties(is_simple_for, {\n __argnames__ : {value: ["self"]},\n __module__ : {value: "output.loops"}\n });\n\n function print_for_loop_body(output) {\n var self;\n self = this;\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n var itervar, flat, stmt;\n if (!((self.simple_for_index || is_simple_for_in(self)))) {\n output.indent();\n if (output.options.js_version === 5) {\n itervar = "ρσ_Iter" + output.index_counter + "[ρσ_Index" + output.index_counter + "]";\n } else {\n itervar = "ρσ_Index" + output.index_counter;\n }\n if (is_node_type(self.init, AST_Array)) {\n flat = self.init.flatten();\n output.assign("ρσ_unpack");\n if (flat.length > self.init.elements.length) {\n output.print("ρσ_flatten(" + itervar + ")");\n } else {\n output.print(itervar);\n }\n output.end_statement();\n unpack_tuple(flat, output);\n } else {\n output.assign(self.init);\n output.print(itervar);\n output.end_statement();\n }\n output.index_counter += 1;\n }\n if (self.simple_for_index) {\n output.indent();\n output.assign(self.init);\n output.print(self.simple_for_index);\n output.end_statement();\n }\n var ρσ_Iter87 = ρσ_Iterable(self.body.body);\n for (var ρσ_Index87 = 0; ρσ_Index87 < ρσ_Iter87.length; ρσ_Index87++) {\n stmt = ρσ_Iter87[ρσ_Index87];\n output.indent();\n stmt.print(output);\n output.newline();\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!print_for_loop_body.__argnames__) Object.defineProperties(print_for_loop_body, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.loops"}\n });\n\n function init_es6_itervar(output, itervar) {\n output.indent();\n output.spaced(itervar, "=", "((typeof", itervar + "[Symbol.iterator]", "===", "\\"function\\")", "?", "(" + itervar, "instanceof", "Map", "?", itervar + ".keys()", ":", itervar + ")", ":", "Object.keys(" + itervar + "))");\n output.end_statement();\n };\n if (!init_es6_itervar.__argnames__) Object.defineProperties(init_es6_itervar, {\n __argnames__ : {value: ["output", "itervar"]},\n __module__ : {value: "output.loops"}\n });\n\n function print_for_in(self, output) {\n var increment, args, tmp_, start, end, idx, itervar;\n function write_object() {\n if (self.object.constructor === AST_Seq) {\n new AST_Array((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["elements"] = self.object.to_array();\n return ρσ_d;\n }).call(this)).print(output);\n } else {\n self.object.print(output);\n }\n };\n if (!write_object.__module__) Object.defineProperties(write_object, {\n __module__ : {value: "output.loops"}\n });\n\n if (is_simple_for(self)) {\n increment = null;\n args = self.object.args;\n tmp_ = args.length;\n if (tmp_ === 1) {\n start = 0;\n end = args[0];\n } else if (tmp_ === 2) {\n start = args[0];\n end = args[1];\n } else if (tmp_ === 3) {\n start = args[0];\n end = args[1];\n increment = args[2];\n }\n self.simple_for_index = idx = "ρσ_Index" + output.index_counter;\n output.index_counter += 1;\n output.print("for");\n output.space();\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n [output.spaced("var", idx, "="), output.space()];\n (start.print) ? start.print(output) : output.print(start);\n output.semicolon();\n output.space();\n output.print(idx);\n output.space();\n (is_node_type(increment, AST_Unary)) ? output.print(">") : output.print("<");\n output.space();\n end.print(output);\n output.semicolon();\n output.space();\n output.print(idx);\n if (increment && (!(is_node_type(increment, AST_Unary)) || increment.expression.value !== "1")) {\n if (is_node_type(increment, AST_Unary)) {\n output.print("-=");\n increment.expression.print(output);\n } else {\n output.print("+=");\n increment.print(output);\n }\n } else {\n if (is_node_type(increment, AST_Unary)) {\n output.print("--");\n } else {\n output.print("++");\n }\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n } else if (is_simple_for_in(self)) {\n output.print("for");\n output.space();\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n self.init.print(output);\n output.space();\n output.print("in");\n output.space();\n self.object.args[0].print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n } else {\n if (output.options.js_version === 5) {\n output.assign("var ρσ_Iter" + output.index_counter);\n output.print("ρσ_Iterable");\n output.with_parens(write_object);\n output.semicolon();\n output.newline();\n output.indent();\n output.print("for");\n output.space();\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n output.print("var");\n output.space();\n output.assign("ρσ_Index" + output.index_counter);\n output.print("0");\n output.semicolon();\n output.space();\n output.print("ρσ_Index" + output.index_counter);\n output.space();\n output.print("<");\n output.space();\n output.print("ρσ_Iter" + output.index_counter + ".length");\n output.semicolon();\n output.space();\n output.print("ρσ_Index" + output.index_counter + "++");\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n } else {\n itervar = "ρσ_Iter" + output.index_counter;\n output.assign("var " + itervar);\n write_object();\n output.end_statement();\n init_es6_itervar(output, itervar);\n output.indent();\n output.spaced("for", "(var", "ρσ_Index" + output.index_counter, "of", itervar + ")");\n }\n }\n output.space();\n self._do_print_body(output);\n };\n if (!print_for_in.__argnames__) Object.defineProperties(print_for_in, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.loops"}\n });\n\n function print_list_comprehension(self, output) {\n var tname, result_obj, is_generator, es5, add_to_result, push_func;\n tname = self.constructor.name.slice(4);\n result_obj = (ρσ_expr_temp = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["ListComprehension"] = "[]";\n ρσ_d["DictComprehension"] = (self.is_jshash) ? "Object.create(null)" : "{}";\n ρσ_d["SetComprehension"] = "ρσ_set()";\n return ρσ_d;\n }).call(this))[(typeof tname === "number" && tname < 0) ? ρσ_expr_temp.length + tname : tname];\n is_generator = tname === "GeneratorComprehension";\n es5 = output.options.js_version === 5;\n if (tname === "DictComprehension") {\n if (self.is_pydict) {\n result_obj = "ρσ_dict()";\n add_to_result = (function() {\n var ρσ_anonfunc = function (output) {\n output.indent();\n output.print("ρσ_Result.set");\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n self.statement.print(output);\n [output.space(), output.print(","), output.space()];\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n if (self.value_statement.constructor === AST_Seq) {\n output.with_square((function() {\n var ρσ_anonfunc = function () {\n self.value_statement.print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n } else {\n self.value_statement.print(output);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n output.end_statement();\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })();\n } else {\n add_to_result = (function() {\n var ρσ_anonfunc = function (output) {\n output.indent();\n output.print("ρσ_Result");\n output.with_square((function() {\n var ρσ_anonfunc = function () {\n self.statement.print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n [output.space(), output.print("="), output.space()];\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n if (self.value_statement.constructor === AST_Seq) {\n output.with_square((function() {\n var ρσ_anonfunc = function () {\n self.value_statement.print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n } else {\n self.value_statement.print(output);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n output.end_statement();\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })();\n }\n } else {\n push_func = "ρσ_Result." + ((self.constructor === AST_ListComprehension) ? "push" : "add");\n if (is_generator) {\n push_func = "yield ";\n }\n add_to_result = (function() {\n var ρσ_anonfunc = function (output) {\n output.indent();\n output.print(push_func);\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n if (self.statement.constructor === AST_Seq) {\n output.with_square((function() {\n var ρσ_anonfunc = function () {\n self.statement.print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n } else {\n self.statement.print(output);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n output.end_statement();\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })();\n }\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n output.print("function");\n output.print("()");\n output.space();\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n var body_out, previous_indentation, i, transpiled, ci;\n body_out = output;\n if (is_generator) {\n if (es5) {\n body_out = new OutputStream((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["beautify"] = true;\n return ρσ_d;\n }).call(this));\n }\n body_out.indent();\n [body_out.print("function* js_generator()"), body_out.space(), body_out.print("{")];\n body_out.newline();\n previous_indentation = output.indentation();\n output.set_indentation(output.next_indent());\n }\n body_out.indent();\n body_out.assign("var ρσ_Iter");\n if (es5) {\n body_out.print("ρσ_Iterable");\n body_out.with_parens((function() {\n var ρσ_anonfunc = function () {\n self.object.print(body_out);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n } else {\n self.object.print(body_out);\n }\n if (result_obj) {\n body_out.comma();\n body_out.assign("ρσ_Result");\n body_out.print(result_obj);\n }\n if (is_node_type(self.init, AST_Array)) {\n var ρσ_Iter88 = ρσ_Iterable(self.init.elements);\n for (var ρσ_Index88 = 0; ρσ_Index88 < ρσ_Iter88.length; ρσ_Index88++) {\n i = ρσ_Iter88[ρσ_Index88];\n body_out.comma();\n i.print(body_out);\n }\n } else {\n body_out.comma();\n self.init.print(body_out);\n }\n body_out.end_statement();\n if (!es5) {\n init_es6_itervar(body_out, "ρσ_Iter");\n }\n body_out.indent();\n body_out.print("for");\n body_out.space();\n body_out.with_parens((function() {\n var ρσ_anonfunc = function () {\n if (es5) {\n body_out.print("var");\n body_out.space();\n body_out.assign("ρσ_Index");\n body_out.print("0");\n body_out.semicolon();\n body_out.space();\n body_out.print("ρσ_Index");\n body_out.space();\n body_out.print("<");\n body_out.space();\n body_out.print("ρσ_Iter.length");\n body_out.semicolon();\n body_out.space();\n body_out.print("ρσ_Index++");\n } else {\n body_out.spaced("var", "ρσ_Index", "of", "ρσ_Iter");\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n body_out.space();\n body_out.with_block((function() {\n var ρσ_anonfunc = function () {\n var itervar, flat;\n body_out.indent();\n itervar = (es5) ? "ρσ_Iter[ρσ_Index]" : "ρσ_Index";\n if (is_node_type(self.init, AST_Array)) {\n flat = self.init.flatten();\n body_out.assign("ρσ_unpack");\n if (flat.length > self.init.elements.length) {\n body_out.print("ρσ_flatten(" + itervar + ")");\n } else {\n body_out.print(itervar);\n }\n body_out.end_statement();\n unpack_tuple(flat, body_out);\n } else {\n body_out.assign(self.init);\n body_out.print(itervar);\n body_out.end_statement();\n }\n if (self.condition) {\n body_out.indent();\n body_out.print("if");\n body_out.space();\n body_out.with_parens((function() {\n var ρσ_anonfunc = function () {\n self.condition.print(body_out);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n body_out.space();\n body_out.with_block((function() {\n var ρσ_anonfunc = function () {\n add_to_result(body_out);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n body_out.newline();\n } else {\n add_to_result(body_out);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n body_out.newline();\n if (self.constructor === AST_ListComprehension) {\n body_out.indent();\n body_out.spaced("ρσ_Result", "=", "ρσ_list_constructor(ρσ_Result)");\n body_out.end_statement();\n }\n if (!is_generator) {\n body_out.indent();\n body_out.print("return ρσ_Result");\n body_out.end_statement();\n }\n if (is_generator) {\n output.set_indentation(previous_indentation);\n [body_out.newline(), body_out.indent(), body_out.print("}")];\n if (es5) {\n transpiled = regenerate(body_out.get(), output.options.beautify).replace(/regeneratorRuntime.(wrap|mark)/g, "ρσ_regenerator.regeneratorRuntime.$1");\n if (output.options.beautify) {\n ci = output.make_indent(0);\n transpiled = (function() {\n var ρσ_Iter = ρσ_Iterable(transpiled.split("\\n")), ρσ_Result = [], x;\n for (var ρσ_Index = 0; ρσ_Index < ρσ_Iter.length; ρσ_Index++) {\n x = ρσ_Iter[ρσ_Index];\n ρσ_Result.push(ci + x);\n }\n ρσ_Result = ρσ_list_constructor(ρσ_Result);\n return ρσ_Result;\n })().join("\\n");\n }\n output.print(transpiled);\n }\n [output.newline(), output.indent()];\n output.spaced("var", "result", "=", "js_generator.call(this)");\n output.end_statement();\n output.indent();\n output.spaced("result.send", "=", "result.next");\n output.end_statement();\n output.indent();\n output.spaced("return", "result");\n output.end_statement();\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.loops"}\n });\n return ρσ_anonfunc;\n })());\n output.print("()");\n };\n if (!print_list_comprehension.__argnames__) Object.defineProperties(print_list_comprehension, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.loops"}\n });\n\n ρσ_modules["output.loops"].unpack_tuple = unpack_tuple;\n ρσ_modules["output.loops"].print_do_loop = print_do_loop;\n ρσ_modules["output.loops"].print_while_loop = print_while_loop;\n ρσ_modules["output.loops"].is_simple_for_in = is_simple_for_in;\n ρσ_modules["output.loops"].is_simple_for = is_simple_for;\n ρσ_modules["output.loops"].print_for_loop_body = print_for_loop_body;\n ρσ_modules["output.loops"].init_es6_itervar = init_es6_itervar;\n ρσ_modules["output.loops"].print_for_in = print_for_in;\n ρσ_modules["output.loops"].print_list_comprehension = print_list_comprehension;\n })();\n\n (function(){\n var __name__ = "output.operators";\n var comparators, function_ops, after_map;\n var AST_Array = ρσ_modules.ast.AST_Array;\n var AST_Assign = ρσ_modules.ast.AST_Assign;\n var AST_BaseCall = ρσ_modules.ast.AST_BaseCall;\n var AST_Binary = ρσ_modules.ast.AST_Binary;\n var AST_Conditional = ρσ_modules.ast.AST_Conditional;\n var AST_ItemAccess = ρσ_modules.ast.AST_ItemAccess;\n var AST_Number = ρσ_modules.ast.AST_Number;\n var AST_Object = ρσ_modules.ast.AST_Object;\n var AST_Return = ρσ_modules.ast.AST_Return;\n var AST_Seq = ρσ_modules.ast.AST_Seq;\n var AST_Set = ρσ_modules.ast.AST_Set;\n var AST_SimpleStatement = ρσ_modules.ast.AST_SimpleStatement;\n var AST_Statement = ρσ_modules.ast.AST_Statement;\n var AST_String = ρσ_modules.ast.AST_String;\n var AST_Sub = ρσ_modules.ast.AST_Sub;\n var AST_Symbol = ρσ_modules.ast.AST_Symbol;\n var AST_SymbolRef = ρσ_modules.ast.AST_SymbolRef;\n var AST_Unary = ρσ_modules.ast.AST_Unary;\n var is_node_type = ρσ_modules.ast.is_node_type;\n\n var unpack_tuple = ρσ_modules["output.loops"].unpack_tuple;\n\n function print_getattr(self, output, skip_expression) {\n var expr;\n if (!skip_expression) {\n expr = self.expression;\n expr.print(output);\n }\n if (is_node_type(expr, AST_Number) && expr.value >= 0) {\n if (!/[xa-f.]/i.test(output.last())) {\n output.print(".");\n }\n }\n output.print(".");\n output.print_name(self.property);\n };\n if (!print_getattr.__argnames__) Object.defineProperties(print_getattr, {\n __argnames__ : {value: ["self", "output", "skip_expression"]},\n __module__ : {value: "output.operators"}\n });\n\n function print_getitem(self, output) {\n var expr, prop, is_negative_number, is_repeatable;\n expr = self.expression;\n prop = self.property;\n if (is_node_type(prop, AST_Number) || is_node_type(prop, AST_String) || is_node_type(prop, AST_SymbolRef) && prop.name && prop.name.startsWith("ρσ_")) {\n expr.print(output);\n [output.print("["), prop.print(output), output.print("]")];\n return;\n }\n is_negative_number = is_node_type(prop, AST_Unary) && prop.operator === "-" && is_node_type(prop.expression, AST_Number);\n is_repeatable = is_node_type(expr, AST_SymbolRef);\n if (is_repeatable) {\n expr.print(output);\n } else {\n [output.spaced("(ρσ_expr_temp", "=", expr), output.print(")")];\n expr = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["print"] = (function() {\n var ρσ_anonfunc = function () {\n output.print("ρσ_expr_temp");\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.operators"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this);\n }\n if (is_negative_number) {\n [output.print("["), expr.print(output), output.print(".length"), prop.print(output), \n output.print("]")];\n return;\n }\n is_repeatable = is_node_type(prop, AST_SymbolRef);\n if (is_repeatable) {\n output.spaced("[(typeof", prop, "===", "\\"number\\"", "&&", prop);\n [output.spaced("", "<", "0)", "?", expr), output.spaced(".length", "+", prop, ":", prop)];\n output.print("]");\n } else {\n [output.print("[ρσ_bound_index("), prop.print(output), output.comma(), expr.print(output), \n output.print(")]")];\n }\n };\n if (!print_getitem.__argnames__) Object.defineProperties(print_getitem, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.operators"}\n });\n\n function print_rich_getitem(self, output) {\n var func, asg, as_op;\n func = "ρσ_" + ((self.assignment) ? "setitem" : "getitem");\n output.print(func + "(");\n [self.expression.print(output), output.comma(), self.property.print(output)];\n if (self.assignment) {\n output.comma();\n asg = self.assignment;\n as_op = self.assign_operator;\n if (as_op.length > 0) {\n self.assignment = null;\n print_rich_getitem(self, output);\n self.assignment = asg;\n output.space();\n output.print(as_op);\n output.space();\n }\n self.assignment.print(output);\n }\n output.print(")");\n };\n if (!print_rich_getitem.__argnames__) Object.defineProperties(print_rich_getitem, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.operators"}\n });\n\n function print_splice_assignment(self, output) {\n output.print("ρσ_splice(");\n [self.expression.print(output), output.comma(), self.assignment.print(output), output.comma()];\n (self.property) ? self.property.print(output) : output.print("0");\n if (self.property2) {\n output.comma();\n self.property2.print(output);\n }\n output.print(")");\n };\n if (!print_splice_assignment.__argnames__) Object.defineProperties(print_splice_assignment, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.operators"}\n });\n\n function print_delete(self, output) {\n if (is_node_type(self, AST_Symbol)) {\n [output.assign(self), output.print("undefined")];\n } else if (is_node_type(self, AST_Sub) || is_node_type(self, AST_ItemAccess)) {\n [output.print("ρσ_delitem("), self.expression.print(output), output.comma(), self.property.print(output), \n output.print(")")];\n } else {\n output.spaced("delete", self);\n }\n };\n if (!print_delete.__argnames__) Object.defineProperties(print_delete, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.operators"}\n });\n\n function print_unary_prefix(self, output) {\n var op;\n op = self.operator;\n if (op === "delete") {\n return print_delete(self.expression, output);\n }\n output.print(op);\n if (/^[a-z]/i.test(op)) {\n output.space();\n }\n if (self.parenthesized) {\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n self.expression.print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.operators"}\n });\n return ρσ_anonfunc;\n })());\n } else {\n self.expression.print(output);\n }\n };\n if (!print_unary_prefix.__argnames__) Object.defineProperties(print_unary_prefix, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.operators"}\n });\n\n function write_instanceof(left, right, output) {\n function do_many(vals) {\n [output.print("ρσ_instanceof.apply(null,"), output.space()];\n [output.print("["), left.print(output), output.comma()];\n for (var i = 0; i < vals.length; i++) {\n vals[(typeof i === "number" && i < 0) ? vals.length + i : i].print(output);\n if (i !== vals.length - 1) {\n output.comma();\n }\n }\n output.print("])");\n };\n if (!do_many.__argnames__) Object.defineProperties(do_many, {\n __argnames__ : {value: ["vals"]},\n __module__ : {value: "output.operators"}\n });\n\n if (is_node_type(right, AST_Seq)) {\n do_many(right.to_array());\n } else if (is_node_type(right, AST_Array)) {\n do_many(right.elements);\n } else {\n output.print("ρσ_instanceof(");\n [left.print(output), output.comma(), right.print(output), output.print(")")];\n }\n };\n if (!write_instanceof.__argnames__) Object.defineProperties(write_instanceof, {\n __argnames__ : {value: ["left", "right", "output"]},\n __module__ : {value: "output.operators"}\n });\n\n function write_smart_equality(self, output) {\n function is_ok(x) {\n return !((is_node_type(x, AST_Array) || is_node_type(x, AST_Set) || is_node_type(x, AST_Object) || is_node_type(x, AST_Statement) || is_node_type(x, AST_Binary) || is_node_type(x, AST_Conditional) || is_node_type(x, AST_BaseCall)));\n };\n if (!is_ok.__argnames__) Object.defineProperties(is_ok, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "output.operators"}\n });\n\n if (is_ok(self.left) && is_ok(self.right)) {\n if (self.operator === "==") {\n output.print("(");\n output.spaced(self.left, "===", self.right, "||", "typeof", self.left, "===", "\\"object\\"", "&&", "ρσ_equals(");\n [self.left.print(output), output.print(","), output.space(), self.right.print(output), \n output.print("))")];\n } else {\n output.print("(");\n output.spaced(self.left, "!==", self.right, "&&", "(typeof", self.left, "!==", "\\"object\\"", "||", "ρσ_not_equals(");\n [self.left.print(output), output.print(","), output.space(), self.right.print(output), \n output.print(")))")];\n }\n } else {\n output.print("ρσ_" + ((self.operator === "==") ? "equals(" : "not_equals("));\n [self.left.print(output), output.print(","), output.space(), self.right.print(output), \n output.print(")")];\n }\n };\n if (!write_smart_equality.__argnames__) Object.defineProperties(write_smart_equality, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.operators"}\n });\n\n comparators = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["<"] = true;\n ρσ_d[">"] = true;\n ρσ_d["<="] = true;\n ρσ_d[">="] = true;\n return ρσ_d;\n }).call(this);\n function_ops = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["in"] = "ρσ_in";\n ρσ_d["nin"] = "!ρσ_in";\n return ρσ_d;\n }).call(this);\n function print_binary_op(self, output) {\n var leftvar, left, nan_check;\n if (function_ops[ρσ_bound_index(self.operator, function_ops)]) {\n output.print(function_ops[ρσ_bound_index(self.operator, function_ops)]);\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n self.left.print(output);\n output.comma();\n self.right.print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.operators"}\n });\n return ρσ_anonfunc;\n })());\n } else if (comparators[ρσ_bound_index(self.operator, comparators)] && is_node_type(self.left, AST_Binary) && comparators[ρσ_bound_index(self.left.operator, comparators)]) {\n if (is_node_type(self.left.right, AST_Symbol)) {\n self.left.print(output);\n leftvar = self.left.right.name;\n } else {\n self.left.left.print(output);\n output.space();\n output.print(self.left.operator);\n output.space();\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n output.assign("ρσ_cond_temp");\n self.left.right.print(output);\n leftvar = "ρσ_cond_temp";\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.operators"}\n });\n return ρσ_anonfunc;\n })());\n }\n output.space();\n output.print("&&");\n output.space();\n output.print(leftvar);\n output.space();\n output.print(self.operator);\n output.space();\n self.right.print(output);\n } else if (self.operator === "//") {\n output.print("Math.floor");\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n self.left.print(output);\n output.space();\n output.print("/");\n output.space();\n self.right.print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.operators"}\n });\n return ρσ_anonfunc;\n })());\n } else if (self.operator === "**") {\n left = self.left;\n if (is_node_type(self.left, AST_Unary) && !self.left.parenthesized) {\n left = self.left.expression;\n output.print(self.left.operator);\n }\n if (output.options.js_version > 6) {\n [output.print("(("), left.print(output), output.spaced(")", "**", "("), self.right.print(output), \n output.print("))")];\n } else {\n [output.print("Math.pow("), left.print(output), output.comma(), self.right.print(output), \n output.print(")")];\n }\n } else if (self.operator === "==" || self.operator === "!=") {\n write_smart_equality(self, output);\n } else if (self.operator === "instanceof") {\n write_instanceof(self.left, self.right, output);\n } else if (self.operator === "*" && is_node_type(self.left, AST_String)) {\n [self.left.print(output), output.print(".repeat("), self.right.print(output), output.print(")")];\n } else if (self.operator === "===" || self.operator === "!==") {\n nan_check = null;\n if (is_node_type(self.right, AST_Symbol) && self.right.name === "NaN") {\n nan_check = self.left;\n }\n if (is_node_type(self.left, AST_Symbol) && self.left.name === "NaN") {\n nan_check = self.right;\n }\n if (nan_check !== null) {\n output.spaced(nan_check, (self.operator === "===") ? "!==" : "===", nan_check);\n } else {\n output.spaced(self.left, self.operator, self.right);\n }\n } else {\n output.spaced(self.left, self.operator, self.right);\n }\n };\n if (!print_binary_op.__argnames__) Object.defineProperties(print_binary_op, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.operators"}\n });\n\n after_map = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["."] = "d";\n ρσ_d["("] = "c";\n ρσ_d["["] = "d";\n ρσ_d["g"] = "g";\n ρσ_d["null"] = "n";\n return ρσ_d;\n }).call(this);\n function print_existential(self, output) {\n var key, after;\n key = (self.after === null || typeof self.after === "string") ? after_map[ρσ_bound_index(self.after, after_map)] : "e";\n if (is_node_type(self.expression, AST_SymbolRef)) {\n if (key === "n") {\n output.spaced("(typeof", self.expression, "!==", "\\"undefined\\"", "&&", self.expression, "!==", "null)");\n return;\n }\n if (key === "c") {\n output.spaced("(typeof", self.expression, "===", "\\"function\\"", "?", self.expression, ":", "(function(){return undefined;}))");\n return;\n }\n after = self.after;\n if (key === "d") {\n after = "Object.create(null)";\n } else if (key === "g") {\n after = "{__getitem__:function(){return undefined;}}";\n }\n output.spaced("(typeof", self.expression, "!==", "\\"undefined\\"", "&&", self.expression, "!==", "null", "?", self.expression, ":", after);\n output.print(")");\n return;\n }\n output.print("ρσ_exists." + key + "(");\n self.expression.print(output);\n if (key === "e") {\n [output.comma(), self.after.print(output)];\n }\n output.print(")");\n };\n if (!print_existential.__argnames__) Object.defineProperties(print_existential, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.operators"}\n });\n\n function print_assignment(self, output) {\n var flattened, left, flat;\n flattened = false;\n left = self.left;\n if (is_node_type(left, AST_Seq)) {\n left = new AST_Array((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["elements"] = [left.car, left.cdr];\n return ρσ_d;\n }).call(this));\n }\n if (is_node_type(left, AST_Array)) {\n flat = left.flatten();\n flattened = flat.length > left.elements.length;\n output.print("ρσ_unpack");\n } else {\n left.print(output);\n }\n output.space();\n output.print(self.operator);\n output.space();\n if (flattened) {\n output.print("ρσ_flatten");\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n self.right.print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.operators"}\n });\n return ρσ_anonfunc;\n })());\n } else {\n self.right.print(output);\n }\n if (is_node_type(left, AST_Array)) {\n output.end_statement();\n if (!is_node_type(self.right, AST_Seq) && !is_node_type(self.right, AST_Array)) {\n output.assign("ρσ_unpack");\n [output.print("ρσ_unpack_asarray(" + flat.length), output.comma(), output.print("ρσ_unpack)")];\n output.end_statement();\n }\n unpack_tuple(flat, output, true);\n }\n };\n if (!print_assignment.__argnames__) Object.defineProperties(print_assignment, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.operators"}\n });\n\n function print_assign(self, output) {\n var ρσ_unpack, left_hand_sides, rhs, is_compound_assign, lhs, temp_rhs;\n if (self.operator === "//=") {\n output.assign(self.left);\n output.print("Math.floor");\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n self.left.print(output);\n output.space();\n output.print("/");\n output.space();\n self.right.print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.operators"}\n });\n return ρσ_anonfunc;\n })());\n return;\n }\n if (self.operator === "=" && self.is_chained()) {\n ρσ_unpack = self.traverse_chain();\nρσ_unpack = ρσ_unpack_asarray(2, ρσ_unpack);\n left_hand_sides = ρσ_unpack[0];\n rhs = ρσ_unpack[1];\n is_compound_assign = false;\n var ρσ_Iter89 = ρσ_Iterable(left_hand_sides);\n for (var ρσ_Index89 = 0; ρσ_Index89 < ρσ_Iter89.length; ρσ_Index89++) {\n lhs = ρσ_Iter89[ρσ_Index89];\n if (is_node_type(lhs, AST_Seq) || is_node_type(lhs, AST_Array) || is_node_type(lhs, AST_ItemAccess)) {\n is_compound_assign = true;\n break;\n }\n }\n if (is_compound_assign) {\n temp_rhs = new AST_SymbolRef((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = "ρσ_chain_assign_temp";\n return ρσ_d;\n }).call(this));\n print_assignment(new AST_Assign((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["left"] = temp_rhs;\n ρσ_d["operator"] = "=";\n ρσ_d["right"] = rhs;\n return ρσ_d;\n }).call(this)), output);\n var ρσ_Iter90 = ρσ_Iterable(left_hand_sides);\n for (var ρσ_Index90 = 0; ρσ_Index90 < ρσ_Iter90.length; ρσ_Index90++) {\n lhs = ρσ_Iter90[ρσ_Index90];\n [output.end_statement(), output.indent()];\n print_assignment(new AST_Assign((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["left"] = lhs;\n ρσ_d["right"] = temp_rhs;\n ρσ_d["operator"] = self.operator;\n return ρσ_d;\n }).call(this)), output);\n }\n } else {\n var ρσ_Iter91 = ρσ_Iterable(left_hand_sides);\n for (var ρσ_Index91 = 0; ρσ_Index91 < ρσ_Iter91.length; ρσ_Index91++) {\n lhs = ρσ_Iter91[ρσ_Index91];\n output.spaced(lhs, "=", "");\n }\n rhs.print(output);\n }\n } else {\n print_assignment(self, output);\n }\n };\n if (!print_assign.__argnames__) Object.defineProperties(print_assign, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.operators"}\n });\n\n function print_conditional(self, output, condition, consequent, alternative) {\n var ρσ_unpack;\n ρσ_unpack = [self.condition, self.consequent, self.alternative];\n condition = ρσ_unpack[0];\n consequent = ρσ_unpack[1];\n alternative = ρσ_unpack[2];\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n condition.print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.operators"}\n });\n return ρσ_anonfunc;\n })());\n output.space();\n output.print("?");\n output.space();\n consequent.print(output);\n output.space();\n output.colon();\n alternative.print(output);\n };\n if (!print_conditional.__argnames__) Object.defineProperties(print_conditional, {\n __argnames__ : {value: ["self", "output", "condition", "consequent", "alternative"]},\n __module__ : {value: "output.operators"}\n });\n\n function print_seq(output) {\n var self, p, print_seq;\n self = this;\n p = output.parent();\n print_seq = (function() {\n var ρσ_anonfunc = function () {\n self.car.print(output);\n if (self.cdr) {\n output.comma();\n if (output.should_break()) {\n output.newline();\n output.indent();\n }\n self.cdr.print(output);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.operators"}\n });\n return ρσ_anonfunc;\n })();\n if (is_node_type(p, AST_Binary) || is_node_type(p, AST_Return) || is_node_type(p, AST_Array) || is_node_type(p, AST_BaseCall) || is_node_type(p, AST_SimpleStatement)) {\n output.with_square(print_seq);\n } else {\n print_seq();\n }\n };\n if (!print_seq.__argnames__) Object.defineProperties(print_seq, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.operators"}\n });\n\n ρσ_modules["output.operators"].comparators = comparators;\n ρσ_modules["output.operators"].function_ops = function_ops;\n ρσ_modules["output.operators"].after_map = after_map;\n ρσ_modules["output.operators"].print_getattr = print_getattr;\n ρσ_modules["output.operators"].print_getitem = print_getitem;\n ρσ_modules["output.operators"].print_rich_getitem = print_rich_getitem;\n ρσ_modules["output.operators"].print_splice_assignment = print_splice_assignment;\n ρσ_modules["output.operators"].print_delete = print_delete;\n ρσ_modules["output.operators"].print_unary_prefix = print_unary_prefix;\n ρσ_modules["output.operators"].write_instanceof = write_instanceof;\n ρσ_modules["output.operators"].write_smart_equality = write_smart_equality;\n ρσ_modules["output.operators"].print_binary_op = print_binary_op;\n ρσ_modules["output.operators"].print_existential = print_existential;\n ρσ_modules["output.operators"].print_assignment = print_assignment;\n ρσ_modules["output.operators"].print_assign = print_assign;\n ρσ_modules["output.operators"].print_conditional = print_conditional;\n ρσ_modules["output.operators"].print_seq = print_seq;\n })();\n\n (function(){\n var __name__ = "output.functions";\n var anonfunc, module_name;\n var AST_ClassCall = ρσ_modules.ast.AST_ClassCall;\n var AST_New = ρσ_modules.ast.AST_New;\n var has_calls = ρσ_modules.ast.has_calls;\n var AST_Dot = ρσ_modules.ast.AST_Dot;\n var AST_SymbolRef = ρσ_modules.ast.AST_SymbolRef;\n var is_node_type = ρσ_modules.ast.is_node_type;\n\n var OutputStream = ρσ_modules["output.stream"].OutputStream;\n\n var print_bracketed = ρσ_modules["output.statements"].print_bracketed;\n\n var create_doctring = ρσ_modules["output.utils"].create_doctring;\n\n var print_getattr = ρσ_modules["output.operators"].print_getattr;\n\n anonfunc = "ρσ_anonfunc";\n module_name = "null";\n function set_module_name(x) {\n module_name = (x) ? "\\"" + x + "\\"" : "null";\n };\n if (!set_module_name.__argnames__) Object.defineProperties(set_module_name, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "output.functions"}\n });\n\n function decorate(decorators, output, func) {\n var pos;\n pos = 0;\n function wrap() {\n if (pos < decorators.length) {\n decorators[(typeof pos === "number" && pos < 0) ? decorators.length + pos : pos].expression.print(output);\n pos += 1;\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n wrap();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.functions"}\n });\n return ρσ_anonfunc;\n })());\n } else {\n func();\n }\n };\n if (!wrap.__module__) Object.defineProperties(wrap, {\n __module__ : {value: "output.functions"}\n });\n\n wrap();\n };\n if (!decorate.__argnames__) Object.defineProperties(decorate, {\n __argnames__ : {value: ["decorators", "output", "func"]},\n __module__ : {value: "output.functions"}\n });\n\n function function_args(argnames, output, strip_first) {\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n var ρσ_unpack, i, arg;\n if (argnames && argnames.length && (argnames.is_simple_func === true || argnames.is_simple_func === undefined)) {\n var ρσ_Iter92 = ρσ_Iterable(enumerate((strip_first) ? argnames.slice(1) : argnames));\n for (var ρσ_Index92 = 0; ρσ_Index92 < ρσ_Iter92.length; ρσ_Index92++) {\n ρσ_unpack = ρσ_Iter92[ρσ_Index92];\n i = ρσ_unpack[0];\n arg = ρσ_unpack[1];\n if (i) {\n output.comma();\n }\n arg.print(output);\n }\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.functions"}\n });\n return ρσ_anonfunc;\n })());\n output.space();\n };\n if (!function_args.__argnames__) Object.defineProperties(function_args, {\n __argnames__ : {value: ["argnames", "output", "strip_first"]},\n __module__ : {value: "output.functions"}\n });\n\n function function_preamble(node, output, offset) {\n var a, fname, kw, i, ρσ_unpack, c, arg, dname, nargs;\n a = node.argnames;\n if (!a || a.is_simple_func) {\n return;\n }\n fname = (node.name) ? node.name.name : anonfunc;\n kw = "arguments[arguments.length-1]";\n var ρσ_Iter93 = ρσ_Iterable(enumerate(a));\n for (var ρσ_Index93 = 0; ρσ_Index93 < ρσ_Iter93.length; ρσ_Index93++) {\n ρσ_unpack = ρσ_Iter93[ρσ_Index93];\n c = ρσ_unpack[0];\n arg = ρσ_unpack[1];\n i = c - offset;\n if (i >= 0) {\n output.indent();\n output.print("var");\n output.space();\n output.assign(arg);\n if (Object.prototype.hasOwnProperty.call(a.defaults, arg.name)) {\n output.spaced("(arguments[" + i + "]", "===", "undefined", "||", "(", i, "===", "arguments.length-1", "&&", kw, "!==", "null", "&&", "typeof", kw, "===", "\\"object\\"", "&&", kw, "[ρσ_kwargs_symbol]", "===", "true))", "?", "");\n [output.print(fname + ".__defaults__."), arg.print(output)];\n [output.space(), output.print(":"), output.space()];\n } else {\n output.spaced("(", i, "===", "arguments.length-1", "&&", kw, "!==", "null", "&&", "typeof", kw, "===", "\\"object\\"", "&&", kw, "[ρσ_kwargs_symbol]", "===", "true)", "?", "undefined", ":", "");\n }\n output.print("arguments[" + i + "]");\n output.end_statement();\n }\n }\n if (a.kwargs || a.has_defaults) {\n kw = (a.kwargs) ? a.kwargs.name : "ρσ_kwargs_obj";\n output.indent();\n output.spaced("var", kw, "=", "arguments[arguments.length-1]");\n output.end_statement();\n output.indent();\n output.spaced("if", "(" + kw, "===", "null", "||", "typeof", kw, "!==", "\\"object\\"", "||", kw, "[ρσ_kwargs_symbol]", "!==", "true)", kw, "=", "{}");\n output.end_statement();\n if (a.has_defaults) {\n var ρσ_Iter94 = ρσ_Iterable(Object.keys(a.defaults));\n for (var ρσ_Index94 = 0; ρσ_Index94 < ρσ_Iter94.length; ρσ_Index94++) {\n dname = ρσ_Iter94[ρσ_Index94];\n output.indent();\n output.spaced("if", "(Object.prototype.hasOwnProperty.call(" + kw + ",", "\\"" + dname + "\\"))");\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n output.indent();\n output.spaced(dname, "=", kw + "." + dname);\n output.end_statement();\n if (a.kwargs) {\n output.indent();\n output.spaced("delete", kw + "." + dname);\n output.end_statement();\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.functions"}\n });\n return ρσ_anonfunc;\n })());\n output.newline();\n }\n }\n }\n if (a.starargs !== undefined) {\n nargs = a.length - offset;\n output.indent();\n output.spaced("var", a.starargs.name, "=", "Array.prototype.slice.call(arguments,", nargs + ")");\n output.end_statement();\n output.indent();\n output.spaced("if", "(" + kw, "!==", "null", "&&", "typeof", kw, "===", "\\"object\\"", "&&", kw, "[ρσ_kwargs_symbol]", "===", "true)", a.starargs.name);\n output.print(".pop()");\n output.end_statement();\n }\n };\n if (!function_preamble.__argnames__) Object.defineProperties(function_preamble, {\n __argnames__ : {value: ["node", "output", "offset"]},\n __module__ : {value: "output.functions"}\n });\n\n function has_annotations(self) {\n var arg;\n if (self.return_annotation) {\n return true;\n }\n var ρσ_Iter95 = ρσ_Iterable(self.argnames);\n for (var ρσ_Index95 = 0; ρσ_Index95 < ρσ_Iter95.length; ρσ_Index95++) {\n arg = ρσ_Iter95[ρσ_Index95];\n if (arg.annotation) {\n return true;\n }\n }\n return false;\n };\n if (!has_annotations.__argnames__) Object.defineProperties(has_annotations, {\n __argnames__ : {value: ["self"]},\n __module__ : {value: "output.functions"}\n });\n\n function function_annotation(self, output, strip_first, name) {\n var fname, props, defaults, dkeys, names;\n fname = name || ((self.name) ? self.name.name : anonfunc);\n props = Object.create(null);\n if (has_annotations(self)) {\n props.__annotations__ = (function() {\n var ρσ_anonfunc = function () {\n var ρσ_unpack, i, arg;\n output.print("{");\n if (self.argnames && self.argnames.length) {\n var ρσ_Iter96 = ρσ_Iterable(enumerate(self.argnames));\n for (var ρσ_Index96 = 0; ρσ_Index96 < ρσ_Iter96.length; ρσ_Index96++) {\n ρσ_unpack = ρσ_Iter96[ρσ_Index96];\n i = ρσ_unpack[0];\n arg = ρσ_unpack[1];\n if (arg.annotation) {\n arg.print(output);\n [output.print(":"), output.space()];\n arg.annotation.print(output);\n if (i < self.argnames.length - 1 || self.return_annotation) {\n output.comma();\n }\n }\n }\n }\n if (self.return_annotation) {\n [output.print("return:"), output.space()];\n self.return_annotation.print(output);\n }\n output.print("}");\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.functions"}\n });\n return ρσ_anonfunc;\n })();\n }\n defaults = self.argnames.defaults;\n dkeys = Object.keys(self.argnames.defaults);\n if (dkeys.length) {\n props.__defaults__ = (function() {\n var ρσ_anonfunc = function () {\n var ρσ_unpack, i, k;\n output.print("{");\n var ρσ_Iter97 = ρσ_Iterable(enumerate(dkeys));\n for (var ρσ_Index97 = 0; ρσ_Index97 < ρσ_Iter97.length; ρσ_Index97++) {\n ρσ_unpack = ρσ_Iter97[ρσ_Index97];\n i = ρσ_unpack[0];\n k = ρσ_unpack[1];\n [output.print(k + ":"), defaults[(typeof k === "number" && k < 0) ? defaults.length + k : k].print(output)];\n if (i !== dkeys.length - 1) {\n output.comma();\n }\n }\n output.print("}");\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.functions"}\n });\n return ρσ_anonfunc;\n })();\n }\n if (!self.argnames.is_simple_func) {\n props.__handles_kwarg_interpolation__ = (function() {\n var ρσ_anonfunc = function () {\n output.print("true");\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.functions"}\n });\n return ρσ_anonfunc;\n })();\n }\n if (self.argnames.length > ((strip_first) ? 1 : 0)) {\n props.__argnames__ = (function() {\n var ρσ_anonfunc = function () {\n var ρσ_unpack, i, arg;\n output.print("[");\n var ρσ_Iter98 = ρσ_Iterable(enumerate(self.argnames));\n for (var ρσ_Index98 = 0; ρσ_Index98 < ρσ_Iter98.length; ρσ_Index98++) {\n ρσ_unpack = ρσ_Iter98[ρσ_Index98];\n i = ρσ_unpack[0];\n arg = ρσ_unpack[1];\n if (strip_first && i === 0) {\n continue;\n }\n output.print(JSON.stringify(arg.name));\n if (i !== self.argnames.length - 1) {\n output.comma();\n }\n }\n output.print("]");\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.functions"}\n });\n return ρσ_anonfunc;\n })();\n }\n if (output.options.keep_docstrings && self.docstrings && self.docstrings.length) {\n props.__doc__ = (function() {\n var ρσ_anonfunc = function () {\n output.print(JSON.stringify(create_doctring(self.docstrings)));\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.functions"}\n });\n return ρσ_anonfunc;\n })();\n }\n props.__module__ = (function() {\n var ρσ_anonfunc = function () {\n output.print(module_name);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.functions"}\n });\n return ρσ_anonfunc;\n })();\n names = Object.keys(props);\n output.indent();\n output.spaced("if", "(!" + fname + "." + names[0] + ")", "Object.defineProperties(" + fname);\n output.comma();\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n var name;\n for (var i = 0; i < names.length; i++) {\n name = names[(typeof i === "number" && i < 0) ? names.length + i : i];\n [output.indent(), output.spaced(name, ":", "{value:", ""), props[(typeof name === "number" && name < 0) ? props.length + name : name](), \n output.print("}")];\n if (i < names.length - 1) {\n output.print(",");\n }\n output.newline();\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.functions"}\n });\n return ρσ_anonfunc;\n })());\n [output.print(")"), output.end_statement()];\n };\n if (!function_annotation.__argnames__) Object.defineProperties(function_annotation, {\n __argnames__ : {value: ["self", "output", "strip_first", "name"]},\n __module__ : {value: "output.functions"}\n });\n\n function function_definition(self, output, strip_first, as_expression) {\n var orig_indent;\n as_expression = as_expression || self.is_expression || self.is_anonymous;\n if (as_expression) {\n orig_indent = output.indentation();\n output.set_indentation(output.next_indent());\n [output.spaced("(function()", "{"), output.newline()];\n [output.indent(), output.spaced("var", anonfunc, "="), output.space()];\n }\n [output.print("function"), output.space()];\n if (self.name) {\n self.name.print(output);\n }\n if (self.is_generator) {\n [output.print("()"), output.space()];\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n var temp, transpiled, ci;\n if (output.options.js_version >= 6) {\n output.indent();\n output.print("function* js_generator");\n function_args(self.argnames, output, strip_first);\n print_bracketed(self, output, true, function_preamble);\n } else {\n temp = new OutputStream((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["beautify"] = true;\n return ρσ_d;\n }).call(this));\n temp.print("function* js_generator");\n function_args(self.argnames, temp, strip_first);\n print_bracketed(self, temp, true, function_preamble);\n transpiled = regenerate(temp.get(), output.options.beautify).replace(/regeneratorRuntime.(wrap|mark)/g, "ρσ_regenerator.regeneratorRuntime.$1");\n if (output.options.beautify) {\n ci = output.make_indent(0);\n transpiled = (function() {\n var ρσ_Iter = ρσ_Iterable(transpiled.split("\\n")), ρσ_Result = [], x;\n for (var ρσ_Index = 0; ρσ_Index < ρσ_Iter.length; ρσ_Index++) {\n x = ρσ_Iter[ρσ_Index];\n ρσ_Result.push(ci + x);\n }\n ρσ_Result = ρσ_list_constructor(ρσ_Result);\n return ρσ_Result;\n })().join("\\n");\n }\n output.print(transpiled);\n }\n output.newline();\n output.indent();\n output.spaced("var", "result", "=", "js_generator.apply(this,", "arguments)");\n output.end_statement();\n output.indent();\n output.spaced("result.send", "=", "result.next");\n output.end_statement();\n output.indent();\n output.spaced("return", "result");\n output.end_statement();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.functions"}\n });\n return ρσ_anonfunc;\n })());\n } else {\n function_args(self.argnames, output, strip_first);\n print_bracketed(self, output, true, function_preamble);\n }\n if (as_expression) {\n output.end_statement();\n function_annotation(self, output, strip_first, anonfunc);\n [output.indent(), output.spaced("return", anonfunc), output.end_statement()];\n output.set_indentation(orig_indent);\n [output.indent(), output.print("})()")];\n }\n };\n if (!function_definition.__argnames__) Object.defineProperties(function_definition, {\n __argnames__ : {value: ["self", "output", "strip_first", "as_expression"]},\n __module__ : {value: "output.functions"}\n });\n\n function print_function(output) {\n var self;\n self = this;\n if (self.decorators && self.decorators.length) {\n output.print("var");\n output.space();\n output.assign(self.name.name);\n decorate(self.decorators, output, (function() {\n var ρσ_anonfunc = function () {\n function_definition(self, output, false, true);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.functions"}\n });\n return ρσ_anonfunc;\n })());\n output.end_statement();\n } else {\n function_definition(self, output, false);\n if (!self.is_expression && !self.is_anonymous) {\n output.end_statement();\n function_annotation(self, output, false);\n }\n }\n };\n if (!print_function.__argnames__) Object.defineProperties(print_function, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.functions"}\n });\n\n function find_this(expression) {\n if (is_node_type(expression, AST_Dot)) {\n return expression.expression;\n }\n if (!is_node_type(expression, AST_SymbolRef)) {\n return expression;\n }\n };\n if (!find_this.__argnames__) Object.defineProperties(find_this, {\n __argnames__ : {value: ["expression"]},\n __module__ : {value: "output.functions"}\n });\n\n function print_this(expression, output) {\n var obj;\n obj = find_this(expression);\n if (obj) {\n obj.print(output);\n } else {\n output.print("this");\n }\n };\n if (!print_this.__argnames__) Object.defineProperties(print_this, {\n __argnames__ : {value: ["expression", "output"]},\n __module__ : {value: "output.functions"}\n });\n\n function print_function_call(self, output) {\n var is_prototype_call, has_kwarg_items, has_kwarg_formals, has_kwargs, is_new, is_repeatable;\n is_prototype_call = false;\n function print_function_name(no_call) {\n if (is_node_type(self, AST_ClassCall)) {\n if (self.static) {\n self.class.print(output);\n output.print(".");\n output.print(self.method);\n } else {\n is_prototype_call = true;\n self.class.print(output);\n output.print(".prototype.");\n output.print(self.method);\n if (!no_call) {\n output.print(".call");\n }\n }\n } else {\n if (!is_repeatable) {\n output.print("ρσ_expr_temp");\n if (is_node_type(self.expression, AST_Dot)) {\n print_getattr(self.expression, output, true);\n }\n } else {\n self.expression.print(output);\n }\n }\n };\n if (!print_function_name.__argnames__) Object.defineProperties(print_function_name, {\n __argnames__ : {value: ["no_call"]},\n __module__ : {value: "output.functions"}\n });\n\n function print_kwargs() {\n var ρσ_unpack, i, kwname, pair;\n output.print("ρσ_desugar_kwargs(");\n if (has_kwarg_items) {\n var ρσ_Iter99 = ρσ_Iterable(enumerate(self.args.kwarg_items));\n for (var ρσ_Index99 = 0; ρσ_Index99 < ρσ_Iter99.length; ρσ_Index99++) {\n ρσ_unpack = ρσ_Iter99[ρσ_Index99];\n i = ρσ_unpack[0];\n kwname = ρσ_unpack[1];\n if (i > 0) {\n output.print(",");\n output.space();\n }\n kwname.print(output);\n }\n if (has_kwarg_formals) {\n output.print(",");\n output.space();\n }\n }\n if (has_kwarg_formals) {\n output.print("{");\n var ρσ_Iter100 = ρσ_Iterable(enumerate(self.args.kwargs));\n for (var ρσ_Index100 = 0; ρσ_Index100 < ρσ_Iter100.length; ρσ_Index100++) {\n ρσ_unpack = ρσ_Iter100[ρσ_Index100];\n i = ρσ_unpack[0];\n pair = ρσ_unpack[1];\n if (i) {\n output.comma();\n }\n pair[0].print(output);\n output.print(":");\n output.space();\n pair[1].print(output);\n }\n output.print("}");\n }\n output.print(")");\n };\n if (!print_kwargs.__module__) Object.defineProperties(print_kwargs, {\n __module__ : {value: "output.functions"}\n });\n\n function print_new(apply) {\n output.print("ρσ_interpolate_kwargs_constructor.call(");\n [output.print("Object.create("), self.expression.print(output), output.print(".prototype)")];\n output.comma();\n output.print((apply) ? "true" : "false");\n output.comma();\n };\n if (!print_new.__argnames__) Object.defineProperties(print_new, {\n __argnames__ : {value: ["apply"]},\n __module__ : {value: "output.functions"}\n });\n\n function do_print_this() {\n if (!is_repeatable) {\n output.print("ρσ_expr_temp");\n } else {\n print_this(self.expression, output);\n }\n output.comma();\n };\n if (!do_print_this.__module__) Object.defineProperties(do_print_this, {\n __module__ : {value: "output.functions"}\n });\n\n function print_positional_args() {\n var i, expr, is_first;\n i = 0;\n while (i < self.args.length) {\n expr = (ρσ_expr_temp = self.args)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i];\n is_first = i === 0;\n if (!is_first) {\n output.print(".concat(");\n }\n if (expr.is_array) {\n expr.print(output);\n i += 1;\n } else {\n output.print("[");\n while (i < self.args.length && !(ρσ_expr_temp = self.args)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i].is_array) {\n (ρσ_expr_temp = self.args)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i].print(output);\n if (i + 1 < self.args.length && !(ρσ_expr_temp = self.args)[ρσ_bound_index(i + 1, ρσ_expr_temp)].is_array) {\n output.print(",");\n output.space();\n }\n i += 1;\n }\n output.print("]");\n }\n if (!is_first) {\n output.print(")");\n }\n }\n };\n if (!print_positional_args.__module__) Object.defineProperties(print_positional_args, {\n __module__ : {value: "output.functions"}\n });\n\n has_kwarg_items = self.args.kwarg_items && self.args.kwarg_items.length;\n has_kwarg_formals = self.args.kwargs && self.args.kwargs.length;\n has_kwargs = has_kwarg_items || has_kwarg_formals;\n is_new = is_node_type(self, AST_New);\n is_repeatable = true;\n if (is_new && !self.args.length && !has_kwargs && !self.args.starargs) {\n [output.print("new"), output.space()];\n print_function_name();\n return;\n }\n if (!has_kwargs && !self.args.starargs) {\n if (is_new) {\n [output.print("new"), output.space()];\n }\n print_function_name();\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n var ρσ_unpack, i, a;\n var ρσ_Iter101 = ρσ_Iterable(enumerate(self.args));\n for (var ρσ_Index101 = 0; ρσ_Index101 < ρσ_Iter101.length; ρσ_Index101++) {\n ρσ_unpack = ρσ_Iter101[ρσ_Index101];\n i = ρσ_unpack[0];\n a = ρσ_unpack[1];\n if (i) {\n output.comma();\n }\n a.print(output);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.functions"}\n });\n return ρσ_anonfunc;\n })());\n return;\n }\n is_repeatable = is_new || !has_calls(self.expression);\n if (!is_repeatable) {\n [output.assign("(ρσ_expr_temp"), print_this(self.expression, output), output.comma()];\n }\n if (has_kwargs) {\n if (is_new) {\n print_new(false);\n } else {\n output.print("ρσ_interpolate_kwargs.call(");\n do_print_this();\n }\n print_function_name(true);\n output.comma();\n } else {\n if (is_new) {\n print_new(true);\n print_function_name(true);\n output.comma();\n } else {\n print_function_name(true);\n output.print(".apply(");\n do_print_this();\n }\n }\n if (is_prototype_call && self.args.length > 1) {\n self.args.shift();\n }\n print_positional_args();\n if (has_kwargs) {\n if (self.args.length) {\n output.print(".concat(");\n }\n output.print("[");\n print_kwargs();\n output.print("]");\n if (self.args.length) {\n output.print(")");\n }\n }\n output.print(")");\n if (!is_repeatable) {\n output.print(")");\n }\n };\n if (!print_function_call.__argnames__) Object.defineProperties(print_function_call, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.functions"}\n });\n\n ρσ_modules["output.functions"].anonfunc = anonfunc;\n ρσ_modules["output.functions"].module_name = module_name;\n ρσ_modules["output.functions"].set_module_name = set_module_name;\n ρσ_modules["output.functions"].decorate = decorate;\n ρσ_modules["output.functions"].function_args = function_args;\n ρσ_modules["output.functions"].function_preamble = function_preamble;\n ρσ_modules["output.functions"].has_annotations = has_annotations;\n ρσ_modules["output.functions"].function_annotation = function_annotation;\n ρσ_modules["output.functions"].function_definition = function_definition;\n ρσ_modules["output.functions"].print_function = print_function;\n ρσ_modules["output.functions"].find_this = find_this;\n ρσ_modules["output.functions"].print_this = print_this;\n ρσ_modules["output.functions"].print_function_call = print_function_call;\n })();\n\n (function(){\n var __name__ = "output.classes";\n var AST_Class = ρσ_modules.ast.AST_Class;\n var AST_Method = ρσ_modules.ast.AST_Method;\n var is_node_type = ρσ_modules.ast.is_node_type;\n\n var decorate = ρσ_modules["output.functions"].decorate;\n var function_definition = ρσ_modules["output.functions"].function_definition;\n var function_annotation = ρσ_modules["output.functions"].function_annotation;\n\n var create_doctring = ρσ_modules["output.utils"].create_doctring;\n\n var has_prop = ρσ_modules.utils.has_prop;\n\n function print_class(output) {\n var self, decorators, num, i, seen_methods, property_names, defined_methods, sname, attr, stmt, di;\n self = this;\n if (self.external) {\n return;\n }\n function class_def(method, is_var) {\n output.indent();\n self.name.print(output);\n if (!is_var && method && has_prop(self.static, method)) {\n output.assign("." + method);\n } else {\n if (is_var) {\n output.assign(".prototype[" + method + "]");\n } else {\n output.assign(".prototype" + ((method) ? "." + method : ""));\n }\n }\n };\n if (!class_def.__argnames__) Object.defineProperties(class_def, {\n __argnames__ : {value: ["method", "is_var"]},\n __module__ : {value: "output.classes"}\n });\n\n function define_method(stmt, is_property) {\n var name, is_static, strip_first, fname;\n name = stmt.name.name;\n if (!is_property) {\n class_def(name);\n }\n is_static = has_prop(self.static, name);\n strip_first = !is_static;\n if (stmt.decorators && stmt.decorators.length) {\n decorate(stmt.decorators, output, (function() {\n var ρσ_anonfunc = function () {\n function_definition(stmt, output, strip_first, true);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.classes"}\n });\n return ρσ_anonfunc;\n })());\n output.end_statement();\n } else {\n function_definition(stmt, output, strip_first);\n if (!is_property) {\n output.end_statement();\n fname = self.name.name + ((is_static) ? "." : ".prototype.") + name;\n function_annotation(stmt, output, strip_first, fname);\n }\n }\n };\n if (!define_method.__argnames__) Object.defineProperties(define_method, {\n __argnames__ : {value: ["stmt", "is_property"]},\n __module__ : {value: "output.classes"}\n });\n\n function define_default_method(name, body) {\n class_def(name);\n output.spaced("function", name, "()", "");\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n [output.indent(), body()];\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.classes"}\n });\n return ρσ_anonfunc;\n })());\n output.end_statement();\n };\n if (!define_default_method.__argnames__) Object.defineProperties(define_default_method, {\n __argnames__ : {value: ["name", "body"]},\n __module__ : {value: "output.classes"}\n });\n\n function add_hidden_property(name, proceed) {\n [output.indent(), output.print("Object.defineProperty(")];\n [self.name.print(output), output.print(".prototype"), output.comma(), output.print(JSON.stringify(name)), \n output.comma()];\n [output.spaced("{value:", ""), proceed(), output.print("})"), output.end_statement()];\n };\n if (!add_hidden_property.__argnames__) Object.defineProperties(add_hidden_property, {\n __argnames__ : {value: ["name", "proceed"]},\n __module__ : {value: "output.classes"}\n });\n\n function write_constructor() {\n output.print("function");\n output.space();\n self.name.print(output);\n output.print("()");\n output.space();\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n output.indent();\n output.spaced("if", "(this.ρσ_object_id", "===", "undefined)", "Object.defineProperty(this,", "\\"ρσ_object_id\\",", "{\\"value\\":++ρσ_object_counter})");\n output.end_statement();\n if (self.bound.length) {\n output.indent();\n [self.name.print(output), output.print(".prototype.__bind_methods__.call(this)")];\n output.end_statement();\n }\n output.indent();\n self.name.print(output);\n [output.print(".prototype.__init__.apply(this"), output.comma(), output.print("arguments)")];\n output.end_statement();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.classes"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!write_constructor.__module__) Object.defineProperties(write_constructor, {\n __module__ : {value: "output.classes"}\n });\n\n decorators = self.decorators || [];\n if (decorators.length) {\n output.print("var ");\n output.assign(self.name);\n write_constructor();\n output.semicolon();\n } else {\n write_constructor();\n }\n output.newline();\n if (decorators.length) {\n output.indent();\n self.name.print(output);\n output.spaced(".ρσ_decorators", "=", "[");\n num = decorators.length;\n for (var ρσ_Index102 = 0; ρσ_Index102 < num; ρσ_Index102++) {\n i = ρσ_Index102;\n decorators[(typeof i === "number" && i < 0) ? decorators.length + i : i].expression.print(output);\n output.spaced((i < num - 1) ? "," : "]");\n }\n output.semicolon();\n output.newline();\n }\n if (self.parent) {\n output.indent();\n output.print("ρσ_extends");\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n self.name.print(output);\n output.comma();\n self.parent.print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.classes"}\n });\n return ρσ_anonfunc;\n })());\n output.end_statement();\n }\n if (self.bound.length) {\n seen_methods = Object.create(null);\n add_hidden_property("__bind_methods__", (function() {\n var ρσ_anonfunc = function () {\n output.spaced("function", "()", "");\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n var base, bname;\n if (self.bases.length) {\n for (var i = self.bases.length - 1; i >= 0; i--) {\n base = (ρσ_expr_temp = self.bases)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i];\n [output.indent(), base.print(output), output.spaced(".prototype.__bind_methods__", "&&", "")];\n [base.print(output), output.print(".prototype.__bind_methods__.call(this)")];\n output.end_statement();\n }\n }\n var ρσ_Iter103 = ρσ_Iterable(self.bound);\n for (var ρσ_Index103 = 0; ρσ_Index103 < ρσ_Iter103.length; ρσ_Index103++) {\n bname = ρσ_Iter103[ρσ_Index103];\n if (seen_methods[(typeof bname === "number" && bname < 0) ? seen_methods.length + bname : bname] || (ρσ_expr_temp = self.dynamic_properties)[(typeof bname === "number" && bname < 0) ? ρσ_expr_temp.length + bname : bname]) {\n continue;\n }\n seen_methods[(typeof bname === "number" && bname < 0) ? seen_methods.length + bname : bname] = true;\n [output.indent(), output.assign("this." + bname)];\n [self.name.print(output), output.print(".prototype." + bname + ".bind(this)")];\n output.end_statement();\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.classes"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.classes"}\n });\n return ρσ_anonfunc;\n })());\n }\n property_names = Object.keys(self.dynamic_properties);\n if (property_names.length) {\n output.indent();\n output.print("Object.defineProperties");\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n [self.name.print(output), output.print(".prototype"), output.comma(), output.space(), \n output.with_block((function() {\n var ρσ_anonfunc = function () {\n var prop, name;\n var ρσ_Iter104 = ρσ_Iterable(property_names);\n for (var ρσ_Index104 = 0; ρσ_Index104 < ρσ_Iter104.length; ρσ_Index104++) {\n name = ρσ_Iter104[ρσ_Index104];\n prop = (ρσ_expr_temp = self.dynamic_properties)[(typeof name === "number" && name < 0) ? ρσ_expr_temp.length + name : name];\n [output.indent(), output.print(JSON.stringify(name) + ":"), output.space()];\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n [output.indent(), output.print("\\"enumerable\\":"), output.space(), output.print("true"), \n output.comma(), output.newline()];\n if (prop.getter) {\n [output.indent(), output.print("\\"get\\":"), output.space()];\n [define_method(prop.getter, true), output.comma(), output.newline()];\n }\n [output.indent(), output.print("\\"set\\":"), output.space()];\n if (prop.setter) {\n [define_method(prop.setter, true), output.newline()];\n } else {\n [output.spaced("function", "()", "{", "throw new AttributeError(\\"can\'t set attribute\\")", "}"), \n output.newline()];\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.classes"}\n });\n return ρσ_anonfunc;\n })());\n [output.comma(), output.newline()];\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.classes"}\n });\n return ρσ_anonfunc;\n })())];\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.classes"}\n });\n return ρσ_anonfunc;\n })());\n output.end_statement();\n }\n if (!self.init) {\n define_default_method("__init__", (function() {\n var ρσ_anonfunc = function () {\n if (self.parent) {\n self.parent.print(output);\n output.spaced(".prototype.__init__", "&&");\n [output.space(), self.parent.print(output)];\n output.print(".prototype.__init__.apply");\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n output.print("this");\n output.comma();\n output.print("arguments");\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.classes"}\n });\n return ρσ_anonfunc;\n })());\n output.end_statement();\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.classes"}\n });\n return ρσ_anonfunc;\n })());\n }\n defined_methods = Object.create(null);\n var ρσ_Iter105 = ρσ_Iterable(self.body);\n for (var ρσ_Index105 = 0; ρσ_Index105 < ρσ_Iter105.length; ρσ_Index105++) {\n stmt = ρσ_Iter105[ρσ_Index105];\n if (is_node_type(stmt, AST_Method)) {\n if (stmt.is_getter || stmt.is_setter) {\n continue;\n }\n define_method(stmt);\n defined_methods[ρσ_bound_index(stmt.name.name, defined_methods)] = true;\n sname = stmt.name.name;\n if (sname === "__init__") {\n var ρσ_Iter106 = ρσ_Iterable(ρσ_list_decorate([ ".__argnames__", ".__handles_kwarg_interpolation__" ]));\n for (var ρσ_Index106 = 0; ρσ_Index106 < ρσ_Iter106.length; ρσ_Index106++) {\n attr = ρσ_Iter106[ρσ_Index106];\n [output.indent(), self.name.print(output), output.assign(attr)];\n [self.name.print(output), output.print(".prototype.__init__" + attr), output.end_statement()];\n }\n }\n if (sname === "__iter__") {\n class_def("ρσ_iterator_symbol", true);\n self.name.print(output);\n output.print(".prototype." + stmt.name.name);\n output.end_statement();\n }\n } else if (is_node_type(stmt, AST_Class)) {\n console.error("Nested classes aren\'t supported yet");\n }\n }\n if (!defined_methods["__repr__"]) {\n define_default_method("__repr__", (function() {\n var ρσ_anonfunc = function () {\n if (self.parent) {\n [output.print("if("), self.parent.print(output), output.spaced(".prototype.__repr__)", "return", self.parent)];\n [output.print(".prototype.__repr__.call(this)"), output.end_statement()];\n }\n [output.indent(), output.spaced("return", "\\"<\\"", "+", "__name__", "+", "\\".\\"", "+", "this.constructor.name", "")];\n output.spaced("+", "\\" #\\"", "+", "this.ρσ_object_id", "+", "\\">\\"");\n output.end_statement();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.classes"}\n });\n return ρσ_anonfunc;\n })());\n }\n if (!defined_methods["__str__"]) {\n define_default_method("__str__", (function() {\n var ρσ_anonfunc = function () {\n if (self.parent) {\n [output.print("if("), self.parent.print(output), output.spaced(".prototype.__str__)", "return", self.parent)];\n [output.print(".prototype.__str__.call(this)"), output.end_statement()];\n }\n output.spaced("return", "this.__repr__()");\n output.end_statement();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.classes"}\n });\n return ρσ_anonfunc;\n })());\n }\n add_hidden_property("__bases__", (function() {\n var ρσ_anonfunc = function () {\n output.print("[");\n for (var i = 0; i < self.bases.length; i++) {\n (ρσ_expr_temp = self.bases)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i].print(output);\n if (i < self.bases.length - 1) {\n output.comma();\n }\n }\n output.print("]");\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.classes"}\n });\n return ρσ_anonfunc;\n })());\n if (self.bases.length > 1) {\n output.indent();\n output.print("ρσ_mixin(");\n self.name.print(output);\n for (var i = 1; i < self.bases.length; i++) {\n output.comma();\n (ρσ_expr_temp = self.bases)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i].print(output);\n }\n [output.print(")"), output.end_statement()];\n }\n if (self.docstrings && self.docstrings.length && output.options.keep_docstrings) {\n add_hidden_property("__doc__", (function() {\n var ρσ_anonfunc = function () {\n output.print(JSON.stringify(create_doctring(self.docstrings)));\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.classes"}\n });\n return ρσ_anonfunc;\n })());\n }\n var ρσ_Iter107 = ρσ_Iterable(self.statements);\n for (var ρσ_Index107 = 0; ρσ_Index107 < ρσ_Iter107.length; ρσ_Index107++) {\n stmt = ρσ_Iter107[ρσ_Index107];\n if (!is_node_type(stmt, AST_Method)) {\n output.indent();\n stmt.print(output);\n output.newline();\n }\n }\n if (decorators.length) {\n output.indent();\n output.assign(self.name);\n for (var ρσ_Index108 = 0; ρσ_Index108 < decorators.length; ρσ_Index108++) {\n di = ρσ_Index108;\n self.name.print(output);\n output.print(".ρσ_decorators[" + ρσ_str.format("{}", di) + "](");\n }\n self.name.print(output);\n output.print(")".repeat(decorators.length));\n output.semicolon();\n output.newline();\n output.indent();\n output.spaced("delete ");\n self.name.print(output);\n output.print(".ρσ_decorators");\n output.semicolon();\n output.newline();\n }\n };\n if (!print_class.__argnames__) Object.defineProperties(print_class, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.classes"}\n });\n\n ρσ_modules["output.classes"].print_class = print_class;\n })();\n\n (function(){\n var __name__ = "output.literals";\n var AST_Binary = ρσ_modules.ast.AST_Binary;\n var is_node_type = ρσ_modules.ast.is_node_type;\n\n function print_array(self, output) {\n output.print("ρσ_list_decorate");\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n output.with_square((function() {\n var ρσ_anonfunc = function () {\n var a, len_, ρσ_unpack, i, exp;\n a = self.elements;\n len_ = a.length;\n if (len_ > 0) {\n output.space();\n }\n var ρσ_Iter109 = ρσ_Iterable(enumerate(a));\n for (var ρσ_Index109 = 0; ρσ_Index109 < ρσ_Iter109.length; ρσ_Index109++) {\n ρσ_unpack = ρσ_Iter109[ρσ_Index109];\n i = ρσ_unpack[0];\n exp = ρσ_unpack[1];\n if (i) {\n output.comma();\n }\n exp.print(output);\n }\n if (len_ > 0) {\n output.space();\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.literals"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.literals"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!print_array.__argnames__) Object.defineProperties(print_array, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.literals"}\n });\n\n function print_obj_literal(self, output) {\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n output.print("function()");\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n var ρσ_unpack, i, prop;\n output.indent();\n if (self.is_pydict) {\n output.spaced.apply(output, "var ρσ_d = ρσ_dict()".split(" "));\n } else {\n output.spaced("var", "ρσ_d", "=", (self.is_jshash) ? "Object.create(null)" : "{}");\n }\n output.end_statement();\n var ρσ_Iter110 = ρσ_Iterable(enumerate(self.properties));\n for (var ρσ_Index110 = 0; ρσ_Index110 < ρσ_Iter110.length; ρσ_Index110++) {\n ρσ_unpack = ρσ_Iter110[ρσ_Index110];\n i = ρσ_unpack[0];\n prop = ρσ_unpack[1];\n output.indent();\n if (self.is_pydict) {\n output.print("ρσ_d.set");\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n prop.key.print(output);\n [output.print(","), output.space()];\n prop.value.print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.literals"}\n });\n return ρσ_anonfunc;\n })());\n } else {\n output.print("ρσ_d");\n output.with_square((function() {\n var ρσ_anonfunc = function () {\n prop.key.print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.literals"}\n });\n return ρσ_anonfunc;\n })());\n [output.space(), output.print("="), output.space()];\n prop.value.print(output);\n }\n output.end_statement();\n }\n output.indent();\n output.spaced("return", "ρσ_d");\n output.end_statement();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.literals"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.literals"}\n });\n return ρσ_anonfunc;\n })());\n output.print(".call(this)");\n };\n if (!print_obj_literal.__argnames__) Object.defineProperties(print_obj_literal, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.literals"}\n });\n\n function print_object(self, output) {\n if (self.is_pydict) {\n if (self.properties.length > 0) {\n print_obj_literal(self, output);\n } else {\n output.print("ρσ_dict()");\n }\n } else {\n if (self.properties.length > 0) {\n print_obj_literal(self, output);\n } else {\n output.print((self.is_jshash) ? "Object.create(null)" : "{}");\n }\n }\n };\n if (!print_object.__argnames__) Object.defineProperties(print_object, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.literals"}\n });\n\n function print_set(self, output) {\n if (self.items.length === 0) {\n output.print("ρσ_set()");\n return;\n }\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n output.print("function()");\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n var item;\n output.indent();\n output.spaced.apply(output, "var s = ρσ_set()".split(" "));\n output.end_statement();\n var ρσ_Iter111 = ρσ_Iterable(self.items);\n for (var ρσ_Index111 = 0; ρσ_Index111 < ρσ_Iter111.length; ρσ_Index111++) {\n item = ρσ_Iter111[ρσ_Index111];\n output.indent();\n output.print("s.jsset.add");\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n item.value.print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.literals"}\n });\n return ρσ_anonfunc;\n })());\n output.end_statement();\n }\n output.indent();\n output.spaced("return", "s");\n output.end_statement();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.literals"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.literals"}\n });\n return ρσ_anonfunc;\n })());\n output.print("()");\n };\n if (!print_set.__argnames__) Object.defineProperties(print_set, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.literals"}\n });\n\n function print_regexp(self, output) {\n var str_, p;\n str_ = self.value.toString();\n if (output.options.ascii_only) {\n str_ = output.to_ascii(str_);\n }\n output.print(str_);\n p = output.parent();\n if (is_node_type(p, AST_Binary) && /^in/.test(p.operator) && p.left === self) {\n output.print(" ");\n }\n };\n if (!print_regexp.__argnames__) Object.defineProperties(print_regexp, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.literals"}\n });\n\n ρσ_modules["output.literals"].print_array = print_array;\n ρσ_modules["output.literals"].print_obj_literal = print_obj_literal;\n ρσ_modules["output.literals"].print_object = print_object;\n ρσ_modules["output.literals"].print_set = print_set;\n ρσ_modules["output.literals"].print_regexp = print_regexp;\n })();\n\n (function(){\n var __name__ = "output.comments";\n var AST_Exit = ρσ_modules.ast.AST_Exit;\n var is_node_type = ρσ_modules.ast.is_node_type;\n\n function output_comments(comments, output, nlb) {\n var comm;\n var ρσ_Iter112 = ρσ_Iterable(comments);\n for (var ρσ_Index112 = 0; ρσ_Index112 < ρσ_Iter112.length; ρσ_Index112++) {\n comm = ρσ_Iter112[ρσ_Index112];\n if (comm.type === "comment1") {\n output.print("//" + comm.value + "\\n");\n output.indent();\n } else if (comm.type === "comment2") {\n output.print("/*" + comm.value + "*/");\n if (nlb) {\n output.print("\\n");\n output.indent();\n } else {\n output.space();\n }\n }\n }\n };\n if (!output_comments.__argnames__) Object.defineProperties(output_comments, {\n __argnames__ : {value: ["comments", "output", "nlb"]},\n __module__ : {value: "output.comments"}\n });\n\n function print_comments(self, output) {\n var c, start, comments;\n c = output.options.comments;\n if (c) {\n start = self.start;\n if (start && !start._comments_dumped) {\n start._comments_dumped = true;\n comments = start.comments_before;\n if (is_node_type(self, AST_Exit) && self.value && self.value.start.comments_before && self.value.start.comments_before.length > 0) {\n comments = (comments || []).concat(self.value.start.comments_before);\n self.value.start.comments_before = [];\n }\n if (c.test) {\n comments = comments.filter((function() {\n var ρσ_anonfunc = function (comment) {\n return c.test(comment.value);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["comment"]},\n __module__ : {value: "output.comments"}\n });\n return ρσ_anonfunc;\n })());\n } else if (typeof c === "function") {\n comments = comments.filter((function() {\n var ρσ_anonfunc = function (comment) {\n return c(self, comment);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["comment"]},\n __module__ : {value: "output.comments"}\n });\n return ρσ_anonfunc;\n })());\n }\n output_comments(comments, output, start.nlb);\n }\n }\n };\n if (!print_comments.__argnames__) Object.defineProperties(print_comments, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.comments"}\n });\n\n ρσ_modules["output.comments"].output_comments = output_comments;\n ρσ_modules["output.comments"].print_comments = print_comments;\n })();\n\n (function(){\n var __name__ = "output.modules";\n var declare_vars = ρσ_modules["output.statements"].declare_vars;\n var display_body = ρσ_modules["output.statements"].display_body;\n\n var OutputStream = ρσ_modules["output.stream"].OutputStream;\n\n var create_doctring = ρσ_modules["output.utils"].create_doctring;\n\n var print_comments = ρσ_modules["output.comments"].print_comments;\n var output_comments = ρσ_modules["output.comments"].output_comments;\n\n var set_module_name = ρσ_modules["output.functions"].set_module_name;\n\n var get_compiler_version = ρσ_modules.parse.get_compiler_version;\n\n var cache_file_name = ρσ_modules.utils.cache_file_name;\n\n function write_imports(module, output) {\n var imports, import_id, nonlocalvars, name, module_, module_id;\n imports = ρσ_list_decorate([]);\n var ρσ_Iter113 = ρσ_Iterable(Object.keys(module.imports));\n for (var ρσ_Index113 = 0; ρσ_Index113 < ρσ_Iter113.length; ρσ_Index113++) {\n import_id = ρσ_Iter113[ρσ_Index113];\n imports.push((ρσ_expr_temp = module.imports)[(typeof import_id === "number" && import_id < 0) ? ρσ_expr_temp.length + import_id : import_id]);\n }\n imports.sort((function() {\n var ρσ_anonfunc = function (a, b) {\n var ρσ_unpack;\n ρσ_unpack = [a.import_order, b.import_order];\n a = ρσ_unpack[0];\n b = ρσ_unpack[1];\n return (a < b) ? -1 : (a > b) ? 1 : 0;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["a", "b"]},\n __module__ : {value: "output.modules"}\n });\n return ρσ_anonfunc;\n })());\n if (imports.length > 1) {\n output.indent();\n output.print("var ρσ_modules = {};");\n output.newline();\n }\n nonlocalvars = Object.create(null);\n var ρσ_Iter114 = ρσ_Iterable(imports);\n for (var ρσ_Index114 = 0; ρσ_Index114 < ρσ_Iter114.length; ρσ_Index114++) {\n module_ = ρσ_Iter114[ρσ_Index114];\n var ρσ_Iter115 = ρσ_Iterable(module_.nonlocalvars);\n for (var ρσ_Index115 = 0; ρσ_Index115 < ρσ_Iter115.length; ρσ_Index115++) {\n name = ρσ_Iter115[ρσ_Index115];\n nonlocalvars[(typeof name === "number" && name < 0) ? nonlocalvars.length + name : name] = true;\n }\n }\n nonlocalvars = Object.getOwnPropertyNames(nonlocalvars).join(", ");\n if (nonlocalvars.length) {\n output.indent();\n output.print("var " + nonlocalvars);\n output.semicolon();\n output.newline();\n }\n var ρσ_Iter116 = ρσ_Iterable(imports);\n for (var ρσ_Index116 = 0; ρσ_Index116 < ρσ_Iter116.length; ρσ_Index116++) {\n module_ = ρσ_Iter116[ρσ_Index116];\n module_id = module_.module_id;\n if (module_id !== "__main__") {\n output.indent();\n if (module_id.indexOf(".") === -1) {\n output.print("ρσ_modules." + module_id);\n } else {\n output.print("ρσ_modules[\\"" + module_id + "\\"]");\n }\n [output.space(), output.print("="), output.space(), output.print("{}")];\n output.end_statement();\n }\n }\n var ρσ_Iter117 = ρσ_Iterable(imports);\n for (var ρσ_Index117 = 0; ρσ_Index117 < ρσ_Iter117.length; ρσ_Index117++) {\n module_ = ρσ_Iter117[ρσ_Index117];\n if (module_.module_id !== "__main__") {\n print_module(module_, output);\n }\n }\n };\n if (!write_imports.__argnames__) Object.defineProperties(write_imports, {\n __argnames__ : {value: ["module", "output"]},\n __module__ : {value: "output.modules"}\n });\n\n function write_main_name(output) {\n if (output.options.write_name) {\n output.newline();\n output.indent();\n output.print("var __name__ = \\"__main__\\"");\n output.semicolon();\n output.newline();\n output.newline();\n }\n };\n if (!write_main_name.__argnames__) Object.defineProperties(write_main_name, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.modules"}\n });\n\n function const_decl(js_version) {\n return "var";\n };\n if (!const_decl.__argnames__) Object.defineProperties(const_decl, {\n __argnames__ : {value: ["js_version"]},\n __module__ : {value: "output.modules"}\n });\n\n function declare_exports(module_id, exports, output, docstrings) {\n var seen, v, symbol;\n seen = Object.create(null);\n if (output.options.keep_docstrings && docstrings && docstrings.length) {\n exports.push((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = "__doc__";\n ρσ_d["refname"] = "ρσ_module_doc__";\n return ρσ_d;\n }).call(this));\n [output.newline(), output.indent()];\n v = const_decl(output.options.js_version);\n [output.assign(v + " ρσ_module_doc__"), output.print(JSON.stringify(create_doctring(docstrings)))];\n output.end_statement();\n }\n output.newline();\n var ρσ_Iter118 = ρσ_Iterable(exports);\n for (var ρσ_Index118 = 0; ρσ_Index118 < ρσ_Iter118.length; ρσ_Index118++) {\n symbol = ρσ_Iter118[ρσ_Index118];\n if (!Object.prototype.hasOwnProperty.call(seen, symbol.name)) {\n output.indent();\n if (module_id.indexOf(".") === -1) {\n output.print("ρσ_modules." + module_id + "." + symbol.name);\n } else {\n output.print("ρσ_modules[\\"" + module_id + "\\"]." + symbol.name);\n }\n [output.space(), output.print("="), output.space(), output.print(symbol.refname || symbol.name)];\n seen[ρσ_bound_index(symbol.name, seen)] = true;\n output.end_statement();\n }\n }\n };\n if (!declare_exports.__argnames__) Object.defineProperties(declare_exports, {\n __argnames__ : {value: ["module_id", "exports", "output", "docstrings"]},\n __module__ : {value: "output.modules"}\n });\n\n function prologue(module, output) {\n var v, needs_yield;\n if (output.options.omit_baselib) {\n return;\n }\n output.indent();\n v = const_decl(output.options.js_version);\n [output.print(v), output.space()];\n output.spaced.apply(output, "ρσ_iterator_symbol = (typeof Symbol === \\"function\\" && typeof Symbol.iterator === \\"symbol\\") ? Symbol.iterator : \\"iterator-Symbol-5d0927e5554349048cf0e3762a228256\\"".split(" "));\n output.end_statement();\n [output.indent(), output.print(v), output.space()];\n output.spaced.apply(output, "ρσ_kwargs_symbol = (typeof Symbol === \\"function\\") ? Symbol(\\"kwargs-object\\") : \\"kwargs-object-Symbol-5d0927e5554349048cf0e3762a228256\\"".split(" "));\n output.end_statement();\n [output.indent(), output.spaced("var", "ρσ_cond_temp,", "ρσ_expr_temp,", "ρσ_last_exception"), \n output.end_statement()];\n [output.indent(), output.spaced("var", "ρσ_object_counter", "=", "0"), output.end_statement()];\n if (output.options.js_version > 5) {\n [output.indent(), output.spaced("if(", "typeof", "HTMLCollection", "!==", "\\"undefined\\"", "&&", "typeof", "Symbol", "===", "\\"function\\")", "NodeList.prototype[Symbol.iterator]", "=", "HTMLCollection.prototype[Symbol.iterator]", "=", "NamedNodeMap.prototype[Symbol.iterator]", "=", "Array.prototype[Symbol.iterator]")];\n output.end_statement();\n }\n needs_yield = output.options.js_version < 6 && module.baselib["yield"];\n if (needs_yield) {\n output.dump_yield();\n }\n if (!output.options.baselib_plain) {\n throw new ValueError("The baselib is missing! Remember to set the baselib_plain field on the options for OutputStream");\n }\n output.print(output.options.baselib_plain);\n output.end_statement();\n };\n if (!prologue.__argnames__) Object.defineProperties(prologue, {\n __argnames__ : {value: ["module", "output"]},\n __module__ : {value: "output.modules"}\n });\n\n function print_top_level(self, output) {\n var is_main;\n set_module_name(self.module_id);\n is_main = self.module_id === "__main__";\n function write_docstrings() {\n var v;\n if (is_main && output.options.keep_docstrings && self.docstrings && self.docstrings.length) {\n [output.newline(), output.indent()];\n v = const_decl(output.options.js_version);\n [output.assign(v + " ρσ_module_doc__"), output.print(JSON.stringify(create_doctring(self.docstrings)))];\n output.end_statement();\n }\n };\n if (!write_docstrings.__module__) Object.defineProperties(write_docstrings, {\n __module__ : {value: "output.modules"}\n });\n\n if (output.options.private_scope && is_main) {\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n output.print("function()");\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n output.indent();\n output.print("\\"use strict\\"");\n output.end_statement();\n prologue(self, output);\n write_imports(self, output);\n output.newline();\n output.indent();\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n output.print("function()");\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n write_main_name(output);\n output.newline();\n declare_vars(self.localvars, output);\n display_body(self.body, true, output);\n output.newline();\n write_docstrings();\n if (self.comments_after && self.comments_after.length) {\n output.indent();\n output_comments(self.comments_after, output);\n output.newline();\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.modules"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.modules"}\n });\n return ρσ_anonfunc;\n })());\n output.print("();");\n output.newline();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.modules"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.modules"}\n });\n return ρσ_anonfunc;\n })());\n output.print("();");\n output.print("");\n } else {\n if (is_main) {\n prologue(self, output);\n write_imports(self, output);\n write_main_name(output);\n }\n declare_vars(self.localvars, output);\n display_body(self.body, true, output);\n if (self.comments_after && self.comments_after.length) {\n output_comments(self.comments_after, output);\n }\n }\n set_module_name();\n };\n if (!print_top_level.__argnames__) Object.defineProperties(print_top_level, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.modules"}\n });\n\n function print_module(self, output) {\n set_module_name(self.module_id);\n function output_module(output) {\n declare_vars(self.localvars, output);\n display_body(self.body, true, output);\n declare_exports(self.module_id, self.exports, output, self.docstrings);\n };\n if (!output_module.__argnames__) Object.defineProperties(output_module, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.modules"}\n });\n\n output.newline();\n output.indent();\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n output.print("function()");\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n var okey, cached, cobj, cname, symdef, co, raw, js_version, keep_docstrings, beautify;\n print_comments(self, output);\n if (output.options.write_name) {\n output.indent();\n output.print("var ");\n output.assign("__name__");\n output.print("\\"" + self.module_id + "\\"");\n output.semicolon();\n output.newline();\n }\n function output_key(beautify, keep_docstrings, js_version) {\n return "beautify:" + beautify + " keep_docstrings:" + keep_docstrings + " js_version:" + js_version;\n };\n if (!output_key.__argnames__) Object.defineProperties(output_key, {\n __argnames__ : {value: ["beautify", "keep_docstrings", "js_version"]},\n __module__ : {value: "output.modules"}\n });\n\n okey = output_key(output.options.beautify, output.options.keep_docstrings, output.options.js_version);\n if (self.is_cached && ρσ_in(okey, self.outputs)) {\n output.print((ρσ_expr_temp = self.outputs)[(typeof okey === "number" && okey < 0) ? ρσ_expr_temp.length + okey : okey]);\n } else {\n output_module(output);\n if (self.srchash && self.filename) {\n cached = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["version"] = get_compiler_version();\n ρσ_d["signature"] = self.srchash;\n ρσ_d["classes"] = Object.create(null);\n ρσ_d["baselib"] = self.baselib;\n ρσ_d["nonlocalvars"] = self.nonlocalvars;\n ρσ_d["imported_module_ids"] = self.imported_module_ids;\n ρσ_d["exports"] = ρσ_list_decorate([]);\n ρσ_d["outputs"] = Object.create(null);\n ρσ_d["discard_asserts"] = !!output.options.discard_asserts;\n return ρσ_d;\n }).call(this);\n var ρσ_Iter119 = ρσ_Iterable(Object.keys(self.classes));\n for (var ρσ_Index119 = 0; ρσ_Index119 < ρσ_Iter119.length; ρσ_Index119++) {\n cname = ρσ_Iter119[ρσ_Index119];\n cobj = (ρσ_expr_temp = self.classes)[(typeof cname === "number" && cname < 0) ? ρσ_expr_temp.length + cname : cname];\n (ρσ_expr_temp = cached.classes)[(typeof cname === "number" && cname < 0) ? ρσ_expr_temp.length + cname : cname] = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = (function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = cobj.name.name;\n return ρσ_d;\n }).call(this);\n ρσ_d["static"] = cobj.static;\n ρσ_d["bound"] = cobj.bound;\n ρσ_d["classvars"] = cobj.classvars;\n return ρσ_d;\n }).call(this);\n }\n var ρσ_Iter120 = ρσ_Iterable(self.exports);\n for (var ρσ_Index120 = 0; ρσ_Index120 < ρσ_Iter120.length; ρσ_Index120++) {\n symdef = ρσ_Iter120[ρσ_Index120];\n cached.exports.push((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["name"] = symdef.name;\n return ρσ_d;\n }).call(this));\n }\n var ρσ_Iter121 = ρσ_Iterable(ρσ_list_decorate([ true, false ]));\n for (var ρσ_Index121 = 0; ρσ_Index121 < ρσ_Iter121.length; ρσ_Index121++) {\n beautify = ρσ_Iter121[ρσ_Index121];\n var ρσ_Iter122 = ρσ_Iterable(ρσ_list_decorate([ true, false ]));\n for (var ρσ_Index122 = 0; ρσ_Index122 < ρσ_Iter122.length; ρσ_Index122++) {\n keep_docstrings = ρσ_Iter122[ρσ_Index122];\n var ρσ_Iter123 = ρσ_Iterable(ρσ_list_decorate([ 5, 6 ]));\n for (var ρσ_Index123 = 0; ρσ_Index123 < ρσ_Iter123.length; ρσ_Index123++) {\n js_version = ρσ_Iter123[ρσ_Index123];\n co = new OutputStream((function(){\n var ρσ_d = Object.create(null);\n ρσ_d["beautify"] = beautify;\n ρσ_d["keep_docstrings"] = keep_docstrings;\n ρσ_d["js_version"] = js_version;\n ρσ_d["private_scope"] = false;\n ρσ_d["write_name"] = false;\n ρσ_d["discard_asserts"] = output.options.discard_asserts;\n return ρσ_d;\n }).call(this));\n co.with_indent(output.indentation(), (function() {\n var ρσ_anonfunc = function () {\n output_module(co);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.modules"}\n });\n return ρσ_anonfunc;\n })());\n raw = co.get();\n (ρσ_expr_temp = cached.outputs)[ρσ_bound_index(output_key(beautify, keep_docstrings, js_version), ρσ_expr_temp)] = raw;\n }\n }\n }\n try {\n writefile(cache_file_name(self.filename, output.options.module_cache_dir), JSON.stringify(cached, null, "\\t"));\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n if (ρσ_Exception instanceof Error) {\n var e = ρσ_Exception;\n console.error("Failed to write output cache file:", self.filename + "-cached", "with error:", e);\n } else {\n throw ρσ_Exception;\n }\n }\n }\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.modules"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.modules"}\n });\n return ρσ_anonfunc;\n })());\n output.print("()");\n output.semicolon();\n output.newline();\n set_module_name();\n };\n if (!print_module.__argnames__) Object.defineProperties(print_module, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.modules"}\n });\n\n function print_imports(container, output) {\n var is_first_aname, akey, argname, parts, q, ρσ_unpack, i, part, self;\n is_first_aname = true;\n function add_aname(aname, key, from_import) {\n if (is_first_aname) {\n is_first_aname = false;\n } else {\n output.indent();\n }\n output.print("var ");\n output.assign(aname);\n if (key.indexOf(".") === -1) {\n [output.print("ρσ_modules."), output.print(key)];\n } else {\n [output.print("ρσ_modules[\\""), output.print(key), output.print("\\"]")];\n }\n if (from_import) {\n output.print(".");\n output.print(from_import);\n }\n output.end_statement();\n };\n if (!add_aname.__argnames__) Object.defineProperties(add_aname, {\n __argnames__ : {value: ["aname", "key", "from_import"]},\n __module__ : {value: "output.modules"}\n });\n\n var ρσ_Iter124 = ρσ_Iterable(container.imports);\n for (var ρσ_Index124 = 0; ρσ_Index124 < ρσ_Iter124.length; ρσ_Index124++) {\n self = ρσ_Iter124[ρσ_Index124];\n if (self.argnames) {\n var ρσ_Iter125 = ρσ_Iterable(self.argnames);\n for (var ρσ_Index125 = 0; ρσ_Index125 < ρσ_Iter125.length; ρσ_Index125++) {\n argname = ρσ_Iter125[ρσ_Index125];\n akey = (argname.alias) ? argname.alias.name : argname.name;\n add_aname(akey, self.key, argname.name);\n }\n } else {\n if (self.alias) {\n add_aname(self.alias.name, self.key, false);\n } else {\n parts = self.key.split(".");\n var ρσ_Iter126 = ρσ_Iterable(enumerate(parts));\n for (var ρσ_Index126 = 0; ρσ_Index126 < ρσ_Iter126.length; ρσ_Index126++) {\n ρσ_unpack = ρσ_Iter126[ρσ_Index126];\n i = ρσ_unpack[0];\n part = ρσ_unpack[1];\n if (i === 0) {\n add_aname(part, part, false);\n } else {\n q = parts.slice(0, i + 1).join(".");\n output.indent();\n output.spaced(q, "=", "ρσ_modules[\\"" + q + "\\"]");\n output.end_statement();\n }\n }\n }\n }\n }\n };\n if (!print_imports.__argnames__) Object.defineProperties(print_imports, {\n __argnames__ : {value: ["container", "output"]},\n __module__ : {value: "output.modules"}\n });\n\n ρσ_modules["output.modules"].write_imports = write_imports;\n ρσ_modules["output.modules"].write_main_name = write_main_name;\n ρσ_modules["output.modules"].const_decl = const_decl;\n ρσ_modules["output.modules"].declare_exports = declare_exports;\n ρσ_modules["output.modules"].prologue = prologue;\n ρσ_modules["output.modules"].print_top_level = print_top_level;\n ρσ_modules["output.modules"].print_module = print_module;\n ρσ_modules["output.modules"].print_imports = print_imports;\n })();\n\n (function(){\n var __name__ = "output.codegen";\n var noop = ρσ_modules.utils.noop;\n\n var PRECEDENCE = ρσ_modules.parse.PRECEDENCE;\n\n var AST_Array = ρσ_modules.ast.AST_Array;\n var AST_Assign = ρσ_modules.ast.AST_Assign;\n var AST_BaseCall = ρσ_modules.ast.AST_BaseCall;\n var AST_Binary = ρσ_modules.ast.AST_Binary;\n var AST_BlockStatement = ρσ_modules.ast.AST_BlockStatement;\n var AST_Break = ρσ_modules.ast.AST_Break;\n var AST_Class = ρσ_modules.ast.AST_Class;\n var AST_Conditional = ρσ_modules.ast.AST_Conditional;\n var AST_Constant = ρσ_modules.ast.AST_Constant;\n var AST_Continue = ρσ_modules.ast.AST_Continue;\n var AST_Debugger = ρσ_modules.ast.AST_Debugger;\n var AST_Definitions = ρσ_modules.ast.AST_Definitions;\n var AST_Directive = ρσ_modules.ast.AST_Directive;\n var AST_Do = ρσ_modules.ast.AST_Do;\n var AST_Dot = ρσ_modules.ast.AST_Dot;\n var is_node_type = ρσ_modules.ast.is_node_type;\n var AST_EmptyStatement = ρσ_modules.ast.AST_EmptyStatement;\n var AST_Exit = ρσ_modules.ast.AST_Exit;\n var AST_ExpressiveObject = ρσ_modules.ast.AST_ExpressiveObject;\n var AST_ForIn = ρσ_modules.ast.AST_ForIn;\n var AST_ForJS = ρσ_modules.ast.AST_ForJS;\n var AST_Function = ρσ_modules.ast.AST_Function;\n var AST_Hole = ρσ_modules.ast.AST_Hole;\n var AST_If = ρσ_modules.ast.AST_If;\n var AST_Imports = ρσ_modules.ast.AST_Imports;\n var AST_Infinity = ρσ_modules.ast.AST_Infinity;\n var AST_Lambda = ρσ_modules.ast.AST_Lambda;\n var AST_ListComprehension = ρσ_modules.ast.AST_ListComprehension;\n var AST_LoopControl = ρσ_modules.ast.AST_LoopControl;\n var AST_NaN = ρσ_modules.ast.AST_NaN;\n var AST_New = ρσ_modules.ast.AST_New;\n var AST_Node = ρσ_modules.ast.AST_Node;\n var AST_Number = ρσ_modules.ast.AST_Number;\n var AST_Object = ρσ_modules.ast.AST_Object;\n var AST_ObjectKeyVal = ρσ_modules.ast.AST_ObjectKeyVal;\n var AST_ObjectProperty = ρσ_modules.ast.AST_ObjectProperty;\n var AST_PropAccess = ρσ_modules.ast.AST_PropAccess;\n var AST_RegExp = ρσ_modules.ast.AST_RegExp;\n var AST_Return = ρσ_modules.ast.AST_Return;\n var AST_Set = ρσ_modules.ast.AST_Set;\n var AST_Seq = ρσ_modules.ast.AST_Seq;\n var AST_SimpleStatement = ρσ_modules.ast.AST_SimpleStatement;\n var AST_Splice = ρσ_modules.ast.AST_Splice;\n var AST_Statement = ρσ_modules.ast.AST_Statement;\n var AST_StatementWithBody = ρσ_modules.ast.AST_StatementWithBody;\n var AST_String = ρσ_modules.ast.AST_String;\n var AST_Sub = ρσ_modules.ast.AST_Sub;\n var AST_ItemAccess = ρσ_modules.ast.AST_ItemAccess;\n var AST_Symbol = ρσ_modules.ast.AST_Symbol;\n var AST_This = ρσ_modules.ast.AST_This;\n var AST_Throw = ρσ_modules.ast.AST_Throw;\n var AST_Toplevel = ρσ_modules.ast.AST_Toplevel;\n var AST_Try = ρσ_modules.ast.AST_Try;\n var AST_Unary = ρσ_modules.ast.AST_Unary;\n var AST_UnaryPrefix = ρσ_modules.ast.AST_UnaryPrefix;\n var AST_Undefined = ρσ_modules.ast.AST_Undefined;\n var AST_Var = ρσ_modules.ast.AST_Var;\n var AST_VarDef = ρσ_modules.ast.AST_VarDef;\n var AST_Assert = ρσ_modules.ast.AST_Assert;\n var AST_Verbatim = ρσ_modules.ast.AST_Verbatim;\n var AST_While = ρσ_modules.ast.AST_While;\n var AST_With = ρσ_modules.ast.AST_With;\n var AST_Yield = ρσ_modules.ast.AST_Yield;\n var TreeWalker = ρσ_modules.ast.TreeWalker;\n var AST_Existential = ρσ_modules.ast.AST_Existential;\n\n var print_try = ρσ_modules["output.exceptions"].print_try;\n\n var print_class = ρσ_modules["output.classes"].print_class;\n\n var print_array = ρσ_modules["output.literals"].print_array;\n var print_obj_literal = ρσ_modules["output.literals"].print_obj_literal;\n var print_object = ρσ_modules["output.literals"].print_object;\n var print_set = ρσ_modules["output.literals"].print_set;\n var print_regexp = ρσ_modules["output.literals"].print_regexp;\n\n var print_do_loop = ρσ_modules["output.loops"].print_do_loop;\n var print_while_loop = ρσ_modules["output.loops"].print_while_loop;\n var print_for_loop_body = ρσ_modules["output.loops"].print_for_loop_body;\n var print_for_in = ρσ_modules["output.loops"].print_for_in;\n var print_list_comprehension = ρσ_modules["output.loops"].print_list_comprehension;\n\n var print_top_level = ρσ_modules["output.modules"].print_top_level;\n var print_imports = ρσ_modules["output.modules"].print_imports;\n\n var print_comments = ρσ_modules["output.comments"].print_comments;\n\n var print_getattr = ρσ_modules["output.operators"].print_getattr;\n var print_getitem = ρσ_modules["output.operators"].print_getitem;\n var print_rich_getitem = ρσ_modules["output.operators"].print_rich_getitem;\n var print_splice_assignment = ρσ_modules["output.operators"].print_splice_assignment;\n var print_unary_prefix = ρσ_modules["output.operators"].print_unary_prefix;\n var print_binary_op = ρσ_modules["output.operators"].print_binary_op;\n var print_assign = ρσ_modules["output.operators"].print_assign;\n var print_conditional = ρσ_modules["output.operators"].print_conditional;\n var print_seq = ρσ_modules["output.operators"].print_seq;\n var print_existential = ρσ_modules["output.operators"].print_existential;\n\n var print_function = ρσ_modules["output.functions"].print_function;\n var print_function_call = ρσ_modules["output.functions"].print_function_call;\n\n var print_bracketed = ρσ_modules["output.statements"].print_bracketed;\n var first_in_statement = ρσ_modules["output.statements"].first_in_statement;\n var force_statement = ρσ_modules["output.statements"].force_statement;\n var print_with = ρσ_modules["output.statements"].print_with;\n var print_assert = ρσ_modules["output.statements"].print_assert;\n\n var make_block = ρσ_modules["output.utils"].make_block;\n var make_num = ρσ_modules["output.utils"].make_num;\n\n function generate_code() {\n function DEFPRINT(nodetype, generator) {\n nodetype.prototype._codegen = generator;\n };\n if (!DEFPRINT.__argnames__) Object.defineProperties(DEFPRINT, {\n __argnames__ : {value: ["nodetype", "generator"]},\n __module__ : {value: "output.codegen"}\n });\n\n AST_Node.prototype.print = (function() {\n var ρσ_anonfunc = function (stream, force_parens) {\n var self, generator;\n self = this;\n generator = self._codegen;\n stream.push_node(self);\n if (force_parens || self.needs_parens(stream)) {\n stream.with_parens((function() {\n var ρσ_anonfunc = function () {\n self.add_comments(stream);\n generator(self, stream);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n } else {\n self.add_comments(stream);\n generator(self, stream);\n }\n stream.pop_node();\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["stream", "force_parens"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })();\n AST_Node.prototype.add_comments = (function() {\n var ρσ_anonfunc = function (output) {\n if (!is_node_type(this, AST_Toplevel)) {\n print_comments(this, output);\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })();\n function PARENS(nodetype, func) {\n nodetype.prototype.needs_parens = func;\n };\n if (!PARENS.__argnames__) Object.defineProperties(PARENS, {\n __argnames__ : {value: ["nodetype", "func"]},\n __module__ : {value: "output.codegen"}\n });\n\n PARENS(AST_Node, (function() {\n var ρσ_anonfunc = function () {\n return false;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n PARENS(AST_Function, (function() {\n var ρσ_anonfunc = function (output) {\n return first_in_statement(output);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n PARENS(AST_Object, (function() {\n var ρσ_anonfunc = function (output) {\n return first_in_statement(output);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n PARENS(AST_Unary, (function() {\n var ρσ_anonfunc = function (output) {\n var p;\n p = output.parent();\n return is_node_type(p, AST_PropAccess) && p.expression === this;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n PARENS(AST_Seq, (function() {\n var ρσ_anonfunc = function (output) {\n var p;\n p = output.parent();\n return is_node_type(p, AST_Unary) || is_node_type(p, AST_VarDef) || is_node_type(p, AST_Dot) || is_node_type(p, AST_ObjectProperty) || is_node_type(p, AST_Conditional);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n PARENS(AST_Binary, (function() {\n var ρσ_anonfunc = function (output) {\n var p, po, pp, so, sp;\n p = output.parent();\n if (is_node_type(p, AST_BaseCall) && p.expression === this) {\n return true;\n }\n if (is_node_type(p, AST_Unary)) {\n return true;\n }\n if (is_node_type(p, AST_PropAccess) && p.expression === this) {\n return true;\n }\n if (is_node_type(p, AST_Binary)) {\n po = p.operator;\n pp = PRECEDENCE[(typeof po === "number" && po < 0) ? PRECEDENCE.length + po : po];\n so = this.operator;\n sp = PRECEDENCE[(typeof so === "number" && so < 0) ? PRECEDENCE.length + so : so];\n if (pp > sp || pp === sp && this === p.right && !((so === po && (so === "*" || so === "&&" || so === "||")))) {\n return true;\n }\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n PARENS(AST_PropAccess, (function() {\n var ρσ_anonfunc = function (output) {\n var p;\n p = output.parent();\n if (is_node_type(p, AST_New) && p.expression === this) {\n try {\n this.walk(new TreeWalker((function() {\n var ρσ_anonfunc = function (node) {\n if (is_node_type(node, AST_BaseCall)) {\n throw p;\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["node"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })()));\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n {\n var ex = ρσ_Exception;\n if (ex !== p) {\n throw ex;\n }\n return true;\n } \n }\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n PARENS(AST_BaseCall, (function() {\n var ρσ_anonfunc = function (output) {\n var p;\n p = output.parent();\n return is_node_type(p, AST_New) && p.expression === this;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n PARENS(AST_New, (function() {\n var ρσ_anonfunc = function (output) {\n var p;\n p = output.parent();\n if (this.args.length === 0 && (is_node_type(p, AST_PropAccess) || is_node_type(p, AST_BaseCall) && p.expression === this)) {\n return true;\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n PARENS(AST_Number, (function() {\n var ρσ_anonfunc = function (output) {\n var p;\n p = output.parent();\n if (this.value < 0 && is_node_type(p, AST_PropAccess) && p.expression === this) {\n return true;\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n PARENS(AST_NaN, (function() {\n var ρσ_anonfunc = function (output) {\n var p;\n p = output.parent();\n if (is_node_type(p, AST_PropAccess) && p.expression === this) {\n return true;\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n function assign_and_conditional_paren_rules(output) {\n var p;\n p = output.parent();\n if (is_node_type(p, AST_Unary)) {\n return true;\n }\n if (is_node_type(p, AST_Binary) && !(is_node_type(p, AST_Assign))) {\n return true;\n }\n if (is_node_type(p, AST_BaseCall) && p.expression === this) {\n return true;\n }\n if (is_node_type(p, AST_Conditional) && p.condition === this) {\n return true;\n }\n if (is_node_type(p, AST_PropAccess) && p.expression === this) {\n return true;\n }\n };\n if (!assign_and_conditional_paren_rules.__argnames__) Object.defineProperties(assign_and_conditional_paren_rules, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.codegen"}\n });\n\n PARENS(AST_Assign, assign_and_conditional_paren_rules);\n PARENS(AST_Conditional, assign_and_conditional_paren_rules);\n DEFPRINT(AST_Directive, (function() {\n var ρσ_anonfunc = function (self, output) {\n output.print_string(self.value);\n output.semicolon();\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_Debugger, (function() {\n var ρσ_anonfunc = function (self, output) {\n output.print("debugger");\n output.semicolon();\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n AST_StatementWithBody.prototype._do_print_body = (function() {\n var ρσ_anonfunc = function (output) {\n force_statement(this.body, output);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })();\n DEFPRINT(AST_Statement, (function() {\n var ρσ_anonfunc = function (self, output) {\n self.body.print(output);\n output.semicolon();\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_Toplevel, print_top_level);\n DEFPRINT(AST_Imports, print_imports);\n DEFPRINT(AST_SimpleStatement, (function() {\n var ρσ_anonfunc = function (self, output) {\n if (!(is_node_type(self.body, AST_EmptyStatement))) {\n self.body.print(output);\n output.semicolon();\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_BlockStatement, (function() {\n var ρσ_anonfunc = function (self, output) {\n print_bracketed(self, output);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_EmptyStatement, (function() {\n var ρσ_anonfunc = function (self, output) {\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_Do, print_do_loop);\n DEFPRINT(AST_While, print_while_loop);\n AST_ForIn.prototype._do_print_body = print_for_loop_body;\n DEFPRINT(AST_ForIn, print_for_in);\n AST_ForJS.prototype._do_print_body = (function() {\n var ρσ_anonfunc = function (output) {\n var self;\n self = this;\n output.with_block((function() {\n var ρσ_anonfunc = function () {\n var stmt;\n var ρσ_Iter127 = ρσ_Iterable(self.body.body);\n for (var ρσ_Index127 = 0; ρσ_Index127 < ρσ_Iter127.length; ρσ_Index127++) {\n stmt = ρσ_Iter127[ρσ_Index127];\n output.indent();\n stmt.print(output);\n output.newline();\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })();\n DEFPRINT(AST_ForJS, (function() {\n var ρσ_anonfunc = function (self, output) {\n output.print("for");\n output.space();\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n self.condition.print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n output.space();\n self._do_print_body(output);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_ListComprehension, print_list_comprehension);\n DEFPRINT(AST_With, print_with);\n DEFPRINT(AST_Assert, print_assert);\n AST_Lambda.prototype._do_print = print_function;\n DEFPRINT(AST_Lambda, (function() {\n var ρσ_anonfunc = function (self, output) {\n self._do_print(output);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n AST_Class.prototype._do_print = print_class;\n DEFPRINT(AST_Class, (function() {\n var ρσ_anonfunc = function (self, output) {\n self._do_print(output);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n AST_Exit.prototype._do_print = (function() {\n var ρσ_anonfunc = function (output, kind) {\n var self;\n self = this;\n output.print(kind);\n if (self.value) {\n output.space();\n self.value.print(output);\n }\n output.semicolon();\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output", "kind"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })();\n DEFPRINT(AST_Yield, (function() {\n var ρσ_anonfunc = function (self, output) {\n self._do_print(output, "yield" + ((self.is_yield_from) ? "*" : ""));\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_Return, (function() {\n var ρσ_anonfunc = function (self, output) {\n self._do_print(output, "return");\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_Throw, (function() {\n var ρσ_anonfunc = function (self, output) {\n self._do_print(output, "throw");\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n AST_LoopControl.prototype._do_print = (function() {\n var ρσ_anonfunc = function (output, kind) {\n output.print(kind);\n if (this.label) {\n output.space();\n this.label.print(output);\n }\n output.semicolon();\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output", "kind"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })();\n DEFPRINT(AST_Break, (function() {\n var ρσ_anonfunc = function (self, output) {\n self._do_print(output, "break");\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_Continue, (function() {\n var ρσ_anonfunc = function (self, output) {\n self._do_print(output, "continue");\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n function make_then(self, output) {\n var b;\n if (output.options.bracketize) {\n make_block(self.body, output);\n return;\n }\n if (!self.body) {\n return output.force_semicolon();\n }\n if (is_node_type(self.body, AST_Do) && output.options.ie_proof) {\n make_block(self.body, output);\n return;\n }\n b = self.body;\n while (true) {\n if (is_node_type(b, AST_If)) {\n if (!b.alternative) {\n make_block(self.body, output);\n return;\n }\n b = b.alternative;\n } else if (is_node_type(b, AST_StatementWithBody)) {\n b = b.body;\n } else {\n break;\n }\n }\n force_statement(self.body, output);\n };\n if (!make_then.__argnames__) Object.defineProperties(make_then, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n\n DEFPRINT(AST_If, (function() {\n var ρσ_anonfunc = function (self, output) {\n output.print("if");\n output.space();\n output.with_parens((function() {\n var ρσ_anonfunc = function () {\n self.condition.print(output);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n output.space();\n if (self.alternative) {\n make_then(self, output);\n output.space();\n output.print("else");\n output.space();\n force_statement(self.alternative, output);\n } else {\n self._do_print_body(output);\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_Try, print_try);\n AST_Definitions.prototype._do_print = (function() {\n var ρσ_anonfunc = function (output, kind) {\n var ρσ_unpack, i, def_, p, in_for, avoid_semicolon;\n output.print(kind);\n output.space();\n var ρσ_Iter128 = ρσ_Iterable(enumerate(this.definitions));\n for (var ρσ_Index128 = 0; ρσ_Index128 < ρσ_Iter128.length; ρσ_Index128++) {\n ρσ_unpack = ρσ_Iter128[ρσ_Index128];\n i = ρσ_unpack[0];\n def_ = ρσ_unpack[1];\n if (i) {\n output.comma();\n }\n def_.print(output);\n }\n p = output.parent();\n in_for = is_node_type(p, AST_ForIn);\n avoid_semicolon = in_for && p.init === this;\n if (!avoid_semicolon) {\n output.semicolon();\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["output", "kind"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })();\n DEFPRINT(AST_Var, (function() {\n var ρσ_anonfunc = function (self, output) {\n self._do_print(output, "var");\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n function parenthesize_for_noin(node, output, noin) {\n if (!noin) {\n node.print(output);\n } else {\n try {\n node.walk(new TreeWalker((function() {\n var ρσ_anonfunc = function (node) {\n if (is_node_type(node, AST_Binary) && node.operator === "in") {\n throw output;\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["node"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })()));\n node.print(output);\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n {\n var ex = ρσ_Exception;\n if (ex !== output) {\n throw ex;\n }\n node.print(output, true);\n } \n }\n }\n };\n if (!parenthesize_for_noin.__argnames__) Object.defineProperties(parenthesize_for_noin, {\n __argnames__ : {value: ["node", "output", "noin"]},\n __module__ : {value: "output.codegen"}\n });\n\n DEFPRINT(AST_VarDef, (function() {\n var ρσ_anonfunc = function (self, output) {\n var p, noin;\n self.name.print(output);\n if (self.value) {\n output.assign("");\n p = output.parent(1);\n noin = is_node_type(p, AST_ForIn);\n parenthesize_for_noin(self.value, output, noin);\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_BaseCall, print_function_call);\n AST_Seq.prototype._do_print = print_seq;\n DEFPRINT(AST_Seq, (function() {\n var ρσ_anonfunc = function (self, output) {\n self._do_print(output);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_Dot, print_getattr);\n DEFPRINT(AST_Sub, print_getitem);\n DEFPRINT(AST_ItemAccess, print_rich_getitem);\n DEFPRINT(AST_Splice, print_splice_assignment);\n DEFPRINT(AST_UnaryPrefix, print_unary_prefix);\n DEFPRINT(AST_Binary, print_binary_op);\n DEFPRINT(AST_Existential, print_existential);\n DEFPRINT(AST_Assign, print_assign);\n DEFPRINT(AST_Conditional, print_conditional);\n DEFPRINT(AST_Array, print_array);\n DEFPRINT(AST_ExpressiveObject, print_obj_literal);\n DEFPRINT(AST_Object, print_object);\n DEFPRINT(AST_ObjectKeyVal, (function() {\n var ρσ_anonfunc = function (self, output) {\n self.key.print(output);\n output.colon();\n self.value.print(output);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_Set, print_set);\n AST_Symbol.prototype.definition = (function() {\n var ρσ_anonfunc = function () {\n return this.thedef;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })();\n DEFPRINT(AST_Symbol, (function() {\n var ρσ_anonfunc = function (self, output) {\n var def_;\n def_ = self.definition();\n output.print_name((def_) ? def_.mangled_name || def_.name : self.name);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_Undefined, (function() {\n var ρσ_anonfunc = function (self, output) {\n output.print("void 0");\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_Hole, noop);\n DEFPRINT(AST_Infinity, (function() {\n var ρσ_anonfunc = function (self, output) {\n output.print("1/0");\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_NaN, (function() {\n var ρσ_anonfunc = function (self, output) {\n output.print("0/0");\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_This, (function() {\n var ρσ_anonfunc = function (self, output) {\n output.print("this");\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_Constant, (function() {\n var ρσ_anonfunc = function (self, output) {\n output.print(self.value);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_String, (function() {\n var ρσ_anonfunc = function (self, output) {\n output.print_string(self.value);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_Verbatim, (function() {\n var ρσ_anonfunc = function (self, output) {\n output.print(self.value);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_Number, (function() {\n var ρσ_anonfunc = function (self, output) {\n output.print(make_num(self.value));\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["self", "output"]},\n __module__ : {value: "output.codegen"}\n });\n return ρσ_anonfunc;\n })());\n DEFPRINT(AST_RegExp, print_regexp);\n };\n if (!generate_code.__module__) Object.defineProperties(generate_code, {\n __module__ : {value: "output.codegen"}\n });\n\n ρσ_modules["output.codegen"].generate_code = generate_code;\n })();\n\n (function(){\n\n var __name__ = "__main__";\n\n\n var ast, ast_node;\n var DefaultsError = ρσ_modules.utils.DefaultsError;\n var string_template = ρσ_modules.utils.string_template;\n\n var ImportError = ρσ_modules.errors.ImportError;\n var SyntaxError = ρσ_modules.errors.SyntaxError;\n\n var ALL_KEYWORDS = ρσ_modules.tokenizer.ALL_KEYWORDS;\n var IDENTIFIER_PAT = ρσ_modules.tokenizer.IDENTIFIER_PAT;\n var tokenizer = ρσ_modules.tokenizer.tokenizer;\n\n var parse = ρσ_modules.parse.parse;\n var NATIVE_CLASSES = ρσ_modules.parse.NATIVE_CLASSES;\n var compile_time_decorators = ρσ_modules.parse.compile_time_decorators;\n\n var OutputStream = ρσ_modules["output.stream"].OutputStream;\n\n var generate_code = ρσ_modules["output.codegen"].generate_code;\n\n generate_code();\n if (typeof exports === "object") {\n exports.DefaultsError = DefaultsError;\n exports.parse = parse;\n exports.compile_time_decorators = compile_time_decorators;\n exports.OutputStream = OutputStream;\n exports.string_template = string_template;\n exports.ALL_KEYWORDS = ALL_KEYWORDS;\n exports.IDENTIFIER_PAT = IDENTIFIER_PAT;\n exports.NATIVE_CLASSES = NATIVE_CLASSES;\n exports.ImportError = ImportError;\n exports.SyntaxError = SyntaxError;\n exports.tokenizer = tokenizer;\n ast = ρσ_modules["ast"];\n var ρσ_Iter129 = ρσ_Iterable(ast);\n for (var ρσ_Index129 = 0; ρσ_Index129 < ρσ_Iter129.length; ρσ_Index129++) {\n ast_node = ρσ_Iter129[ρσ_Index129];\n if (ast_node.substr(0, 4) === "AST_") {\n exports[(typeof ast_node === "number" && ast_node < 0) ? exports.length + ast_node : ast_node] = ast[(typeof ast_node === "number" && ast_node < 0) ? ast.length + ast_node : ast_node];\n }\n }\n }\n })();\n})();',"baselib-plain-pretty.js":'var ρσ_len;\nfunction ρσ_bool(val) {\n return !!val;\n};\nif (!ρσ_bool.__argnames__) Object.defineProperties(ρσ_bool, {\n __argnames__ : {value: ["val"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_print() {\n var parts;\n if (typeof console === "object") {\n parts = [];\n for (var i = 0; i < arguments.length; i++) {\n parts.push(ρσ_str(arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i]));\n }\n console.log(parts.join(" "));\n }\n};\nif (!ρσ_print.__module__) Object.defineProperties(ρσ_print, {\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_int(val, base) {\n var ans;\n if (typeof val === "number") {\n ans = val | 0;\n } else {\n ans = parseInt(val, base || 10);\n }\n if (isNaN(ans)) {\n throw new ValueError("Invalid literal for int with base " + (base || 10) + ": " + val);\n }\n return ans;\n};\nif (!ρσ_int.__argnames__) Object.defineProperties(ρσ_int, {\n __argnames__ : {value: ["val", "base"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_float(val) {\n var ans;\n if (typeof val === "number") {\n ans = val;\n } else {\n ans = parseFloat(val);\n }\n if (isNaN(ans)) {\n throw new ValueError("Could not convert string to float: " + arguments[0]);\n }\n return ans;\n};\nif (!ρσ_float.__argnames__) Object.defineProperties(ρσ_float, {\n __argnames__ : {value: ["val"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_arraylike_creator() {\n var names;\n names = "Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" ");\n if (typeof HTMLCollection === "function") {\n names = names.concat("HTMLCollection NodeList NamedNodeMap TouchList".split(" "));\n }\n return (function() {\n var ρσ_anonfunc = function (x) {\n if (Array.isArray(x) || typeof x === "string" || names.indexOf(Object.prototype.toString.call(x).slice(8, -1)) > -1) {\n return true;\n }\n return false;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n};\nif (!ρσ_arraylike_creator.__module__) Object.defineProperties(ρσ_arraylike_creator, {\n __module__ : {value: "__main__"}\n});\n\nfunction options_object(f) {\n return (function() {\n var ρσ_anonfunc = function () {\n if (typeof arguments[arguments.length - 1] === "object") {\n arguments[ρσ_bound_index(arguments.length - 1, arguments)][ρσ_kwargs_symbol] = true;\n }\n return f.apply(this, arguments);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n};\nif (!options_object.__argnames__) Object.defineProperties(options_object, {\n __argnames__ : {value: ["f"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_id(x) {\n return x.ρσ_object_id;\n};\nif (!ρσ_id.__argnames__) Object.defineProperties(ρσ_id, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_dir(item) {\n var arr;\n arr = ρσ_list_decorate([]);\n for (var i in item) {\n arr.push(i);\n }\n return arr;\n};\nif (!ρσ_dir.__argnames__) Object.defineProperties(ρσ_dir, {\n __argnames__ : {value: ["item"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_ord(x) {\n var ans, second;\n ans = x.charCodeAt(0);\n if (55296 <= ans && ans <= 56319) {\n second = x.charCodeAt(1);\n if (56320 <= second && second <= 57343) {\n return (ans - 55296) * 1024 + second - 56320 + 65536;\n }\n throw new TypeError("string is missing the low surrogate char");\n }\n return ans;\n};\nif (!ρσ_ord.__argnames__) Object.defineProperties(ρσ_ord, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_chr(code) {\n if (code <= 65535) {\n return String.fromCharCode(code);\n }\n code -= 65536;\n return String.fromCharCode(55296 + (code >> 10), 56320 + (code & 1023));\n};\nif (!ρσ_chr.__argnames__) Object.defineProperties(ρσ_chr, {\n __argnames__ : {value: ["code"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_callable(x) {\n return typeof x === "function";\n};\nif (!ρσ_callable.__argnames__) Object.defineProperties(ρσ_callable, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_bin(x) {\n var ans;\n if (typeof x !== "number" || x % 1 !== 0) {\n throw new TypeError("integer required");\n }\n ans = x.toString(2);\n if (ans[0] === "-") {\n ans = "-" + "0b" + ans.slice(1);\n } else {\n ans = "0b" + ans;\n }\n return ans;\n};\nif (!ρσ_bin.__argnames__) Object.defineProperties(ρσ_bin, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_hex(x) {\n var ans;\n if (typeof x !== "number" || x % 1 !== 0) {\n throw new TypeError("integer required");\n }\n ans = x.toString(16);\n if (ans[0] === "-") {\n ans = "-" + "0x" + ans.slice(1);\n } else {\n ans = "0x" + ans;\n }\n return ans;\n};\nif (!ρσ_hex.__argnames__) Object.defineProperties(ρσ_hex, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_enumerate(iterable) {\n var ans, iterator;\n ans = {"_i":-1};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n if (ρσ_arraylike(iterable)) {\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n this._i += 1;\n if (this._i < iterable.length) {\n return {\'done\':false, \'value\':[this._i, iterable[this._i]]};\n }\n return {\'done\':true};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n }\n if (typeof iterable[ρσ_iterator_symbol] === "function") {\n iterator = (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();\n ans["_iterator"] = iterator;\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n var r;\n r = this._iterator.next();\n if (r.done) {\n return {\'done\':true};\n }\n this._i += 1;\n return {\'done\':false, \'value\':[this._i, r.value]};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n }\n return ρσ_enumerate(Object.keys(iterable));\n};\nif (!ρσ_enumerate.__argnames__) Object.defineProperties(ρσ_enumerate, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_reversed(iterable) {\n var ans;\n if (ρσ_arraylike(iterable)) {\n ans = {"_i": iterable.length};\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n this._i -= 1;\n if (this._i > -1) {\n return {\'done\':false, \'value\':iterable[this._i]};\n }\n return {\'done\':true};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n }\n throw new TypeError("reversed() can only be called on arrays or strings");\n};\nif (!ρσ_reversed.__argnames__) Object.defineProperties(ρσ_reversed, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_iter(iterable) {\n var ans;\n if (typeof iterable[ρσ_iterator_symbol] === "function") {\n return (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();\n }\n if (ρσ_arraylike(iterable)) {\n ans = {"_i":-1};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n this._i += 1;\n if (this._i < iterable.length) {\n return {\'done\':false, \'value\':iterable[this._i]};\n }\n return {\'done\':true};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n }\n return ρσ_iter(Object.keys(iterable));\n};\nif (!ρσ_iter.__argnames__) Object.defineProperties(ρσ_iter, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_range_next(step, length) {\n var ρσ_unpack;\n this._i += step;\n this._idx += 1;\n if (this._idx >= length) {\n ρσ_unpack = [this.__i, -1];\n this._i = ρσ_unpack[0];\n this._idx = ρσ_unpack[1];\n return {\'done\':true};\n }\n return {\'done\':false, \'value\':this._i};\n};\nif (!ρσ_range_next.__argnames__) Object.defineProperties(ρσ_range_next, {\n __argnames__ : {value: ["step", "length"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_range(start, stop, step) {\n var length, ans;\n if (arguments.length <= 1) {\n stop = start || 0;\n start = 0;\n }\n step = arguments[2] || 1;\n length = Math.max(Math.ceil((stop - start) / step), 0);\n ans = {start:start, step:step, stop:stop};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n var it;\n it = {"_i": start - step, "_idx": -1};\n it.next = ρσ_range_next.bind(it, step, length);\n it[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return it;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans.count = (function() {\n var ρσ_anonfunc = function (val) {\n if (!this._cached) {\n this._cached = list(this);\n }\n return this._cached.count(val);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["val"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans.index = (function() {\n var ρσ_anonfunc = function (val) {\n if (!this._cached) {\n this._cached = list(this);\n }\n return this._cached.index(val);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["val"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans.__len__ = (function() {\n var ρσ_anonfunc = function () {\n return length;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans.__repr__ = (function() {\n var ρσ_anonfunc = function () {\n return "range(" + ρσ_str.format("{}", start) + ", " + ρσ_str.format("{}", stop) + ", " + ρσ_str.format("{}", step) + ")";\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans.__str__ = ans.toString = ans.__repr__;\n if (typeof Proxy === "function") {\n ans = new Proxy(ans, (function(){\n var ρσ_d = {};\n ρσ_d["get"] = (function() {\n var ρσ_anonfunc = function (obj, prop) {\n var iprop;\n if (typeof prop === "string") {\n iprop = parseInt(prop);\n if (!isNaN(iprop)) {\n prop = iprop;\n }\n }\n if (typeof prop === "number") {\n if (!obj._cached) {\n obj._cached = list(obj);\n }\n return (ρσ_expr_temp = obj._cached)[(typeof prop === "number" && prop < 0) ? ρσ_expr_temp.length + prop : prop];\n }\n return obj[(typeof prop === "number" && prop < 0) ? obj.length + prop : prop];\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["obj", "prop"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this));\n }\n return ans;\n};\nif (!ρσ_range.__argnames__) Object.defineProperties(ρσ_range, {\n __argnames__ : {value: ["start", "stop", "step"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_getattr(obj, name, defval) {\n var ret;\n try {\n ret = obj[(typeof name === "number" && name < 0) ? obj.length + name : name];\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n if (ρσ_Exception instanceof TypeError) {\n if (defval === undefined) {\n throw new AttributeError("The attribute " + name + " is not present");\n }\n return defval;\n } else {\n throw ρσ_Exception;\n }\n }\n if (ret === undefined && !(name in obj)) {\n if (defval === undefined) {\n throw new AttributeError("The attribute " + name + " is not present");\n }\n ret = defval;\n }\n return ret;\n};\nif (!ρσ_getattr.__argnames__) Object.defineProperties(ρσ_getattr, {\n __argnames__ : {value: ["obj", "name", "defval"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_setattr(obj, name, value) {\n obj[(typeof name === "number" && name < 0) ? obj.length + name : name] = value;\n};\nif (!ρσ_setattr.__argnames__) Object.defineProperties(ρσ_setattr, {\n __argnames__ : {value: ["obj", "name", "value"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_hasattr(obj, name) {\n return name in obj;\n};\nif (!ρσ_hasattr.__argnames__) Object.defineProperties(ρσ_hasattr, {\n __argnames__ : {value: ["obj", "name"]},\n __module__ : {value: "__main__"}\n});\n\nρσ_len = (function() {\n var ρσ_anonfunc = function () {\n function len(obj) {\n if (ρσ_arraylike(obj)) {\n return obj.length;\n }\n if (typeof obj.__len__ === "function") {\n return obj.__len__();\n }\n if (obj instanceof Set || obj instanceof Map) {\n return obj.size;\n }\n return Object.keys(obj).length;\n };\n if (!len.__argnames__) Object.defineProperties(len, {\n __argnames__ : {value: ["obj"]},\n __module__ : {value: "__main__"}\n });\n\n function len5(obj) {\n if (ρσ_arraylike(obj)) {\n return obj.length;\n }\n if (typeof obj.__len__ === "function") {\n return obj.__len__();\n }\n return Object.keys(obj).length;\n };\n if (!len5.__argnames__) Object.defineProperties(len5, {\n __argnames__ : {value: ["obj"]},\n __module__ : {value: "__main__"}\n });\n\n return (typeof Set === "function" && typeof Map === "function") ? len : len5;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})()();\nfunction ρσ_get_module(name) {\n return ρσ_modules[(typeof name === "number" && name < 0) ? ρσ_modules.length + name : name];\n};\nif (!ρσ_get_module.__argnames__) Object.defineProperties(ρσ_get_module, {\n __argnames__ : {value: ["name"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_pow(x, y, z) {\n var ans;\n ans = Math.pow(x, y);\n if (z !== undefined) {\n ans %= z;\n }\n return ans;\n};\nif (!ρσ_pow.__argnames__) Object.defineProperties(ρσ_pow, {\n __argnames__ : {value: ["x", "y", "z"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_type(x) {\n return x.constructor;\n};\nif (!ρσ_type.__argnames__) Object.defineProperties(ρσ_type, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_divmod(x, y) {\n var d;\n if (y === 0) {\n throw new ZeroDivisionError("integer division or modulo by zero");\n }\n d = Math.floor(x / y);\n return [d, x - d * y];\n};\nif (!ρσ_divmod.__argnames__) Object.defineProperties(ρσ_divmod, {\n __argnames__ : {value: ["x", "y"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_max() {\n var kwargs = arguments[arguments.length-1];\n if (kwargs === null || typeof kwargs !== "object" || kwargs [ρσ_kwargs_symbol] !== true) kwargs = {};\n var args = Array.prototype.slice.call(arguments, 0);\n if (kwargs !== null && typeof kwargs === "object" && kwargs [ρσ_kwargs_symbol] === true) args.pop();\n var args, x;\n if (args.length === 0) {\n if (kwargs.defval !== undefined) {\n return kwargs.defval;\n }\n throw new TypeError("expected at least one argument");\n }\n if (args.length === 1) {\n args = args[0];\n }\n if (kwargs.key) {\n args = (function() {\n var ρσ_Iter = ρσ_Iterable(args), ρσ_Result = [], x;\n for (var ρσ_Index = 0; ρσ_Index < ρσ_Iter.length; ρσ_Index++) {\n x = ρσ_Iter[ρσ_Index];\n ρσ_Result.push(kwargs.key(x));\n }\n ρσ_Result = ρσ_list_constructor(ρσ_Result);\n return ρσ_Result;\n })();\n }\n if (!Array.isArray(args)) {\n args = list(args);\n }\n if (args.length) {\n return this.apply(null, args);\n }\n if (kwargs.defval !== undefined) {\n return kwargs.defval;\n }\n throw new TypeError("expected at least one argument");\n};\nif (!ρσ_max.__handles_kwarg_interpolation__) Object.defineProperties(ρσ_max, {\n __handles_kwarg_interpolation__ : {value: true},\n __module__ : {value: "__main__"}\n});\n\nvar abs = Math.abs, max = ρσ_max.bind(Math.max), min = ρσ_max.bind(Math.min), bool = ρσ_bool, type = ρσ_type;\nvar float = ρσ_float, int = ρσ_int, arraylike = ρσ_arraylike_creator(), ρσ_arraylike = arraylike;\nvar print = ρσ_print, id = ρσ_id, get_module = ρσ_get_module, pow = ρσ_pow, divmod = ρσ_divmod;\nvar dir = ρσ_dir, ord = ρσ_ord, chr = ρσ_chr, bin = ρσ_bin, hex = ρσ_hex, callable = ρσ_callable;\nvar enumerate = ρσ_enumerate, iter = ρσ_iter, reversed = ρσ_reversed, len = ρσ_len;\nvar range = ρσ_range, getattr = ρσ_getattr, setattr = ρσ_setattr, hasattr = ρσ_hasattr;function ρσ_equals(a, b) {\n var ρσ_unpack, akeys, bkeys, key;\n if (a instanceof vec) {\n if (!(b instanceof vec)) return false;\nreturn (a.x === b.x && a.y === b.y && a.z === b.z);\n}\n if (a === b) {\n return true;\n }\n if (a && typeof a.__eq__ === "function") {\n return a.__eq__(b);\n }\n if (b && typeof b.__eq__ === "function") {\n return b.__eq__(a);\n }\n if (ρσ_arraylike(a) && ρσ_arraylike(b)) {\n if ((a.length !== b.length && (typeof a.length !== "object" || ρσ_not_equals(a.length, b.length)))) {\n return false;\n }\n for (var i=0; i < a.length; i++) {\n if (!(((a[(typeof i === "number" && i < 0) ? a.length + i : i] === b[(typeof i === "number" && i < 0) ? b.length + i : i] || typeof a[(typeof i === "number" && i < 0) ? a.length + i : i] === "object" && ρσ_equals(a[(typeof i === "number" && i < 0) ? a.length + i : i], b[(typeof i === "number" && i < 0) ? b.length + i : i]))))) {\n return false;\n }\n }\n return true;\n }\n if (typeof a === "object" && typeof b === "object" && a !== null && b !== null && (a.constructor === Object && b.constructor === Object || Object.getPrototypeOf(a) === null && Object.getPrototypeOf(b) === null)) {\n ρσ_unpack = [Object.keys(a), Object.keys(b)];\n akeys = ρσ_unpack[0];\n bkeys = ρσ_unpack[1];\n if (akeys.length !== bkeys.length) {\n return false;\n }\n for (var j=0; j < akeys.length; j++) {\n key = akeys[(typeof j === "number" && j < 0) ? akeys.length + j : j];\n if (!(((a[(typeof key === "number" && key < 0) ? a.length + key : key] === b[(typeof key === "number" && key < 0) ? b.length + key : key] || typeof a[(typeof key === "number" && key < 0) ? a.length + key : key] === "object" && ρσ_equals(a[(typeof key === "number" && key < 0) ? a.length + key : key], b[(typeof key === "number" && key < 0) ? b.length + key : key]))))) {\n return false;\n }\n }\n return true;\n }\n return false;\n};\nif (!ρσ_equals.__argnames__) Object.defineProperties(ρσ_equals, {\n __argnames__ : {value: ["a", "b"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_not_equals(a, b) {\n\tif (a instanceof vec) {\n if (!(b instanceof vec)) return true;\nreturn (a.x !== b.x || a.y !== b.y || a.z !== b.z);\n}\n if (a === b) {\n return false;\n }\n if (a && typeof a.__ne__ === "function") {\n return a.__ne__(b);\n }\n if (b && typeof b.__ne__ === "function") {\n return b.__ne__(a);\n }\n return !ρσ_equals(a, b);\n};\nif (!ρσ_not_equals.__argnames__) Object.defineProperties(ρσ_not_equals, {\n __argnames__ : {value: ["a", "b"]},\n __module__ : {value: "__main__"}\n});\n\nvar equals = ρσ_equals;\nfunction ρσ_list_extend(iterable) {\n var start, iterator, result;\n if (Array.isArray(iterable) || typeof iterable === "string") {\n start = this.length;\n this.length += iterable.length;\n for (var i = 0; i < iterable.length; i++) {\n (ρσ_expr_temp = this)[ρσ_bound_index(start + i, ρσ_expr_temp)] = iterable[(typeof i === "number" && i < 0) ? iterable.length + i : i];\n }\n } else {\n iterator = (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();\n result = iterator.next();\n while (!result.done) {\n this.push(result.value);\n result = iterator.next();\n }\n }\n};\nif (!ρσ_list_extend.__argnames__) Object.defineProperties(ρσ_list_extend, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_index(val, start, stop) {\n start = start || 0;\n if (start < 0) {\n start = this.length + start;\n }\n if (start < 0) {\n throw new ValueError(val + " is not in list");\n }\n if (stop === undefined) {\n stop = this.length;\n }\n if (stop < 0) {\n stop = this.length + stop;\n }\n for (var i = start; i < stop; i++) {\n if (((ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i] === val ||\nval instanceof vec && val.equals((ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i]) ||\n typeof (ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i] === "object" && ρσ_equals((ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i], val))) {\n return i;\n }\n }\n throw new ValueError(val + " is not in list");\n};\nif (!ρσ_list_index.__argnames__) Object.defineProperties(ρσ_list_index, {\n __argnames__ : {value: ["val", "start", "stop"]},\n __module__ : {value: "__main__"}\n});\nfunction ρσ_list_pop(index) {\n var ans;\n if (this.length === 0) {\n throw new IndexError("list is empty");\n }\n if (index === undefined) {\n index = -1;\n }\n ans = this.splice(index, 1);\n if (!ans.length) {\n throw new IndexError("pop index out of range");\n }\n return ans[0];\n};\nif (!ρσ_list_pop.__argnames__) Object.defineProperties(ρσ_list_pop, {\n __argnames__ : {value: ["index"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_remove(value) {\n for (var i = 0; i < this.length; i++) {\n if (((ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i] === value || \n value instanceof vec &&\nvalue.equals((ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i]) ||\n typeof (ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i] === "object" && ρσ_equals((ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i], value))) {\n this.splice(i, 1);\n return;\n }\n }\n throw new ValueError(value + " not in list");\n};\nif (!ρσ_list_remove.__argnames__) Object.defineProperties(ρσ_list_remove, {\n __argnames__ : {value: ["value"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_to_string() {\n return "[" + this.join(", ") + "]";\n};\nif (!ρσ_list_to_string.__module__) Object.defineProperties(ρσ_list_to_string, {\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_insert(index, val) {\n if (index < 0) {\n index += this.length;\n }\n index = min(this.length, max(index, 0));\n if (index === 0) {\n this.unshift(val);\n return;\n }\n for (var i = this.length; i > index; i--) {\n (ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] = (ρσ_expr_temp = this)[ρσ_bound_index(i - 1, ρσ_expr_temp)];\n }\n (ρσ_expr_temp = this)[(typeof index === "number" && index < 0) ? ρσ_expr_temp.length + index : index] = val;\n};\nif (!ρσ_list_insert.__argnames__) Object.defineProperties(ρσ_list_insert, {\n __argnames__ : {value: ["index", "val"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_copy() {\n return ρσ_list_constructor(this);\n};\nif (!ρσ_list_copy.__module__) Object.defineProperties(ρσ_list_copy, {\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_clear() {\n this.length = 0;\n};\nif (!ρσ_list_clear.__module__) Object.defineProperties(ρσ_list_clear, {\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_as_array() {\n return Array.prototype.slice.call(this);\n};\nif (!ρσ_list_as_array.__module__) Object.defineProperties(ρσ_list_as_array, {\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_count(value) {\n return this.reduce((function() {\n var ρσ_anonfunc = function (n, val) {\n return n + (val === value);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["n", "val"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })(), 0);\n};\nif (!ρσ_list_count.__argnames__) Object.defineProperties(ρσ_list_count, {\n __argnames__ : {value: ["value"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_sort_key(value) {\n var t;\n t = typeof value;\n if (t === "string" || t === "number") {\n return value;\n }\n return value.toString();\n};\nif (!ρσ_list_sort_key.__argnames__) Object.defineProperties(ρσ_list_sort_key, {\n __argnames__ : {value: ["value"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_sort_cmp(a, b, ap, bp) {\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return ap - bp;\n};\nif (!ρσ_list_sort_cmp.__argnames__) Object.defineProperties(ρσ_list_sort_cmp, {\n __argnames__ : {value: ["a", "b", "ap", "bp"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_sort() {\n var key = (arguments[0] === undefined || ( 0 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? ρσ_list_sort.__defaults__.key : arguments[0];\n var reverse = (arguments[1] === undefined || ( 1 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? ρσ_list_sort.__defaults__.reverse : arguments[1];\n var ρσ_kwargs_obj = arguments[arguments.length-1];\n if (ρσ_kwargs_obj === null || typeof ρσ_kwargs_obj !== "object" || ρσ_kwargs_obj [ρσ_kwargs_symbol] !== true) ρσ_kwargs_obj = {};\n if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "key")){\n key = ρσ_kwargs_obj.key;\n }\n if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "reverse")){\n reverse = ρσ_kwargs_obj.reverse;\n }\n var mult, keymap, posmap, k;\n key = key || ρσ_list_sort_key;\n mult = (reverse) ? -1 : 1;\n keymap = dict();\n posmap = dict();\n for (var i=0; i < this.length; i++) {\n k = (ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i];\n keymap.set(k, key(k));\n posmap.set(k, i);\n }\n this.sort((function() {\n var ρσ_anonfunc = function (a, b) {\n return mult * ρσ_list_sort_cmp(keymap.get(a), keymap.get(b), posmap.get(a), posmap.get(b));\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["a", "b"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })());\n};\nif (!ρσ_list_sort.__defaults__) Object.defineProperties(ρσ_list_sort, {\n __defaults__ : {value: {key:null, reverse:false}},\n __handles_kwarg_interpolation__ : {value: true},\n __argnames__ : {value: ["key", "reverse"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_concat() {\n var ans;\n ans = Array.prototype.concat.apply(this, arguments);\n ρσ_list_decorate(ans);\n return ans;\n};\nif (!ρσ_list_concat.__module__) Object.defineProperties(ρσ_list_concat, {\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_slice() {\n var ans;\n ans = Array.prototype.slice.apply(this, arguments);\n ρσ_list_decorate(ans);\n return ans;\n};\nif (!ρσ_list_slice.__module__) Object.defineProperties(ρσ_list_slice, {\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_iterator(value) {\n var self;\n self = this;\n return (function(){\n var ρσ_d = {};\n ρσ_d["_i"] = -1;\n ρσ_d["_list"] = self;\n ρσ_d["next"] = (function() {\n var ρσ_anonfunc = function () {\n this._i += 1;\n if (this._i >= this._list.length) {\n return (function(){\n var ρσ_d = {};\n ρσ_d["done"] = true;\n return ρσ_d;\n }).call(this);\n }\n return (function(){\n var ρσ_d = {};\n ρσ_d["done"] = false;\n ρσ_d["value"] = (ρσ_expr_temp = this._list)[ρσ_bound_index(this._i, ρσ_expr_temp)];\n return ρσ_d;\n }).call(this);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this);\n};\nif (!ρσ_list_iterator.__argnames__) Object.defineProperties(ρσ_list_iterator, {\n __argnames__ : {value: ["value"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_len() {\n return this.length;\n};\nif (!ρσ_list_len.__module__) Object.defineProperties(ρσ_list_len, {\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_contains(val) {\n for (var i = 0; i < this.length; i++) {\n if (((ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i] === val || \n val instanceof vec &&\n val.equals((ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i]) ||\n typeof (ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i] === "object" &&\n ρσ_equals((ρσ_expr_temp = this)[(i < 0) ? ρσ_expr_temp.length + i : i], val))) {\n return true;\n }\n }\n return false;\n};\n\nfunction ρσ_list_eq(other) {\n if (!ρσ_arraylike(other)) {\n return false;\n }\n if ((this.length !== other.length && (typeof this.length !== "object" || ρσ_not_equals(this.length, other.length)))) {\n return false;\n }\n for (var i = 0; i < this.length; i++) {\n if (!((((ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] === other[(typeof i === "number" && i < 0) ? other.length + i : i] || typeof (ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] === "object" && ρσ_equals((ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i], other[(typeof i === "number" && i < 0) ? other.length + i : i]))))) {\n return false;\n }\n }\n return true;\n};\nif (!ρσ_list_eq.__argnames__) Object.defineProperties(ρσ_list_eq, {\n __argnames__ : {value: ["other"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_decorate(ans) {\n ans.append = Array.prototype.push;\n ans.toString = ρσ_list_to_string;\n ans.inspect = ρσ_list_to_string;\n ans.extend = ρσ_list_extend;\n ans.index = ρσ_list_index;\n ans.pypop = ρσ_list_pop;\n ans.remove = ρσ_list_remove;\n ans.insert = ρσ_list_insert;\n ans.copy = ρσ_list_copy;\n ans.clear = ρσ_list_clear;\n ans.count = ρσ_list_count;\n ans.concat = ρσ_list_concat;\n ans.pysort = ρσ_list_sort;\n ans.slice = ρσ_list_slice;\n ans.as_array = ρσ_list_as_array;\n ans.__len__ = ρσ_list_len;\n ans.__contains__ = ρσ_list_contains;\n ans.__eq__ = ρσ_list_eq;\n ans.constructor = ρσ_list_constructor;\n if (typeof ans[ρσ_iterator_symbol] !== "function") {\n ans[ρσ_iterator_symbol] = ρσ_list_iterator;\n }\n return ans;\n};\nif (!ρσ_list_decorate.__argnames__) Object.defineProperties(ρσ_list_decorate, {\n __argnames__ : {value: ["ans"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_list_constructor(iterable) {\n var ans, iterator, result;\n if (iterable === undefined) {\n ans = [];\n } else if (ρσ_arraylike(iterable)) {\n ans = new Array(iterable.length);\n for (var i = 0; i < iterable.length; i++) {\n ans[(typeof i === "number" && i < 0) ? ans.length + i : i] = iterable[(typeof i === "number" && i < 0) ? iterable.length + i : i];\n }\n } else if (typeof iterable[ρσ_iterator_symbol] === "function") {\n iterator = (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();\n ans = ρσ_list_decorate([]);\n result = iterator.next();\n while (!result.done) {\n ans.push(result.value);\n result = iterator.next();\n }\n } else if (typeof iterable === "number") {\n ans = new Array(iterable);\n } else {\n ans = Object.keys(iterable);\n }\n return ρσ_list_decorate(ans);\n};\nif (!ρσ_list_constructor.__argnames__) Object.defineProperties(ρσ_list_constructor, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\n\nρσ_list_constructor.__name__ = "list";\nvar list = ρσ_list_constructor, list_wrap = ρσ_list_decorate;\nfunction sorted() {\n var iterable = ( 0 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true) ? undefined : arguments[0];\n var key = (arguments[1] === undefined || ( 1 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? sorted.__defaults__.key : arguments[1];\n var reverse = (arguments[2] === undefined || ( 2 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? sorted.__defaults__.reverse : arguments[2];\n var ρσ_kwargs_obj = arguments[arguments.length-1];\n if (ρσ_kwargs_obj === null || typeof ρσ_kwargs_obj !== "object" || ρσ_kwargs_obj [ρσ_kwargs_symbol] !== true) ρσ_kwargs_obj = {};\n if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "key")){\n key = ρσ_kwargs_obj.key;\n }\n if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "reverse")){\n reverse = ρσ_kwargs_obj.reverse;\n }\n var ans;\n ans = ρσ_list_constructor(iterable);\n ans.pysort(key, reverse);\n return ans;\n};\nif (!sorted.__defaults__) Object.defineProperties(sorted, {\n __defaults__ : {value: {key:null, reverse:false}},\n __handles_kwarg_interpolation__ : {value: true},\n __argnames__ : {value: ["iterable", "key", "reverse"]},\n __module__ : {value: "__main__"}\n});\n\nvar ρσ_global_object_id = 0, ρσ_set_implementation;\nfunction ρσ_set_keyfor(x) {\n var t, ans;\n t = typeof x;\n if (t === "string" || t === "number" || t === "boolean") {\n return "_" + t[0] + x;\n }\n if (x === null) {\n return "__!@#$0";\n }\n ans = x.ρσ_hash_key_prop;\n if (ans === undefined) {\n ans = "_!@#$" + (++ρσ_global_object_id);\n Object.defineProperty(x, "ρσ_hash_key_prop", (function(){\n var ρσ_d = {};\n ρσ_d["value"] = ans;\n return ρσ_d;\n }).call(this));\n }\n return ans;\n};\nif (!ρσ_set_keyfor.__argnames__) Object.defineProperties(ρσ_set_keyfor, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_set_polyfill() {\n this._store = {};\n this.size = 0;\n};\nif (!ρσ_set_polyfill.__module__) Object.defineProperties(ρσ_set_polyfill, {\n __module__ : {value: "__main__"}\n});\n\nρσ_set_polyfill.prototype.add = (function() {\n var ρσ_anonfunc = function (x) {\n var key;\n key = ρσ_set_keyfor(x);\n if (!Object.prototype.hasOwnProperty.call(this._store, key)) {\n this.size += 1;\n (ρσ_expr_temp = this._store)[(typeof key === "number" && key < 0) ? ρσ_expr_temp.length + key : key] = x;\n }\n return this;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set_polyfill.prototype.clear = (function() {\n var ρσ_anonfunc = function (x) {\n this._store = {};\n this.size = 0;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set_polyfill.prototype.delete = (function() {\n var ρσ_anonfunc = function (x) {\n var key;\n key = ρσ_set_keyfor(x);\n if (Object.prototype.hasOwnProperty.call(this._store, key)) {\n this.size -= 1;\n delete this._store[key];\n return true;\n }\n return false;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set_polyfill.prototype.has = (function() {\n var ρσ_anonfunc = function (x) {\n return Object.prototype.hasOwnProperty.call(this._store, ρσ_set_keyfor(x));\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set_polyfill.prototype.values = (function() {\n var ρσ_anonfunc = function (x) {\n var ans;\n ans = {\'_keys\': Object.keys(this._store), \'_i\':-1, \'_s\':this._store};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n this._i += 1;\n if (this._i >= this._keys.length) {\n return {\'done\': true};\n }\n return {\'done\':false, \'value\':this._s[this._keys[this._i]]};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nif (typeof Set !== "function" || typeof Set.prototype.delete !== "function") {\n ρσ_set_implementation = ρσ_set_polyfill;\n} else {\n ρσ_set_implementation = Set;\n}\nfunction ρσ_set(iterable) {\n var ans, s, iterator, result, keys;\n if (this instanceof ρσ_set) {\n this.jsset = new ρσ_set_implementation;\n ans = this;\n if (iterable === undefined) {\n return ans;\n }\n s = ans.jsset;\n if (ρσ_arraylike(iterable)) {\n for (var i = 0; i < iterable.length; i++) {\n s.add(iterable[(typeof i === "number" && i < 0) ? iterable.length + i : i]);\n }\n } else if (typeof iterable[ρσ_iterator_symbol] === "function") {\n iterator = (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();\n result = iterator.next();\n while (!result.done) {\n s.add(result.value);\n result = iterator.next();\n }\n } else {\n keys = Object.keys(iterable);\n for (var j=0; j < keys.length; j++) {\n s.add(keys[(typeof j === "number" && j < 0) ? keys.length + j : j]);\n }\n }\n return ans;\n } else {\n return new ρσ_set(iterable);\n }\n};\nif (!ρσ_set.__argnames__) Object.defineProperties(ρσ_set, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\n\nρσ_set.prototype.__name__ = "set";\nObject.defineProperties(ρσ_set.prototype, (function(){\n var ρσ_d = {};\n ρσ_d["length"] = (function(){\n var ρσ_d = {};\n ρσ_d["get"] = (function() {\n var ρσ_anonfunc = function () {\n return this.jsset.size;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this);\n ρσ_d["size"] = (function(){\n var ρσ_d = {};\n ρσ_d["get"] = (function() {\n var ρσ_anonfunc = function () {\n return this.jsset.size;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this);\n return ρσ_d;\n}).call(this));\nρσ_set.prototype.__len__ = (function() {\n var ρσ_anonfunc = function () {\n return this.jsset.size;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.has = ρσ_set.prototype.__contains__ = (function() {\n var ρσ_anonfunc = function (x) {\n return this.jsset.has(x);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.add = (function() {\n var ρσ_anonfunc = function (x) {\n this.jsset.add(x);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.clear = (function() {\n var ρσ_anonfunc = function () {\n this.jsset.clear();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.copy = (function() {\n var ρσ_anonfunc = function () {\n return ρσ_set(this);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.discard = (function() {\n var ρσ_anonfunc = function (x) {\n this.jsset.delete(x);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this.jsset.values();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.difference = (function() {\n var ρσ_anonfunc = function () {\n var ans, s, iterator, r, x, has;\n ans = new ρσ_set;\n s = ans.jsset;\n iterator = this.jsset.values();\n r = iterator.next();\n while (!r.done) {\n x = r.value;\n has = false;\n for (var i = 0; i < arguments.length; i++) {\n if (arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i].has(x)) {\n has = true;\n break;\n }\n }\n if (!has) {\n s.add(x);\n }\n r = iterator.next();\n }\n return ans;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.difference_update = (function() {\n var ρσ_anonfunc = function () {\n var s, remove, iterator, r, x;\n s = this.jsset;\n remove = [];\n iterator = s.values();\n r = iterator.next();\n while (!r.done) {\n x = r.value;\n for (var i = 0; i < arguments.length; i++) {\n if (arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i].has(x)) {\n remove.push(x);\n break;\n }\n }\n r = iterator.next();\n }\n for (var j = 0; j < remove.length; j++) {\n s.delete(remove[(typeof j === "number" && j < 0) ? remove.length + j : j]);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.intersection = (function() {\n var ρσ_anonfunc = function () {\n var ans, s, iterator, r, x, has;\n ans = new ρσ_set;\n s = ans.jsset;\n iterator = this.jsset.values();\n r = iterator.next();\n while (!r.done) {\n x = r.value;\n has = true;\n for (var i = 0; i < arguments.length; i++) {\n if (!arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i].has(x)) {\n has = false;\n break;\n }\n }\n if (has) {\n s.add(x);\n }\n r = iterator.next();\n }\n return ans;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.intersection_update = (function() {\n var ρσ_anonfunc = function () {\n var s, remove, iterator, r, x;\n s = this.jsset;\n remove = [];\n iterator = s.values();\n r = iterator.next();\n while (!r.done) {\n x = r.value;\n for (var i = 0; i < arguments.length; i++) {\n if (!arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i].has(x)) {\n remove.push(x);\n break;\n }\n }\n r = iterator.next();\n }\n for (var j = 0; j < remove.length; j++) {\n s.delete(remove[(typeof j === "number" && j < 0) ? remove.length + j : j]);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.isdisjoint = (function() {\n var ρσ_anonfunc = function (other) {\n var iterator, r, x;\n iterator = this.jsset.values();\n r = iterator.next();\n while (!r.done) {\n x = r.value;\n if (other.has(x)) {\n return false;\n }\n r = iterator.next();\n }\n return true;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["other"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.issubset = (function() {\n var ρσ_anonfunc = function (other) {\n var iterator, r, x;\n iterator = this.jsset.values();\n r = iterator.next();\n while (!r.done) {\n x = r.value;\n if (!other.has(x)) {\n return false;\n }\n r = iterator.next();\n }\n return true;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["other"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.issuperset = (function() {\n var ρσ_anonfunc = function (other) {\n var s, iterator, r, x;\n s = this.jsset;\n iterator = other.jsset.values();\n r = iterator.next();\n while (!r.done) {\n x = r.value;\n if (!s.has(x)) {\n return false;\n }\n r = iterator.next();\n }\n return true;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["other"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.pypop = (function() {\n var ρσ_anonfunc = function () {\n var iterator, r;\n iterator = this.jsset.values();\n r = iterator.next();\n if (r.done) {\n throw new KeyError("pop from an empty set");\n }\n this.jsset.delete(r.value);\n return r.value;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.remove = (function() {\n var ρσ_anonfunc = function (x) {\n if (!this.jsset.delete(x)) {\n throw new KeyError(x.toString());\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.symmetric_difference = (function() {\n var ρσ_anonfunc = function (other) {\n return this.union(other).difference(this.intersection(other));\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["other"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.symmetric_difference_update = (function() {\n var ρσ_anonfunc = function (other) {\n var common;\n common = this.intersection(other);\n this.update(other);\n this.difference_update(common);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["other"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.union = (function() {\n var ρσ_anonfunc = function () {\n var ans;\n ans = ρσ_set(this);\n ans.update.apply(ans, arguments);\n return ans;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.update = (function() {\n var ρσ_anonfunc = function () {\n var s, iterator, r;\n s = this.jsset;\n for (var i=0; i < arguments.length; i++) {\n iterator = arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i][ρσ_iterator_symbol]();\n r = iterator.next();\n while (!r.done) {\n s.add(r.value);\n r = iterator.next();\n }\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.toString = ρσ_set.prototype.__repr__ = ρσ_set.prototype.__str__ = ρσ_set.prototype.inspect = (function() {\n var ρσ_anonfunc = function () {\n return "{" + list(this).join(", ") + "}";\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_set.prototype.__eq__ = (function() {\n var ρσ_anonfunc = function (other) {\n var iterator, r;\n if (!other instanceof this.constructor) {\n return false;\n }\n if (other.size !== this.size) {\n return false;\n }\n if (other.size === 0) {\n return true;\n }\n iterator = other[ρσ_iterator_symbol]();\n r = iterator.next();\n while (!r.done) {\n if (!this.has(r.value)) {\n return false;\n }\n r = iterator.next();\n }\n return true;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["other"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nfunction ρσ_set_wrap(x) {\n var ans;\n ans = new ρσ_set;\n ans.jsset = x;\n return ans;\n};\nif (!ρσ_set_wrap.__argnames__) Object.defineProperties(ρσ_set_wrap, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nvar set = ρσ_set, set_wrap = ρσ_set_wrap;\nvar ρσ_dict_implementation;\nfunction ρσ_dict_polyfill() {\n this._store = {};\n this.size = 0;\n};\nif (!ρσ_dict_polyfill.__module__) Object.defineProperties(ρσ_dict_polyfill, {\n __module__ : {value: "__main__"}\n});\n\nρσ_dict_polyfill.prototype.set = (function() {\n var ρσ_anonfunc = function (x, value) {\n var key;\n key = ρσ_set_keyfor(x);\n if (!Object.prototype.hasOwnProperty.call(this._store, key)) {\n this.size += 1;\n }\n (ρσ_expr_temp = this._store)[(typeof key === "number" && key < 0) ? ρσ_expr_temp.length + key : key] = [x, value];\n return this;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x", "value"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict_polyfill.prototype.clear = (function() {\n var ρσ_anonfunc = function (x) {\n this._store = {};\n this.size = 0;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict_polyfill.prototype.delete = (function() {\n var ρσ_anonfunc = function (x) {\n var key;\n key = ρσ_set_keyfor(x);\n if (Object.prototype.hasOwnProperty.call(this._store, key)) {\n this.size -= 1;\n delete this._store[key];\n return true;\n }\n return false;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict_polyfill.prototype.has = (function() {\n var ρσ_anonfunc = function (x) {\n return Object.prototype.hasOwnProperty.call(this._store, ρσ_set_keyfor(x));\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict_polyfill.prototype.get = (function() {\n var ρσ_anonfunc = function (x) {\n try {\n return (ρσ_expr_temp = this._store)[ρσ_bound_index(ρσ_set_keyfor(x), ρσ_expr_temp)][1];\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n if (ρσ_Exception instanceof TypeError) {\n return undefined;\n } else {\n throw ρσ_Exception;\n }\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict_polyfill.prototype.values = (function() {\n var ρσ_anonfunc = function (x) {\n var ans;\n ans = {\'_keys\': Object.keys(this._store), \'_i\':-1, \'_s\':this._store};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n this._i += 1;\n if (this._i >= this._keys.length) {\n return {\'done\': true};\n }\n return {\'done\':false, \'value\':this._s[this._keys[this._i]][1]};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict_polyfill.prototype.keys = (function() {\n var ρσ_anonfunc = function (x) {\n var ans;\n ans = {\'_keys\': Object.keys(this._store), \'_i\':-1, \'_s\':this._store};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n this._i += 1;\n if (this._i >= this._keys.length) {\n return {\'done\': true};\n }\n return {\'done\':false, \'value\':this._s[this._keys[this._i]][0]};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict_polyfill.prototype.entries = (function() {\n var ρσ_anonfunc = function (x) {\n var ans;\n ans = {\'_keys\': Object.keys(this._store), \'_i\':-1, \'_s\':this._store};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n this._i += 1;\n if (this._i >= this._keys.length) {\n return {\'done\': true};\n }\n return {\'done\':false, \'value\':this._s[this._keys[this._i]]};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nif (typeof Map !== "function" || typeof Map.prototype.delete !== "function") {\n ρσ_dict_implementation = ρσ_dict_polyfill;\n} else {\n ρσ_dict_implementation = Map;\n}\nfunction ρσ_dict() {\n var iterable = ( 0 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true) ? undefined : arguments[0];\n var kw = arguments[arguments.length-1];\n if (kw === null || typeof kw !== "object" || kw [ρσ_kwargs_symbol] !== true) kw = {};\n if (this instanceof ρσ_dict) {\n this.jsmap = new ρσ_dict_implementation;\n if (iterable !== undefined) {\n this.update(iterable);\n }\n this.update(kw);\n return this;\n } else {\n return ρσ_interpolate_kwargs_constructor.call(Object.create(ρσ_dict.prototype), false, ρσ_dict, [iterable].concat([ρσ_desugar_kwargs(kw)]));\n }\n};\nif (!ρσ_dict.__handles_kwarg_interpolation__) Object.defineProperties(ρσ_dict, {\n __handles_kwarg_interpolation__ : {value: true},\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\n\nρσ_dict.prototype.__name__ = "dict";\nObject.defineProperties(ρσ_dict.prototype, (function(){\n var ρσ_d = {};\n ρσ_d["length"] = (function(){\n var ρσ_d = {};\n ρσ_d["get"] = (function() {\n var ρσ_anonfunc = function () {\n return this.jsmap.size;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this);\n ρσ_d["size"] = (function(){\n var ρσ_d = {};\n ρσ_d["get"] = (function() {\n var ρσ_anonfunc = function () {\n return this.jsmap.size;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this);\n return ρσ_d;\n}).call(this));\nρσ_dict.prototype.__len__ = (function() {\n var ρσ_anonfunc = function () {\n return this.jsmap.size;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.has = ρσ_dict.prototype.__contains__ = (function() {\n var ρσ_anonfunc = function (x) {\n return this.jsmap.has(x);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.set = ρσ_dict.prototype.__setitem__ = (function() {\n var ρσ_anonfunc = function (key, value) {\n this.jsmap.set(key, value);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["key", "value"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.__delitem__ = (function() {\n var ρσ_anonfunc = function (key) {\n this.jsmap.delete(key);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["key"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.clear = (function() {\n var ρσ_anonfunc = function () {\n this.jsmap.clear();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.copy = (function() {\n var ρσ_anonfunc = function () {\n return ρσ_dict(this);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.keys = (function() {\n var ρσ_anonfunc = function () {\n return this.jsmap.keys();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.values = (function() {\n var ρσ_anonfunc = function () {\n return this.jsmap.values();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.items = ρσ_dict.prototype.entries = (function() {\n var ρσ_anonfunc = function () {\n return this.jsmap.entries();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this.jsmap.keys();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.__getitem__ = (function() {\n var ρσ_anonfunc = function (key) {\n var ans;\n ans = this.jsmap.get(key);\n if (ans === undefined && !this.jsmap.has(key)) {\n throw new KeyError(key + "");\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["key"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.get = (function() {\n var ρσ_anonfunc = function (key, defval) {\n var ans;\n ans = this.jsmap.get(key);\n if (ans === undefined && !this.jsmap.has(key)) {\n return (defval === undefined) ? null : defval;\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["key", "defval"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.set_default = ρσ_dict.prototype.setdefault = (function() {\n var ρσ_anonfunc = function (key, defval) {\n var j;\n j = this.jsmap;\n if (!j.has(key)) {\n j.set(key, defval);\n return defval;\n }\n return j.get(key);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["key", "defval"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.fromkeys = ρσ_dict.prototype.fromkeys = (function() {\n var ρσ_anonfunc = function () {\n var iterable = ( 0 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true) ? undefined : arguments[0];\n var value = (arguments[1] === undefined || ( 1 === arguments.length-1 && arguments[arguments.length-1] !== null && typeof arguments[arguments.length-1] === "object" && arguments[arguments.length-1] [ρσ_kwargs_symbol] === true)) ? ρσ_anonfunc.__defaults__.value : arguments[1];\n var ρσ_kwargs_obj = arguments[arguments.length-1];\n if (ρσ_kwargs_obj === null || typeof ρσ_kwargs_obj !== "object" || ρσ_kwargs_obj [ρσ_kwargs_symbol] !== true) ρσ_kwargs_obj = {};\n if (Object.prototype.hasOwnProperty.call(ρσ_kwargs_obj, "value")){\n value = ρσ_kwargs_obj.value;\n }\n var ans, iterator, r;\n ans = ρσ_dict();\n iterator = iter(iterable);\n r = iterator.next();\n while (!r.done) {\n ans.set(r.value, value);\n r = iterator.next();\n }\n return ans;\n };\n if (!ρσ_anonfunc.__defaults__) Object.defineProperties(ρσ_anonfunc, {\n __defaults__ : {value: {value:null}},\n __handles_kwarg_interpolation__ : {value: true},\n __argnames__ : {value: ["iterable", "value"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.pypop = (function() {\n var ρσ_anonfunc = function (key, defval) {\n var ans;\n ans = this.jsmap.get(key);\n if (ans === undefined && !this.jsmap.has(key)) {\n if (defval === undefined) {\n throw new KeyError(key);\n }\n return defval;\n }\n this.jsmap.delete(key);\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["key", "defval"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.popitem = (function() {\n var ρσ_anonfunc = function () {\n var last, e, r;\n last = null;\n e = this.jsmap.entries();\n while (true) {\n r = e.next();\n if (r.done) {\n if (last === null) {\n throw new KeyError("dict is empty");\n }\n this.jsmap.delete(last.value[0]);\n return last.value;\n }\n last = r;\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.update = (function() {\n var ρσ_anonfunc = function () {\n var m, iterable, iterator, result, keys;\n if (arguments.length === 0) {\n return;\n }\n m = this.jsmap;\n iterable = arguments[0];\n if (Array.isArray(iterable)) {\n for (var i = 0; i < iterable.length; i++) {\n m.set(iterable[(typeof i === "number" && i < 0) ? iterable.length + i : i][0], iterable[(typeof i === "number" && i < 0) ? iterable.length + i : i][1]);\n }\n } else if (iterable instanceof ρσ_dict) {\n iterator = iterable.items();\n result = iterator.next();\n while (!result.done) {\n m.set(result.value[0], result.value[1]);\n result = iterator.next();\n }\n } else if (typeof Map === "function" && iterable instanceof Map) {\n iterator = iterable.entries();\n result = iterator.next();\n while (!result.done) {\n m.set(result.value[0], result.value[1]);\n result = iterator.next();\n }\n } else if (typeof iterable[ρσ_iterator_symbol] === "function") {\n iterator = iterable[ρσ_iterator_symbol]();\n result = iterator.next();\n while (!result.done) {\n m.set(result.value[0], result.value[1]);\n result = iterator.next();\n }\n } else {\n keys = Object.keys(iterable);\n for (var j=0; j < keys.length; j++) {\n if (keys[(typeof j === "number" && j < 0) ? keys.length + j : j] !== ρσ_iterator_symbol) {\n m.set(keys[(typeof j === "number" && j < 0) ? keys.length + j : j], iterable[ρσ_bound_index(keys[(typeof j === "number" && j < 0) ? keys.length + j : j], iterable)]);\n }\n }\n }\n if (arguments.length > 1) {\n ρσ_dict.prototype.update.call(this, arguments[1]);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.toString = ρσ_dict.prototype.inspect = ρσ_dict.prototype.__str__ = ρσ_dict.prototype.__repr__ = (function() {\n var ρσ_anonfunc = function () {\n var entries, iterator, r;\n entries = [];\n iterator = this.jsmap.entries();\n r = iterator.next();\n while (!r.done) {\n entries.push(ρσ_repr(r.value[0]) + ": " + ρσ_repr(r.value[1]));\n r = iterator.next();\n }\n return "{" + entries.join(", ") + "}";\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.__eq__ = (function() {\n var ρσ_anonfunc = function (other) {\n var iterator, r, x;\n if (!(other instanceof this.constructor)) {\n return false;\n }\n if (other.size !== this.size) {\n return false;\n }\n if (other.size === 0) {\n return true;\n }\n iterator = other.items();\n r = iterator.next();\n while (!r.done) {\n x = this.jsmap.get(r.value[0]);\n if (x === undefined && !this.jsmap.has(r.value[0]) || x !== r.value[1]) {\n return false;\n }\n r = iterator.next();\n }\n return true;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["other"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_dict.prototype.as_object = (function() {\n var ρσ_anonfunc = function (other) {\n var ans, iterator, r;\n ans = {};\n iterator = this.jsmap.entries();\n r = iterator.next();\n while (!r.done) {\n ans[ρσ_bound_index(r.value[0], ans)] = r.value[1];\n r = iterator.next();\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["other"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nfunction ρσ_dict_wrap(x) {\n var ans;\n ans = new ρσ_dict;\n ans.jsmap = x;\n return ans;\n};\nif (!ρσ_dict_wrap.__argnames__) Object.defineProperties(ρσ_dict_wrap, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nvar dict = ρσ_dict, dict_wrap = ρσ_dict_wrap;// }}}\nvar NameError;\nNameError = ReferenceError;\nfunction Exception() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n Exception.prototype.__init__.apply(this, arguments);\n}\nρσ_extends(Exception, Error);\nException.prototype.__init__ = function __init__(message) {\n var self = this;\n self.message = message;\n self.stack = (new Error).stack;\n self.name = self.constructor.name;\n};\nif (!Exception.prototype.__init__.__argnames__) Object.defineProperties(Exception.prototype.__init__, {\n __argnames__ : {value: ["message"]},\n __module__ : {value: "__main__"}\n});\nException.__argnames__ = Exception.prototype.__init__.__argnames__;\nException.__handles_kwarg_interpolation__ = Exception.prototype.__init__.__handles_kwarg_interpolation__;\nException.prototype.__repr__ = function __repr__() {\n var self = this;\n return self.name + ": " + self.message;\n};\nif (!Exception.prototype.__repr__.__module__) Object.defineProperties(Exception.prototype.__repr__, {\n __module__ : {value: "__main__"}\n});\nException.prototype.__str__ = function __str__ () {\n if(Error.prototype.__str__) return Error.prototype.__str__.call(this);\nreturn this.__repr__();\n};\nObject.defineProperty(Exception.prototype, "__bases__", {value: [Error]});\n\nfunction AttributeError() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AttributeError.prototype.__init__.apply(this, arguments);\n}\nρσ_extends(AttributeError, Exception);\nAttributeError.prototype.__init__ = function __init__ () {\n Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);\n};\nAttributeError.prototype.__repr__ = function __repr__ () {\n if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n};\nAttributeError.prototype.__str__ = function __str__ () {\n if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);\nreturn this.__repr__();\n};\nObject.defineProperty(AttributeError.prototype, "__bases__", {value: [Exception]});\n\n\nfunction IndexError() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n IndexError.prototype.__init__.apply(this, arguments);\n}\nρσ_extends(IndexError, Exception);\nIndexError.prototype.__init__ = function __init__ () {\n Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);\n};\nIndexError.prototype.__repr__ = function __repr__ () {\n if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n};\nIndexError.prototype.__str__ = function __str__ () {\n if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);\nreturn this.__repr__();\n};\nObject.defineProperty(IndexError.prototype, "__bases__", {value: [Exception]});\n\n\nfunction KeyError() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n KeyError.prototype.__init__.apply(this, arguments);\n}\nρσ_extends(KeyError, Exception);\nKeyError.prototype.__init__ = function __init__ () {\n Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);\n};\nKeyError.prototype.__repr__ = function __repr__ () {\n if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n};\nKeyError.prototype.__str__ = function __str__ () {\n if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);\nreturn this.__repr__();\n};\nObject.defineProperty(KeyError.prototype, "__bases__", {value: [Exception]});\n\n\nfunction ValueError() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n ValueError.prototype.__init__.apply(this, arguments);\n}\nρσ_extends(ValueError, Exception);\nValueError.prototype.__init__ = function __init__ () {\n Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);\n};\nValueError.prototype.__repr__ = function __repr__ () {\n if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n};\nValueError.prototype.__str__ = function __str__ () {\n if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);\nreturn this.__repr__();\n};\nObject.defineProperty(ValueError.prototype, "__bases__", {value: [Exception]});\n\n\nfunction UnicodeDecodeError() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n UnicodeDecodeError.prototype.__init__.apply(this, arguments);\n}\nρσ_extends(UnicodeDecodeError, Exception);\nUnicodeDecodeError.prototype.__init__ = function __init__ () {\n Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);\n};\nUnicodeDecodeError.prototype.__repr__ = function __repr__ () {\n if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n};\nUnicodeDecodeError.prototype.__str__ = function __str__ () {\n if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);\nreturn this.__repr__();\n};\nObject.defineProperty(UnicodeDecodeError.prototype, "__bases__", {value: [Exception]});\n\n\nfunction AssertionError() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n AssertionError.prototype.__init__.apply(this, arguments);\n}\nρσ_extends(AssertionError, Exception);\nAssertionError.prototype.__init__ = function __init__ () {\n Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);\n};\nAssertionError.prototype.__repr__ = function __repr__ () {\n if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n};\nAssertionError.prototype.__str__ = function __str__ () {\n if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);\nreturn this.__repr__();\n};\nObject.defineProperty(AssertionError.prototype, "__bases__", {value: [Exception]});\n\n\nfunction ZeroDivisionError() {\n if (this.ρσ_object_id === undefined) Object.defineProperty(this, "ρσ_object_id", {"value":++ρσ_object_counter});\n ZeroDivisionError.prototype.__init__.apply(this, arguments);\n}\nρσ_extends(ZeroDivisionError, Exception);\nZeroDivisionError.prototype.__init__ = function __init__ () {\n Exception.prototype.__init__ && Exception.prototype.__init__.apply(this, arguments);\n};\nZeroDivisionError.prototype.__repr__ = function __repr__ () {\n if(Exception.prototype.__repr__) return Exception.prototype.__repr__.call(this);\n return "<" + __name__ + "." + this.constructor.name + " #" + this.ρσ_object_id + ">";\n};\nZeroDivisionError.prototype.__str__ = function __str__ () {\n if(Exception.prototype.__str__) return Exception.prototype.__str__.call(this);\nreturn this.__repr__();\n};\nObject.defineProperty(ZeroDivisionError.prototype, "__bases__", {value: [Exception]});\n\nvar ρσ_in, ρσ_desugar_kwargs, ρσ_exists;\nfunction ρσ_eslice(arr, step, start, end) {\n var is_string;\n if (typeof arr === "string" || arr instanceof String) {\n is_string = true;\n arr = arr.split("");\n }\n if (step < 0) {\n step = -step;\n arr = arr.slice().reverse();\n if (typeof start !== "undefined") {\n start = arr.length - start - 1;\n }\n if (typeof end !== "undefined") {\n end = arr.length - end - 1;\n }\n }\n if (typeof start === "undefined") {\n start = 0;\n }\n if (typeof end === "undefined") {\n end = arr.length;\n }\n arr = arr.slice(start, end).filter((function() {\n var ρσ_anonfunc = function (e, i) {\n return i % step === 0;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["e", "i"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })());\n if (is_string) {\n arr = arr.join("");\n }\n return arr;\n};\nif (!ρσ_eslice.__argnames__) Object.defineProperties(ρσ_eslice, {\n __argnames__ : {value: ["arr", "step", "start", "end"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_delslice(arr, step, start, end) {\n var is_string, ρσ_unpack, indices;\n if (typeof arr === "string" || arr instanceof String) {\n is_string = true;\n arr = arr.split("");\n }\n if (step < 0) {\n if (typeof start === "undefined") {\n start = arr.length;\n }\n if (typeof end === "undefined") {\n end = 0;\n }\n ρσ_unpack = [end, start, -step];\n start = ρσ_unpack[0];\n end = ρσ_unpack[1];\n step = ρσ_unpack[2];\n }\n if (typeof start === "undefined") {\n start = 0;\n }\n if (typeof end === "undefined") {\n end = arr.length;\n }\n if (step === 1) {\n arr.splice(start, end - start);\n } else {\n if (end > start) {\n indices = [];\n for (var i = start; i < end; i += step) {\n indices.push(i);\n }\n for (var i = indices.length - 1; i >= 0; i--) {\n arr.splice(indices[(typeof i === "number" && i < 0) ? indices.length + i : i], 1);\n }\n }\n }\n if (is_string) {\n arr = arr.join("");\n }\n return arr;\n};\nif (!ρσ_delslice.__argnames__) Object.defineProperties(ρσ_delslice, {\n __argnames__ : {value: ["arr", "step", "start", "end"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_flatten(arr) {\n var ans, value;\n ans = ρσ_list_decorate([]);\n for (var i=0; i < arr.length; i++) {\n value = arr[(typeof i === "number" && i < 0) ? arr.length + i : i];\n if (Array.isArray(value)) {\n ans = ans.concat(ρσ_flatten(value));\n } else {\n ans.push(value);\n }\n }\n return ans;\n};\nif (!ρσ_flatten.__argnames__) Object.defineProperties(ρσ_flatten, {\n __argnames__ : {value: ["arr"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_unpack_asarray(num, iterable) {\n var ans, iterator, result;\n if (ρσ_arraylike(iterable)) {\n return iterable;\n }\n ans = [];\n if (typeof iterable[ρσ_iterator_symbol] === "function") {\n iterator = (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();\n result = iterator.next();\n while (!result.done && ans.length < num) {\n ans.push(result.value);\n result = iterator.next();\n }\n }\n return ans;\n};\nif (!ρσ_unpack_asarray.__argnames__) Object.defineProperties(ρσ_unpack_asarray, {\n __argnames__ : {value: ["num", "iterable"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_extends(child, parent) {\n child.prototype = Object.create(parent.prototype);\n child.prototype.constructor = child;\n};\nif (!ρσ_extends.__argnames__) Object.defineProperties(ρσ_extends, {\n __argnames__ : {value: ["child", "parent"]},\n __module__ : {value: "__main__"}\n});\n\nρσ_in = (function() {\n var ρσ_anonfunc = function () {\n if (typeof Map === "function" && typeof Set === "function") {\n return (function() {\n var ρσ_anonfunc = function (val, arr) {\n if (typeof arr === "string") {\n return arr.indexOf(val) !== -1;\n }\n if (typeof arr.__contains__ === "function") {\n return arr.__contains__(val);\n }\n if (arr instanceof Map || arr instanceof Set) {\n return arr.has(val);\n }\nif (arr instanceof vec)\n {\n return ρσ_list_contains.call(arr, val);\n}\n if (ρσ_arraylike(arr)) {\n return ρσ_list_contains.call(arr, val);\n }\n return Object.prototype.hasOwnProperty.call(arr, val);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["val", "arr"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n }\n return (function() {\n var ρσ_anonfunc = function (val, arr) {\n if (typeof arr === "string") {\n return arr.indexOf(val) !== -1;\n }\n if (typeof arr.__contains__ === "function") {\n return arr.__contains__(val);\n }\nif (arr instanceof vec)\n {\n return ρσ_list_contains.call(arr, val);\n}\n if (ρσ_arraylike(arr)) {\n return ρσ_list_contains.call(arr, val);\n }\n return Object.prototype.hasOwnProperty.call(arr, val);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["val", "arr"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})()();\nfunction ρσ_Iterable(iterable) {\n var iterator, ans, result;\n if (ρσ_arraylike(iterable)) {\n return iterable;\n }\n if (typeof iterable[ρσ_iterator_symbol] === "function") {\n iterator = (typeof Map === "function" && iterable instanceof Map) ? iterable.keys() : iterable[ρσ_iterator_symbol]();\n ans = ρσ_list_decorate([]);\n result = iterator.next();\n while (!result.done) {\n ans.push(result.value);\n result = iterator.next();\n }\n return ans;\n }\n return Object.keys(iterable);\n};\nif (!ρσ_Iterable.__argnames__) Object.defineProperties(ρσ_Iterable, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\n\nρσ_desugar_kwargs = (function() {\n var ρσ_anonfunc = function () {\n if (typeof Object.assign === "function") {\n return (function() {\n var ρσ_anonfunc = function () {\n var ans;\n ans = Object.create(null);\n ans[ρσ_kwargs_symbol] = true;\n for (var i = 0; i < arguments.length; i++) {\n Object.assign(ans, arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i]);\n }\n return ans;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n }\n return (function() {\n var ρσ_anonfunc = function () {\n var ans, keys;\n ans = Object.create(null);\n ans[ρσ_kwargs_symbol] = true;\n for (var i = 0; i < arguments.length; i++) {\n keys = Object.keys(arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i]);\n for (var j = 0; j < keys.length; j++) {\n ans[ρσ_bound_index(keys[(typeof j === "number" && j < 0) ? keys.length + j : j], ans)] = (ρσ_expr_temp = arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i])[ρσ_bound_index(keys[(typeof j === "number" && j < 0) ? keys.length + j : j], ρσ_expr_temp)];\n }\n }\n return ans;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})()();\nfunction ρσ_interpolate_kwargs(f, supplied_args) {\n var has_prop, kwobj, args, prop;\n if (!f.__argnames__) {\n return f.apply(this, supplied_args);\n }\n has_prop = Object.prototype.hasOwnProperty;\n kwobj = supplied_args.pop();\n if (f.__handles_kwarg_interpolation__) {\n args = new Array(Math.max(supplied_args.length, f.__argnames__.length) + 1);\n args[args.length-1] = kwobj;\n for (var i = 0; i < args.length - 1; i++) {\n if (i < f.__argnames__.length) {\n prop = (ρσ_expr_temp = f.__argnames__)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i];\n if (has_prop.call(kwobj, prop)) {\n args[(typeof i === "number" && i < 0) ? args.length + i : i] = kwobj[(typeof prop === "number" && prop < 0) ? kwobj.length + prop : prop];\n delete kwobj[prop];\n } else if (i < supplied_args.length) {\n args[(typeof i === "number" && i < 0) ? args.length + i : i] = supplied_args[(typeof i === "number" && i < 0) ? supplied_args.length + i : i];\n }\n } else {\n args[(typeof i === "number" && i < 0) ? args.length + i : i] = supplied_args[(typeof i === "number" && i < 0) ? supplied_args.length + i : i];\n }\n }\n return f.apply(this, args);\n }\n for (var i = 0; i < f.__argnames__.length; i++) {\n prop = (ρσ_expr_temp = f.__argnames__)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i];\n if (has_prop.call(kwobj, prop)) {\n supplied_args[(typeof i === "number" && i < 0) ? supplied_args.length + i : i] = kwobj[(typeof prop === "number" && prop < 0) ? kwobj.length + prop : prop];\n }\n }\n return f.apply(this, supplied_args);\n};\nif (!ρσ_interpolate_kwargs.__argnames__) Object.defineProperties(ρσ_interpolate_kwargs, {\n __argnames__ : {value: ["f", "supplied_args"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_interpolate_kwargs_constructor(apply, f, supplied_args) {\n if (apply) {\n f.apply(this, supplied_args);\n } else {\n ρσ_interpolate_kwargs.call(this, f, supplied_args);\n }\n return this;\n};\nif (!ρσ_interpolate_kwargs_constructor.__argnames__) Object.defineProperties(ρσ_interpolate_kwargs_constructor, {\n __argnames__ : {value: ["apply", "f", "supplied_args"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_getitem(obj, key) {\n if (obj.__getitem__) {\n return obj.__getitem__(key);\n }\n if (typeof key === "number" && key < 0) {\n key += obj.length;\n }\n return obj[(typeof key === "number" && key < 0) ? obj.length + key : key];\n};\nif (!ρσ_getitem.__argnames__) Object.defineProperties(ρσ_getitem, {\n __argnames__ : {value: ["obj", "key"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_setitem(obj, key, val) {\n if (obj.__setitem__) {\n obj.__setitem__(key, val);\n } else {\n if (typeof key === "number" && key < 0) {\n key += obj.length;\n }\n obj[(typeof key === "number" && key < 0) ? obj.length + key : key] = val;\n }\n return val;\n};\nif (!ρσ_setitem.__argnames__) Object.defineProperties(ρσ_setitem, {\n __argnames__ : {value: ["obj", "key", "val"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_delitem(obj, key) {\n if (obj.__delitem__) {\n obj.__delitem__(key);\n } else if (typeof obj.splice === "function") {\n obj.splice(key, 1);\n } else {\n if (typeof key === "number" && key < 0) {\n key += obj.length;\n }\n delete obj[key];\n }\n};\nif (!ρσ_delitem.__argnames__) Object.defineProperties(ρσ_delitem, {\n __argnames__ : {value: ["obj", "key"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_bound_index(idx, arr) {\n if (typeof idx === "number" && idx < 0) {\n idx += arr.length;\n }\n return idx;\n};\nif (!ρσ_bound_index.__argnames__) Object.defineProperties(ρσ_bound_index, {\n __argnames__ : {value: ["idx", "arr"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_splice(arr, val, start, end) {\n start = start || 0;\n if (start < 0) {\n start += arr.length;\n }\n if (end === undefined) {\n end = arr.length;\n }\n if (end < 0) {\n end += arr.length;\n }\n Array.prototype.splice.apply(arr, [start, end - start].concat(val));\n};\nif (!ρσ_splice.__argnames__) Object.defineProperties(ρσ_splice, {\n __argnames__ : {value: ["arr", "val", "start", "end"]},\n __module__ : {value: "__main__"}\n});\n\nρσ_exists = (function(){\n var ρσ_d = {};\n ρσ_d["n"] = (function() {\n var ρσ_anonfunc = function (expr) {\n return expr !== undefined && expr !== null;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["expr"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ρσ_d["d"] = (function() {\n var ρσ_anonfunc = function (expr) {\n if (expr === undefined || expr === null) {\n return Object.create(null);\n }\n return expr;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["expr"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ρσ_d["c"] = (function() {\n var ρσ_anonfunc = function (expr) {\n if (typeof expr === "function") {\n return expr;\n }\n return (function() {\n var ρσ_anonfunc = function () {\n return undefined;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["expr"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ρσ_d["g"] = (function() {\n var ρσ_anonfunc = function (expr) {\n if (expr === undefined || expr === null || typeof expr.__getitem__ !== "function") {\n return (function(){\n var ρσ_d = {};\n ρσ_d["__getitem__"] = (function() {\n var ρσ_anonfunc = function () {\n return undefined;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this);\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["expr"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ρσ_d["e"] = (function() {\n var ρσ_anonfunc = function (expr, alt) {\n return (expr === undefined || expr === null) ? alt : expr;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["expr", "alt"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n}).call(this);\nfunction ρσ_mixin() {\n var seen, resolved_props, p, target, props, name;\n seen = Object.create(null);\n seen.__argnames__ = seen.__handles_kwarg_interpolation__ = seen.__init__ = seen.__annotations__ = seen.__doc__ = seen.__bind_methods__ = seen.__bases__ = seen.constructor = seen.__class__ = true;\n resolved_props = {};\n p = target = arguments[0].prototype;\n while (p && p !== Object.prototype) {\n props = Object.getOwnPropertyNames(p);\n for (var i = 0; i < props.length; i++) {\n seen[ρσ_bound_index(props[(typeof i === "number" && i < 0) ? props.length + i : i], seen)] = true;\n }\n p = Object.getPrototypeOf(p);\n }\n for (var c = 1; c < arguments.length; c++) {\n p = arguments[(typeof c === "number" && c < 0) ? arguments.length + c : c].prototype;\n while (p && p !== Object.prototype) {\n props = Object.getOwnPropertyNames(p);\n for (var i = 0; i < props.length; i++) {\n name = props[(typeof i === "number" && i < 0) ? props.length + i : i];\n if (seen[(typeof name === "number" && name < 0) ? seen.length + name : name]) {\n continue;\n }\n seen[(typeof name === "number" && name < 0) ? seen.length + name : name] = true;\n resolved_props[(typeof name === "number" && name < 0) ? resolved_props.length + name : name] = Object.getOwnPropertyDescriptor(p, name);\n }\n p = Object.getPrototypeOf(p);\n }\n }\n Object.defineProperties(target, resolved_props);\n};\nif (!ρσ_mixin.__module__) Object.defineProperties(ρσ_mixin, {\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_instanceof() {\n var obj, bases, q, cls, p;\n obj = arguments[0];\n bases = "";\n if (obj && obj.constructor && obj.constructor.prototype) {\n bases = obj.constructor.prototype.__bases__ || "";\n }\n for (var i = 1; i < arguments.length; i++) {\n q = arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i];\n if (obj instanceof q) {\n return true;\n }\n if ((q === Array || q === ρσ_list_constructor) && Array.isArray(obj)) {\n return true;\n }\n if (q === ρσ_str && (typeof obj === "string" || obj instanceof String)) {\n return true;\n }\n if (q === ρσ_int && typeof obj === "number" && Number.isInteger(obj)) {\n return true;\n }\n if (q === ρσ_float && typeof obj === "number" && !Number.isInteger(obj)) {\n return true;\n }\n if (bases.length > 1) {\n for (var c = 1; c < bases.length; c++) {\n cls = bases[(typeof c === "number" && c < 0) ? bases.length + c : c];\n while (cls) {\n if (q === cls) {\n return true;\n }\n p = Object.getPrototypeOf(cls.prototype);\n if (!p) {\n break;\n }\n cls = p.constructor;\n }\n }\n }\n }\n return false;\n};\nif (!ρσ_instanceof.__module__) Object.defineProperties(ρσ_instanceof, {\n __module__ : {value: "__main__"}\n});\nfunction sum(iterable, start) {\n var ans, iterator, r;\n if (Array.isArray(iterable)) {\n return iterable.reduce((function() {\n var ρσ_anonfunc = function (prev, cur) {\n return prev + cur;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["prev", "cur"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })(), start || 0);\n }\n ans = start || 0;\n iterator = iter(iterable);\n r = iterator.next();\n while (!r.done) {\n ans += r.value;\n r = iterator.next();\n }\n return ans;\n};\nif (!sum.__argnames__) Object.defineProperties(sum, {\n __argnames__ : {value: ["iterable", "start"]},\n __module__ : {value: "__main__"}\n});\n\nfunction map() {\n var iterators, func, args, ans;\n iterators = new Array(arguments.length - 1);\n func = arguments[0];\n args = new Array(arguments.length - 1);\n for (var i = 1; i < arguments.length; i++) {\n iterators[ρσ_bound_index(i - 1, iterators)] = iter(arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i]);\n }\n ans = {\'_func\':func, \'_iterators\':iterators, \'_args\':args};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n var r;\n for (var i = 0; i < this._iterators.length; i++) {\n r = (ρσ_expr_temp = this._iterators)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i].next();\n if (r.done) {\n return {\'done\':true};\n }\n (ρσ_expr_temp = this._args)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] = r.value;\n }\n return {\'done\':false, \'value\':this._func.apply(undefined, this._args)};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n};\nif (!map.__module__) Object.defineProperties(map, {\n __module__ : {value: "__main__"}\n});\n\nfunction filter(func_or_none, iterable) {\n var func, ans;\n func = (func_or_none === null) ? ρσ_bool : func_or_none;\n ans = {\'_func\':func, \'_iterator\':ρσ_iter(iterable)};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n var r;\n r = this._iterator.next();\n while (!r.done) {\n if (this._func(r.value)) {\n return r;\n }\n r = this._iterator.next();\n }\n return {\'done\':true};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n};\nif (!filter.__argnames__) Object.defineProperties(filter, {\n __argnames__ : {value: ["func_or_none", "iterable"]},\n __module__ : {value: "__main__"}\n});\n\nfunction zip() {\n var iterators, ans;\n iterators = new Array(arguments.length);\n for (var i = 0; i < arguments.length; i++) {\n iterators[(typeof i === "number" && i < 0) ? iterators.length + i : i] = iter(arguments[(typeof i === "number" && i < 0) ? arguments.length + i : i]);\n }\n ans = {\'_iterators\':iterators};\n ans[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ans["next"] = (function() {\n var ρσ_anonfunc = function () {\n var args, r;\n args = new Array(this._iterators.length);\n for (var i = 0; i < this._iterators.length; i++) {\n r = (ρσ_expr_temp = this._iterators)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i].next();\n if (r.done) {\n return {\'done\':true};\n }\n args[(typeof i === "number" && i < 0) ? args.length + i : i] = r.value;\n }\n return {\'done\':false, \'value\':args};\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ans;\n};\nif (!zip.__module__) Object.defineProperties(zip, {\n __module__ : {value: "__main__"}\n});\n\nfunction any(iterable) {\n var i;\n var ρσ_Iter0 = ρσ_Iterable(iterable);\n for (var ρσ_Index0 = 0; ρσ_Index0 < ρσ_Iter0.length; ρσ_Index0++) {\n i = ρσ_Iter0[ρσ_Index0];\n if (i) {\n return true;\n }\n }\n return false;\n};\nif (!any.__argnames__) Object.defineProperties(any, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\n\nfunction all(iterable) {\n var i;\n var ρσ_Iter1 = ρσ_Iterable(iterable);\n for (var ρσ_Index1 = 0; ρσ_Index1 < ρσ_Iter1.length; ρσ_Index1++) {\n i = ρσ_Iter1[ρσ_Index1];\n if (!i) {\n return false;\n }\n }\n return true;\n};\nif (!all.__argnames__) Object.defineProperties(all, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n});\nvar decimal_sep, define_str_func, ρσ_unpack, ρσ_orig_split, ρσ_orig_replace;\ndecimal_sep = 1.1.toLocaleString()[1];\nfunction ρσ_repr_js_builtin(x, as_array) {\n var ans, b, keys, key;\n ans = [];\n b = "{}";\n if (as_array) {\n b = "[]";\n for (var i = 0; i < x.length; i++) {\n ans.push(ρσ_repr(x[(typeof i === "number" && i < 0) ? x.length + i : i]));\n }\n } else {\n keys = Object.keys(x);\n for (var k = 0; k < keys.length; k++) {\n key = keys[(typeof k === "number" && k < 0) ? keys.length + k : k];\n ans.push(JSON.stringify(key) + ":" + ρσ_repr(x[(typeof key === "number" && key < 0) ? x.length + key : key]));\n }\n }\n return b[0] + ans.join(", ") + b[1];\n};\nif (!ρσ_repr_js_builtin.__argnames__) Object.defineProperties(ρσ_repr_js_builtin, {\n __argnames__ : {value: ["x", "as_array"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_html_element_to_string(elem) {\n var attrs, val, attr, ans;\n attrs = [];\n var ρσ_Iter0 = ρσ_Iterable(elem.attributes);\n for (var ρσ_Index0 = 0; ρσ_Index0 < ρσ_Iter0.length; ρσ_Index0++) {\n attr = ρσ_Iter0[ρσ_Index0];\n if (attr.specified) {\n val = attr.value;\n if (val.length > 10) {\n val = val.slice(0, 15) + "...";\n }\n val = JSON.stringify(val);\n attrs.push("" + ρσ_str.format("{}", attr.name) + "=" + ρσ_str.format("{}", val) + "");\n }\n }\n attrs = (attrs.length) ? " " + attrs.join(" ") : "";\n ans = "<" + ρσ_str.format("{}", elem.tagName) + "" + ρσ_str.format("{}", attrs) + ">";\n return ans;\n};\nif (!ρσ_html_element_to_string.__argnames__) Object.defineProperties(ρσ_html_element_to_string, {\n __argnames__ : {value: ["elem"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_repr(x) {\n var ans, name;\n if (x === null) {\n return "None";\n }\n if (x === undefined) {\n return "undefined";\n }\n ans = x;\n if (typeof x.__repr__ === "function") {\n ans = x.__repr__();\n } else if (x === true || x === false) {\n ans = (x) ? "True" : "False";\n } else if (Array.isArray(x)) {\n ans = ρσ_repr_js_builtin(x, true);\n } else if (typeof x === "function") {\n ans = x.toString();\n } else if (typeof x === "object" && !x.toString) {\n ans = ρσ_repr_js_builtin(x);\n } else {\n name = Object.prototype.toString.call(x).slice(8, -1);\n if (ρσ_not_equals("Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".indexOf(name), -1)) {\n return name + "([" + x.map((function() {\n var ρσ_anonfunc = function (i) {\n return str.format("0x{:02x}", i);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["i"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })()).join(", ") + "])";\n }\n if (typeof HTMLElement !== "undefined" && x instanceof HTMLElement) {\n ans = ρσ_html_element_to_string(x);\n } else {\n ans = (typeof x.toString === "function") ? x.toString() : x;\n }\n if (ans === "[object Object]") {\n return ρσ_repr_js_builtin(x);\n }\n try {\n ans = JSON.stringify(x);\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n {\n } \n }\n }\n return ans + "";\n};\nif (!ρσ_repr.__argnames__) Object.defineProperties(ρσ_repr, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\nfunction ρσ_str(x) {\n var ans, name;\n if (x === null) {\n return "None";\n }\n if (x === undefined) {\n return "undefined";\n }\n ans = x;\n if (typeof x.__str__ === "function") {\n ans = x.__str__();\n } else if (typeof x.__repr__ === "function") {\n ans = x.__repr__();\n } else if (x === true || x === false) {\n ans = (x) ? "True" : "False";\n } else if (Array.isArray(x)) {\n ans = ρσ_repr_js_builtin(x, true);\n } else if (typeof x.toString === "function") {\n name = Object.prototype.toString.call(x).slice(8, -1);\n if (ρσ_not_equals("Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".indexOf(name), -1)) {\n return name + "([" + x.map((function() {\n var ρσ_anonfunc = function (i) {\n return str.format("0x{:02x}", i);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["i"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })()).join(", ") + "])";\n }\n if (typeof HTMLElement !== "undefined" && x instanceof HTMLElement) {\n ans = ρσ_html_element_to_string(x);\n } else {\n ans = x.toString();\n }\n if (ans === "[object Object]") {\n ans = ρσ_repr_js_builtin(x);\n }\n } else if (typeof x === "object" && !x.toString) {\n ans = ρσ_repr_js_builtin(x);\n }\n return ans + "";\n};\nif (!ρσ_str.__argnames__) Object.defineProperties(ρσ_str, {\n __argnames__ : {value: ["x"]},\n __module__ : {value: "__main__"}\n});\n\ndefine_str_func = (function() {\n var ρσ_anonfunc = function (name, func) {\n var f;\n (ρσ_expr_temp = ρσ_str.prototype)[(typeof name === "number" && name < 0) ? ρσ_expr_temp.length + name : name] = func;\n ρσ_str[(typeof name === "number" && name < 0) ? ρσ_str.length + name : name] = f = func.call.bind(func);\n if (func.__argnames__) {\n Object.defineProperty(f, "__argnames__", (function(){\n var ρσ_d = {};\n ρσ_d["value"] = [\'string\'].concat(func.__argnames__);\n return ρσ_d;\n }).call(this));\n }\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["name", "func"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_unpack = [String.prototype.split.call.bind(String.prototype.split), String.prototype.replace.call.bind(String.prototype.replace)];\nρσ_orig_split = ρσ_unpack[0];\nρσ_orig_replace = ρσ_unpack[1];\ndefine_str_func("format", (function() {\n var ρσ_anonfunc = function () {\n var template, args, kwargs, explicit, implicit, idx, split, ans, pos, in_brace, markup, ch;\n template = this;\n if (template === undefined) {\n throw new TypeError("Template is required");\n }\n args = Array.prototype.slice.call(arguments);\n kwargs = {};\n if (args[args.length-1] && args[args.length-1][ρσ_kwargs_symbol] !== undefined) {\n kwargs = args[args.length-1];\n args = args.slice(0, -1);\n }\n explicit = implicit = false;\n idx = 0;\n split = ρσ_orig_split;\n if (ρσ_str.format._template_resolve_pat === undefined) {\n ρσ_str.format._template_resolve_pat = /[.\\[]/;\n }\n function resolve(arg, object) {\n var ρσ_unpack, first, key, rest, ans;\n if (!arg) {\n return object;\n }\n ρσ_unpack = [arg[0], arg.slice(1)];\n first = ρσ_unpack[0];\n arg = ρσ_unpack[1];\n key = split(arg, ρσ_str.format._template_resolve_pat, 1)[0];\n rest = arg.slice(key.length);\n ans = (first === "[") ? object[ρσ_bound_index(key.slice(0, -1), object)] : getattr(object, key);\n if (ans === undefined) {\n throw new KeyError((first === "[") ? key.slice(0, -1) : key);\n }\n return resolve(rest, ans);\n };\n if (!resolve.__argnames__) Object.defineProperties(resolve, {\n __argnames__ : {value: ["arg", "object"]},\n __module__ : {value: "__main__"}\n });\n\n function resolve_format_spec(format_spec) {\n if (ρσ_str.format._template_resolve_fs_pat === undefined) {\n ρσ_str.format._template_resolve_fs_pat = /[{]([a-zA-Z0-9_]+)[}]/g;\n }\n return format_spec.replace(ρσ_str.format._template_resolve_fs_pat, (function() {\n var ρσ_anonfunc = function (match, key) {\n if (!Object.prototype.hasOwnProperty.call(kwargs, key)) {\n return "";\n }\n return "" + kwargs[(typeof key === "number" && key < 0) ? kwargs.length + key : key];\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["match", "key"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })());\n };\n if (!resolve_format_spec.__argnames__) Object.defineProperties(resolve_format_spec, {\n __argnames__ : {value: ["format_spec"]},\n __module__ : {value: "__main__"}\n });\n\n function set_comma(ans, comma) {\n var sep;\n if (comma !== ",") {\n sep = 1234;\n sep = sep.toLocaleString(undefined, {useGrouping: true})[1];\n ans = str.replace(ans, sep, comma);\n }\n return ans;\n };\n if (!set_comma.__argnames__) Object.defineProperties(set_comma, {\n __argnames__ : {value: ["ans", "comma"]},\n __module__ : {value: "__main__"}\n });\n\n function safe_comma(value, comma) {\n try {\n return set_comma(value.toLocaleString(undefined, {useGrouping: true}), comma);\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n {\n return value.toString(10);\n } \n }\n };\n if (!safe_comma.__argnames__) Object.defineProperties(safe_comma, {\n __argnames__ : {value: ["value", "comma"]},\n __module__ : {value: "__main__"}\n });\n\n function safe_fixed(value, precision, comma) {\n if (!comma) {\n return value.toFixed(precision);\n }\n try {\n return set_comma(value.toLocaleString(undefined, {useGrouping: true, minimumFractionDigits: precision, maximumFractionDigits: precision}), comma);\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n {\n return value.toFixed(precision);\n } \n }\n };\n if (!safe_fixed.__argnames__) Object.defineProperties(safe_fixed, {\n __argnames__ : {value: ["value", "precision", "comma"]},\n __module__ : {value: "__main__"}\n });\n\n function apply_formatting(value, format_spec) {\n var ρσ_unpack, fill, align, sign, fhash, zeropad, width, comma, precision, ftype, is_numeric, is_int, lftype, code, prec, exp, nval, is_positive, left, right;\n if (format_spec.indexOf("{") !== -1) {\n format_spec = resolve_format_spec(format_spec);\n }\n if (ρσ_str.format._template_format_pat === undefined) {\n ρσ_str.format._template_format_pat = /([^{}](?=[<>=^]))?([<>=^])?([-+\\x20])?(\\#)?(0)?(\\d+)?([,_])?(?:\\.(\\d+))?([bcdeEfFgGnosxX%])?/;\n }\n try {\n ρσ_unpack = format_spec.match(ρσ_str.format._template_format_pat).slice(1);\nρσ_unpack = ρσ_unpack_asarray(9, ρσ_unpack);\n fill = ρσ_unpack[0];\n align = ρσ_unpack[1];\n sign = ρσ_unpack[2];\n fhash = ρσ_unpack[3];\n zeropad = ρσ_unpack[4];\n width = ρσ_unpack[5];\n comma = ρσ_unpack[6];\n precision = ρσ_unpack[7];\n ftype = ρσ_unpack[8];\n } catch (ρσ_Exception) {\n ρσ_last_exception = ρσ_Exception;\n if (ρσ_Exception instanceof TypeError) {\n return value;\n } else {\n throw ρσ_Exception;\n }\n }\n if (zeropad) {\n fill = fill || "0";\n align = align || "=";\n } else {\n fill = fill || " ";\n align = align || ">";\n }\n is_numeric = Number(value) === value;\n is_int = is_numeric && value % 1 === 0;\n precision = parseInt(precision, 10);\n lftype = (ftype || "").toLowerCase();\n if (ftype === "n") {\n is_numeric = true;\n if (is_int) {\n if (comma) {\n throw new ValueError("Cannot specify \',\' with \'n\'");\n }\n value = parseInt(value, 10).toLocaleString();\n } else {\n value = parseFloat(value).toLocaleString();\n }\n } else if ([\'b\', \'c\', \'d\', \'o\', \'x\'].indexOf(lftype) !== -1) {\n value = parseInt(value, 10);\n is_numeric = true;\n if (!isNaN(value)) {\n if (ftype === "b") {\n value = (value >>> 0).toString(2);\n if (fhash) {\n value = "0b" + value;\n }\n } else if (ftype === "c") {\n if (value > 65535) {\n code = value - 65536;\n value = String.fromCharCode(55296 + (code >> 10), 56320 + (code & 1023));\n } else {\n value = String.fromCharCode(value);\n }\n } else if (ftype === "d") {\n if (comma) {\n value = safe_comma(value, comma);\n } else {\n value = value.toString(10);\n }\n } else if (ftype === "o") {\n value = value.toString(8);\n if (fhash) {\n value = "0o" + value;\n }\n } else if (lftype === "x") {\n value = value.toString(16);\n value = (ftype === "x") ? value.toLowerCase() : value.toUpperCase();\n if (fhash) {\n value = "0x" + value;\n }\n }\n }\n } else if ([\'e\',\'f\',\'g\',\'%\'].indexOf(lftype) !== -1) {\n is_numeric = true;\n value = parseFloat(value);\n prec = (isNaN(precision)) ? 6 : precision;\n if (lftype === "e") {\n value = value.toExponential(prec);\n value = (ftype === "E") ? value.toUpperCase() : value.toLowerCase();\n } else if (lftype === "f") {\n value = safe_fixed(value, prec, comma);\n value = (ftype === "F") ? value.toUpperCase() : value.toLowerCase();\n } else if (lftype === "%") {\n value *= 100;\n value = safe_fixed(value, prec, comma) + "%";\n } else if (lftype === "g") {\n prec = max(1, prec);\n exp = parseInt(split(value.toExponential(prec - 1).toLowerCase(), "e")[1], 10);\n if (-4 <= exp && exp < prec) {\n value = safe_fixed(value, prec - 1 - exp, comma);\n } else {\n value = value.toExponential(prec - 1);\n }\n value = value.replace(/0+$/g, "");\n if (value[value.length-1] === decimal_sep) {\n value = value.slice(0, -1);\n }\n if (ftype === "G") {\n value = value.toUpperCase();\n }\n }\n } else {\n if (comma) {\n value = parseInt(value, 10);\n if (isNaN(value)) {\n throw new ValueError("Must use numbers with , or _");\n }\n value = safe_comma(value, comma);\n }\n value += "";\n if (!isNaN(precision)) {\n value = value.slice(0, precision);\n }\n }\n value += "";\n if (is_numeric && sign) {\n nval = Number(value);\n is_positive = !isNaN(nval) && nval >= 0;\n if (is_positive && (sign === " " || sign === "+")) {\n value = sign + value;\n }\n }\n function repeat(char, num) {\n return (new Array(num+1)).join(char);\n };\n if (!repeat.__argnames__) Object.defineProperties(repeat, {\n __argnames__ : {value: ["char", "num"]},\n __module__ : {value: "__main__"}\n });\n\n if (is_numeric && width && width[0] === "0") {\n width = width.slice(1);\n ρσ_unpack = ["0", "="];\n fill = ρσ_unpack[0];\n align = ρσ_unpack[1];\n }\n width = parseInt(width || "-1", 10);\n if (isNaN(width)) {\n throw new ValueError("Invalid width specification: " + width);\n }\n if (fill && value.length < width) {\n if (align === "<") {\n value = value + repeat(fill, width - value.length);\n } else if (align === ">") {\n value = repeat(fill, width - value.length) + value;\n } else if (align === "^") {\n left = Math.floor((width - value.length) / 2);\n right = width - left - value.length;\n value = repeat(fill, left) + value + repeat(fill, right);\n } else if (align === "=") {\n if (ρσ_in(value[0], "+- ")) {\n value = value[0] + repeat(fill, width - value.length) + value.slice(1);\n } else {\n value = repeat(fill, width - value.length) + value;\n }\n } else {\n throw new ValueError("Unrecognized alignment: " + align);\n }\n }\n return value;\n };\n if (!apply_formatting.__argnames__) Object.defineProperties(apply_formatting, {\n __argnames__ : {value: ["value", "format_spec"]},\n __module__ : {value: "__main__"}\n });\n\n function parse_markup(markup) {\n var key, transformer, format_spec, pos, state, ch;\n key = transformer = format_spec = "";\n pos = 0;\n state = 0;\n while (pos < markup.length) {\n ch = markup[(typeof pos === "number" && pos < 0) ? markup.length + pos : pos];\n if (state === 0) {\n if (ch === "!") {\n state = 1;\n } else if (ch === ":") {\n state = 2;\n } else {\n key += ch;\n }\n } else if (state === 1) {\n if (ch === ":") {\n state = 2;\n } else {\n transformer += ch;\n }\n } else {\n format_spec += ch;\n }\n pos += 1;\n }\n return [key, transformer, format_spec];\n };\n if (!parse_markup.__argnames__) Object.defineProperties(parse_markup, {\n __argnames__ : {value: ["markup"]},\n __module__ : {value: "__main__"}\n });\n\n function render_markup(markup) {\n var ρσ_unpack, key, transformer, format_spec, ends_with_equal, lkey, nvalue, object, ans;\n ρσ_unpack = parse_markup(markup);\nρσ_unpack = ρσ_unpack_asarray(3, ρσ_unpack);\n key = ρσ_unpack[0];\n transformer = ρσ_unpack[1];\n format_spec = ρσ_unpack[2];\n if (transformer && [\'a\', \'r\', \'s\'].indexOf(transformer) === -1) {\n throw new ValueError("Unknown conversion specifier: " + transformer);\n }\n ends_with_equal = key.endsWith("=");\n if (ends_with_equal) {\n key = key.slice(0, -1);\n }\n lkey = key.length && split(key, /[.\\[]/, 1)[0];\n if (lkey) {\n explicit = true;\n if (implicit) {\n throw new ValueError("cannot switch from automatic field numbering to manual field specification");\n }\n nvalue = parseInt(lkey);\n object = (isNaN(nvalue)) ? kwargs[(typeof lkey === "number" && lkey < 0) ? kwargs.length + lkey : lkey] : args[(typeof nvalue === "number" && nvalue < 0) ? args.length + nvalue : nvalue];\n if (object === undefined) {\n if (isNaN(nvalue)) {\n throw new KeyError(lkey);\n }\n throw new IndexError(lkey);\n }\n object = resolve(key.slice(lkey.length), object);\n } else {\n implicit = true;\n if (explicit) {\n throw new ValueError("cannot switch from manual field specification to automatic field numbering");\n }\n if (idx >= args.length) {\n throw new IndexError("Not enough arguments to match template: " + template);\n }\n object = args[(typeof idx === "number" && idx < 0) ? args.length + idx : idx];\n idx += 1;\n }\n if (typeof object === "function") {\n object = object();\n }\n ans = "" + object;\n if (format_spec) {\n ans = apply_formatting(ans, format_spec);\n }\n if (ends_with_equal) {\n ans = "" + ρσ_str.format("{}", key) + "=" + ρσ_str.format("{}", ans) + "";\n }\n return ans;\n };\n if (!render_markup.__argnames__) Object.defineProperties(render_markup, {\n __argnames__ : {value: ["markup"]},\n __module__ : {value: "__main__"}\n });\n\n ans = "";\n pos = 0;\n in_brace = 0;\n markup = "";\n while (pos < template.length) {\n ch = template[(typeof pos === "number" && pos < 0) ? template.length + pos : pos];\n if (in_brace) {\n if (ch === "{") {\n in_brace += 1;\n markup += "{";\n } else if (ch === "}") {\n in_brace -= 1;\n if (in_brace > 0) {\n markup += "}";\n } else {\n ans += render_markup(markup);\n }\n } else {\n markup += ch;\n }\n } else {\n if (ch === "{") {\n if (template[ρσ_bound_index(pos + 1, template)] === "{") {\n pos += 1;\n ans += "{";\n } else {\n in_brace = 1;\n markup = "";\n }\n } else {\n ans += ch;\n if (ch === "}" && template[ρσ_bound_index(pos + 1, template)] === "}") {\n pos += 1;\n }\n }\n }\n pos += 1;\n }\n if (in_brace) {\n throw new ValueError("expected \'}\' before end of string");\n }\n return ans;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("capitalize", (function() {\n var ρσ_anonfunc = function () {\n var string;\n string = this;\n if (string) {\n string = string[0].toUpperCase() + string.slice(1).toLowerCase();\n }\n return string;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("center", (function() {\n var ρσ_anonfunc = function (width, fill) {\n var left, right;\n left = Math.floor((width - this.length) / 2);\n right = width - left - this.length;\n fill = fill || " ";\n return new Array(left+1).join(fill) + this + new Array(right+1).join(fill);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["width", "fill"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("count", (function() {\n var ρσ_anonfunc = function (needle, start, end) {\n var string, ρσ_unpack, pos, step, ans;\n string = this;\n start = start || 0;\n end = end || string.length;\n if (start < 0 || end < 0) {\n string = string.slice(start, end);\n ρσ_unpack = [0, string.length];\n start = ρσ_unpack[0];\n end = ρσ_unpack[1];\n }\n pos = start;\n step = needle.length;\n if (!step) {\n return 0;\n }\n ans = 0;\n while (pos !== -1) {\n pos = string.indexOf(needle, pos);\n if (pos !== -1) {\n ans += 1;\n pos += step;\n }\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["needle", "start", "end"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("endswith", (function() {\n var ρσ_anonfunc = function (suffixes, start, end) {\n var string, q;\n string = this;\n start = start || 0;\n if (typeof suffixes === "string") {\n suffixes = [suffixes];\n }\n if (end !== undefined) {\n string = string.slice(0, end);\n }\n for (var i = 0; i < suffixes.length; i++) {\n q = suffixes[(typeof i === "number" && i < 0) ? suffixes.length + i : i];\n if (string.indexOf(q, Math.max(start, string.length - q.length)) !== -1) {\n return true;\n }\n }\n return false;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["suffixes", "start", "end"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("startswith", (function() {\n var ρσ_anonfunc = function (prefixes, start, end) {\n var prefix;\n start = start || 0;\n if (typeof prefixes === "string") {\n prefixes = [prefixes];\n }\n for (var i = 0; i < prefixes.length; i++) {\n prefix = prefixes[(typeof i === "number" && i < 0) ? prefixes.length + i : i];\n end = (end === undefined) ? this.length : end;\n if (end - start >= prefix.length && prefix === this.slice(start, start + prefix.length)) {\n return true;\n }\n }\n return false;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["prefixes", "start", "end"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("find", (function() {\n var ρσ_anonfunc = function (needle, start, end) {\n var ans;\n while (start < 0) {\n start += this.length;\n }\n ans = this.indexOf(needle, start);\n if (end !== undefined && ans !== -1) {\n while (end < 0) {\n end += this.length;\n }\n if (ans >= end - needle.length) {\n return -1;\n }\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["needle", "start", "end"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("rfind", (function() {\n var ρσ_anonfunc = function (needle, start, end) {\n var ans;\n while (end < 0) {\n end += this.length;\n }\n ans = this.lastIndexOf(needle, end - 1);\n if (start !== undefined && ans !== -1) {\n while (start < 0) {\n start += this.length;\n }\n if (ans < start) {\n return -1;\n }\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["needle", "start", "end"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("index", (function() {\n var ρσ_anonfunc = function (needle, start, end) {\n var ans;\n ans = ρσ_str.prototype.find.apply(this, arguments);\n if (ans === -1) {\n throw new ValueError("substring not found");\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["needle", "start", "end"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("rindex", (function() {\n var ρσ_anonfunc = function (needle, start, end) {\n var ans;\n ans = ρσ_str.prototype.rfind.apply(this, arguments);\n if (ans === -1) {\n throw new ValueError("substring not found");\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["needle", "start", "end"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("islower", (function() {\n var ρσ_anonfunc = function () {\n return this.length > 0 && this.toLowerCase() === this.toString();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("isupper", (function() {\n var ρσ_anonfunc = function () {\n return this.length > 0 && this.toUpperCase() === this.toString();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("isspace", (function() {\n var ρσ_anonfunc = function () {\n return this.length > 0 && /^\\s+$/.test(this);\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("join", (function() {\n var ρσ_anonfunc = function (iterable) {\n var ans, r;\n if (Array.isArray(iterable)) {\n return iterable.join(this);\n }\n ans = "";\n r = iterable.next();\n while (!r.done) {\n if (ans) {\n ans += this;\n }\n ans += r.value;\n r = iterable.next();\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["iterable"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("ljust", (function() {\n var ρσ_anonfunc = function (width, fill) {\n var string;\n string = this;\n if (width > string.length) {\n fill = fill || " ";\n string += new Array(width - string.length + 1).join(fill);\n }\n return string;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["width", "fill"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("rjust", (function() {\n var ρσ_anonfunc = function (width, fill) {\n var string;\n string = this;\n if (width > string.length) {\n fill = fill || " ";\n string = new Array(width - string.length + 1).join(fill) + string;\n }\n return string;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["width", "fill"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("lower", (function() {\n var ρσ_anonfunc = function () {\n return this.toLowerCase();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("upper", (function() {\n var ρσ_anonfunc = function () {\n return this.toUpperCase();\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("lstrip", (function() {\n var ρσ_anonfunc = function (chars) {\n var string, pos;\n string = this;\n pos = 0;\n chars = chars || ρσ_str.whitespace;\n while (chars.indexOf(string[(typeof pos === "number" && pos < 0) ? string.length + pos : pos]) !== -1) {\n pos += 1;\n }\n if (pos) {\n string = string.slice(pos);\n }\n return string;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["chars"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("rstrip", (function() {\n var ρσ_anonfunc = function (chars) {\n var string, pos;\n string = this;\n pos = string.length - 1;\n chars = chars || ρσ_str.whitespace;\n while (chars.indexOf(string[(typeof pos === "number" && pos < 0) ? string.length + pos : pos]) !== -1) {\n pos -= 1;\n }\n if (pos < string.length - 1) {\n string = string.slice(0, pos + 1);\n }\n return string;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["chars"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("strip", (function() {\n var ρσ_anonfunc = function (chars) {\n return ρσ_str.prototype.lstrip.call(ρσ_str.prototype.rstrip.call(this, chars), chars);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["chars"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("partition", (function() {\n var ρσ_anonfunc = function (sep) {\n var idx;\n idx = this.indexOf(sep);\n if (idx === -1) {\n return [this, "", ""];\n }\n return [this.slice(0, idx), sep, this.slice(idx + sep.length)];\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["sep"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("rpartition", (function() {\n var ρσ_anonfunc = function (sep) {\n var idx;\n idx = this.lastIndexOf(sep);\n if (idx === -1) {\n return ["", "", this];\n }\n return [this.slice(0, idx), sep, this.slice(idx + sep.length)];\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["sep"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("replace", (function() {\n var ρσ_anonfunc = function (old, repl, count) {\n var string, pos, idx;\n string = this;\n if (count === 1) {\n return ρσ_orig_replace(string, old, repl);\n }\n if (count < 1) {\n return string;\n }\n count = count || Number.MAX_VALUE;\n pos = 0;\n while (count > 0) {\n count -= 1;\n idx = string.indexOf(old, pos);\n if (idx === -1) {\n break;\n }\n pos = idx + repl.length;\n string = string.slice(0, idx) + repl + string.slice(idx + old.length);\n }\n return string;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["old", "repl", "count"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("split", (function() {\n var ρσ_anonfunc = function (sep, maxsplit) {\n var split, ans, extra, parts;\n if (maxsplit === 0) {\n return ρσ_list_decorate([ this ]);\n }\n split = ρσ_orig_split;\n if (sep === undefined || sep === null) {\n if (maxsplit > 0) {\n ans = split(this, /(\\s+)/);\n extra = "";\n parts = [];\n for (var i = 0; i < ans.length; i++) {\n if (parts.length >= maxsplit + 1) {\n extra += ans[(typeof i === "number" && i < 0) ? ans.length + i : i];\n } else if (i % 2 === 0) {\n parts.push(ans[(typeof i === "number" && i < 0) ? ans.length + i : i]);\n }\n }\n parts[parts.length-1] += extra;\n ans = parts;\n } else {\n ans = split(this, /\\s+/);\n }\n } else {\n if (sep === "") {\n throw new ValueError("empty separator");\n }\n ans = split(this, sep);\n if (maxsplit > 0 && ans.length > maxsplit) {\n extra = ans.slice(maxsplit).join(sep);\n ans = ans.slice(0, maxsplit);\n ans.push(extra);\n }\n }\n return ρσ_list_decorate(ans);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["sep", "maxsplit"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("rsplit", (function() {\n var ρσ_anonfunc = function (sep, maxsplit) {\n var split, ans, is_space, pos, current, spc, ch, end, idx;\n if (!maxsplit) {\n return ρσ_str.prototype.split.call(this, sep);\n }\n split = ρσ_orig_split;\n if (sep === undefined || sep === null) {\n if (maxsplit > 0) {\n ans = [];\n is_space = /\\s/;\n pos = this.length - 1;\n current = "";\n while (pos > -1 && maxsplit > 0) {\n spc = false;\n ch = (ρσ_expr_temp = this)[(typeof pos === "number" && pos < 0) ? ρσ_expr_temp.length + pos : pos];\n while (pos > -1 && is_space.test(ch)) {\n spc = true;\n ch = this[--pos];\n }\n if (spc) {\n if (current) {\n ans.push(current);\n maxsplit -= 1;\n }\n current = ch;\n } else {\n current += ch;\n }\n pos -= 1;\n }\n ans.push(this.slice(0, pos + 1) + current);\n ans.reverse();\n } else {\n ans = split(this, /\\s+/);\n }\n } else {\n if (sep === "") {\n throw new ValueError("empty separator");\n }\n ans = [];\n pos = end = this.length;\n while (pos > -1 && maxsplit > 0) {\n maxsplit -= 1;\n idx = this.lastIndexOf(sep, pos);\n if (idx === -1) {\n break;\n }\n ans.push(this.slice(idx + sep.length, end));\n pos = idx - 1;\n end = idx;\n }\n ans.push(this.slice(0, end));\n ans.reverse();\n }\n return ρσ_list_decorate(ans);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["sep", "maxsplit"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("splitlines", (function() {\n var ρσ_anonfunc = function (keepends) {\n var split, parts, ans;\n split = ρσ_orig_split;\n if (keepends) {\n parts = split(this, /((?:\\r?\\n)|\\r)/);\n ans = [];\n for (var i = 0; i < parts.length; i++) {\n if (i % 2 === 0) {\n ans.push(parts[(typeof i === "number" && i < 0) ? parts.length + i : i]);\n } else {\n ans[ans.length-1] += parts[(typeof i === "number" && i < 0) ? parts.length + i : i];\n }\n }\n } else {\n ans = split(this, /(?:\\r?\\n)|\\r/);\n }\n return ρσ_list_decorate(ans);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["keepends"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("swapcase", (function() {\n var ρσ_anonfunc = function () {\n var ans, a, b;\n ans = new Array(this.length);\n for (var i = 0; i < ans.length; i++) {\n a = (ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i];\n b = a.toLowerCase();\n if (a === b) {\n b = a.toUpperCase();\n }\n ans[(typeof i === "number" && i < 0) ? ans.length + i : i] = b;\n }\n return ans.join("");\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\ndefine_str_func("zfill", (function() {\n var ρσ_anonfunc = function (width) {\n var string;\n string = this;\n if (width > string.length) {\n string = new Array(width - string.length + 1).join("0") + string;\n }\n return string;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["width"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})());\nρσ_str.uchrs = (function() {\n var ρσ_anonfunc = function (string, with_positions) {\n return (function(){\n var ρσ_d = {};\n ρσ_d["_string"] = string;\n ρσ_d["_pos"] = 0;\n ρσ_d[ρσ_iterator_symbol] = (function() {\n var ρσ_anonfunc = function () {\n return this;\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n ρσ_d["next"] = (function() {\n var ρσ_anonfunc = function () {\n var length, pos, value, ans, extra;\n length = this._string.length;\n if (this._pos >= length) {\n return (function(){\n var ρσ_d = {};\n ρσ_d["done"] = true;\n return ρσ_d;\n }).call(this);\n }\n pos = this._pos;\n value = this._string.charCodeAt(this._pos++);\n ans = "\\ufffd";\n if (55296 <= value && value <= 56319) {\n if (this._pos < length) {\n extra = this._string.charCodeAt(this._pos++);\n if ((extra & 56320) === 56320) {\n ans = String.fromCharCode(value, extra);\n }\n }\n } else if ((value & 56320) !== 56320) {\n ans = String.fromCharCode(value);\n }\n if (with_positions) {\n return (function(){\n var ρσ_d = {};\n ρσ_d["done"] = false;\n ρσ_d["value"] = ρσ_list_decorate([ pos, ans ]);\n return ρσ_d;\n }).call(this);\n } else {\n return (function(){\n var ρσ_d = {};\n ρσ_d["done"] = false;\n ρσ_d["value"] = ans;\n return ρσ_d;\n }).call(this);\n }\n };\n if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n })();\n return ρσ_d;\n }).call(this);\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["string", "with_positions"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_str.uslice = (function() {\n var ρσ_anonfunc = function (string, start, end) {\n var items, iterator, r;\n items = [];\n iterator = ρσ_str.uchrs(string);\n r = iterator.next();\n while (!r.done) {\n items.push(r.value);\n r = iterator.next();\n }\n return items.slice(start || 0, (end === undefined) ? items.length : end).join("");\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["string", "start", "end"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_str.ulen = (function() {\n var ρσ_anonfunc = function (string) {\n var iterator, r, ans;\n iterator = ρσ_str.uchrs(string);\n r = iterator.next();\n ans = 0;\n while (!r.done) {\n r = iterator.next();\n ans += 1;\n }\n return ans;\n };\n if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {\n __argnames__ : {value: ["string"]},\n __module__ : {value: "__main__"}\n });\n return ρσ_anonfunc;\n})();\nρσ_str.ascii_lowercase = "abcdefghijklmnopqrstuvwxyz";\nρσ_str.ascii_uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";\nρσ_str.ascii_letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";\nρσ_str.digits = "0123456789";\nρσ_str.punctuation = "!\\"#$%&\'()*+,-./:;<=>?@[\\\\]^_`{|}~";\nρσ_str.printable = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\\"#$%&\'()*+,-./:;<=>?@[\\\\]^_`{|}~ \\t\\n\\r\\u000b\\f";\nρσ_str.whitespace = " \\t\\n\\r\\u000b\\f";\ndefine_str_func = undefined;\nvar str = ρσ_str, repr = ρσ_repr;',"tools/web_repl.js":"/* vim:fileencoding=utf-8\n * \n * Copyright (C) 2016 Kovid Goyal \n *\n * Distributed under terms of the BSD license\n */\n\"use strict\"; /*jshint node:true */\nvar vm = require('vm');\nvar embedded_compiler = require('tools/embedded_compiler.js');\n\nmodule.exports = function(compiler, baselib) {\n var ctx = vm.createContext();\n var LINE_CONTINUATION_CHARS = ':\\\\';\n var find_completions = null;\n var streaming_compiler = embedded_compiler(compiler, baselib, function(js) { return vm.runInContext(js, ctx); }, '__repl__');\n\n return {\n 'in_block_mode': false,\n\n 'replace_print': function replace_print(write_line_func) {\n ctx.print = function() {\n var parts = [];\n for (var i = 0; i < arguments.length; i++) \n parts.push(ctx.ρσ_str(arguments[i]));\n write_line_func(parts.join(' '));\n };\n },\n\n 'is_input_complete': function is_input_complete(source) {\n if (!source || !source.trim()) return false;\n var lines = source.split('\\n');\n var last_line = lines[lines.length - 1].trimRight();\n if (this.in_block_mode) {\n // In a block only exit after two blank lines\n if (lines.length < 2) return false;\n var second_last_line = lines[lines.length - 2].trimRight();\n var block_ended = !!(!last_line && !second_last_line);\n if (!block_ended) return false;\n this.in_block_mode = false;\n return true;\n }\n\n if (last_line && LINE_CONTINUATION_CHARS.indexOf(last_line.substr(last_line.length - 1)) > -1) {\n this.in_block_mode = true;\n return false;\n }\n try {\n compiler.parse(source, {'filename': '', 'basedir': '__stdlib__'});\n } catch(e) {\n if (e.is_eof && e.line === lines.length && e.col > 0) {\n return false;\n }\n this.in_block_mode = false;\n return true;\n }\n this.in_block_mode = false;\n return true;\n },\n\n 'compile': function web_repl_compile(code, opts) {\n opts = opts || {};\n opts.keep_docstrings = true;\n opts.filename = '';\n return streaming_compiler.compile(code, opts);\n },\n\n 'runjs': function runjs(code) {\n var ans = vm.runInContext(code, ctx);\n if (ans !== undefined || ans === null) {\n ctx.ρσ_repl_val = ans;\n var q = vm.runInContext('ρσ_repr(ρσ_repl_val)', ctx);\n ans = (q === 'undefined') ? ans.toString() : q;\n }\n return ans;\n },\n\n 'init_completions': function init_completions(completelib) {\n find_completions = completelib(compiler);\n },\n\n 'find_completions': function find_completions_(line) {\n return find_completions(line, ctx);\n },\n\n };\n};\n\n","tools/embedded_compiler.js":"/* vim:fileencoding=utf-8\n * \n * Copyright (C) 2016 Kovid Goyal \n *\n * Distributed under terms of the BSD license\n */\n\"use strict\"; /*jshint node:true */\n\nvar has_prop = Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty);\n\nmodule.exports = function(compiler, baselib, runjs, name) {\n var LINE_CONTINUATION_CHARS = ':\\\\';\n runjs = runjs || eval;\n runjs(print_ast(compiler.parse(''), true));\n runjs('var __name__ = \"' + (name || '__embedded__') + '\";');\n\n function print_ast(ast, keep_baselib, keep_docstrings, js_version, private_scope, write_name) {\n var output_options = {omit_baselib:!keep_baselib, write_name:!!write_name, private_scope:!!private_scope, beautify:true, js_version: (js_version || 6), keep_docstrings:keep_docstrings};\n if (keep_baselib) output_options.baselib_plain = baselib;\n var output = new compiler.OutputStream(output_options);\n ast.print(output);\n return output.get();\n }\n\n return {\n 'toplevel': null,\n\n 'compile': function streaming_compile(code, opts) {\n opts = opts || {};\n var classes = (this.toplevel) ? this.toplevel.classes : undefined;\n var scoped_flags = (this.toplevel) ? this.toplevel.scoped_flags: undefined;\n this.toplevel = compiler.parse(code, {\n 'filename': opts.filename || '',\n 'basedir': '__stdlib__',\n 'classes': classes,\n 'scoped_flags': scoped_flags,\n 'discard_asserts': opts.discard_asserts,\n });\n var ans = print_ast(this.toplevel, opts.keep_baselib, opts.keep_docstrings, opts.js_version, opts.private_scope, opts.write_name);\n if (classes) {\n var exports = {};\n var self = this;\n this.toplevel.exports.forEach(function (name) { exports[name] = true; });\n Object.getOwnPropertyNames(classes).forEach(function (name) {\n if (!has_prop(exports, name) && !has_prop(self.toplevel.classes, name))\n self.toplevel.classes[name] = classes[name];\n });\n }\n scoped_flags = this.toplevel.scoped_flags;\n \n return ans;\n },\n\n };\n};\n\n","tools/utils.js":"/* vim:fileencoding=utf-8\n * \n * Copyright (C) 2015 Kovid Goyal \n *\n * Distributed under terms of the BSD license\n */\n\"use strict\"; /*jshint node:true */\n\nvar comment_contents = /\\/\\*!?(?:\\@preserve)?[ \\t]*(?:\\r\\n|\\n)([\\s\\S]*?)(?:\\r\\n|\\n)[ \\t]*\\*\\//;\nvar colors = ['red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white'];\n\nfunction ansi(code) {\n code = code || 0;\n return String.fromCharCode(27) + '[' + code + 'm';\n}\n\nfunction path_exists(path) {\n var fs = require('fs');\n try {\n fs.statSync(path);\n return true;\n } catch(e) {\n if (e.code != 'ENOENT') throw e;\n }\n}\n\nfunction colored(string, color, bold) {\n var prefix = [];\n if (bold) prefix.push(ansi(1));\n if (color) prefix.push(ansi(colors.indexOf(color) + 31));\n return prefix.join('') + string + ansi(0);\n}\n\nfunction supports_color(stdout) {\n stdout = stdout || process.stdout;\n\tif (stdout && !stdout.isTTY) {\n\t\treturn false;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\treturn false;\n\t}\n\n\tif ('COLORTERM' in process.env) {\n\t\treturn true;\n\t}\n\n\tif (process.env.TERM === 'dumb') {\n\t\treturn false;\n\t}\n\n\tif (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {\n\t\treturn true;\n\t}\n\n return false;\n\n}\n\nfunction safe_colored(string) {\n return string;\n}\n\nfunction repeat(str, num) {\n return new Array( num + 1 ).join( str );\n}\n\nfunction generators_available() {\n var gen;\n try {\n eval('gen = function *(){}'); // jshint ignore:line\n return typeof gen === 'function' && gen.constructor.name == 'GeneratorFunction';\n } catch(e) {\n return false;\n }\n}\n\nfunction wrap(lines, width) {\n\tvar ans = [];\n\tvar prev = '';\n\tlines.forEach(function (line) {\n\t\tline = prev + line;\n\t\tprev = '';\n\t\tif (line.length > width) {\n\t\t\tprev = line.substr(width);\n if (prev) prev += ' ';\n\t\t\tline = line.substr(0, width - 1);\n\t\t\tif (line.substr(line.length - 1 !== ' ')) line += '-';\n\t\t} \n\t\tans.push(line);\n\t});\n\tif (prev) ans = ans.concat(wrap([prev]));\n\treturn ans;\n}\n\nfunction merge() {\n // Simple merge of properties from all objects\n var ans = {};\n Array.prototype.slice.call(arguments).forEach(function (arg) {\n Object.keys(arg).forEach(function(key) {\n ans[key] = arg[key];\n });\n });\n return ans;\n}\n\nfunction get_import_dirs(paths_string, ignore_env) {\n var path = require('path');\n var paths = [];\n function merge(new_path) {\n if (paths.indexOf(new_path) == -1) paths.push(new_path);\n }\n if (!ignore_env && process && process.env && process.env.RAPYDSCRIPT_IMPORT_PATH) {\n process.env.RAPYDSCRIPT_IMPORT_PATH.split(path.delimiter).forEach(merge);\n }\n if (paths_string) paths_string.split(path.delimiter).forEach(merge);\n return paths;\n}\n\nexports.comment_contents = comment_contents;\nexports.repeat = repeat;\nexports.wrap = wrap;\nexports.merge = merge;\nexports.colored = colored;\nexports.safe_colored = (supports_color()) ? colored : safe_colored;\nexports.generators_available = generators_available;\nexports.get_import_dirs = get_import_dirs;\nexports.path_exists = path_exists;\n","tools/completer.js":"/* vim:fileencoding=utf-8\n * \n * Copyright (C) 2016 Kovid Goyal \n *\n * Distributed under terms of the BSD license\n */\n\n\nmodule.exports = function(compiler, options) {\n \"use strict\";\n var all_keywords = compiler.ALL_KEYWORDS.split(' ');\n var vm = require('vm');\n options = options || {};\n if (!options.enum_global) options.enum_global = \"var global = Function('return this')(); Object.getOwnPropertyNames(global);\";\n\n function global_names(ctx) {\n try {\n var ans = vm.runInContext(options.enum_global, ctx);\n ans = ans.concat(all_keywords);\n ans.sort();\n var seen = {};\n ans.filter(function (item) { \n if (Object.prototype.hasOwnProperty.call(seen, item)) return false;\n seen[item] = true;\n return true;\n });\n return ans;\n } catch(e) {\n console.log(e.stack || e.toString());\n }\n return [];\n }\n\n function object_names(obj, prefix) {\n if (obj === null || obj === undefined) return [];\n var groups = [], prefix_len = prefix.length, p;\n\n function prefix_filter(name) { return (prefix_len) ? (name.substr(0, prefix_len) === prefix) : true; }\n\n function add(o) {\n var items = Object.getOwnPropertyNames(o).filter(prefix_filter);\n if (items.length) groups.push(items);\n }\n\n if (typeof obj === 'object' || typeof obj === 'function') {\n add(obj);\n p = Object.getPrototypeOf(obj);\n } else p = obj.constructor ? obj.constructor.prototype : null; \n\n // Walk the prototype chain\n try {\n var sentinel = 5;\n while (p !== null && sentinel > 0) {\n add(p);\n p = Object.getPrototypeOf(p);\n // Circular refs possible? Let's guard against that.\n sentinel--;\n }\n } catch (e) {\n // console.error(\"completion error walking prototype chain:\" + e);\n }\n if (!groups.length) return [];\n var seen = {}, ans = [];\n function uniq(name) {\n if (Object.prototype.hasOwnProperty.call(seen, name)) return false;\n seen[name] = true;\n return true;\n }\n for (var i = 0; i < groups.length; i++) {\n var group = groups[i];\n group.sort();\n ans = ans.concat(group.filter(uniq));\n ans.push(''); // group separator\n\n }\n while (ans.length && ans[ans.length - 1] === '') ans.pop();\n return ans;\n }\n\n function prefix_matches(prefix, items) {\n var len = prefix.length;\n var ans = items.filter(function(item) { return item.substr(0, len) === prefix; });\n ans.sort();\n return ans;\n }\n\n function find_completions(line, ctx) {\n var t;\n try {\n t = compiler.tokenizer(line, '');\n } catch(e) { return []; }\n var tokens = [], token;\n while (true) {\n try {\n token = t();\n } catch (e) { return []; }\n if (token.type === 'eof') break;\n if (token.type === 'punc' && '(){},;:'.indexOf(token.value) > -1)\n tokens = [];\n tokens.push(token);\n }\n if (!tokens.length) {\n // New line or trailing space\n return [global_names(ctx), ''];\n }\n var last_tok = tokens[tokens.length - 1];\n if (last_tok.value === '.' || (last_tok.type === 'name' && compiler.IDENTIFIER_PAT.test(last_tok.value))) {\n last_tok = last_tok.value;\n if (last_tok === '.') {\n tokens.push({'value':''});\n last_tok = '';\n }\n if (tokens.length > 1 && tokens[tokens.length - 2].value === '.') {\n // A compound expression\n var prefix = '', result;\n tokens.slice(0, tokens.length - 2).forEach(function (tok) { prefix += tok.value; });\n if (prefix) {\n try {\n result = vm.runInContext(prefix, ctx, {'displayErrors':false});\n } catch(e) { return []; }\n return [object_names(result, last_tok), last_tok];\n }\n } else {\n return [prefix_matches(last_tok, global_names(ctx)), last_tok];\n }\n }\n return [];\n }\n\n return find_completions;\n};\n","tools/msgfmt.js":"/* vim:fileencoding=utf-8\n * \n * Copyright (C) 2015 Kovid Goyal \n *\n * Distributed under terms of the BSD license\n */\n\"use strict\"; /*jshint node:true */\n\nfunction unesc(string) {\n return string.replace(/\\\\\"/g, '\"').replace(/\\\\n/g, '\\n').replace(/\\\\r/g, '\\r').replace(/\\\\t/g, '\\t').replace(/\\\\\\\\/g, '\\\\');\n}\n\nfunction parse(data, on_error) {\n // Parse a PO file using a state machine (does not work for POT files). Also only extracts data useful\n // for JSON output.\n var plural_forms = null;\n var lines = data.split('\\n');\n var entries = [];\n var current_entry = create_entry();\n var lnum = 0;\n var nplurals = null;\n var language = null;\n\n function fatal() {\n var msg = Array.prototype.slice.call(arguments).join(' ');\n if (on_error) { on_error(msg); return; }\n console.error(msg);\n process.exit(1);\n }\n\n function create_entry() {\n return {msgid: null, fuzzy: false, msgstr:[], msgid_plural:null, lnum:null};\n }\n\n function parse_header() {\n var raw = current_entry.msgstr[0];\n if (raw === undefined) fatal('Header has no msgstr');\n raw.split('\\n').forEach(function(line) {\n if (line.startsWith('Plural-Forms:')) {\n plural_forms = line.slice('Plural-Forms:'.length).trim();\n var match = /^nplurals\\s*=\\s*(\\d+)\\s*;/.exec(plural_forms);\n if (!match || match[1] === undefined) fatal('Invalid Plural-Forms header:', plural_forms);\n nplurals = parseInt(match[1]);\n } \n else if (line.startsWith('Language:')) {\n language = line.slice('Language:'.length).trim();\n }\n });\n }\n\n function commit_entry() {\n if (current_entry.msgid) {\n if (current_entry.msgid_plural !== null) {\n if (nplurals === null) fatal('Plural-Forms header missing');\n for (var i = 0; i < nplurals; i++) {\n if (current_entry.msgstr[i] === undefined) fatal('Missing plural form for entry at line number:', lnum);\n }\n }\n entries.push(current_entry);\n } else if (current_entry.msgid === '') parse_header();\n current_entry = create_entry();\n }\n\n function read_string(line) {\n line = line.trim();\n if (!line || line[0] !== '\"' || line[line.length - 1] !== '\"') {\n fatal('Expecting a string at line number:', lnum);\n }\n return unesc(line.slice(1, -1));\n }\n\n function continuation(line, lines, append, after) {\n if (line[0] === '\"') append(read_string(line));\n else {\n state = after;\n after(line, lines);\n }\n }\n\n function start(line, lines) {\n if (line[0] === '#') {\n if (line[1] === ',') {\n line.slice(2).trimLeft().split(',').forEach(function(flag) {\n if (flag.trim().toLowerCase() === 'fuzzy') current_entry.fuzzy = true;\n });\n }\n } else if (line.startsWith('msgid ')) {\n current_entry.msgid = read_string(line.slice('msgid '.length));\n current_entry.lnum = lnum;\n state = function(line, lines) { \n continuation(line, lines, function(x) { current_entry.msgid += x; }, after_msgid);\n };\n } else {\n fatal('Expecting msgid at line number:', lnum);\n }\n }\n\n function after_msgid(line, lines) {\n if (line.startsWith('msgid_plural ')) {\n current_entry.msgid_plural = read_string(line.slice('msgid_plural '.length));\n state = function(line, lines) { \n continuation(line, lines, function(x) { current_entry.msgid_plural += x; }, msgstr);\n };\n } \n \n else if (line.startsWith('msgstr ') || line.startsWith('msgstr[')) {\n state = msgstr;\n msgstr(line, lines);\n } \n \n else fatal('Expecting either msgstr or msgid_plural at line number:', lnum);\n\n }\n\n function msgstr(line, lines) {\n if (line.startsWith('msgstr ')) {\n if (current_entry.msgid_plural !== null) fatal('Expecting msgstr[0] at line number:', lnum);\n current_entry.msgstr.push(read_string(line.slice('msgstr '.length)));\n state = function(line, lines) { \n continuation(line, lines, function(x) { current_entry.msgstr[current_entry.msgstr.length - 1] += x; }, msgstr);\n };\n } \n\n else if (line[0] === '#' || line.startsWith('msgid ')) {\n if (!current_entry.msgstr.length) fatal('Expecting msgstr at line number:', lnum);\n commit_entry();\n state = start;\n start(line, lines);\n }\n\n else if (line.startsWith('msgstr[')) {\n if (current_entry.msgid_plural === null) fatal('Expecting non-plural msgstr at line number:', lnum);\n var pnum = /^msgstr\\[(\\d+)\\] /.exec(line);\n if (!pnum || pnum[1] === undefined) fatal('Malformed msgstr at line number:', lnum);\n var idx = parseInt(pnum[1]);\n current_entry.msgstr[idx] = read_string(line.slice(pnum[0].length));\n state = function(line, lines) { \n continuation(line, lines, function(x) { current_entry.msgstr[idx] += x; }, msgstr);\n };\n }\n\n else fatal('Expecting msgstr or msgid at line number:', lnum);\n }\n\n var state = start;\n\n while (lines.length) {\n var line = lines.shift().trim();\n lnum += 1;\n if (!line) continue;\n state(line, lines);\n }\n commit_entry();\n if (language === null) fatal('No language specified in the header of this po file');\n return {entries:entries, plural_forms:plural_forms, nplurals:nplurals, language:language};\n}\n\nfunction read_stdin(cont) {\n var chunks = [];\n process.stdin.setEncoding('utf8');\n\n process.stdin.on('readable', function () { \n var chunk = process.stdin.read();\n if (chunk) chunks.push(chunk); \n });\n\n process.stdin.on('end', function() { cont(chunks.join('')); });\n}\n\nfunction serialize_catalog(catalog, options) {\n if (!options.use_fuzzy) catalog.entries = catalog.entries.filter(function(e) { return !e.fuzzy; });\n var entries = {};\n catalog.entries.forEach(function (entry) {\n entries[entry.msgid] = entry.msgstr;\n });\n return JSON.stringify({'plural_forms':catalog.plural_forms, 'entries':entries, 'language':catalog.language});\n}\n\nmodule.exports.cli = function(argv, base_path, src_path, lib_path) {\n read_stdin(function process(data) {\n var catalog = parse(data);\n console.log(serialize_catalog(catalog, argv));\n });\n};\n\nmodule.exports.parse = parse;\nmodule.exports.build = function(data, options) { return serialize_catalog(parse(data), options); };\n","tools/gettext.js":"/* vim:fileencoding=utf-8\n * \n * Copyright (C) 2015 Kovid Goyal \n *\n * Distributed under terms of the BSD license\n */\n\"use strict\"; /*jshint node:true */\n\nvar fs = require('fs');\nvar RapydScript = (typeof create_rapydscript_compiler === 'function') ? create_rapydscript_compiler() : require('./compiler').create_compiler();\nvar path = require('path');\n\nfunction parse_file(code, filename) {\n return RapydScript.parse(code, {\n filename: filename,\n basedir: path.dirname(filename),\n libdir: path.dirname(filename),\n for_linting: true,\n });\n}\n\nfunction detect_format(msgid) {\n var q = msgid.replace('{{', '');\n if (/\\{[0-9a-zA-Z_}]+/.test(q)) return 'python-brace-format';\n return null;\n}\n\nfunction Gettext(catalog, filename) {\n this._visit = function (node, cont) {\n if (node instanceof RapydScript.AST_Call && node.args && node.args.length && node.expression instanceof RapydScript.AST_Symbol) {\n var name = node.expression.name;\n if (name === '_' || name === 'gettext' || name === 'ngettext') {\n var nargs = (name === 'ngettext') ? 2 : 1;\n var line = node.start.line;\n for (var i = 0; i < nargs; i++) {\n if (!(node.args[i] instanceof RapydScript.AST_String)) {\n console.error('Translation function: ' + name + ' does not have a string literal argument at line: ' + line + ' of ' + filename);\n process.exit(1);\n }\n }\n var msgid = node.args[0].value;\n if (!Object.prototype.hasOwnProperty.call(catalog, msgid)) {\n catalog[msgid] = {\n 'locations': [],\n 'plural': null,\n 'format': detect_format(msgid),\n };\n }\n if (name === 'ngettext') catalog[msgid].plural = node.args[1].value;\n if (filename) catalog[msgid].locations.push(filename + ':' + line);\n }\n \n }\n if (cont !== undefined) cont();\n };\n}\n\nfunction gettext(catalog, code, filename) {\n var toplevel;\n\n try {\n toplevel = parse_file(code, filename);\n } catch(e) {\n if (e instanceof RapydScript.SyntaxError) {\n console.error('Failed to parse: ' + filename + ' with error: ' + e.line + ':' + e.col + ':' + e.message);\n process.exit(1);\n } else throw e;\n }\n\n if (toplevel) {\n var gt = new Gettext(catalog, filename);\n toplevel.walk(gt);\n }\n}\n\nfunction esc(string) {\n return (string || '').replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"').replace(/\\n/g, '\\\\n').replace(/\\t/g, '\\\\t').replace(/\\r/g, '');\n}\n\nfunction entry_to_string(msgid, data) {\n var ans = [];\n data.locations.forEach(function (loc) { ans.push('#: ' + loc); });\n if (data.format) ans.push('#, ' + data.format);\n ans.push('msgid \"' + esc(msgid) + '\"');\n if (data.plural) {\n ans.push('msgid_plural \"' + esc(data.plural) + '\"');\n ans.push('msgstr[0] \"\"');\n ans.push('msgstr[1] \"\"');\n } else ans.push('msgstr \"\"');\n return ans.join('\\n');\n}\n\nfunction write_output(catalog, options, write) {\n write = write || (function(x) { process.stdout.write(new Buffer(x, 'utf-8')); });\n function print() {\n var val = Array.prototype.slice.call(arguments).join(' ') + '\\n';\n write(val);\n }\n function header_line() {\n var val = '\"' + Array.prototype.slice.call(arguments).join(' ') + '\\\\n\"\\n';\n write(val);\n }\n if (!options.omit_header) {\n var now = (new Date()).toISOString();\n print('msgid', '\"\"');\n print('msgstr', '\"\"');\n header_line('Project-Id-Version:', esc(options.package_name), esc(options.package_version));\n header_line('POT-Creation-Date:', now);\n header_line(\"PO-Revision-Date:\", now);\n header_line(\"Report-Msgid-Bugs-To:\", esc(options.bugs_address));\n header_line(\"Last-Translator: Automatically generated\");\n header_line(\"Language-Team: LANGUAGE\");\n header_line(\"MIME-Version: 1.0\");\n header_line(\"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\");\n header_line(\"Content-Type: text/plain; charset=UTF-8\");\n header_line(\"Content-Transfer-Encoding: 8bit\");\n print();\n }\n Object.keys(catalog).forEach(function(msgid) {\n var data = catalog[msgid];\n print(entry_to_string(msgid, data));\n print();\n });\n}\n\n// CLI {{{\n\nfunction read_whole_file(filename, cb) {\n if (!filename) {\n var chunks = [];\n process.stdin.setEncoding('utf-8');\n process.stdin.on('data', function (chunk) {\n chunks.push(chunk);\n }).on('end', function () {\n cb(null, chunks.join(\"\"));\n });\n process.openStdin();\n } else {\n fs.readFile(filename, \"utf-8\", cb);\n }\n}\n\nmodule.exports.cli = function(argv, base_path, src_path, lib_path) {\n var files = [];\n var num_of_files = files.length || 1;\n var catalog = {};\n\n function read_files(src) {\n src.forEach(function(f) {\n if (fs.lstatSync(f).isDirectory()) {\n var children = [];\n fs.readdirSync(f).forEach(function(x) { children.push(path.join(f, x)); });\n read_files(children);\n }\n else files.push(f);\n });\n }\n read_files(argv.files);\n\n function process_single_file(err, code) {\n if (err) {\n console.error(\"ERROR: can't read file: \" + files[0]);\n process.exit(1);\n }\n\n gettext(catalog, code, files[0]);\n\n files = files.slice(1);\n if (files.length) {\n setImmediate(read_whole_file, files[0], process_single_file);\n return;\n } else {\n write_output(catalog, argv);\n process.exit(0);\n }\n }\n \n setImmediate(read_whole_file, files[0], process_single_file);\n\n};\n\nmodule.exports.gettext = gettext;\nmodule.exports.entry_to_string = entry_to_string;\nmodule.exports.write_output = write_output;\n// }}}\n","__stdlib__/aes.pyj":"# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal \n\n# globals: crypto\n\n# Internal API {{{\n\ndef string_to_bytes_encoder(string):\n return TextEncoder('utf-8').encode(string + '')\n\ndef string_to_bytes_slow(string):\n escstr = encodeURIComponent(string)\n binstr = escstr.replace(/%([0-9A-F]{2})/g, def(match, p1):\n return String.fromCharCode('0x' + p1)\n )\n ua = Uint8Array(binstr.length)\n for i, ch in enumerate(binstr):\n ua[i] = ch.charCodeAt(0)\n return ua\n\ndef as_hex(array, sep=''):\n num = array.BYTES_PER_ELEMENT or 1\n fmt = '{:0' + num * 2 + 'x}'\n return [str.format(fmt, x) for x in array].join(sep)\n\ndef bytes_to_string_decoder(bytes, offset):\n offset = offset or 0\n if offset:\n bytes = bytes.subarray(offset)\n return TextDecoder('utf-8').decode(bytes)\n\ndef bytes_to_string_slow(bytes, offset):\n ans = v'[]'\n i = offset or 0\n while i < bytes.length:\n c = bytes[i]\n if c < 128:\n ans.push(String.fromCharCode(c))\n i += 1\n elif 191 < c < 224:\n ans.push(String.fromCharCode(((c & 0x1f) << 6) | (bytes[i + 1] & 0x3f)))\n i += 2\n else:\n ans.push(String.fromCharCode(((c & 0x0f) << 12) | ((bytes[i + 1] & 0x3f) << 6) | (bytes[i + 2] & 0x3f)))\n i += 3\n return ans.join('')\n\nstring_to_bytes = string_to_bytes_encoder if jstype(TextEncoder) is 'function' else string_to_bytes_slow\nbytes_to_string = bytes_to_string_decoder if jstype(TextDecoder) is 'function' else bytes_to_string_slow\n\ndef increment_counter(c):\n # c must be a Uint8Array of length 16\n for v'var i = 15; i >= 12; i--':\n if c[i] is 255:\n c[i] = 0\n else:\n c[i] += 1\n break\n\ndef convert_to_int32(bytes, output, offset, length):\n offset = offset or 0\n length = length or bytes.length\n for v'var i = offset, j = 0; i < offset + length; i += 4, j++':\n output[j] = (bytes[i] << 24) | (bytes[i + 1] << 16) | (bytes[i + 2] << 8) | bytes[i + 3]\n\ndef convert_to_int32_pad(bytes):\n extra = bytes.length % 4\n if extra:\n t = Uint8Array(bytes.length + 4 - extra)\n t.set(bytes)\n bytes = t\n ans = Uint32Array(bytes.length / 4)\n convert_to_int32(bytes, ans)\n return ans\n\nif not Uint8Array.prototype.fill:\n Uint8Array.prototype.fill = Uint32Array.prototype.fill = def(val, start, end):\n start = start or 0\n if end is undefined:\n end = this.length\n if start < 0:\n start += this.length\n if end < 0:\n end += this.length\n for v'var i = start; i < end; i++':\n this[i] = val\n\ndef from_64_to_32(num):\n # convert 64-bit number to two BE Int32s\n ans = Uint32Array(2)\n ans[0] = (num / 0x100000000) | 0\n ans[1] = num & 0xFFFFFFFF\n return ans\n\n# Lookup tables for AES {{{\n# Number of rounds by keysize\nnumber_of_rounds = {16: 10, 24: 12, 32: 14}\n# Round constant words\nrcon = v'new Uint32Array([0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91])'\n\n# S-box and Inverse S-box (S is for Substitution)\nS = v'new Uint32Array([0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16])'\nSi = v'new Uint32Array([0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d])'\n\n# Transformations for encryption\nT1 = v'new Uint32Array([0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a])'\nT2 = v'new Uint32Array([0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616])'\nT3 = v'new Uint32Array([0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16])'\nT4 = v'new Uint32Array([0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c])'\n\n# Transformations for decryption\nT5 = v'new Uint32Array([0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742])'\nT6 = v'new Uint32Array([0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857])'\nT7 = v'new Uint32Array([0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8])'\nT8 = v'new Uint32Array([0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0])'\n\n# Transformations for decryption key expansion\nU1 = v'new Uint32Array([0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3])'\nU2 = v'new Uint32Array([0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697])'\nU3 = v'new Uint32Array([0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46])'\nU4 = v'new Uint32Array([0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d])'\n\n# }}}\n\nclass AES: # {{{\n\n def __init__(self, key):\n self.working_mem = [Uint32Array(4), Uint32Array(4)]\n rounds = number_of_rounds[key.length]\n if not rounds:\n raise ValueError('invalid key size (must be length 16, 24 or 32)')\n\n # encryption round keys\n self._Ke = v'[]'\n\n # decryption round keys\n self._Kd = v'[]'\n\n for v'var i = 0; i <= rounds; i++':\n self._Ke.push(Uint32Array(4))\n self._Kd.push(Uint32Array(4))\n\n round_key_count = (rounds + 1) * 4\n KC = key.length / 4\n\n # convert the key into ints\n tk = Uint32Array(KC)\n convert_to_int32(key, tk)\n\n # copy values into round key arrays\n index = 0\n for v'var i = 0; i < KC; i++':\n index = i >> 2\n self._Ke[index][i % 4] = tk[i]\n self._Kd[rounds - index][i % 4] = tk[i]\n\n # key expansion (fips-197 section 5.2)\n rconpointer = 0\n t = KC\n while t < round_key_count:\n tt = tk[KC - 1]\n tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^\n (S[(tt >> 8) & 0xFF] << 16) ^\n (S[ tt & 0xFF] << 8) ^\n S[(tt >> 24) & 0xFF] ^\n (rcon[rconpointer] << 24))\n rconpointer += 1\n\n # key expansion (for non-256 bit)\n if KC != 8:\n for v'var i = 1; i < KC; i++':\n tk[i] ^= tk[i - 1]\n\n # key expansion for 256-bit keys is \"slightly different\" (fips-197)\n else:\n for v'var i = 1; i < (KC / 2); i++':\n tk[i] ^= tk[i - 1]\n tt = tk[(KC / 2) - 1]\n\n tk[KC / 2] ^= (S[ tt & 0xFF] ^\n (S[(tt >> 8) & 0xFF] << 8) ^\n (S[(tt >> 16) & 0xFF] << 16) ^\n (S[(tt >> 24) & 0xFF] << 24))\n\n for v'var i = (KC / 2) + 1; i < KC; i++':\n tk[i] ^= tk[i - 1]\n\n # copy values into round key arrays\n i = 0\n while i < KC and t < round_key_count:\n r = t >> 2\n c = t % 4\n self._Ke[r][c] = tk[i]\n self._Kd[rounds - r][c] = tk[v'i++']\n t += 1\n\n # inverse-cipher-ify the decryption round key (fips-197 section 5.3)\n for v'var r = 1; r < rounds; r++':\n for v'var c = 0; c < 4; c++':\n tt = self._Kd[r][c]\n self._Kd[r][c] = (U1[(tt >> 24) & 0xFF] ^\n U2[(tt >> 16) & 0xFF] ^\n U3[(tt >> 8) & 0xFF] ^\n U4[ tt & 0xFF])\n\n def _crypt(self, ciphertext, offset, encrypt):\n if encrypt:\n R1 = T1; R2 = T2; R3 = T3; R4 = T4\n o1 = 1; o3 = 3\n SB = S\n K = self._Ke\n else:\n R1 = T5; R2 = T6; R3 = T7; R4 = T8\n o1 = 3; o3 = 1\n SB = Si\n K = self._Kd\n rounds = K.length - 1\n a = self.working_mem[0]\n t = self.working_mem[1]\n\n # XOR plaintext with key\n for v'var i = 0; i < 4; i++':\n t[i] ^= K[0][i]\n\n # apply round transforms\n for v'var r = 1; r < rounds; r++':\n for v'var i = 0; i < 4; i++':\n a[i] = (R1[(t[i] >> 24) & 0xff] ^\n R2[(t[(i + o1) % 4] >> 16) & 0xff] ^\n R3[(t[(i + 2) % 4] >> 8) & 0xff] ^\n R4[ t[(i + o3) % 4] & 0xff] ^\n K[r][i])\n t.set(a)\n\n # the last round is special\n for v'var i = 0; i < 4; i++':\n tt = K[rounds][i]\n ciphertext[offset + 4 * i] = (SB[(t[i] >> 24) & 0xff] ^ (tt >> 24)) & 0xff\n ciphertext[offset + 4 * i + 1] = (SB[(t[(i + o1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff\n ciphertext[offset + 4 * i + 2] = (SB[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff\n ciphertext[offset + 4 * i + 3] = (SB[ t[(i + o3) % 4] & 0xff] ^ tt ) & 0xff\n\n def encrypt(self, plaintext, ciphertext, offset):\n convert_to_int32(plaintext, self.working_mem[1], offset, 16)\n return self._crypt(ciphertext, offset, True)\n\n def encrypt32(self, plaintext, ciphertext, offset):\n self.working_mem[1].set(plaintext)\n return self._crypt(ciphertext, offset, True)\n\n def decrypt(self, ciphertext, plaintext, offset):\n convert_to_int32(ciphertext, self.working_mem[1], offset, 16)\n return self._crypt(plaintext, offset, False)\n\n def decrypt32(self, ciphertext, plaintext, offset):\n self.working_mem[1].set(ciphertext)\n return self._crypt(plaintext, offset, False)\n# }}}\n\ndef random_bytes_insecure(sz):\n ans = Uint8Array(sz)\n for v'var i = 0; i < sz; i++':\n ans[i] = Math.floor(Math.random() * 256)\n return ans\n\ndef random_bytes_secure(sz):\n ans = Uint8Array(sz)\n crypto.getRandomValues(ans)\n return ans\n\nrandom_bytes = random_bytes_secure if jstype(crypto) is not 'undefined' and jstype(crypto.getRandomValues) is 'function' else random_bytes_insecure\nif random_bytes is random_bytes_insecure:\n try:\n noderandom = require('crypto').randomBytes\n random_bytes = def(sz):\n return Uint8Array(noderandom(sz))\n except:\n print('WARNING: Using insecure RNG for AES')\n\nclass ModeOfOperation: # {{{\n\n def __init__(self, key):\n self.key = key or generate_key(32)\n self.aes = AES(self.key)\n\n @property\n def key_as_js(self):\n return typed_array_as_js(self.key)\n\n def tag_as_bytes(self, tag):\n if isinstance(tag, Uint8Array):\n return tag\n if not tag:\n return Uint8Array(0)\n if jstype(tag) is 'string':\n return string_to_bytes(tag)\n raise TypeError('Invalid tag, must be a string or a Uint8Array')\n# }}}\n\nclass GaloisField: # {{{\n\n def __init__(self, sub_key):\n k32 = Uint32Array(4)\n convert_to_int32(sub_key, k32, 0)\n self.m = self.generate_hash_table(k32)\n self.wmem = Uint32Array(4)\n\n def power(self, x, out):\n lsb = x[3] & 1\n for v'var i = 3; i > 0; --i':\n out[i] = (x[i] >>> 1) | ((x[i - 1] & 1) << 31)\n out[0] = x[0] >>> 1\n if lsb:\n out[0] ^= 0xE1000000\n\n def multiply(self, x, y):\n z_i = Uint32Array(4)\n v_i = Uint32Array(y)\n for v'var i = 0; i < 128; ++i':\n x_i = x[(i / 32) | 0] & (1 << (31 - i % 32))\n if x_i:\n z_i[0] ^= v_i[0]\n z_i[1] ^= v_i[1]\n z_i[2] ^= v_i[2]\n z_i[3] ^= v_i[3]\n self.power(v_i, v_i)\n return z_i\n\n def generate_sub_hash_table(self, mid):\n bits = mid.length\n size = 1 << bits\n half = size >>> 1\n m = Array(size)\n m[half] = Uint32Array(mid)\n i = half >>> 1\n while i > 0:\n m[i] = Uint32Array(4)\n self.power(m[2 * i], m[i])\n i >>= 1\n i = 2\n while i < half:\n for v'var j = 1; j < i; ++j':\n m_i = m[i]\n m_j = m[j]\n m[i + j] = x = Uint32Array(4)\n for v'var c = 0; c < 4; c++':\n x[c] = m_i[c] ^ m_j[c]\n i *= 2\n m[0] = Uint32Array(4)\n for v'i = half + 1; i < size; ++i':\n x = m[i ^ half]\n m[i] = y = Uint32Array(4)\n for v'var c = 0; c < 4; c++':\n y[c] = mid[c] ^ x[c]\n return m\n\n def generate_hash_table(self, key_as_int32_array):\n bits = key_as_int32_array.length\n multiplier = 8 / bits\n per_int = 4 * multiplier\n size = 16 * multiplier\n ans = Array(size)\n for v'var i =0; i < size; ++i':\n tmp = Uint32Array(4)\n idx = (i/ per_int) | 0\n shft = ((per_int - 1 - (i % per_int)) * bits)\n tmp[idx] = (1 << (bits - 1)) << shft\n ans[i] = self.generate_sub_hash_table(self.multiply(tmp, key_as_int32_array))\n return ans\n\n def table_multiply(self, x):\n z = Uint32Array(4)\n for v'var i = 0; i < 32; ++i':\n idx = (i / 8) | 0\n x_i = (x[idx] >>> ((7 - (i % 8)) * 4)) & 0xF\n ah = self.m[i][x_i]\n z[0] ^= ah[0]\n z[1] ^= ah[1]\n z[2] ^= ah[2]\n z[3] ^= ah[3]\n return z\n\n def ghash(self, x, y):\n # Corresponds to the XOR + mult_H operation from the paper\n z = self.wmem\n z[0] = y[0] ^ x[0]\n z[1] = y[1] ^ x[1]\n z[2] = y[2] ^ x[2]\n z[3] = y[3] ^ x[3]\n return self.table_multiply(z)\n\n# }}}\n\n# }}}\n\ndef generate_key(sz):\n if not number_of_rounds[sz]:\n raise ValueError('Invalid key size, must be: 16, 24 or 32')\n return random_bytes(sz)\n\ndef generate_tag(sz):\n return random_bytes(sz or 32)\n\ndef typed_array_as_js(x):\n name = x.constructor.name or 'Uint8Array'\n return '(new ' + name + '(' + JSON.stringify(Array.prototype.slice.call(x)) + '))'\n\nclass CBC(ModeOfOperation): # {{{\n\n def encrypt_bytes(self, bytes, tag_bytes, iv):\n iv = first_iv = iv or random_bytes(16)\n mlen = bytes.length + tag_bytes.length\n padsz = (16 - (mlen % 16)) % 16\n inputbytes = Uint8Array(mlen + padsz)\n if tag_bytes.length:\n inputbytes.set(tag_bytes)\n inputbytes.set(bytes, tag_bytes.length)\n\n offset = 0\n outputbytes = Uint8Array(inputbytes.length)\n for v'var block = 0; block < inputbytes.length; block += 16':\n if block > 0:\n iv, offset = outputbytes, block - 16\n for v'var i = 0; i < 16; i++':\n inputbytes[block + i] ^= iv[offset + i]\n self.aes.encrypt(inputbytes, outputbytes, block)\n return {'iv':first_iv, 'cipherbytes':outputbytes}\n\n def encrypt(self, plaintext, tag):\n return self.encrypt_bytes(string_to_bytes(plaintext), self.tag_as_bytes(tag))\n\n def decrypt_bytes(self, inputbytes, tag_bytes, iv):\n offset = 0\n outputbytes = Uint8Array(inputbytes.length)\n for v'var block = 0; block < inputbytes.length; block += 16':\n self.aes.decrypt(inputbytes, outputbytes, block)\n if block > 0:\n iv, offset = inputbytes, block - 16\n for v'var i = 0; i < 16; i++':\n outputbytes[block + i] ^= iv[offset + i]\n for v'var i = 0; i < tag_bytes.length; i++':\n if tag_bytes[i] != outputbytes[i]:\n raise ValueError('Corrupt message')\n outputbytes = outputbytes.subarray(tag_bytes.length)\n return outputbytes\n\n def decrypt(self, output_from_encrypt, tag):\n ans = self.decrypt_bytes(output_from_encrypt.cipherbytes, self.tag_as_bytes(tag), output_from_encrypt.iv)\n return str.rstrip(bytes_to_string(ans), '\\0')\n# }}}\n\nclass CTR(ModeOfOperation): # {{{\n\n # Note that this mode of operation requires the pair of (counterbytes,\n # secret key) to always be unique, for every block. Therefore, if you are\n # using it for bi-directional messaging it is best to use a different\n # secret key for each direction\n\n def __init__(self, key, iv):\n ModeOfOperation.__init__(self, key)\n self.wmem = Uint8Array(16)\n self.counter_block = Uint8Array(iv or 16)\n if self.counter_block.length != 16:\n raise ValueError('iv must be 16 bytes long')\n self.counter_index = 16\n\n def _crypt(self, bytes):\n for v'var i = 0; i < bytes.length; i++, self.counter_index++':\n if self.counter_index is 16:\n self.counter_index = 0\n self.aes.encrypt(self.counter_block, self.wmem, 0)\n increment_counter(self.counter_block)\n bytes[i] ^= self.wmem[self.counter_index]\n self.counter_index = 16\n\n def encrypt(self, plaintext, tag):\n outbytes = string_to_bytes(plaintext)\n counterbytes = Uint8Array(self.counter_block)\n if tag:\n tag_bytes = self.tag_as_bytes(tag)\n t = Uint8Array(outbytes.length + tag_bytes.length)\n t.set(tag_bytes)\n t.set(outbytes, tag_bytes.length)\n outbytes = t\n self._crypt(outbytes)\n return {'cipherbytes':outbytes, 'counterbytes':counterbytes}\n\n def __enter__(self):\n self.before_index = self.counter_index\n self.before_counter = Uint8Array(self.counter_block)\n\n def __exit__(self):\n self.counter_index = self.before_index\n self.counter_block = self.before_counter\n\n def decrypt(self, output_from_encrypt, tag):\n b = Uint8Array(output_from_encrypt.cipherbytes)\n with self:\n self.counter_block = output_from_encrypt.counterbytes\n self.counter_index = 16\n self._crypt(b)\n offset = 0\n if tag:\n tag_bytes = self.tag_as_bytes(tag)\n for v'var i = 0; i < tag_bytes.length; i++':\n if tag_bytes[i] != b[i]:\n raise ValueError('Corrupted message')\n offset = tag_bytes.length\n return bytes_to_string(b, offset)\n# }}}\n\nclass GCM(ModeOfOperation): # {{{\n\n # Note that this mode of operation requires the pair of (iv,\n # secret key) to always be unique, for every message. Therefore, if you are\n # using it for bi-directional messaging it is best to use a different\n # secret key for each direction (you could also use random_key,\n # but that has a non-zero probability of repeating keys).\n # See http://web.cs.ucdavis.edu/~rogaway/ocb/gcm.pdf\n\n def __init__(self, key, random_iv=False):\n ModeOfOperation.__init__(self, key)\n self.random_iv = random_iv\n if not random_iv:\n self.current_iv = Uint8Array(12)\n\n # Generate the hash subkey\n H = Uint8Array(16)\n self.aes.encrypt(Uint8Array(16), H, 0)\n self.galois = GaloisField(H)\n\n # Working memory\n self.J0 = Uint32Array(4)\n self.wmem = Uint32Array(4)\n self.byte_block = Uint8Array(16)\n\n def increment_iv(self):\n c = self.current_iv\n for v'var i = 11; i >=0; i--':\n if c[i] is 255:\n if i is 0:\n raise ValueError('The GCM IV space is exhausted, cannot encrypt anymore messages with this key as doing so would cause the IV to repeat')\n c[i] = 0\n else:\n c[i] += 1\n break\n\n def _create_j0(self, iv):\n J0 = self.J0\n if iv.length is 12:\n convert_to_int32(iv, J0)\n J0[3] = 1\n else:\n J0.fill(0)\n tmp = convert_to_int32_pad(iv)\n while tmp.length:\n J0 = self.galois.ghash(J0, tmp)\n tmp = tmp.subarray(4)\n tmp = Uint32Array(4)\n tmp.set(from_64_to_32(iv.length * 8), 2)\n J0 = self.galois.ghash(J0, tmp)\n return J0\n\n def _start(self, iv, additional_data):\n J0 = self._create_j0(iv)\n # Generate initial counter block\n in_block = Uint32Array(J0)\n in_block[3] = (in_block[3] + 1) & 0xFFFFFFFF # increment counter\n\n # Process additional_data\n S = Uint32Array(4)\n overflow = additional_data.length % 16\n for v'var i = 0; i < additional_data.length - overflow; i += 16':\n convert_to_int32(additional_data, self.wmem, i, 16)\n S = self.galois.ghash(S, self.wmem)\n if overflow:\n self.byte_block.fill(0)\n self.byte_block.set(additional_data.subarray(additional_data.length - overflow))\n convert_to_int32(self.byte_block, self.wmem)\n S = self.galois.ghash(S, self.wmem)\n return J0, in_block, S\n\n def _finish(self, iv, J0, adata_len, S, outbytes):\n # Mix the lengths into S\n lengths = Uint32Array(4)\n lengths.set(from_64_to_32(adata_len * 8))\n lengths.set(from_64_to_32(outbytes.length * 8), 2)\n S = self.galois.ghash(S, lengths)\n\n # Create the tag\n self.aes.encrypt32(J0, self.byte_block, 0)\n convert_to_int32(self.byte_block, self.wmem)\n tag = Uint32Array(4)\n for v'var i = 0; i < S.length; i++':\n tag[i] = S[i] ^ self.wmem[i]\n return {'iv':iv, 'cipherbytes':outbytes, 'tag':tag}\n\n def _crypt(self, iv, bytes, additional_data, decrypt):\n ghash = self.galois.ghash.bind(self.galois)\n outbytes = Uint8Array(bytes.length)\n J0, in_block, S = self._start(iv, additional_data)\n bb = self.byte_block\n enc = self.aes.encrypt32.bind(self.aes)\n hash_bytes = bytes if decrypt else outbytes\n\n # Create the ciphertext, encrypting block by block\n for v'var i = 0, counter_index = 16; i < bytes.length; i++, counter_index++':\n if counter_index is 16:\n # Encrypt counter and increment it\n enc(in_block, bb, 0)\n in_block[3] = (in_block[3] + 1) & 0xFFFFFFFF # increment counter\n counter_index = 0\n # Output is XOR of encrypted counter with input\n outbytes[i] = bytes[i] ^ bb[counter_index]\n if counter_index is 15:\n # We have completed a block, update the hash\n convert_to_int32(hash_bytes, self.wmem, i - 15, 16)\n S = ghash(S, self.wmem)\n\n # Check if we have a last partial block\n overflow = outbytes.length % 16\n if overflow:\n # partial output block\n bb.fill(0)\n bb.set(hash_bytes.subarray(hash_bytes.length - overflow))\n convert_to_int32(bb, self.wmem)\n S = ghash(S, self.wmem)\n\n return self._finish(iv, J0, additional_data.length, S, outbytes)\n\n def encrypt(self, plaintext, tag):\n if self.random_iv:\n iv = random_bytes(12)\n else:\n self.increment_iv()\n iv = self.current_iv\n return self._crypt(iv, string_to_bytes(plaintext), self.tag_as_bytes(tag), False)\n\n def decrypt(self, output_from_encrypt, tag):\n if output_from_encrypt.tag.length != 4:\n raise ValueError('Corrupted message')\n ans = self._crypt(output_from_encrypt.iv, output_from_encrypt.cipherbytes, self.tag_as_bytes(tag), True)\n if ans.tag != output_from_encrypt.tag:\n raise ValueError('Corrupted message')\n return bytes_to_string(ans.cipherbytes)\n# }}}\n","__stdlib__/elementmaker.pyj":"# vim:fileencoding=utf-8\n# License: GPL v3 Copyright: 2015, Kovid Goyal \n\nhtml_elements = {\n 'a', 'abbr', 'acronym', 'address', 'area',\n 'article', 'aside', 'audio', 'b', 'base', 'big', 'body', 'blockquote', 'br', 'button',\n 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup',\n 'command', 'datagrid', 'datalist', 'dd', 'del', 'details', 'dfn',\n 'dialog', 'dir', 'div', 'dl', 'dt', 'em', 'event-source', 'fieldset',\n 'figcaption', 'figure', 'footer', 'font', 'form', 'header', 'h1',\n 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'head', 'i', 'iframe', 'img', 'input', 'ins',\n 'keygen', 'kbd', 'label', 'legend', 'li', 'm', 'map', 'menu', 'meter',\n 'multicol', 'nav', 'nextid', 'ol', 'output', 'optgroup', 'option',\n 'p', 'pre', 'progress', 'q', 's', 'samp', 'script', 'section', 'select',\n 'small', 'sound', 'source', 'spacer', 'span', 'strike', 'strong', 'style',\n 'sub', 'sup', 'table', 'tbody', 'td', 'textarea', 'time', 'tfoot',\n 'th', 'thead', 'tr', 'tt', 'u', 'ul', 'var', 'video'\n}\n\nmathml_elements = {\n 'maction', 'math', 'merror', 'mfrac', 'mi',\n 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom',\n 'mprescripts', 'mroot', 'mrow', 'mspace', 'msqrt', 'mstyle', 'msub',\n 'msubsup', 'msup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder',\n 'munderover', 'none'\n}\n\nsvg_elements = {\n 'a', 'animate', 'animateColor', 'animateMotion',\n 'animateTransform', 'clipPath', 'circle', 'defs', 'desc', 'ellipse',\n 'font-face', 'font-face-name', 'font-face-src', 'g', 'glyph', 'hkern',\n 'linearGradient', 'line', 'marker', 'metadata', 'missing-glyph',\n 'mpath', 'path', 'polygon', 'polyline', 'radialGradient', 'rect',\n 'set', 'stop', 'svg', 'switch', 'text', 'title', 'tspan', 'use'\n}\n\nhtml5_tags = html_elements.union(mathml_elements).union(svg_elements)\n\ndef _makeelement(tag, *args, **kwargs):\n ans = this.createElement(tag)\n\n for attr in kwargs:\n vattr = str.replace(str.rstrip(attr, '_'), '_', '-')\n val = kwargs[attr]\n if callable(val):\n if str.startswith(attr, 'on'):\n attr = attr[2:]\n ans.addEventListener(attr, val)\n elif val is True:\n ans.setAttribute(vattr, vattr)\n elif jstype(val) is 'string':\n ans.setAttribute(vattr, val)\n\n for arg in args:\n if jstype(arg) is 'string':\n arg = this.createTextNode(arg)\n ans.appendChild(arg)\n return ans\n\ndef maker_for_document(document):\n # Create an elementmaker to be used with the specified document\n E = _makeelement.bind(document)\n Object.defineProperties(E, {\n tag: {\n 'value':_makeelement.bind(document, tag)\n } for tag in html5_tags\n })\n return E\n\nif jstype(document) is 'undefined':\n E = maker_for_document({\n 'createTextNode': def(value): return value;,\n 'createElement': def(name):\n return {\n 'name':name,\n 'children':[],\n 'attributes':{},\n 'setAttribute': def(name, val): this.attributes[name] = val;,\n 'appendChild': def(child): this.children.push(child);,\n }\n })\nelse:\n E = maker_for_document(document)\n","__stdlib__/encodings.pyj":"# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal \n\ndef base64encode(bytes, altchars, pad_char):\n # Convert an array of bytes into a base-64 encoded string\n l = bytes.length\n remainder = l % 3\n main_length = l - remainder\n encodings = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' + (altchars or '+/')\n pad_char = '=' if pad_char is undefined else pad_char\n ans = v'[]'\n for v'var i = 0; i < main_length; i += 3':\n chunk = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2]\n ans.push(encodings[(chunk & 16515072) >> 18], encodings[(chunk & 258048) >> 12], encodings[(chunk & 4032) >> 6], encodings[chunk & 63])\n if remainder is 1:\n chunk = bytes[main_length]\n ans.push(encodings[(chunk & 252) >> 2], encodings[(chunk & 3) << 4], pad_char, pad_char)\n elif remainder is 2:\n chunk = (bytes[main_length] << 8) | bytes[main_length + 1]\n ans.push(encodings[(chunk & 64512) >> 10], encodings[(chunk & 1008) >> 4], encodings[(chunk & 15) << 2], pad_char)\n return ans.join('')\n\ndef base64decode(string):\n # convert the output of base64encode back into an array of bytes\n # (Uint8Array) only works with the standard altchars and pad_char\n if jstype(window) is not 'undefined':\n chars = window.atob(string)\n else:\n chars = new Buffer(string, 'base64').toString('binary') # noqa: undef\n ans = Uint8Array(chars.length)\n for i in range(ans.length):\n ans[i] = chars.charCodeAt(i)\n return ans\n\ndef urlsafe_b64encode(bytes, pad_char):\n return base64encode(bytes, '-_', pad_char)\n\ndef urlsafe_b64decode(string):\n string = String.prototype.replace.call(string, /[_-]/g, def(m): return '+' if m is '-' else '/';)\n return base64decode(string)\n\ndef hexlify(bytes):\n ans = v'[]'\n for v'var i = 0; i < bytes.length; i++':\n x = bytes[i].toString(16)\n if x.length is 1:\n x = '0' + x\n ans.push(x)\n return ans.join('')\n\ndef unhexlify(string):\n num = string.length // 2\n if num * 2 is not string.length:\n raise ValueError('string length is not a multiple of two')\n ans = Uint8Array(num)\n for v'var i = 0; i < num; i++':\n x = parseInt(string[i*2:i*2+2], 16)\n if isNaN(x):\n raise ValueError('string is not hex-encoded')\n ans[i] = x\n return ans\n\nutf8_decoder_table = v'''[\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 00..1f\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 20..3f\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 40..5f\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 60..7f\n 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, // 80..9f\n 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, // a0..bf\n 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, // c0..df\n 0xa,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x4,0x3,0x3, // e0..ef\n 0xb,0x6,0x6,0x6,0x5,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8, // f0..ff\n 0x0,0x1,0x2,0x3,0x5,0x8,0x7,0x1,0x1,0x1,0x4,0x6,0x1,0x1,0x1,0x1, // s0..s0\n 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,1,1, // s1..s2\n 1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1, // s3..s4\n 1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,1,1,1,1,1,1, // s5..s6\n 1,3,1,1,1,1,1,3,1,3,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // s7..s8\n]'''\n\ndef _from_code_point(x):\n if x <= 0xFFFF:\n return String.fromCharCode(x)\n x -= 0x10000\n return String.fromCharCode((x >> 10) + 0xD800, (x % 0x400) + 0xDC00)\n\ndef utf8_decode(bytes, errors, replacement):\n # Convert an array of UTF-8 encoded bytes into a string\n state = 0\n ans = v'[]'\n\n for v'var i = 0, l = bytes.length; i < l; i++': # noqa\n byte = bytes[i]\n typ = utf8_decoder_table[byte]\n codep = (byte & 0x3f) | (codep << 6) if state is not 0 else (0xff >> typ) & (byte)\n state = utf8_decoder_table[256 + state*16 + typ]\n if state is 0:\n ans.push(_from_code_point(codep))\n elif state is 1:\n if not errors or errors is 'strict':\n raise UnicodeDecodeError(str.format('The byte 0x{:02x} at position {} is not valid UTF-8', byte, i))\n elif errors is 'replace':\n ans.push(replacement or '?')\n return ans.join('')\n\ndef utf8_encode_js(string):\n # Encode a string as an array of UTF-8 bytes\n escstr = encodeURIComponent(string)\n ans = v'[]'\n for v'var i = 0; i < escstr.length; i++':\n ch = escstr[i]\n if ch is '%':\n ans.push(parseInt(escstr[i+1:i+3], 16))\n i += 2\n else:\n ans.push(ch.charCodeAt(0))\n return Uint8Array(ans)\n\nif jstype(TextEncoder) is 'function':\n _u8enc = TextEncoder('utf-8')\n utf8_encode = _u8enc.encode.bind(_u8enc)\n _u8enc = undefined\nelse:\n utf8_encode = utf8_encode_js\n\ndef utf8_encode_native(string):\n return _u8enc.encode(string)\n","__stdlib__/gettext.pyj":"# vim:fileencoding=utf-8\n# License: BSD Copyright: 2015, Kovid Goyal \n\n# noqa: eol-semicolon\n\n# The Plural-Forms parser {{{\n# From: https://github.com/SlexAxton/Jed/blob/master/jed.js licensed under the WTFPL\n\nJed = {}\n\nvr'''\n Jed.PF = {};\n\n Jed.PF.parse = function ( p ) {\n var plural_str = Jed.PF.extractPluralExpr( p );\n return Jed.PF.parser.parse.call(Jed.PF.parser, plural_str);\n };\n\n Jed.PF.compile = function ( p ) {\n // Handle trues and falses as 0 and 1\n function imply( val ) {\n return (val === true ? 1 : val ? val : 0);\n }\n\n var ast = Jed.PF.parse( p );\n return function ( n ) {\n return imply( Jed.PF.interpreter( ast )( n ) );\n };\n };\n\n Jed.PF.interpreter = function ( ast ) {\n return function ( n ) {\n var res;\n switch ( ast.type ) {\n case 'GROUP':\n return Jed.PF.interpreter( ast.expr )( n );\n case 'TERNARY':\n if ( Jed.PF.interpreter( ast.expr )( n ) ) {\n return Jed.PF.interpreter( ast.truthy )( n );\n }\n return Jed.PF.interpreter( ast.falsey )( n );\n case 'OR':\n return Jed.PF.interpreter( ast.left )( n ) || Jed.PF.interpreter( ast.right )( n );\n case 'AND':\n return Jed.PF.interpreter( ast.left )( n ) && Jed.PF.interpreter( ast.right )( n );\n case 'LT':\n return Jed.PF.interpreter( ast.left )( n ) < Jed.PF.interpreter( ast.right )( n );\n case 'GT':\n return Jed.PF.interpreter( ast.left )( n ) > Jed.PF.interpreter( ast.right )( n );\n case 'LTE':\n return Jed.PF.interpreter( ast.left )( n ) <= Jed.PF.interpreter( ast.right )( n );\n case 'GTE':\n return Jed.PF.interpreter( ast.left )( n ) >= Jed.PF.interpreter( ast.right )( n );\n case 'EQ':\n return Jed.PF.interpreter( ast.left )( n ) == Jed.PF.interpreter( ast.right )( n );\n case 'NEQ':\n return Jed.PF.interpreter( ast.left )( n ) != Jed.PF.interpreter( ast.right )( n );\n case 'MOD':\n return Jed.PF.interpreter( ast.left )( n ) % Jed.PF.interpreter( ast.right )( n );\n case 'VAR':\n return n;\n case 'NUM':\n return ast.val;\n default:\n throw new Error(\"Invalid Token found.\");\n }\n };\n };\n\n Jed.PF.extractPluralExpr = function ( p ) {\n // trim first\n p = p.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n\n if (! /;\\s*$/.test(p)) {\n p = p.concat(';');\n }\n\n var nplurals_re = /nplurals\\=(\\d+);/,\n plural_re = /plural\\=(.*);/,\n nplurals_matches = p.match( nplurals_re ),\n res = {},\n plural_matches;\n\n // Find the nplurals number\n if ( nplurals_matches.length > 1 ) {\n res.nplurals = nplurals_matches[1];\n }\n else {\n throw new Error('nplurals not found in plural_forms string: ' + p );\n }\n\n // remove that data to get to the formula\n p = p.replace( nplurals_re, \"\" );\n plural_matches = p.match( plural_re );\n\n if (!( plural_matches && plural_matches.length > 1 ) ) {\n throw new Error('`plural` expression not found: ' + p);\n }\n return plural_matches[ 1 ];\n };\n\n /* Jison generated parser */\n Jed.PF.parser = (function(){\n\nvar parser = {trace: function trace() { },\nyy: {},\nsymbols_: {\"error\":2,\"expressions\":3,\"e\":4,\"EOF\":5,\"?\":6,\":\":7,\"||\":8,\"&&\":9,\"<\":10,\"<=\":11,\">\":12,\">=\":13,\"!=\":14,\"==\":15,\"%\":16,\"(\":17,\")\":18,\"n\":19,\"NUMBER\":20,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",5:\"EOF\",6:\"?\",7:\":\",8:\"||\",9:\"&&\",10:\"<\",11:\"<=\",12:\">\",13:\">=\",14:\"!=\",15:\"==\",16:\"%\",17:\"(\",18:\")\",19:\"n\",20:\"NUMBER\"},\nproductions_: [0,[3,2],[4,5],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,1],[4,1]],\nperformAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 1: return { type : 'GROUP', expr: $$[$0-1] };\ncase 2:this.$ = { type: 'TERNARY', expr: $$[$0-4], truthy : $$[$0-2], falsey: $$[$0] };\nbreak;\ncase 3:this.$ = { type: \"OR\", left: $$[$0-2], right: $$[$0] };\nbreak;\ncase 4:this.$ = { type: \"AND\", left: $$[$0-2], right: $$[$0] };\nbreak;\ncase 5:this.$ = { type: 'LT', left: $$[$0-2], right: $$[$0] };\nbreak;\ncase 6:this.$ = { type: 'LTE', left: $$[$0-2], right: $$[$0] };\nbreak;\ncase 7:this.$ = { type: 'GT', left: $$[$0-2], right: $$[$0] };\nbreak;\ncase 8:this.$ = { type: 'GTE', left: $$[$0-2], right: $$[$0] };\nbreak;\ncase 9:this.$ = { type: 'NEQ', left: $$[$0-2], right: $$[$0] };\nbreak;\ncase 10:this.$ = { type: 'EQ', left: $$[$0-2], right: $$[$0] };\nbreak;\ncase 11:this.$ = { type: 'MOD', left: $$[$0-2], right: $$[$0] };\nbreak;\ncase 12:this.$ = { type: 'GROUP', expr: $$[$0-1] };\nbreak;\ncase 13:this.$ = { type: 'VAR' };\nbreak;\ncase 14:this.$ = { type: 'NUM', val: Number(yytext) };\nbreak;\n}\n},\ntable: [{3:1,4:2,17:[1,3],19:[1,4],20:[1,5]},{1:[3]},{5:[1,6],6:[1,7],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16]},{4:17,17:[1,3],19:[1,4],20:[1,5]},{5:[2,13],6:[2,13],7:[2,13],8:[2,13],9:[2,13],10:[2,13],11:[2,13],12:[2,13],13:[2,13],14:[2,13],15:[2,13],16:[2,13],18:[2,13]},{5:[2,14],6:[2,14],7:[2,14],8:[2,14],9:[2,14],10:[2,14],11:[2,14],12:[2,14],13:[2,14],14:[2,14],15:[2,14],16:[2,14],18:[2,14]},{1:[2,1]},{4:18,17:[1,3],19:[1,4],20:[1,5]},{4:19,17:[1,3],19:[1,4],20:[1,5]},{4:20,17:[1,3],19:[1,4],20:[1,5]},{4:21,17:[1,3],19:[1,4],20:[1,5]},{4:22,17:[1,3],19:[1,4],20:[1,5]},{4:23,17:[1,3],19:[1,4],20:[1,5]},{4:24,17:[1,3],19:[1,4],20:[1,5]},{4:25,17:[1,3],19:[1,4],20:[1,5]},{4:26,17:[1,3],19:[1,4],20:[1,5]},{4:27,17:[1,3],19:[1,4],20:[1,5]},{6:[1,7],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[1,28]},{6:[1,7],7:[1,29],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16]},{5:[2,3],6:[2,3],7:[2,3],8:[2,3],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,3]},{5:[2,4],6:[2,4],7:[2,4],8:[2,4],9:[2,4],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,4]},{5:[2,5],6:[2,5],7:[2,5],8:[2,5],9:[2,5],10:[2,5],11:[2,5],12:[2,5],13:[2,5],14:[2,5],15:[2,5],16:[1,16],18:[2,5]},{5:[2,6],6:[2,6],7:[2,6],8:[2,6],9:[2,6],10:[2,6],11:[2,6],12:[2,6],13:[2,6],14:[2,6],15:[2,6],16:[1,16],18:[2,6]},{5:[2,7],6:[2,7],7:[2,7],8:[2,7],9:[2,7],10:[2,7],11:[2,7],12:[2,7],13:[2,7],14:[2,7],15:[2,7],16:[1,16],18:[2,7]},{5:[2,8],6:[2,8],7:[2,8],8:[2,8],9:[2,8],10:[2,8],11:[2,8],12:[2,8],13:[2,8],14:[2,8],15:[2,8],16:[1,16],18:[2,8]},{5:[2,9],6:[2,9],7:[2,9],8:[2,9],9:[2,9],10:[2,9],11:[2,9],12:[2,9],13:[2,9],14:[2,9],15:[2,9],16:[1,16],18:[2,9]},{5:[2,10],6:[2,10],7:[2,10],8:[2,10],9:[2,10],10:[2,10],11:[2,10],12:[2,10],13:[2,10],14:[2,10],15:[2,10],16:[1,16],18:[2,10]},{5:[2,11],6:[2,11],7:[2,11],8:[2,11],9:[2,11],10:[2,11],11:[2,11],12:[2,11],13:[2,11],14:[2,11],15:[2,11],16:[2,11],18:[2,11]},{5:[2,12],6:[2,12],7:[2,12],8:[2,12],9:[2,12],10:[2,12],11:[2,12],12:[2,12],13:[2,12],14:[2,12],15:[2,12],16:[2,12],18:[2,12]},{4:30,17:[1,3],19:[1,4],20:[1,5]},{5:[2,2],6:[1,7],7:[2,2],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,2]}],\ndefaultActions: {6:[2,1]},\nparseError: function parseError(str, hash) {\n throw new Error(str);\n},\nparse: function parse(input) {\n var self = this,\n stack = [0],\n vstack = [null], // semantic value stack\n lstack = [], // location stack\n table = this.table,\n yytext = '',\n yylineno = 0,\n yyleng = 0,\n recovering = 0,\n TERROR = 2,\n EOF = 1;\n\n //this.reductionCount = this.shiftCount = 0;\n\n this.lexer.setInput(input);\n this.lexer.yy = this.yy;\n this.yy.lexer = this.lexer;\n if (typeof this.lexer.yylloc == 'undefined')\n this.lexer.yylloc = {};\n var yyloc = this.lexer.yylloc;\n lstack.push(yyloc);\n\n if (typeof this.yy.parseError === 'function')\n this.parseError = this.yy.parseError;\n\n function popStack (n) {\n stack.length = stack.length - 2*n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n\n function lex() {\n var token;\n token = self.lexer.lex() || 1; // $end = 1\n // if token isn't its numeric value, convert\n if (typeof token !== 'number') {\n token = self.symbols_[token] || token;\n }\n return token;\n }\n\n var symbol, preErrorSymbol, state, action, a, r, yyval={},p,len,newState, expected, errStr;\n while (true) {\n // retreive state number from top of stack\n state = stack[stack.length-1];\n\n // use default actions if available\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || symbol === undefined)\n symbol = lex();\n // read action for current state and first input\n action = table[state] && table[state][symbol];\n }\n\n // handle parse error\n _handle_error:\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n\n if (!recovering) {\n // Report error\n expected = [];\n for (p in table[state]) if (this.terminals_[p] && p > 2) {\n expected.push(\"'\"+this.terminals_[p]+\"'\");\n }\n errStr = '';\n if (this.lexer.showPosition) {\n errStr = 'Parse error on line '+(yylineno+1)+\":\\n\"+this.lexer.showPosition()+\"\\nExpecting \"+expected.join(', ') + \", got '\" + this.terminals_[symbol]+ \"'\";\n } else {\n errStr = 'Parse error on line '+(yylineno+1)+\": Unexpected \" +\n (symbol == 1 /*EOF*/ ? \"end of input\" :\n (\"'\"+(this.terminals_[symbol] || symbol)+\"'\"));\n }\n this.parseError(errStr,\n {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});\n }\n\n // just recovered from another error\n if (recovering == 3) {\n if (symbol == EOF) {\n throw new Error(errStr || 'Parsing halted.');\n }\n\n // discard current lookahead and grab another\n yyleng = this.lexer.yyleng;\n yytext = this.lexer.yytext;\n yylineno = this.lexer.yylineno;\n yyloc = this.lexer.yylloc;\n symbol = lex();\n }\n\n // try to recover from error\n while (1) {\n // check for error recovery rule in this state\n if ((TERROR.toString()) in table[state]) {\n break;\n }\n if (state === 0) {\n throw new Error(errStr || 'Parsing halted.');\n }\n popStack(1);\n state = stack[stack.length-1];\n }\n\n preErrorSymbol = symbol; // save the lookahead token\n symbol = TERROR; // insert generic error symbol as new lookahead\n state = stack[stack.length-1];\n action = table[state] && table[state][TERROR];\n recovering = 3; // allow 3 real symbols to be shifted before reporting a new error\n }\n\n // this shouldn't happen, unless resolve defaults are off\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: '+state+', token: '+symbol);\n }\n\n switch (action[0]) {\n\n case 1: // shift\n //this.shiftCount++;\n\n stack.push(symbol);\n vstack.push(this.lexer.yytext);\n lstack.push(this.lexer.yylloc);\n stack.push(action[1]); // push state\n symbol = null;\n if (!preErrorSymbol) { // normal execution/no error\n yyleng = this.lexer.yyleng;\n yytext = this.lexer.yytext;\n yylineno = this.lexer.yylineno;\n yyloc = this.lexer.yylloc;\n if (recovering > 0)\n recovering--;\n } else { // error just occurred, resume old lookahead f/ before error\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n\n case 2: // reduce\n //this.reductionCount++;\n\n len = this.productions_[action[1]][1];\n\n // perform semantic action\n yyval.$ = vstack[vstack.length-len]; // default to $$ = $1\n // default location, uses first token for firsts, last for lasts\n yyval._$ = {\n first_line: lstack[lstack.length-(len||1)].first_line,\n last_line: lstack[lstack.length-1].last_line,\n first_column: lstack[lstack.length-(len||1)].first_column,\n last_column: lstack[lstack.length-1].last_column\n };\n r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);\n\n if (typeof r !== 'undefined') {\n return r;\n }\n\n // pop off stack\n if (len) {\n stack = stack.slice(0,-1*len*2);\n vstack = vstack.slice(0, -1*len);\n lstack = lstack.slice(0, -1*len);\n }\n\n stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n // goto new state = table[STATE][NONTERMINAL]\n newState = table[stack[stack.length-2]][stack[stack.length-1]];\n stack.push(newState);\n break;\n\n case 3: // accept\n return true;\n }\n\n }\n\n return true;\n}};/* Jison generated lexer */\nvar lexer = (function(){\n\nvar lexer = ({EOF:1,\nparseError:function parseError(str, hash) {\n if (this.yy.parseError) {\n this.yy.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\nsetInput:function (input) {\n this._input = input;\n this._more = this._less = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};\n return this;\n },\ninput:function () {\n var ch = this._input[0];\n this.yytext+=ch;\n this.yyleng++;\n this.match+=ch;\n this.matched+=ch;\n var lines = ch.match(/\\n/);\n if (lines) this.yylineno++;\n this._input = this._input.slice(1);\n return ch;\n },\nunput:function (ch) {\n this._input = ch + this._input;\n return this;\n },\nmore:function () {\n this._more = true;\n return this;\n },\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\\n/g, \"\");\n },\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c+\"^\";\n },\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) this.done = true;\n\n var token,\n match,\n col,\n lines;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i=0;i < rules.length; i++) {\n match = this._input.match(this.rules[rules[i]]);\n if (match) {\n lines = match[0].match(/\\n.*/g);\n if (lines) this.yylineno += lines.length;\n this.yylloc = {first_line: this.yylloc.last_line,\n last_line: this.yylineno+1,\n first_column: this.yylloc.last_column,\n last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length};\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n this._more = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, rules[i],this.conditionStack[this.conditionStack.length-1]);\n if (token) return token;\n else return;\n }\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\\n'+this.showPosition(),\n {text: \"\", token: null, line: this.yylineno});\n }\n },\nlex:function lex() {\n var r = this.next();\n if (typeof r !== 'undefined') {\n return r;\n } else {\n return this.lex();\n }\n },\nbegin:function begin(condition) {\n this.conditionStack.push(condition);\n },\npopState:function popState() {\n return this.conditionStack.pop();\n },\n_currentRules:function _currentRules() {\n return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;\n },\ntopState:function () {\n return this.conditionStack[this.conditionStack.length-2];\n },\npushState:function begin(condition) {\n this.begin(condition);\n }});\nlexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\n\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0:/* skip whitespace */\nbreak;\ncase 1:return 20\nbreak;\ncase 2:return 19\nbreak;\ncase 3:return 8\nbreak;\ncase 4:return 9\nbreak;\ncase 5:return 6\nbreak;\ncase 6:return 7\nbreak;\ncase 7:return 11\nbreak;\ncase 8:return 13\nbreak;\ncase 9:return 10\nbreak;\ncase 10:return 12\nbreak;\ncase 11:return 14\nbreak;\ncase 12:return 15\nbreak;\ncase 13:return 16\nbreak;\ncase 14:return 17\nbreak;\ncase 15:return 18\nbreak;\ncase 16:return 5\nbreak;\ncase 17:return 'INVALID'\nbreak;\n}\n};\nlexer.rules = [/^\\s+/,/^[0-9]+(\\.[0-9]+)?\\b/,/^n\\b/,/^\\|\\|/,/^&&/,/^\\?/,/^:/,/^<=/,/^>=/,/^/,/^!=/,/^==/,/^%/,/^\\(/,/^\\)/,/^$/,/^./];\nlexer.conditions = {\"INITIAL\":{\"rules\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],\"inclusive\":true}};return lexer;})()\nparser.lexer = lexer;\nreturn parser;\n})();\n'''\nplural_forms_parser = Jed.PF\n# }}}\n\ndef _get_plural_forms_function(plural_forms_string):\n return plural_forms_parser.compile(plural_forms_string or \"nplurals=2; plural=(n != 1);\")\n\n_gettext = def(text): return text\n\n_ngettext = def(text, plural, n): return text if n is 1 else plural\n\ndef gettext(text):\n return _gettext(text)\n\ndef ngettext(text, plural, n):\n return _ngettext(text, plural, n)\n\ndef install(translation_data):\n t = new Translations(translation_data)\n t.install()\n for func in register_callback.install_callbacks:\n try:\n func(t)\n except:\n pass\n return t\n\nhas_prop = Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty)\n\ndef register_callback(func):\n # Register callbacks that will be called when new translation data is\n # installed\n register_callback.install_callbacks.push(func)\nregister_callback.install_callbacks = v'[]'\n\nempty_translation_data = {'entries': {}}\n\nclass Translations:\n\n def __init__(self, translation_data):\n translation_data = translation_data or empty_translation_data\n func = _get_plural_forms_function(translation_data.plural_forms)\n self.translations = [[translation_data, func]]\n self.language = translation_data['language']\n\n def add_fallback(self, fallback):\n fallback = fallback or empty_translation_data\n func = _get_plural_forms_function(fallback.plural_forms)\n self.translations.push([fallback, func])\n\n def gettext(self, text):\n for t in self.translations:\n m = t[0].entries\n if has_prop(m, text):\n return m[text][0]\n return text\n\n def ngettext(self, text, plural, n):\n for t in self.translations:\n m = t[0].entries\n if has_prop(m, text):\n idx = t[1](n)\n return m[text][idx] or (text if n is 1 else plural)\n return text if n is 1 else plural\n\n def install(self):\n nonlocal _gettext, _ngettext\n _gettext = def ():\n return self.gettext.apply(self, arguments)\n _ngettext = def ():\n return self.ngettext.apply(self, arguments)\n","__stdlib__/math.pyj":"###########################################################\n# RapydScript Standard Library\n# Author: Alexander Tsepkov\n# Copyright 2013 Pyjeon Software LLC\n# License: Apache License 2.0\n# This library is covered under Apache license, so that\n# you can distribute it with your RapydScript applications.\n###########################################################\n\n\n# basic implementation of Python's 'math' library\n\n# NOTE: this is only meant to aid those porting lots of Python code into RapydScript,\n# if you're writing a new RapydScript application, in most cases you probably want to\n# use JavaScript's Math module directly instead\n\n\npi = Math.PI\ne = Math.E\n\n########################################\n# Number-theoretic and representation functions\n########################################\ndef ceil(x):\n return Math.ceil(x)\ndef copysign(x, y):\n x = Math.abs(x)\n if y < 0:\n return -x\n else:\n return x\ndef fabs(x):\n return Math.abs(x)\ndef factorial(x):\n if Math.abs(int(x)) is not x:\n raise ValueError(\"factorial() only accepts integral values\")\n factorial.cache = []\n r = def(n):\n if n is 0 or n is 1:\n return 1\n if not factorial.cache[n]:\n factorial.cache[n] = r(n-1) * n\n return factorial.cache[n]\n return r(x)\ndef floor(x):\n return Math.floor(x)\ndef fmod(x, y):\n # javascript's % operator isn't consistent with C fmod implementation, this function is\n while y <= x:\n x -= y\n return x\ndef fsum(iterable):\n # like Python's fsum, this method is much more resilient to rounding errors than regular sum\n partials = [] # sorted, non-overlapping partial sums\n for x in iterable:\n i = 0\n for y in partials:\n if Math.abs(x) < Math.abs(y):\n x, y = y, x\n hi = x + y\n lo = y - (hi - x)\n if lo:\n partials[i] = lo\n i += 1\n x = hi\n #partials[i:] = [x]\n partials.splice(i, partials.length-i, x)\n return sum(partials)\ndef isinf(x):\n return not isFinite(x)\ndef isnan(x):\n return isNaN(x)\ndef modf(x):\n m = fmod(x, 1)\n return m, x-m\ndef trunc(x):\n return x | 0\n\n########################################\n# Power and logarithmic functions\n########################################\ndef exp(x):\n return Math.exp(x)\ndef expm1(x):\n # NOTE: Math.expm1() is currently only implemented in Firefox, this provides alternative implementation\n # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1\n #return Math.expm1(x)\n if Math.abs(x) < 1e-5:\n return x + 0.5*x*x\n else:\n return Math.exp(x) - 1\ndef log(x, base=e):\n return Math.log(x)/Math.log(base)\ndef log1p(x):\n # NOTE: Math.log1p() is currently only implemented in Firefox, this provides alternative implementation\n # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log1p\n # this version has been taken from http://phpjs.org/functions/log1p/\n # admittedly it's not as accurate as MDN version, as you can see from math.log1p(1) result\n ret = 0\n n = 50\n if x <= -1:\n return Number.NEGATIVE_INFINITY\n if x < 0 or x > 1:\n return Math.log(1 + x)\n for i in range(1, n):\n if i % 2 is 0:\n ret -= Math.pow(x, i) / i\n else:\n ret += Math.pow(x, i) / i\n return ret\ndef log10(x):\n # NOTE: Math.log10() is currently only implemented in Firefox, this provides alternative implementation\n # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log10\n # I didn't find a more accurate algorithm so I'm using the basic implementation\n return Math.log(x)/Math.LN10\ndef pow(x, y):\n if x < 0 and int(y) is not y:\n raise ValueError('math domain error')\n if isnan(y) and x is 1:\n return 1\n return Math.pow(x, y)\ndef sqrt(x):\n return Math.sqrt(x)\n\n########################################\n# Trigonometric functions\n########################################\ndef acos(x): return Math.acos(x)\ndef asin(x): return Math.asin(x)\ndef atan(x): return Math.atan(x)\ndef atan2(y, x): return Math.atan2(y, x)\ndef cos(x): return Math.cos(x)\ndef sin(x): return Math.sin(x)\ndef hypot(x, y): return Math.sqrt(x*x + y*y)\ndef tan(x): return Math.tan(x)\n\n########################################\n# Angular conversion\n########################################\ndef degrees(x): return x*180/pi\ndef radians(x): return x*pi/180\n\n########################################\n# Hyperbolic functions\n########################################\ndef acosh(x):\n # NOTE: will be replaced with official, when it becomes mainstream\n # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acosh\n return Math.log(x + Math.sqrt(x*x - 1))\ndef asinh(x):\n # NOTE: will be replaced with official, when it becomes mainstream\n # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh\n return Math.log(x + Math.sqrt(x*x + 1))\ndef atanh(x):\n # NOTE: will be replaced with official, when it becomes mainstream\n # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh\n return 0.5 * Math.log((1 + x) / (1 - x))\ndef cosh(x):\n # NOTE: will be replaced with official, when it becomes mainstream\n # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh\n return (Math.exp(x) + Math.exp(-x)) / 2\ndef sinh(x):\n # NOTE: will be replaced with official, when it becomes mainstream\n # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sinh\n return (Math.exp(x) - Math.exp(-x)) / 2\ndef tanh(x):\n # NOTE: will be replaced with official, when it becomes mainstream\n # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tanh\n return (Math.exp(x) - Math.exp(-x)) / (Math.exp(x) + Math.exp(-x))\n\n\n\n#import stdlib\n#print(math.ceil(4.2))\n#print(math.floor(4.2))\n#print(math.fabs(-6))\n#print(math.copysign(-5, 7))\n#print(math.factorial(4))\n#print(math.fmod(-1e100, 1e100))\n#\n#d = [0.9999999, 1, 2, 3]\n#print(sum(d), math.fsum(d))\n#print(math.isinf(5), math.isinf(Infinity))\n#print(math.modf(5.5))\n#print(math.trunc(2.6), math.trunc(-2.6))\n#print(math.exp(1e-5), math.expm1(1e-5))\n#print(math.log(10), math.log(10, 1000))\n#print(math.log1p(1e-15), math.log1p(1))\n#print(math.log10(1000), math.log(1000, 10))\n#print(math.pow(1, 0), math.pow(1, NaN), math.pow(0, 0), math.pow(NaN, 0), math.pow(4,3), math.pow(100, -2))\n#print(math.hypot(3,4))\n#print(math.acosh(2), math.asinh(1), math.atanh(0.5), math.cosh(1), math.cosh(-1), math.sinh(1), math.tanh(1))\n","__stdlib__/operator.pyj":"add = __add__ = def(x, y): return x + y\nsub = __sub__ = def(x, y): return x - y\nmul = __mul__ = def(x, y): return x * y\ndiv = __div__ = def(x, y): return x / y\n\nlt = __lt__ = def(x, y): return x < y\nle = __le__ = def(x, y): return x <= y\neq = __eq__ = def(x, y): return x is y\nne = __ne__ = def(x, y): return x is not y\nge = __ge__ = def(x, y): return x >= y\ngt = __gt__ = def(x, y): return x > y\n","__stdlib__/pythonize.pyj":"# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal \n# globals: ρσ_str\n\ndef strings():\n string_funcs = set((\n 'capitalize strip lstrip rstrip islower isupper isspace lower upper swapcase'\n ' center count endswith startswith find rfind index rindex format join ljust rjust'\n ' partition rpartition replace split rsplit splitlines zfill').split(' '))\n\n if not arguments.length:\n exclude = {'split', 'replace'}\n elif arguments[0]:\n exclude = Array.prototype.slice.call(arguments)\n else:\n exclude = None\n if exclude:\n string_funcs = string_funcs.difference(set(exclude))\n for name in string_funcs:\n String.prototype[name] = ρσ_str.prototype[name]\n","__stdlib__/random.pyj":"###########################################################\n# RapydScript Standard Library\n# Author: Alexander Tsepkov\n# Copyright 2013 Pyjeon Software LLC\n# License: Apache License 2.0\n# This library is covered under Apache license, so that\n# you can distribute it with your RapydScript applications.\n###########################################################\n\n\n# basic implementation of Python's 'random' library\n\n# JavaScript's Math.random() does not allow seeding its random generator, to bypass that, this module implements its own\n# version that can be seeded. I decided on RC4 algorithm for this.\n\n# please don't mess with this from the outside\n\nρσ_seed_state = {\n 'key': [],\n 'key_i': 0,\n 'key_j': 0\n}\n\nρσ_get_random_byte = def():\n ρσ_seed_state.key_i = (ρσ_seed_state.key_i + 1) % 256\n ρσ_seed_state.key_j = (ρσ_seed_state.key_j + ρσ_seed_state.key[ρσ_seed_state.key_i]) % 256\n ρσ_seed_state.key[ρσ_seed_state.key_i], ρσ_seed_state.key[ρσ_seed_state.key_j] = \\\n ρσ_seed_state.key[ρσ_seed_state.key_j], ρσ_seed_state.key[ρσ_seed_state.key_i]\n return ρσ_seed_state.key[(ρσ_seed_state.key[ρσ_seed_state.key_i] + \\\n ρσ_seed_state.key[ρσ_seed_state.key_j]) % 256]\n\ndef seed(x=Date().getTime()):\n ρσ_seed_state.key_i = ρσ_seed_state.key_j = 0\n if jstype(x) is 'number':\n x = x.toString()\n elif jstype(x) is not 'string':\n raise TypeError(\"unhashable type: '\" + jstype(x) + \"'\")\n for i in range(256):\n ρσ_seed_state.key[i] = i\n j = 0\n for i in range(256):\n j = (j + ρσ_seed_state.key[i] + x.charCodeAt(i % x.length)) % 256\n ρσ_seed_state.key[i], ρσ_seed_state.key[j] = ρσ_seed_state.key[j], ρσ_seed_state.key[i]\nseed()\n\ndef random():\n n = 0\n m = 1\n for i in range(8):\n n += ρσ_get_random_byte() * m\n m *= 256\n return v'n / 0x10000000000000000'\n\n# unlike the python version, this DOES build a range object, feel free to reimplement\ndef randrange():\n if arguments.length is 1:\n return randbelow(int(arguments[0]))\n start = int(arguments[0])\n stop = int(arguments[1])\n if arguments.length < 3:\n step = 1\n else:\n step = int(arguments[2])\n width = stop - start\n if step is 1:\n if width > 0:\n return start + randbelow(width)\n raise ValueError(\"empty range for randrange()\")\n if step > 0:\n n = (width + step - 1) // step\n elif step < 0:\n n = (width + step + 1) // step\n else:\n raise ValueError(\"zero step for randrange()\")\n if n <= 0:\n raise ValueError(f\"empty range in randrange({start}, {stop}, {step})\")\n return start + step * randbelow(n)\n\ndef randint(a, b):\n return int(random()*(b-a+1) + a)\n\ndef uniform(a, b):\n return random()*(b-a) + a\n\ndef randbelow(n):\n return Math.floor(random()*n)\n\ndef choice(seq):\n if seq.length > 0:\n return seq[randbelow(seq.length)]\n else:\n raise IndexError()\n\n# uses Fisher-Yates algorithm to shuffle an array\ndef shuffle(x, random_f=random):\n for i in range(x.length):\n j = Math.floor(random_f() * (i+1))\n x[i], x[j] = x[j], x[i]\n return x\n\n# similar to shuffle, but only shuffles a subset and creates a copy\ndef sample(population, k):\n x = population.slice()\n for i in range(population.length-1, population.length-k-1, -1):\n j = Math.floor(random() * (i+1))\n x[i], x[j] = x[j], x[i]\n return x.slice(population.length-k)\n\n\n#import stdlib\n#a = range(50)\n#random.seed(5)\n#print(random.choice(a))\n#print(random.shuffle(a))\n#print(random.randrange(10))\n#print(random.randint(1,5))\n#print(random.uniform(1,5))\n#print(random.sample(range(20),5))\n","__stdlib__/re.pyj":'# vim:fileencoding=utf-8\n# License: BSD\n# Copyright: 2015, Kovid Goyal \n# Copyright: 2013, Alexander Tsepkov\n\n# globals: ρσ_iterator_symbol, ρσ_list_decorate\n\n# basic implementation of Python\'s \'re\' library\n\nfrom __python__ import bound_methods\n\n# Alias DB from http://www.unicode.org/Public/8.0.0/ucd/NameAliases.txt {{{\n_ALIAS_MAP = {"null":0,"nul":0,"start of heading":1,"soh":1,"start of text":2,"stx":2,"end of text":3,"etx":3,"end of transmission":4,"eot":4,"enquiry":5,"enq":5,"acknowledge":6,"ack":6,"alert":7,"bel":7,"backspace":8,"bs":8,"character tabulation":9,"horizontal tabulation":9,"ht":9,"tab":9,"line feed":10,"new line":10,"end of line":10,"lf":10,"nl":10,"eol":10,"line tabulation":11,"vertical tabulation":11,"vt":11,"form feed":12,"ff":12,"carriage return":13,"cr":13,"shift out":14,"locking-shift one":14,"so":14,"shift in":15,"locking-shift zero":15,"si":15,"data link escape":16,"dle":16,"device control one":17,"dc1":17,"device control two":18,"dc2":18,"device control three":19,"dc3":19,"device control four":20,"dc4":20,"negative acknowledge":21,"nak":21,"synchronous idle":22,"syn":22,"end of transmission block":23,"etb":23,"cancel":24,"can":24,"end of medium":25,"eom":25,"substitute":26,"sub":26,"escape":27,"esc":27,"information separator four":28,"file separator":28,"fs":28,"information separator three":29,"group separator":29,"gs":29,"information separator two":30,"record separator":30,"rs":30,"information separator one":31,"unit separator":31,"us":31,"sp":32,"delete":127,"del":127,"padding character":128,"pad":128,"high octet preset":129,"hop":129,"break permitted here":130,"bph":130,"no break here":131,"nbh":131,"index":132,"ind":132,"next line":133,"nel":133,"start of selected area":134,"ssa":134,"end of selected area":135,"esa":135,"character tabulation set":136,"horizontal tabulation set":136,"hts":136,"character tabulation with justification":137,"horizontal tabulation with justification":137,"htj":137,"line tabulation set":138,"vertical tabulation set":138,"vts":138,"partial line forward":139,"partial line down":139,"pld":139,"partial line backward":140,"partial line up":140,"plu":140,"reverse line feed":141,"reverse index":141,"ri":141,"single shift two":142,"single-shift-2":142,"ss2":142,"single shift three":143,"single-shift-3":143,"ss3":143,"device control string":144,"dcs":144,"private use one":145,"private use-1":145,"pu1":145,"private use two":146,"private use-2":146,"pu2":146,"set transmit state":147,"sts":147,"cancel character":148,"cch":148,"message waiting":149,"mw":149,"start of guarded area":150,"start of protected area":150,"spa":150,"end of guarded area":151,"end of protected area":151,"epa":151,"start of string":152,"sos":152,"single graphic character introducer":153,"sgc":153,"single character introducer":154,"sci":154,"control sequence introducer":155,"csi":155,"string terminator":156,"st":156,"operating system command":157,"osc":157,"privacy message":158,"pm":158,"application program command":159,"apc":159,"nbsp":160,"shy":173,"latin capital letter gha":418,"latin small letter gha":419,"cgj":847,"alm":1564,"syriac sublinear colon skewed left":1801,"kannada letter llla":3294,"lao letter fo fon":3741,"lao letter fo fay":3743,"lao letter ro":3747,"lao letter lo":3749,"tibetan mark bka- shog gi mgo rgyan":4048,"fvs1":6155,"fvs2":6156,"fvs3":6157,"mvs":6158,"zwsp":8203,"zwnj":8204,"zwj":8205,"lrm":8206,"rlm":8207,"lre":8234,"rle":8235,"pdf":8236,"lro":8237,"rlo":8238,"nnbsp":8239,"mmsp":8287,"wj":8288,"lri":8294,"rli":8295,"fsi":8296,"pdi":8297,"weierstrass elliptic function":8472,"micr on us symbol":9288,"micr dash symbol":9289,"leftwards triangle-headed arrow with double vertical stroke":11130,"rightwards triangle-headed arrow with double vertical stroke":11132,"yi syllable iteration mark":40981,"presentation form for vertical right white lenticular bracket":65048,"vs1":65024,"vs2":65025,"vs3":65026,"vs4":65027,"vs5":65028,"vs6":65029,"vs7":65030,"vs8":65031,"vs9":65032,"vs10":65033,"vs11":65034,"vs12":65035,"vs13":65036,"vs14":65037,"vs15":65038,"vs16":65039,"byte order mark":65279,"bom":65279,"zwnbsp":65279,"cuneiform sign nu11 tenu":74452,"cuneiform sign nu11 over nu11 bur over bur":74453,"byzantine musical symbol fthora skliron chroma vasis":118981,"vs17":917760,"vs18":917761,"vs19":917762,"vs20":917763,"vs21":917764,"vs22":917765,"vs23":917766,"vs24":917767,"vs25":917768,"vs26":917769,"vs27":917770,"vs28":917771,"vs29":917772,"vs30":917773,"vs31":917774,"vs32":917775,"vs33":917776,"vs34":917777,"vs35":917778,"vs36":917779,"vs37":917780,"vs38":917781,"vs39":917782,"vs40":917783,"vs41":917784,"vs42":917785,"vs43":917786,"vs44":917787,"vs45":917788,"vs46":917789,"vs47":917790,"vs48":917791,"vs49":917792,"vs50":917793,"vs51":917794,"vs52":917795,"vs53":917796,"vs54":917797,"vs55":917798,"vs56":917799,"vs57":917800,"vs58":917801,"vs59":917802,"vs60":917803,"vs61":917804,"vs62":917805,"vs63":917806,"vs64":917807,"vs65":917808,"vs66":917809,"vs67":917810,"vs68":917811,"vs69":917812,"vs70":917813,"vs71":917814,"vs72":917815,"vs73":917816,"vs74":917817,"vs75":917818,"vs76":917819,"vs77":917820,"vs78":917821,"vs79":917822,"vs80":917823,"vs81":917824,"vs82":917825,"vs83":917826,"vs84":917827,"vs85":917828,"vs86":917829,"vs87":917830,"vs88":917831,"vs89":917832,"vs90":917833,"vs91":917834,"vs92":917835,"vs93":917836,"vs94":917837,"vs95":917838,"vs96":917839,"vs97":917840,"vs98":917841,"vs99":917842,"vs100":917843,"vs101":917844,"vs102":917845,"vs103":917846,"vs104":917847,"vs105":917848,"vs106":917849,"vs107":917850,"vs108":917851,"vs109":917852,"vs110":917853,"vs111":917854,"vs112":917855,"vs113":917856,"vs114":917857,"vs115":917858,"vs116":917859,"vs117":917860,"vs118":917861,"vs119":917862,"vs120":917863,"vs121":917864,"vs122":917865,"vs123":917866,"vs124":917867,"vs125":917868,"vs126":917869,"vs127":917870,"vs128":917871,"vs129":917872,"vs130":917873,"vs131":917874,"vs132":917875,"vs133":917876,"vs134":917877,"vs135":917878,"vs136":917879,"vs137":917880,"vs138":917881,"vs139":917882,"vs140":917883,"vs141":917884,"vs142":917885,"vs143":917886,"vs144":917887,"vs145":917888,"vs146":917889,"vs147":917890,"vs148":917891,"vs149":917892,"vs150":917893,"vs151":917894,"vs152":917895,"vs153":917896,"vs154":917897,"vs155":917898,"vs156":917899,"vs157":917900,"vs158":917901,"vs159":917902,"vs160":917903,"vs161":917904,"vs162":917905,"vs163":917906,"vs164":917907,"vs165":917908,"vs166":917909,"vs167":917910,"vs168":917911,"vs169":917912,"vs170":917913,"vs171":917914,"vs172":917915,"vs173":917916,"vs174":917917,"vs175":917918,"vs176":917919,"vs177":917920,"vs178":917921,"vs179":917922,"vs180":917923,"vs181":917924,"vs182":917925,"vs183":917926,"vs184":917927,"vs185":917928,"vs186":917929,"vs187":917930,"vs188":917931,"vs189":917932,"vs190":917933,"vs191":917934,"vs192":917935,"vs193":917936,"vs194":917937,"vs195":917938,"vs196":917939,"vs197":917940,"vs198":917941,"vs199":917942,"vs200":917943,"vs201":917944,"vs202":917945,"vs203":917946,"vs204":917947,"vs205":917948,"vs206":917949,"vs207":917950,"vs208":917951,"vs209":917952,"vs210":917953,"vs211":917954,"vs212":917955,"vs213":917956,"vs214":917957,"vs215":917958,"vs216":917959,"vs217":917960,"vs218":917961,"vs219":917962,"vs220":917963,"vs221":917964,"vs222":917965,"vs223":917966,"vs224":917967,"vs225":917968,"vs226":917969,"vs227":917970,"vs228":917971,"vs229":917972,"vs230":917973,"vs231":917974,"vs232":917975,"vs233":917976,"vs234":917977,"vs235":917978,"vs236":917979,"vs237":917980,"vs238":917981,"vs239":917982,"vs240":917983,"vs241":917984,"vs242":917985,"vs243":917986,"vs244":917987,"vs245":917988,"vs246":917989,"vs247":917990,"vs248":917991,"vs249":917992,"vs250":917993,"vs251":917994,"vs252":917995,"vs253":917996,"vs254":917997,"vs255":917998,"vs256":917999}\n# }}}\n\n_ASCII_CONTROL_CHARS = {\'a\':7, \'b\':8, \'f\': 12, \'n\': 10, \'r\': 13, \'t\': 9, \'v\': 11}\n_HEX_PAT = /^[a-fA-F0-9]/\n_NUM_PAT = /^[0-9]/\n_GROUP_PAT = /<([^>]+)>/\n_NAME_PAT = /^[a-zA-Z ]/\n\nI = IGNORECASE = 2\nL = LOCALE = 4\nM = MULTILINE = 8\nD = DOTALL = 16\nU = UNICODE = 32\nX = VERBOSE = 64\nDEBUG = 128\nA = ASCII = 256\n\nsupports_unicode = RegExp.prototype.unicode is not undefined\n\n_RE_ESCAPE = /[-\\/\\\\^$*+?.()|[\\]{}]/g\n\n_re_cache_map = {}\n_re_cache_items = v\'[]\'\n\nerror = SyntaxError # This is the error JS throws for invalid regexps\nhas_prop = Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty)\n\ndef _expand(groups, repl, group_name_map):\n i = 0\n\n def next():\n nonlocal i\n return v\'repl[i++]\'\n\n def peek():\n return repl[i]\n\n def read_digits(count, pat, base, maxval, prefix):\n ans = prefix or \'\'\n greedy = count is Number.MAX_VALUE\n while count > 0:\n count -= 1\n if not pat.test(peek()):\n if greedy:\n break\n return ans\n ans += next()\n nval = parseInt(ans, base)\n if nval > maxval:\n return ans\n return nval\n\n def read_escape_sequence():\n nonlocal i\n q = next()\n if not q or q is \'\\\\\':\n return \'\\\\\'\n if \'"\\\'\'.indexOf(q) is not -1:\n return q\n if _ASCII_CONTROL_CHARS[q]:\n return String.fromCharCode(_ASCII_CONTROL_CHARS[q])\n if \'0\' <= q <= \'9\':\n ans = read_digits(Number.MAX_VALUE, _NUM_PAT, 10, Number.MAX_VALUE, q)\n if jstype(ans) is \'number\':\n return groups[ans] or \'\'\n return \'\\\\\' + ans\n if q is \'g\':\n m = _GROUP_PAT.exec(repl[i:])\n if m is not None:\n i += m[0].length\n gn = m[1]\n if isNaN(parseInt(gn, 10)):\n if not has_prop(group_name_map, gn):\n return \'\'\n gn = group_name_map[gn][-1]\n return groups[gn] or \'\'\n if q is \'x\':\n code = read_digits(2, _HEX_PAT, 16, 0x10FFFF)\n if jstype(code) is \'number\':\n return String.fromCharCode(code)\n return \'\\\\x\' + code\n if q is \'u\':\n code = read_digits(4, _HEX_PAT, 16, 0x10FFFF)\n if jstype(code) is \'number\':\n return String.fromCharCode(code)\n return \'\\\\u\' + code\n if q is \'U\':\n code = read_digits(8, _HEX_PAT, 16, 0x10FFFF)\n if jstype(code) is \'number\':\n if code <= 0xFFFF:\n return String.fromCharCode(code)\n code -= 0x10000\n return String.fromCharCode(0xD800+(code>>10), 0xDC00+(code&0x3FF))\n return \'\\\\U\' + code\n if q is \'N\' and peek() is \'{\':\n next()\n name = \'\'\n while _NAME_PAT.test(peek()):\n name += next()\n if peek() is not \'}\':\n return \'\\\\N{\' + name\n next()\n key = (name or \'\').toLowerCase()\n if not name or not has_prop(_ALIAS_MAP, key):\n return \'\\\\N{\' + name + \'}\'\n code = _ALIAS_MAP[key]\n if code <= 0xFFFF:\n return String.fromCharCode(code)\n code -= 0x10000\n return String.fromCharCode(0xD800+(code>>10), 0xDC00+(code&0x3FF))\n\n return \'\\\\\' + q\n\n ans = ch = \'\'\n while True:\n ch = next()\n if ch is \'\\\\\':\n ans += read_escape_sequence()\n elif not ch:\n break\n else:\n ans += ch\n return ans\n\ndef transform_regex(source, flags):\n pos = 0\n previous_backslash = in_class = False\n ans = \'\'\n group_map = {}\n flags = flags or 0\n group_count = 0\n\n while pos < source.length:\n ch = v\'source[pos++]\'\n if previous_backslash:\n ans += \'\\\\\' + ch\n previous_backslash = False\n continue\n\n if in_class:\n if ch is \']\':\n in_class = False\n ans += ch\n continue\n\n if ch is \'\\\\\':\n previous_backslash = True\n continue\n\n if ch is \'[\':\n in_class = True\n if source[pos] is \']\': # in python the empty set is not allowed, instead []] is the same as [\\]]\n pos += 1\n ch = r\'[\\]\'\n elif ch is \'(\':\n if source[pos] is \'?\':\n extension = source[pos + 1]\n if extension is \'#\':\n close = source.indexOf(\')\', pos + 1)\n if close is -1:\n raise ValueError(\'Expecting a closing )\')\n pos = close + 1\n continue\n if \'aiLmsux\'.indexOf(extension) is not -1:\n flag_map = {\'a\':ASCII, \'i\':IGNORECASE, \'L\':LOCALE, \'m\':MULTILINE, \'s\':DOTALL, \'u\':UNICODE, \'x\':VERBOSE}\n close = source.indexOf(\')\', pos + 1)\n if close is -1:\n raise SyntaxError(\'Expecting a closing )\')\n flgs = source[pos+1:close]\n for v\'var i = 0; i < flgs.length; i++\':\n q = flgs[i] # noqa:undef\n if not has_prop(flag_map, q):\n raise SyntaxError(\'Invalid flag: \' + q)\n flags |= flag_map[q]\n pos = close + 1\n continue\n if extension is \'(\':\n raise SyntaxError(\'Group existence assertions are not supported in JavaScript\')\n if extension is \'P\':\n pos += 2\n q = source[pos]\n if q is \'<\':\n close = source.indexOf(\'>\', pos)\n if close is -1:\n raise SyntaxError(\'Named group not closed, expecting >\')\n name = source[pos+1:close]\n if not has_prop(group_map, name):\n group_map[name] = v\'[]\'\n group_map[name].push(v\'++group_count\')\n pos = close + 1\n elif q is \'=\':\n close = source.indexOf(\')\', pos)\n if close is -1:\n raise SyntaxError(\'Named group back-reference not closed, expecting a )\')\n name = source[pos+1:close]\n if not isNaN(parseInt(name, 10)):\n ans += \'\\\\\' + name\n else:\n if not has_prop(group_map, name):\n raise SyntaxError(\'Invalid back-reference. The named group: \' + name + \' has not yet been defined.\')\n ans += \'\\\\\' + group_map[name][-1]\n pos = close + 1\n continue\n else:\n raise SyntaxError(\'Expecting < or = after (?P\')\n else:\n group_count += 1\n elif ch is \'.\' and (flags & DOTALL):\n ans += r\'[\\s\\S]\' # JavaScript has no DOTALL\n continue\n\n ans += ch\n\n return ans, flags, group_map\n\nclass MatchObject:\n\n def __init__(self, regex, match, pos, endpos):\n self.re = regex\n self.string = match.input\n self._start_pos = match.index\n self._groups = match\n self.pos, self.endpos = pos, endpos\n\n def _compute_extents(self):\n # compute start/end for each group\n match = self._groups\n self._start = v\'Array(match.length)\'\n self._end = v\'Array(match.length)\'\n self._start[0] = self._start_pos\n self._end[0] = self._start_pos + match[0].length\n offset = self._start_pos\n extent = match[0]\n loc = 0\n for v\'var i = 1; i < match.length; i++\':\n g = match[i]\n loc = extent.indexOf(g, loc)\n if loc is -1:\n self._start[i] = self._start[i-1]\n self._end[i] = self._end[i-1]\n else:\n self._start[i] = offset + loc\n loc += g.length\n self._end[i] = offset + loc # noqa:undef\n\n def groups(self, defval=None):\n ans = v\'[]\'\n for v\'var i = 1; i < self._groups.length; i++\':\n val = self._groups[i] # noqa:undef\n if val is undefined:\n val = defval\n ans.push(val)\n return ans\n\n def _group_number(self, g):\n if jstype(g) is \'number\':\n return g\n if has_prop(self.re.group_name_map, g):\n return self.re.group_name_map[g][-1]\n return g\n\n def _group_val(self, q, defval):\n val = undefined\n if jstype(q) is \'number\' and -1 < q < self._groups.length:\n val = self._groups[q]\n else:\n if has_prop(self.re.group_name_map, q):\n val = self._groups[self.re.group_name_map[q][-1]]\n if val is undefined:\n val = defval\n return val\n\n def group(self):\n if arguments.length is 0:\n return self._groups[0]\n ans = v\'[]\'\n for v\'var i = 0; i < arguments.length; i++\':\n q = arguments[i] # noqa:undef\n ans.push(self._group_val(q, None))\n return ans[0] if ans.length is 1 else ans\n\n def start(self, g):\n if self._start is undefined:\n self._compute_extents()\n val = self._start[self._group_number(g or 0)]\n if val is undefined:\n val = -1\n return val\n\n def end(self, g):\n if self._end is undefined:\n self._compute_extents()\n val = self._end[self._group_number(g or 0)]\n if val is undefined:\n val = -1\n return val\n\n def span(self, g):\n return [self.start(g), self.end(g)]\n\n def expand(self, repl):\n return _expand(repl, this._groups, this.re.group_name_map)\n\n def groupdict(self, defval=None):\n gnm = self.re.group_name_map\n names = Object.keys(gnm)\n ans = {}\n for v"var i = 0; i < names.length; i++":\n name = names[i] # noqa:undef\n if has_prop(gnm, name):\n val = self._groups[gnm[name][-1]]\n if val is undefined:\n val = defval\n ans[name] = val\n return ans\n\n def captures(self, group_name):\n ans = []\n if not has_prop(self.re.group_name_map, group_name):\n return ans\n groups = self.re.group_name_map[group_name]\n for v\'var i = 0; i < groups.length; i++\':\n val = self._groups[groups[i]] # noqa:undef\n if val is not undefined:\n ans.push(val)\n return ans\n\n def capturesdict(self):\n gnm = self.re.group_name_map\n names = Object.keys(gnm)\n ans = {}\n for v\'var i = 0; i < names.length; i++\':\n name = names[i] # noqa:undef\n ans[name] = self.captures(name)\n return ans\n\nclass RegexObject:\n\n def __init__(self, pattern, flags):\n self.pattern = pattern.source if isinstance(pattern, RegExp) else pattern\n self.js_pattern, self.flags, self.group_name_map = transform_regex(self.pattern, flags)\n\n modifiers = \'\'\n if self.flags & IGNORECASE: modifiers += \'i\'\n if self.flags & MULTILINE: modifiers += \'m\'\n if not (self.flags & ASCII) and supports_unicode:\n modifiers += \'u\'\n self._modifiers = modifiers + \'g\'\n self._pattern = RegExp(self.js_pattern, self._modifiers)\n\n def _do_search(self, pat, string, pos, endpos):\n pat.lastIndex = 0\n if endpos is not None:\n string = string[:endpos]\n while True:\n n = pat.exec(string)\n if n is None:\n return None\n if n.index >= pos:\n return MatchObject(self, n, pos, endpos)\n\n def search(self, string, pos=0, endpos=None):\n return self._do_search(self._pattern, string, pos, endpos)\n\n def match(self, string, pos=0, endpos=None):\n return self._do_search(RegExp(\'^\' + self.js_pattern, self._modifiers), string, pos, endpos)\n\n def split(self, string, maxsplit=0):\n self._pattern.lastIndex = 0\n return string.split(self._pattern, maxsplit or undefined)\n\n def findall(self, string):\n self._pattern.lastIndex = 0\n return ρσ_list_decorate(string.match(self._pattern) or v\'[]\')\n\n def finditer(self, string):\n # We have to copy pat since lastIndex is mutable\n pat = RegExp(this._pattern.source, this._modifiers) # noqa: unused-local\n ans = v"{\'_string\':string, \'_r\':pat, \'_self\':self}"\n ans[ρσ_iterator_symbol] = def():\n return this\n ans[\'next\'] = def():\n m = this._r.exec(this._string)\n if m is None:\n return v"{\'done\':true}"\n return v"{\'done\':false, \'value\':new MatchObject(this._self, m, 0, null)}"\n return ans\n\n def subn(self, repl, string, count=0):\n expand = _expand\n if jstype(repl) is \'function\':\n expand = def(m, repl, gnm): return \'\' + repl(MatchObject(self, m, 0, None))\n this._pattern.lastIndex = 0\n num = 0\n matches = v\'[]\'\n\n while count < 1 or num < count:\n m = this._pattern.exec(string)\n if m is None:\n break\n matches.push(m)\n num += 1\n\n for v\'var i = matches.length - 1; i > -1; i--\':\n m = matches[i] # noqa:undef\n start = m.index\n end = start + m[0].length\n string = string[:start] + expand(m, repl, self.group_name_map) + string[end:]\n return string, matches.length\n\n def sub(self, repl, string, count=0):\n return self.subn(repl, string, count)[0]\n\ndef _get_from_cache(pattern, flags):\n if isinstance(pattern, RegExp):\n pattern = pattern.source\n key = JSON.stringify(v\'[pattern, flags]\')\n if has_prop(_re_cache_map, key):\n return _re_cache_map[key]\n if _re_cache_items.length >= 100:\n v\'delete _re_cache_map[_re_cache_items.shift()]\'\n ans = RegexObject(pattern, flags)\n _re_cache_map[key] = ans\n _re_cache_items.push(key)\n return ans\n\ndef compile(pattern, flags=0):\n return _get_from_cache(pattern, flags)\n\ndef search(pattern, string, flags=0):\n return _get_from_cache(pattern, flags).search(string)\n\ndef match(pattern, string, flags=0):\n return _get_from_cache(pattern, flags).match(string)\n\ndef split(pattern, string, maxsplit=0, flags=0):\n return _get_from_cache(pattern, flags).split(string)\n\ndef findall(pattern, string, flags=0):\n return _get_from_cache(pattern, flags).findall(string)\n\ndef finditer(pattern, string, flags=0):\n return _get_from_cache(pattern, flags).finditer(string)\n\ndef sub(pattern, repl, string, count=0, flags=0):\n return _get_from_cache(pattern, flags).sub(repl, string, count)\n\ndef subn(pattern, repl, string, count=0, flags=0):\n return _get_from_cache(pattern, flags).subn(repl, string, count)\n\ndef escape(string):\n return string.replace(_RE_ESCAPE, \'\\\\$&\')\n\ndef purge():\n nonlocal _re_cache_map, _re_cache_items\n _re_cache_map = {}\n _re_cache_items = v\'[]\'\n',"__stdlib__/traceback.pyj":"# vim:fileencoding=utf-8\n# License: BSD Copyright: 2016, Kovid Goyal \n# globals: ρσ_str, ρσ_last_exception\n\n\ndef _get_internal_traceback(err):\n if isinstance(err, Exception) and err.stack:\n lines = ρσ_str.splitlines(err.stack)\n final_lines = v'[]'\n found_sentinel = False\n for i, line in enumerate(lines):\n sline = ρσ_str.strip(line)\n if i is 0:\n final_lines.push(line)\n continue\n if found_sentinel:\n final_lines.push(line)\n continue\n # These two conditions work on desktop Chrome and Firefox to identify the correct\n # line in the traceback.\n if sline.startsWith('at new ' + err.name) or sline.startsWith(err.name + '@'):\n found_sentinel = True\n return final_lines.join('\\n')\n return err and err.stack\n\ndef format_exception(exc, limit):\n if jstype(exc) is 'undefined':\n exc = ρσ_last_exception\n if not isinstance(exc, Error):\n if exc and exc.toString:\n return [exc.toString()]\n return []\n tb = _get_internal_traceback(exc)\n if tb:\n lines = ρσ_str.splitlines(tb)\n e = lines[0]\n lines = lines[1:]\n if limit:\n lines = lines[:limit+1] if limit > 0 else lines[limit:]\n lines.reverse()\n lines.push(e)\n lines.insert(0, 'Traceback (most recent call last):')\n return [l+'\\n' for l in lines]\n return [exc.toString()]\n\ndef format_exc(limit):\n return format_exception(ρσ_last_exception, limit).join('')\n\ndef print_exc(limit):\n print(format_exc(limit))\n\ndef format_stack(limit):\n stack = Error().stack\n if not stack:\n return []\n lines = str.splitlines(stack)[2:]\n lines.reverse()\n if limit:\n lines = lines[:limit+1] if limit > 0 else lines[limit:]\n return [l + '\\n' for l in lines]\n\ndef print_stack(limit):\n print(format_stack(limit).join(''))\n","__stdlib__/uuid.pyj":"# vim:fileencoding=utf-8\n# License: BSD Copyright: 2017, Kovid Goyal \n# globals: crypto\nfrom __python__ import hash_literals\n\nfrom encodings import hexlify, urlsafe_b64decode, urlsafe_b64encode\n\nRFC_4122 = 1\n\nif jstype(crypto) is 'object' and crypto.getRandomValues:\n random_bytes = def (num):\n ans = Uint8Array(num or 16)\n crypto.getRandomValues(ans)\n return ans\nelse:\n random_bytes = def (num):\n ans = Uint8Array(num or 16)\n for i in range(ans.length):\n ans[i] = Math.floor(Math.random() * 256)\n return ans\n\n\ndef uuid4_bytes():\n data = random_bytes()\n data[6] = 0b01000000 | (data[6] & 0b1111)\n data[8] = (((data[8] >> 4) & 0b11 | 0b1000) << 4) | (data[8] & 0b1111)\n return data\n\n\ndef as_str():\n h = this.hex\n return h[:8] + '-' + h[8:12] + '-' + h[12:16] + '-' + h[16:20] + '-' + h[20:]\n\n\ndef uuid4():\n b = uuid4_bytes()\n return {\n 'hex': hexlify(b),\n 'bytes': b,\n 'variant': RFC_4122,\n 'version': 4,\n '__str__': as_str,\n 'toString': as_str,\n }\n\n\ndef num_to_string(numbers, alphabet, pad_to_length):\n ans = v'[]'\n alphabet_len = alphabet.length\n numbers = Array.prototype.slice.call(numbers)\n for v'var i = 0; i < numbers.length - 1; i++':\n x = divmod(numbers[i], alphabet_len)\n numbers[i] = x[0]\n numbers[i+1] += x[1]\n for v'var i = 0; i < numbers.length; i++':\n number = numbers[i]\n while number:\n x = divmod(number, alphabet_len)\n number = x[0]\n ans.push(alphabet[x[1]])\n if pad_to_length and pad_to_length > ans.length:\n ans.push(alphabet[0].repeat(pad_to_length - ans.length))\n return ans.join('')\n\n\ndef short_uuid():\n # A totally random uuid encoded using only URL and filename safe characters\n return urlsafe_b64encode(random_bytes(), '')\n\n\ndef short_uuid4():\n # A uuid4 encoded using only URL and filename safe characters\n return urlsafe_b64encode(uuid4_bytes(), '')\n\n\ndef decode_short_uuid(val):\n return urlsafe_b64decode(val + '==')\n"},_={},r={},a={},o={crypto:{createHash:function(){var n=new r.jsSHA("SHA-1","TEXT");return n.digest=function(){return n.getHash("HEX")},n}},vm:{createContext:function(n){var e=document.createElement("iframe");e.style.display="none",document.body.appendChild(e);var t=e.contentWindow;return n||(n={}),n.sha1sum||(n.sha1sum=k),n.require||(n.require=i),Object.keys(n).forEach(function(e){t[e]=n[e]}),t},runInContext:function(n,e){return e.eval(n)},runInThisContext:eval},path:{join:function(){return Array.prototype.slice.call(arguments).join("/")},dirname:function(n){return n.split("/").slice(0,-1).join("/")}},inspect:function(n){return n.toString()},fs:{readFileSync:function(n){if(_.virtual_file_system&&_.virtual_file_system.read_file_sync&&null!==(e=_.virtual_file_system.read_file_sync(n)))return e;var e=_.file_data[n];if(e)return e;if(e=a[n])return e;var t=Error();throw t.code="ENOENT",t},writeFileSync:function(n,e){_.virtual_file_system&&_.virtual_file_system.write_file_sync?_.virtual_file_system.write_file_sync(n,e):a[n]=e}}};function i(n){return o[n]||{}}(function(){!function(n){function e(n,e,s){var u=0,l=[],p=0,m=!1,b=[],x=[],y=!1,v=(s=s||{}).encoding||"UTF8",h=s.numRounds||1;if(h!==parseInt(h,10)||1>h)throw Error("numRounds must a integer >= 1");if("SHA-1"!==n)throw Error("Chosen SHA variant is not supported");var g=512,S=f,A=d,T=160,j=function(n){return n.slice()},k=i(e,v),O=c(n);this.setHMACKey=function(e,t,_){if(!0===m)throw Error("HMAC key already set");if(!0===y)throw Error("Cannot set HMAC key after calling update");e=(t=i(t,v=(_||{}).encoding||"UTF8")(e)).binLen,t=t.value;var r=g>>>3;if(_=r/4-1,re/8){for(;t.length<=_;)t.push(0);t[_]&=4294967040}for(e=0;e<=_;e+=1)b[e]=909522486^t[e],x[e]=1549556828^t[e];O=S(b,O),u=g,m=!0},this.update=function(n){var e,t=0,_=g>>>5,r=k(n,l,p);n=r.binLen;var a=r.value;for(r=n>>>5,e=0;e>>5),p=n%g,y=!0},this.getHash=function(e,i){if(!0===m)throw Error("Cannot call getHash after setting HMAC key");var s=o(i);switch(e){case"HEX":e=function(n){return t(n,T,s)};break;case"B64":e=function(n){return _(n,T,s)};break;case"BYTES":e=function(n){return r(n,T)};break;case"ARRAYBUFFER":try{i=new ArrayBuffer(0)}catch(n){throw Error("ARRAYBUFFER not supported by this environment")}e=function(n){return a(n,T)};break;default:throw Error("format must be HEX, B64, BYTES, or ARRAYBUFFER")}var f=A(l.slice(),p,u,j(O),T);for(i=1;i>>2]>>>8*(3+_%4*-1);r+="0123456789abcdef".charAt(a>>>4&15)+"0123456789abcdef".charAt(15&a)}return t.outputUpper?r.toUpperCase():r}function _(n,e,t){var _,r="",a=e/8;for(_=0;_>>2]:0,i=_+2>>2]:0;for(i=(n[_>>>2]>>>8*(3+_%4*-1)&255)<<16|(o>>>8*(3+(_+1)%4*-1)&255)<<8|i>>>8*(3+(_+2)%4*-1)&255,o=0;4>o;o+=1)r+=8*_+6*o<=e?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>>6*(3-o)&63):t.b64Pad}return r}function r(n,e){var t,_="";for(e/=8,t=0;t>>2]>>>8*(3+t%4*-1)&255;_+=String.fromCharCode(r)}return _}function a(n,e){e/=8;var t,_=new ArrayBuffer(e),r=new Uint8Array(_);for(t=0;t>>2]>>>8*(3+t%4*-1)&255;return _}function o(n){var e={outputUpper:!1,b64Pad:"=",shakeLen:-1};if(n=n||{},e.outputUpper=n.outputUpper||!1,!0===n.hasOwnProperty("b64Pad")&&(e.b64Pad=n.b64Pad),n.hasOwnProperty("shakeLen"),"boolean"!=typeof e.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof e.b64Pad)throw Error("Invalid b64Pad formatting option");return e}function i(n,e){switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(n){case"HEX":n=function(n,e,t){var _,r,a=n.length;if(a%2)throw Error("String of HEX type must be in byte increments");e=e||[0];var o=(t=t||0)>>>3;for(_=0;_>>1)+o;for(r=s>>>2;e.length<=r;)e.push(0);e[r]|=i<<8*(3+s%4*-1)}return{value:e,binLen:4*a+t}};break;case"TEXT":n=function(n,t,_){var r,a,o,i=0;t=t||[0];var s=(_=_||0)>>>3;if("UTF8"===e){var u=3;for(r=0;rl?p.push(l):2048>l?(p.push(192|l>>>6),p.push(128|63&l)):55296>l||57344<=l?p.push(224|l>>>12,128|l>>>6&63,128|63&l):(r+=1,l=65536+((1023&l)<<10|1023&n.charCodeAt(r)),p.push(240|l>>>18,128|l>>>12&63,128|l>>>6&63,128|63&l)),a=0;a>>2;t.length<=o;)t.push(0);t[o]|=p[a]<<8*(u+c%4*-1),i+=1}}}else if("UTF16BE"===e||"UTF16LE"===e)for(u=2,p="UTF16LE"===e||"UTF16LE"!==e&&!1,r=0;r>>8),o=(c=i+s)>>>2;t.length<=o;)t.push(0);t[o]|=l<<8*(u+c%4*-1),i+=2}return{value:t,binLen:8*i+_}};break;case"B64":n=function(n,e,t){var _,r,a=0;if(-1===n.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");var o=n.indexOf("=");if(n=n.replace(/\=/g,""),-1!==o&&o=0?new Error(l.message+" at line "+e.slice(t+1,e.length-1)+": "+i):new Error(l.message+": "+i)}}}window.glowscript_compile=function(w,y){y=y||{},window.__original={text:w.split("\n")},window.__GSlang=y.lang;var b='["'+y.version+'", "glowscript"]',R=/[^\.\w]text[\ ]*\(/.exec(w);R||(R=/^text[\ ]*\(/.exec(w)),w=w.replace(/\.delete/g,".remove");const k=["arrow","box","compound","cone","curve","cylinder","ellipsoid","extrusion","helix","points","pyramid","ring","sphere","simple_sphere","vec","vector","rate","sleep","update","color","paths","shapes","canvas","vertex","triangle","quad","label","distant_light","local_light","attach_trail","attach_arrow","attach_light","sqrt","pi","sin","cos","tan","asin","acos","atan","atan2","exp","log","pow","factorial","combin","button","radio","checkbox","slider","checkbox","text","download","radians","degrees","get_library","read_local_file"];if("vpython"==y.lang){let r="";var E="";if("ERROR: "==(w=function(r,s){if("rapydscript"==s)throw new Error("GlowScript RapydScript is not available after GlowScript 2.9.Choose GlowScript VPython instead.");var a,o,f,w,y,O,b,R;"vpython"==s&&u.push("self");var k=0,E=0,S=0,G=null,j=null,q=null,C="",M=/(^\s*)(.*)/,$="",A="",L=!1,T=!1,W=-1;const z=/(\.pick)\s*(.)/;var N=/^print_options/,P=!1;"javascript"==s&&(v=" "+v);var J="",U="";for("vpython"==s&&(r=r.replace(/arange/g,"range")),f=r.split("\n"),o=1;o=0){f[o]="";break}f[o]="",o++}continue}}if(w=w.replace(/\s+$/g,""),"vpython"!=s||"\\"!=w.slice(-1))if((K=w.match(N))&&(w=w.replace(/delete/,"remove")),"vpython"!=s||"@"!=w[0]){if(0!==w.length){"vpython"==s?(W===C.length&&(W=-1),w.match(i)&&(W=C.length)):w=" "+w,y=!1,O=!1,b=!1,R=!1;var Y=!1,B=L,D=!1;for(X=0;X0&&"f"==w[X-1]&&(D=!0),X<=w.length-3&&w[X+1]==ge&&w[X+2]==ge){if("javascript"==s)throw new Error("JavaScript doesn't recognize triple quotes.");b=!b,X+=2}else"'"==ge?O||b?D=!1:y=!y:'"'==ge?y||b?D=!1:O=!O:"`"==ge&&R&&(R=!R)}if(b&&X==w.length-1&&o0&&"\\"==w[X-1])break;0===k&&(G=o),k++;break;case")":if(X>0&&"\\"==w[X-1])break;k--,T&&0==k&&(T=!1);break;case"[":if(X>0&&"\\"==w[X-1])break;0===E&&(j=o),E++;break;case"]":if(X>0&&"\\"==w[X-1])break;E--;break;case"{":if(X>0&&"\\"==w[X-1])break;0===S&&(q=o),S++;break;case"}":if(X>0&&"\\"==w[X-1])break;S--}if("\\"==ge){X!=w.length-1&&" "!=w[X+1]&&"#"!=w[X+1]||(w=w.slice(0,X)),Y=!0;break}}}L=!T&&(Y||k>0||E>0||S>0),F||"vpython"==s&&(K=z.exec(w+" "))&&"("!=K[2]&&0!=K[2].search(/\w/)&&(X=K.index,w=w.slice(0,X)+".pick()"+w.slice(X+5));var H=w.split(" ");if("vpython"==s&&H.indexOf("import")>-1){if(H.indexOf("random")>-1){$+=" "+C+w+"\n";continue}if(null===e&&(n=[]),"__future__"==H[1])continue;if("visual.factorial"==H[1])continue;if("from"==H[0]&&"import"==H[2]&&H.length>=4){if("visual.graph"==H[1]){if("*"==H[3])continue;return'ERROR: Currently only "from visual.graph import *" is supported, line '+(o+2)+": "+f[o]}if("vpython"!=H[1]&&"visual"!=H[1]&&"vis"!=H[1])throw new Error("Line "+(o+1)+": cannot import from "+H[1]);if(null===e){if("*"==H[3])continue;e=H[1];for(var I=3;I0&&","!=H[I]){if(","==H[I].slice(-1)&&(H[I]=H[I].slice(0,-1))," "==H[I]||"("==H[I]||")"==H[I]||"("==H[I][0]||")"==H[I][-1])continue;n.push(H[I])}-1==n.indexOf("canvas")&&n.push("canvas")}continue}if("import"==H[0]&&2==H.length){if("visual.graph"==H[1])return'ERROR: Currently only "from visual.graph import *" is supported, line '+(o+1)+": "+f[o];if("vpython"!=H[1]&&"visual"!=H[1]&&"vis"!=H[1])return"ERROR: Cannot import from "+H[1]+", line "+(o+1)+": "+f[o];null===e&&(e=H[1]);continue}if("import"==H[0]){if("vpython"==H[1]||"visual"==H[1]||"vis"==H[1]){if(4==H.length&&"as"==H[2]){e=H[3];continue}return"ERROR: improper import statement, line "+(o+1)+": "+f[o]}return"ERROR: Cannot import from "+H[1]+", line "+(o+1)+": "+f[o]}}if("vpython"==s){const e=["def","class","while","for","if","elif","else","try","except","finally"],n=new RegExp("^(\\w+)");var K;let r=null;if(null!==(K=w.match(n))){let n=e.indexOf(K[1]);if(n>=0&&(r=e[n],w.search(":")<0))throw new Error("Line "+(o+1)+', "'+w+'", must include a colon.')}const s=["if","else","elif","except","finally"];if(a="",C.length=0)?a=A+v+_+(o+1)+_+"\n":P||(a=C+v+_+(o+1)+_+"\n"),P=!1,(C.length!=A.length||"elif"!=w.substr(0,4)&&"else"!=w.substr(0,4))&&'"""'!=w.substr(0,3)&&"'''"!=w.substr(0,3)&&")"!=w[0]||(a=""),"="==w[w.length-1])return"ERROR: Line "+(o+1)+" ends with equal sign: "+f[o];var Q="";B?(Q=C,C=A):Q=""==a?" "+C:" "+a+" "+C;var Z,ee,ne=0,ie=null,te=null,le=null,re=!1,se="",ae="";const g=new RegExp("^(\\w+)\\s*=\\s*(\\w+)\\.(\\w+)$"),y=new RegExp("^(\\w+)\\s*=\\s*(\\w+)\\s*");if(null===(ee=w.match(l))&&(ie=w.match(i)),null===ie&&(te=w.match(g)),null===te&&(le=w.match(y)),null!==ee)0===C.length||-1===W?p.push(ee[1]):W>=0&&C.length>W&&x.push(ee[1]),re=!0;else if(null!==ie)d.push(ie[1]),re=!0;else if(null!==te)u.indexOf(te[2])>=0&&x.indexOf(te[3])>=0&&x.push(te[1]);else if(null!==le){var ce=le[1],oe=le[2];if("("==w[le[0].length]){var fe=m(w.slice(le[0].length));null!==fe&&le[0].length+fe+1==w.length&&(d.indexOf(oe)>=0?u.push(ce):x.indexOf(oe)>=0?x.push(ce):p.indexOf(oe)>=0&&p.push(ce))}}null!==(K=w.match(c))&&h.push(K[1]),ne=0;const O=new RegExp("(\\w+)\\.(\\w+)\\s*");for(;null!==(K=w.slice(ne).match(O));)u.indexOf(K[1])>=0&&x.indexOf(K[2])>=0&&(ne+K.index+K[0].length>=w.length||"("!=w[ne+K.index+K[0].length])?(w=w.slice(0,ne+K.index)+w.slice(ne+K.index).replace(K[2],K[2]+".bind("+K[1]+")"),ne+=K.index+K[0].length+K[1].length+7):ne+=K.index+K[0].length;if(!re){const e=new RegExp("^(\\w+)\\s*=\\s*");null!==(K=w.match(e))&&(K[1],w.slice(K[0].length)),ne=0;for(var pe=0;;){if(null===(K=w.slice(ne).match(t))){se.length>0&&(ae+=w.slice(ne));break}Z=K[1];var he=ne+K.index+K[1].length;if(d.indexOf(Z)>=0){for(ce=0,X=he;;){var ge;if("("==(ge=w[X]))ce+=1;else if(")"==ge&&0==(ce-=1))break;if((X+=1)>w.length)break}if(X>w.length)break;se+="_GS_"+(pe+=1)+" = "+Z+"(); _GS_"+pe+".__init__"+w.slice(he,X+1)+"; ",ae+=w.slice(ne,he-K[1].length)+"_GS_"+pe,ne=X+1}else ae+=w.slice(ne,he),ne=he}}se.length>0&&(w=se+ae);const b=new RegExp("input\\s*\\(");if(null!==(K=w.match(b))){let e=!0,n=K.index-1;if(n>=0){let i=w[n];e="w"==i||"."==i||" "==i||"="==i||"("==i}e&&($+=" "+C+"sleep(0.1)")}else w.indexOf(".autoscale")>=0&&($+=" "+C+"sleep(0.1)");$+=Q+w+"\n"}if(A=C,k<0)return"ERROR: Too many right parentheses, line "+(o+1)+": "+f[o];if(E<0)return"ERROR: Too many right brackets, line "+(o+1)+": "+f[o];if(S<0)return"ERROR: Too many right braces, line "+(o+1)+": "+f[o]}}else $+=" "+C+_+v+(o+2)+_+"\n "+w+"\n",P=!0;else J=w.slice(0,-1),U=C}return k>0?"ERROR: Missing right parenthesis, see line "+(G+2)+": "+f[G]:E>0?"ERROR: Missing right bracket, see line "+(j+2)+": "+f[j]:S>0?"ERROR: Missing right brace, see line "+(q+2)+": "+f[q]:$}(w,y.lang)).slice(0,7))O(w);else{var S;if(w=(w=w.replace(/(\.pop\s*\(\s*)([^)]*)/g,function(e,n,i){return".py"+e.slice(1)})).replace(/\.sort\s*\(/g,".pysort("),S="def __main__():\n version = "+b+"\n",S+=" from __python__ import dict_literals, overload_getitem\n",S+=" window.__GSlang = 'vpython'\n",null===e);else if(n.length>0){r="var ";for(let e of k)n.indexOf(e)<0&&(r+=e+", ");r=r.slice(0,-2)}else{let n=new RegExp(e+"\\.(\\w+)","g"),i=w.match(n);n=new RegExp(e+"\\.(\\w+)");let t={};E=" var "+e+" = {";for(let e=0;e0){let e="function __main__() {";w=w.replace(e,"\n"+e+" "+r)}var G=(w=w.replace("function __main__() {",'async function __main__() {\n"use strict";\n var display = canvas;\n var scene = canvas();\n')).indexOf("window.__GSlang"),j="Array.prototype['+'] = function(r) {return this.concat(r)}\n";j+=" Array.prototype['*'] = function(r) {return __array_times_number(this, r)}\n",n.length<=0&&(j+=E),w=w.slice(0,G)+j+w.slice(G-4)}}else{let e=w.search("\n");if(e<0)throw new Error("Missing GlowScript X.Y initial line.");var q='async function __main__() {\n"use strict";\n';q+="var version = "+b+";\n",q+="Array.prototype.toString = function() { return __parsearray(this) };\n",w=(q+="var scene = canvas();\n")+(w=w.substr(e+1))+"\n}"}G=w.indexOf("async function __main__()"),S=w.slice(G),S=papercompile(S),S=";\n"+(S=w.slice(0,G)+S);let C=["if","elif","return","for","while","function","else","dict","str","float","hex","int","iter","len","list","vec","vector","catch","enumerate","oct","ord","print","range","arange","update","print","GSprint","clock","msclock","canvas","graph","gcurve","gdots","gvbars","ghbars","rotate","box","cylinder","cone","pyramid","sphere","simple_sphere","arrow","curve","points","paths","shapes","helix","ring","compound","vertex","triangle","quad","label","distant_light","local_light","attach_trail","attach_arrow","attach_light","text","extrusion","wtext","winput","radio","checkbox","button","slider","menu","input","js_generator","yield","clear","copy","get","items","keys","values","pypop","popitem","fromkeys","update","setdefault","mag","mag2","norm","hat","dot","cross","proj","diff_angle","abs","filter","set","sin","cos","tan","asin","acos","atan","atan2","exp","log","log10","pow","sqrt","ceil","floor","sign","round","max","min","random","factorial","combin"];if("vpython"==y.lang){const n=new RegExp("\\w+\\.prototype\\."+v+'"\\w+";',"g");var M,$,A=(S=S.replace(n,"")).search(v);G=A;let i=[];for(;null!==(M=S.slice(G).match(a));)i.push(M[1]),C.indexOf(M[1]>=0)&&C.push(M[1]),G+=M.index+M[0].length;for(G=A;"vpython"==y.lang&&(M=S.slice(G).match(r)),null!==(M=S.slice(G).match(r));)$=M[1],d.indexOf($)>=0?G+=M[0].length:h.indexOf($)>=0?(C.push($),G+=M[0].length):i.indexOf($)>=0?G+=M[0].length:(S=S.slice(0,G+M.index+1)+"async function "+$+g+S.slice(G+M.index+M[0].length),G+=M.index+"async function ".length+M[1].length+g.length+1);for(G=A;;){var L=!1;if(null===(M=S.slice(G).match(s))||"\\"==S[G+M.index])break;if(L="."==S[G+M.index],$=M[1],!L&&C.indexOf($)>=0){G+=M.index+$.length+1;continue}if("vpython"==y.lang&&!L&&d.indexOf($)>=0){G+=M.index+$.length+1;var T=S.slice(G).search("{"),W=S.slice(G).search("arguments");S=S.slice(0,G+T+1)+S.slice(G+"arguments".length+W+1);continue}if("ρσ_"==$.slice(0,3)){G+=M.index+$.length+1;continue}let n,i=G+M.index+1,t=0,l=0,r=!1,a=!1;for(;;){if('"'==(n=S[--i]))r=!r;else if("'"==n);else if("]"!=n||r||a)if("["!=n||r||a)if(")"!=n||r||a){if("("==n&&!r&&!a){if(0===l)break;l++}}else l--;else{if(0===t)break;t++}else t--;if(" "==n&&0===t&&0===l&&!r&&!a)break}let c=i+1;if("s.jsset.add"==S.slice(c,c+11)){G+=M.index+$.length+1;continue}let h="";if(L){const e="ρσ_interpolate_kwargs",t="ρσ_list_decorate(";if((h=S.slice(c,G+M.index))==e&&"call"==$){let e=S.slice(G+M.index+6).search(","),i=S.slice(G+M.index+6,G+M.index+6+e),r=S.slice(G+M.index+6+e+1).search(","),s=S.slice(G+M.index+6+e+2,G+M.index+6+e+r+1);if("paths"==i||"shapes"==i||"this"==i){e=G+M.index+6+e+2,l=1;let r=!1,a=!1,o=S[e-1];for(;;){if("'"!=(n=S[e])||a)if('"'!=n||r||"\\"==o){if(!r&&!a)if("("==n)l++;else if(")"==n&&0==--l)break}else a=!a;else r=!r;o=n,e++}if("this"==i){p.indexOf(s)>=0&&(S=S.slice(0,c)+"await "+t+S.slice(c,e)+")"+S.slice(e));let n="ρσ_desugar_kwargs(";G=c+=S.slice(c).indexOf(n)+n.length}else S=S.slice(0,c)+t+S.slice(c,e)+")"+S.slice(e),G=e+t.length;continue}G+=M.index+$.length+2;continue}if("paths"==h||"shapes"==h){for(i=S.slice(G+M.index+$.length+1).search("\\(")+G+M.index+$.length+2,l=1;;){if("("==(n=S[i]))l++;else if(")"==n&&0==--l)break;i++}S=S.slice(0,c)+t+S.slice(c,i)+")"+S.slice(i),G=i+t.length;continue}}if("vpython"==y.lang&&L&&u.indexOf(h)<0&&"replace"==$){S=S.slice(0,G+M.index+1)+"__GSrep"+S.slice(G+M.index+$.length+1),G+=M.index+$.length+1;continue}let g=["remove","select","append_to_title","append_to_caption","bind","unbind","call","append","rgb_to_hsv","hsv_to_rgb","mag","mag2","norm","hat","rotate","random","pow","equals","format","trigger","follow","defineProperties","textures","bumpmaps","slice","plot","pypop","insert","find","extend","copy","count","reverse","pysort","set","clear","copy","get","items","keys","values","popitem","fromkeys","update","setdefault","npoints","unshift","splice","modify","clear","shift","point","slice"];if(L&&"self"==h||L&&"ρσ_getitem"==h.slice(0,10)&&x.indexOf($)>=0||L&&d.indexOf(h)>=0&&x.indexOf($)>=0||L&&u.indexOf(h)<0&&o.indexOf($)>=0||L&&h===e&&f.indexOf($)>=0||L&&u.indexOf(h)>=0&&x.indexOf($)>=0||L&&u.indexOf(h)>=0&&g.indexOf($)<0||L&&x.indexOf($)>=0||!L&&p.indexOf($)>=0||!L&&x.indexOf($)>=0||!L&&d.indexOf($)>=0||!L&&C.indexOf($)<0||!L&&C.indexOf($)<0&&g.indexOf($)<0&&p.indexOf($)<0)if(h==e&&f.indexOf($)<0)G+=M.index+$.length+1;else if("Object"!=h)if(!(S.slice(c,G+M.index).search("ρσ_")>=0)||L&&"ρσ_getitem"==h.slice(0,10)&&x.indexOf($)>=0){var z=G+M.index+$.length+1,N=m(S.slice(z));N+=z,S=S.slice(0,c)+"(await "+S.slice(c,N)+")"+S.slice(N),G+=M.index+$.length+7}else G+=M.index+$.length+1;else G+=M.index+$.length+1;else{if(L&&"ρσ_interpolate_kwargs"==h&&"call"==$){let e=S.slice(G+M.index).search("\n");e<0&&(e=S.length-(G+M.index));let n=S.slice(G+M.index,G+M.index+e),i=n.indexOf("concat(");const t=new RegExp("\\s*\\(\\s*([^,]*),\\s*([^,]*)");let l=n.match(t);$=l[1];let r=l[2],s="";if((L=r.indexOf("."))>0){let e=r.length-1;for(;e>0&&"."!=r[e];)e-=1;s=r.slice(0,e),r=r.slice(e+1),L=!0}else L=!1;if("this"==$&&($=r),x.indexOf(r)>=0||"_GS_"==$.slice(0,4)||L&&"self"==s||!L&&p.indexOf($)>=0||L&&d.indexOf($)>=0&&x.indexOf(r)>=0||!L&&x.indexOf($)>=0||!L&&d.indexOf($)>=0||L&&u.indexOf($)<0&&o.indexOf(r)>=0){S=S.slice(0,G+M.index-h.length)+"await "+S.slice(G+M.index-h.length),G+=-1==i?M.index+l.index+7:M.index+l.index+i+14;continue}G+=i>=0?M.index+i:M.index+l.index+5;continue}G+=M.index+$.length+1}}}let P="scene = canvas();\n",J=(w=(w=(w=(w=S.replace(/\n\n\n\n/g,"")).replace(new RegExp(v,"g"),"")).replace(new RegExp("\\n\\s*var ρσ_ls;","g"),"")).replace(new RegExp(g,"g"),"(")).indexOf(P)+P.length;return R&&(P=" fontloading();\n await waitforfonts();\n",w=w.slice(0,J)+P+w.slice(J,w.length)),w.indexOf("input")>=0&&(P="\n function input(arg) {\n",P+=" \targ = arg || {}\n",P+=" \tif (arg.prompt !== undefined && arg.prompt != '') return prompt(arg.prompt)\n",P+=" \telse if (typeof arg === 'string') return prompt(arg)\n",P+=" \telse return prompt()\n",P+=" }\n",w=w.slice(0,J)+P+w.slice(J,w.length)),w}}(); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).acorn={})}(this,function(t){"use strict";var e={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},i="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",s={5:i,"5module":i+" export import",6:i+" const class extends export import super"},a=/^in(stanceof)?$/,r="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿯ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-Ᶎꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭧꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",n="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",o=new RegExp("["+r+"]"),h=new RegExp("["+r+n+"]");r=n=null;var p=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,155,22,13,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,0,33,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,0,161,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,754,9486,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541],c=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,232,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,792487,239];function u(t,e){for(var i=65536,s=0;st)return!1;if((i+=e[s+1])>=t)return!0}}function l(t,e){return t<65?36===t:t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&o.test(String.fromCharCode(t)):!1!==e&&u(t,p)))}function d(t,e){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&h.test(String.fromCharCode(t)):!1!==e&&(u(t,p)||u(t,c)))))}var f=function(t,e){void 0===e&&(e={}),this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.updateContext=null};function m(t,e){return new f(t,{beforeExpr:!0,binop:e})}var g={beforeExpr:!0},x={startsExpr:!0},v={};function y(t,e){return void 0===e&&(e={}),e.keyword=t,v[t]=new f(t,e)}var _={num:new f("num",x),regexp:new f("regexp",x),string:new f("string",x),name:new f("name",x),eof:new f("eof"),bracketL:new f("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new f("]"),braceL:new f("{",{beforeExpr:!0,startsExpr:!0}),braceR:new f("}"),parenL:new f("(",{beforeExpr:!0,startsExpr:!0}),parenR:new f(")"),comma:new f(",",g),semi:new f(";",g),colon:new f(":",g),dot:new f("."),question:new f("?",g),arrow:new f("=>",g),template:new f("template"),invalidTemplate:new f("invalidTemplate"),ellipsis:new f("...",g),backQuote:new f("`",x),dollarBraceL:new f("${",{beforeExpr:!0,startsExpr:!0}),eq:new f("=",{beforeExpr:!0,isAssign:!0}),assign:new f("_=",{beforeExpr:!0,isAssign:!0}),incDec:new f("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new f("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:m("||",1),logicalAND:m("&&",2),bitwiseOR:m("|",3),bitwiseXOR:m("^",4),bitwiseAND:m("&",5),equality:m("==/!=/===/!==",6),relational:m("/<=/>=",7),bitShift:m("<>/>>>",8),plusMin:new f("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:m("%",10),star:m("*",10),slash:m("/",10),starstar:new f("**",{beforeExpr:!0}),_break:y("break"),_case:y("case",g),_catch:y("catch"),_continue:y("continue"),_debugger:y("debugger"),_default:y("default",g),_do:y("do",{isLoop:!0,beforeExpr:!0}),_else:y("else",g),_finally:y("finally"),_for:y("for",{isLoop:!0}),_function:y("function",x),_if:y("if"),_return:y("return",g),_switch:y("switch"),_throw:y("throw",g),_try:y("try"),_var:y("var"),_const:y("const"),_while:y("while",{isLoop:!0}),_with:y("with"),_new:y("new",{beforeExpr:!0,startsExpr:!0}),_this:y("this",x),_super:y("super",x),_class:y("class",x),_extends:y("extends",g),_export:y("export"),_import:y("import",x),_null:y("null",x),_true:y("true",x),_false:y("false",x),_in:y("in",{beforeExpr:!0,binop:7}),_instanceof:y("instanceof",{beforeExpr:!0,binop:7}),_typeof:y("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:y("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:y("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},b=/\r\n?|\n|\u2028|\u2029/,k=new RegExp(b.source,"g");function S(t,e){return 10===t||13===t||!e&&(8232===t||8233===t)}var C=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,w=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,E=Object.prototype,A=E.hasOwnProperty,I=E.toString;function P(t,e){return A.call(t,e)}var T=Array.isArray||function(t){return"[object Array]"===I.call(t)};function L(t){return new RegExp("^(?:"+t.replace(/ /g,"|")+")$")}var N=function(t,e){this.line=t,this.column=e};N.prototype.offset=function(t){return new N(this.line,this.column+t)};var V=function(t,e,i){this.start=e,this.end=i,null!==t.sourceFile&&(this.source=t.sourceFile)};function R(t,e){for(var i=1,s=0;;){k.lastIndex=s;var a=k.exec(t);if(!(a&&a.index=2015&&(e.ecmaVersion-=2009),null==e.allowReserved&&(e.allowReserved=e.ecmaVersion<5),T(e.onToken)){var s=e.onToken;e.onToken=function(t){return s.push(t)}}return T(e.onComment)&&(e.onComment=function(t,e){return function(i,s,a,r,n,o){var h={type:i?"Block":"Line",value:s,start:a,end:r};t.locations&&(h.loc=new V(this,n,o)),t.ranges&&(h.range=[a,r]),e.push(h)}}(e,e.onComment)),e}var D=2,O=1|D,U=4,F=8;function H(t,e){return D|(t?U:0)|(e?F:0)}var G=function(t,i,a){this.options=t=B(t),this.sourceFile=t.sourceFile,this.keywords=L(s[t.ecmaVersion>=6?6:"module"===t.sourceType?"5module":5]);var r="";if(!0!==t.allowReserved){for(var n=t.ecmaVersion;!(r=e[n]);n--);"module"===t.sourceType&&(r+=" await")}this.reservedWords=L(r);var o=(r?r+" ":"")+e.strict;this.reservedWordsStrict=L(o),this.reservedWordsStrictBind=L(o+" "+e.strictBind),this.input=String(i),this.containsEsc=!1,a?(this.pos=a,this.lineStart=this.input.lastIndexOf("\n",a-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(b).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=_.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===t.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&t.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null},W={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};G.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)},W.inFunction.get=function(){return(this.currentVarScope().flags&D)>0},W.inGenerator.get=function(){return(this.currentVarScope().flags&F)>0},W.inAsync.get=function(){return(this.currentVarScope().flags&U)>0},W.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},W.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},W.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},G.prototype.inNonArrowFunction=function(){return(this.currentThisScope().flags&D)>0},G.extend=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];for(var i=this,s=0;s-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var i=e?t.parenthesizedAssign:t.parenthesizedBind;i>-1&&this.raiseRecoverable(i,"Parenthesized pattern")}},j.checkExpressionErrors=function(t,e){if(!t)return!1;var i=t.shorthandAssign,s=t.doubleProto;if(!e)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")},j.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!t);case _._class:return t&&this.unexpected(),this.parseClass(r,!0);case _._if:return this.parseIfStatement(r);case _._return:return this.parseReturnStatement(r);case _._switch:return this.parseSwitchStatement(r);case _._throw:return this.parseThrowStatement(r);case _._try:return this.parseTryStatement(r);case _._const:case _._var:return s=s||this.value,t&&"var"!==s&&this.unexpected(),this.parseVarStatement(r,s);case _._while:return this.parseWhileStatement(r);case _._with:return this.parseWithStatement(r);case _.braceL:return this.parseBlock(!0,r);case _.semi:return this.parseEmptyStatement(r);case _._export:case _._import:if(this.options.ecmaVersion>10&&a===_._import){w.lastIndex=this.pos;var n=w.exec(this.input),o=this.pos+n[0].length;if(40===this.input.charCodeAt(o))return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),a===_._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return t&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!t);var h=this.value,p=this.parseExpression();return a===_.name&&"Identifier"===p.type&&this.eat(_.colon)?this.parseLabeledStatement(r,h,p,t):this.parseExpressionStatement(r,p)}},z.parseBreakContinueStatement=function(t,e){var i="break"===e;this.next(),this.eat(_.semi)||this.insertSemicolon()?t.label=null:this.type!==_.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var s=0;s=6?this.eat(_.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")},z.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Q),this.enterScope(0),this.expect(_.parenL),this.type===_.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);var i=this.isLet();if(this.type===_._var||this.type===_._const||i){var s=this.startNode(),a=i?"let":this.value;return this.next(),this.parseVar(s,!0,a),this.finishNode(s,"VariableDeclaration"),(this.type===_._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===s.declarations.length?(this.options.ecmaVersion>=9&&(this.type===_._in?e>-1&&this.unexpected(e):t.await=e>-1),this.parseForIn(t,s)):(e>-1&&this.unexpected(e),this.parseFor(t,s))}var r=new K,n=this.parseExpression(!0,r);return this.type===_._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===_._in?e>-1&&this.unexpected(e):t.await=e>-1),this.toAssignable(n,!1,r),this.checkLVal(n),this.parseForIn(t,n)):(this.checkExpressionErrors(r,!0),e>-1&&this.unexpected(e),this.parseFor(t,n))},z.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,Y|(i?0:J),!1,e)},z.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(_._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")},z.parseReturnStatement=function(t){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(_.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")},z.parseSwitchStatement=function(t){var e;this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(_.braceL),this.labels.push(X),this.enterScope(0);for(var i=!1;this.type!==_.braceR;)if(this.type===_._case||this.type===_._default){var s=this.type===_._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),s?e.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,e.test=null),this.expect(_.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")},z.parseThrowStatement=function(t){return this.next(),b.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var Z=[];z.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===_._catch){var e=this.startNode();if(this.next(),this.eat(_.parenL)){e.param=this.parseBindingAtom();var i="Identifier"===e.param.type;this.enterScope(i?32:0),this.checkLVal(e.param,i?4:2),this.expect(_.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0);e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(_._finally)?this.parseBlock():null,t.handler||t.finalizer||this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")},z.parseVarStatement=function(t,e){return this.next(),this.parseVar(t,!1,e),this.semicolon(),this.finishNode(t,"VariableDeclaration")},z.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(Q),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")},z.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")},z.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")},z.parseLabeledStatement=function(t,e,i,s){for(var a=0,r=this.labels;a=0;o--){var h=this.labels[o];if(h.statementStart!==t.start)break;h.statementStart=this.start,h.kind=n}return this.labels.push({name:e,kind:n,statementStart:this.start}),t.body=this.parseStatement(s?-1===s.indexOf("label")?s+"label":s:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")},z.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")},z.parseBlock=function(t,e){for(void 0===t&&(t=!0),void 0===e&&(e=this.startNode()),e.body=[],this.expect(_.braceL),t&&this.enterScope(0);!this.eat(_.braceR);){var i=this.parseStatement(null);e.body.push(i)}return t&&this.exitScope(),this.finishNode(e,"BlockStatement")},z.parseFor=function(t,e){return t.init=e,this.expect(_.semi),t.test=this.type===_.semi?null:this.parseExpression(),this.expect(_.semi),t.update=this.type===_.parenR?null:this.parseExpression(),this.expect(_.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")},z.parseForIn=function(t,e){var i=this.type===_._in;return this.next(),"VariableDeclaration"===e.type&&null!=e.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==e.kind||"Identifier"!==e.declarations[0].id.type)?this.raise(e.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===e.type&&this.raise(e.start,"Invalid left-hand side in for-loop"),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(_.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")},z.parseVar=function(t,e,i){for(t.declarations=[],t.kind=i;;){var s=this.startNode();if(this.parseVarId(s,i),this.eat(_.eq)?s.init=this.parseMaybeAssign(e):"const"!==i||this.type===_._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===s.id.type||e&&(this.type===_._in||this.isContextual("of"))?s.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),t.declarations.push(this.finishNode(s,"VariableDeclarator")),!this.eat(_.comma))break}return t},z.parseVarId=function(t,e){t.id=this.parseBindingAtom(),this.checkLVal(t.id,"var"===e?1:2,!1)};var Y=1,J=2;z.parseFunction=function(t,e,i,s){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===_.star&&e&J&&this.unexpected(),t.generator=this.eat(_.star)),this.options.ecmaVersion>=8&&(t.async=!!s),e&Y&&(t.id=4&e&&this.type!==_.name?null:this.parseIdent(),!t.id||e&J||this.checkLVal(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?1:2:3));var a=this.yieldPos,r=this.awaitPos,n=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(H(t.async,t.generator)),e&Y||(t.id=this.type===_.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,i,!1),this.yieldPos=a,this.awaitPos=r,this.awaitIdentPos=n,this.finishNode(t,e&Y?"FunctionDeclaration":"FunctionExpression")},z.parseFunctionParams=function(t){this.expect(_.parenL),t.params=this.parseBindingList(_.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},z.parseClass=function(t,e){this.next();var i=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);var s=this.startNode(),a=!1;for(s.body=[],this.expect(_.braceL);!this.eat(_.braceR);){var r=this.parseClassElement(null!==t.superClass);r&&(s.body.push(r),"MethodDefinition"===r.type&&"constructor"===r.kind&&(a&&this.raise(r.start,"Duplicate constructor in the same class"),a=!0))}return t.body=this.finishNode(s,"ClassBody"),this.strict=i,this.finishNode(t,e?"ClassDeclaration":"ClassExpression")},z.parseClassElement=function(t){var e=this;if(this.eat(_.semi))return null;var i=this.startNode(),s=function(t,s){void 0===s&&(s=!1);var a=e.start,r=e.startLoc;return!!e.eatContextual(t)&&(!(e.type===_.parenL||s&&e.canInsertSemicolon())||(i.key&&e.unexpected(),i.computed=!1,i.key=e.startNodeAt(a,r),i.key.name=t,e.finishNode(i.key,"Identifier"),!1))};i.kind="method",i.static=s("static");var a=this.eat(_.star),r=!1;a||(this.options.ecmaVersion>=8&&s("async",!0)?(r=!0,a=this.options.ecmaVersion>=9&&this.eat(_.star)):s("get")?i.kind="get":s("set")&&(i.kind="set")),i.key||this.parsePropertyName(i);var n=i.key,o=!1;return i.computed||i.static||!("Identifier"===n.type&&"constructor"===n.name||"Literal"===n.type&&"constructor"===n.value)?i.static&&"Identifier"===n.type&&"prototype"===n.name&&this.raise(n.start,"Classes may not have a static property named prototype"):("method"!==i.kind&&this.raise(n.start,"Constructor can't have get/set modifier"),a&&this.raise(n.start,"Constructor can't be a generator"),r&&this.raise(n.start,"Constructor can't be an async method"),i.kind="constructor",o=t),this.parseClassMethod(i,a,r,o),"get"===i.kind&&0!==i.value.params.length&&this.raiseRecoverable(i.value.start,"getter should have no params"),"set"===i.kind&&1!==i.value.params.length&&this.raiseRecoverable(i.value.start,"setter should have exactly one param"),"set"===i.kind&&"RestElement"===i.value.params[0].type&&this.raiseRecoverable(i.value.params[0].start,"Setter cannot use rest params"),i},z.parseClassMethod=function(t,e,i,s){return t.value=this.parseMethod(e,i,s),this.finishNode(t,"MethodDefinition")},z.parseClassId=function(t,e){this.type===_.name?(t.id=this.parseIdent(),e&&this.checkLVal(t.id,2,!1)):(!0===e&&this.unexpected(),t.id=null)},z.parseClassSuper=function(t){t.superClass=this.eat(_._extends)?this.parseExprSubscripts():null},z.parseExport=function(t,e){if(this.next(),this.eat(_.star))return this.expectContextual("from"),this.type!==_.string&&this.unexpected(),t.source=this.parseExprAtom(),this.semicolon(),this.finishNode(t,"ExportAllDeclaration");if(this.eat(_._default)){var i;if(this.checkExport(e,"default",this.lastTokStart),this.type===_._function||(i=this.isAsyncFunction())){var s=this.startNode();this.next(),i&&this.next(),t.declaration=this.parseFunction(s,4|Y,!1,i)}else if(this.type===_._class){var a=this.startNode();t.declaration=this.parseClass(a,"nullableID")}else t.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(t,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())t.declaration=this.parseStatement(null),"VariableDeclaration"===t.declaration.type?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id.name,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==_.string&&this.unexpected(),t.source=this.parseExprAtom();else{for(var r=0,n=t.specifiers;r=6&&t)switch(t.type){case"Identifier":this.inAsync&&"await"===t.name&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var s=0,a=t.properties;s=8&&!r&&"async"===n.name&&!this.canInsertSemicolon()&&this.eat(_._function))return this.parseFunction(this.startNodeAt(s,a),0,!1,!0);if(i&&!this.canInsertSemicolon()){if(this.eat(_.arrow))return this.parseArrowExpression(this.startNodeAt(s,a),[n],!1);if(this.options.ecmaVersion>=8&&"async"===n.name&&this.type===_.name&&!r)return n=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(_.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(s,a),[n],!0)}return n;case _.regexp:var o=this.value;return(e=this.parseLiteral(o.value)).regex={pattern:o.pattern,flags:o.flags},e;case _.num:case _.string:return this.parseLiteral(this.value);case _._null:case _._true:case _._false:return(e=this.startNode()).value=this.type===_._null?null:this.type===_._true,e.raw=this.type.keyword,this.next(),this.finishNode(e,"Literal");case _.parenL:var h=this.start,p=this.parseParenAndDistinguishExpression(i);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(t.parenthesizedAssign=h),t.parenthesizedBind<0&&(t.parenthesizedBind=h)),p;case _.bracketL:return e=this.startNode(),this.next(),e.elements=this.parseExprList(_.bracketR,!0,!0,t),this.finishNode(e,"ArrayExpression");case _.braceL:return this.parseObj(!1,t);case _._function:return e=this.startNode(),this.next(),this.parseFunction(e,0);case _._class:return this.parseClass(this.startNode(),!1);case _._new:return this.parseNew();case _.backQuote:return this.parseTemplate();case _._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},tt.parseExprImport=function(){var t=this.startNode();switch(this.next(),this.type){case _.parenL:return this.parseDynamicImport(t);default:this.unexpected()}},tt.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),!this.eat(_.parenR)){var e=this.start;this.eat(_.comma)&&this.eat(_.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)}return this.finishNode(t,"ImportExpression")},tt.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),110===e.raw.charCodeAt(e.raw.length-1)&&(e.bigint=e.raw.slice(0,-1)),this.next(),this.finishNode(e,"Literal")},tt.parseParenExpression=function(){this.expect(_.parenL);var t=this.parseExpression();return this.expect(_.parenR),t},tt.parseParenAndDistinguishExpression=function(t){var e,i=this.start,s=this.startLoc,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var r,n=this.start,o=this.startLoc,h=[],p=!0,c=!1,u=new K,l=this.yieldPos,d=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==_.parenR;){if(p?p=!1:this.expect(_.comma),a&&this.afterTrailingComma(_.parenR,!0)){c=!0;break}if(this.type===_.ellipsis){r=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===_.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}h.push(this.parseMaybeAssign(!1,u,this.parseParenItem))}var f=this.start,m=this.startLoc;if(this.expect(_.parenR),t&&!this.canInsertSemicolon()&&this.eat(_.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=l,this.awaitPos=d,this.parseParenArrowList(i,s,h);h.length&&!c||this.unexpected(this.lastTokStart),r&&this.unexpected(r),this.checkExpressionErrors(u,!0),this.yieldPos=l||this.yieldPos,this.awaitPos=d||this.awaitPos,h.length>1?((e=this.startNodeAt(n,o)).expressions=h,this.finishNodeAt(e,"SequenceExpression",f,m)):e=h[0]}else e=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(i,s);return g.expression=e,this.finishNode(g,"ParenthesizedExpression")}return e},tt.parseParenItem=function(t){return t},tt.parseParenArrowList=function(t,e,i){return this.parseArrowExpression(this.startNodeAt(t,e),i)};var et=[];tt.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var t=this.startNode(),e=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(_.dot)){t.meta=e;var i=this.containsEsc;return t.property=this.parseIdent(!0),("target"!==t.property.name||i)&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is new.target"),this.inNonArrowFunction()||this.raiseRecoverable(t.start,"new.target can only be used in functions"),this.finishNode(t,"MetaProperty")}var s=this.start,a=this.startLoc,r=this.type===_._import;return t.callee=this.parseSubscripts(this.parseExprAtom(),s,a,!0),r&&"ImportExpression"===t.callee.type&&this.raise(s,"Cannot use new with import()"),this.eat(_.parenL)?t.arguments=this.parseExprList(_.parenR,this.options.ecmaVersion>=8,!1):t.arguments=et,this.finishNode(t,"NewExpression")},tt.parseTemplateElement=function(t){var e=t.isTagged,i=this.startNode();return this.type===_.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value,cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),i.tail=this.type===_.backQuote,this.finishNode(i,"TemplateElement")},tt.parseTemplate=function(t){void 0===t&&(t={});var e=t.isTagged;void 0===e&&(e=!1);var i=this.startNode();this.next(),i.expressions=[];var s=this.parseTemplateElement({isTagged:e});for(i.quasis=[s];!s.tail;)this.type===_.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(_.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(_.braceR),i.quasis.push(s=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(i,"TemplateLiteral")},tt.isAsyncProp=function(t){return!t.computed&&"Identifier"===t.key.type&&"async"===t.key.name&&(this.type===_.name||this.type===_.num||this.type===_.string||this.type===_.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===_.star)&&!b.test(this.input.slice(this.lastTokEnd,this.start))},tt.parseObj=function(t,e){var i=this.startNode(),s=!0,a={};for(i.properties=[],this.next();!this.eat(_.braceR);){if(s)s=!1;else if(this.expect(_.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(_.braceR))break;var r=this.parseProperty(t,e);t||this.checkPropClash(r,a,e),i.properties.push(r)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")},tt.parseProperty=function(t,e){var i,s,a,r,n=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(_.ellipsis))return t?(n.argument=this.parseIdent(!1),this.type===_.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(n,"RestElement")):(this.type===_.parenL&&e&&(e.parenthesizedAssign<0&&(e.parenthesizedAssign=this.start),e.parenthesizedBind<0&&(e.parenthesizedBind=this.start)),n.argument=this.parseMaybeAssign(!1,e),this.type===_.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(n,"SpreadElement"));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(t||e)&&(a=this.start,r=this.startLoc),t||(i=this.eat(_.star)));var o=this.containsEsc;return this.parsePropertyName(n),!t&&!o&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(n)?(s=!0,i=this.options.ecmaVersion>=9&&this.eat(_.star),this.parsePropertyName(n,e)):s=!1,this.parsePropertyValue(n,t,i,s,a,r,e,o),this.finishNode(n,"Property")},tt.parsePropertyValue=function(t,e,i,s,a,r,n,o){if((i||s)&&this.type===_.colon&&this.unexpected(),this.eat(_.colon))t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,n),t.kind="init";else if(this.options.ecmaVersion>=6&&this.type===_.parenL)e&&this.unexpected(),t.kind="init",t.method=!0,t.value=this.parseMethod(i,s);else if(e||o||!(this.options.ecmaVersion>=5)||t.computed||"Identifier"!==t.key.type||"get"!==t.key.name&&"set"!==t.key.name||this.type===_.comma||this.type===_.braceR)this.options.ecmaVersion>=6&&!t.computed&&"Identifier"===t.key.type?((i||s)&&this.unexpected(),this.checkUnreserved(t.key),"await"!==t.key.name||this.awaitIdentPos||(this.awaitIdentPos=a),t.kind="init",e?t.value=this.parseMaybeDefault(a,r,t.key):this.type===_.eq&&n?(n.shorthandAssign<0&&(n.shorthandAssign=this.start),t.value=this.parseMaybeDefault(a,r,t.key)):t.value=t.key,t.shorthand=!0):this.unexpected();else{(i||s)&&this.unexpected(),t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1);var h="get"===t.kind?0:1;if(t.value.params.length!==h){var p=t.value.start;"get"===t.kind?this.raiseRecoverable(p,"getter should have no params"):this.raiseRecoverable(p,"setter should have exactly one param")}else"set"===t.kind&&"RestElement"===t.value.params[0].type&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")}},tt.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(_.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(_.bracketR),t.key;t.computed=!1}return t.key=this.type===_.num||this.type===_.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},tt.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)},tt.parseMethod=function(t,e,i){var s=this.startNode(),a=this.yieldPos,r=this.awaitPos,n=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=t),this.options.ecmaVersion>=8&&(s.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|H(e,s.generator)|(i?128:0)),this.expect(_.parenL),s.params=this.parseBindingList(_.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0),this.yieldPos=a,this.awaitPos=r,this.awaitIdentPos=n,this.finishNode(s,"FunctionExpression")},tt.parseArrowExpression=function(t,e,i){var s=this.yieldPos,a=this.awaitPos,r=this.awaitIdentPos;return this.enterScope(16|H(i,!1)),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1),this.yieldPos=s,this.awaitPos=a,this.awaitIdentPos=r,this.finishNode(t,"ArrowFunctionExpression")},tt.parseFunctionBody=function(t,e,i){var s=e&&this.type!==_.braceL,a=this.strict,r=!1;if(s)t.body=this.parseMaybeAssign(),t.expression=!0,this.checkParams(t,!1);else{var n=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);a&&!n||(r=this.strictDirective(this.end))&&n&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list");var o=this.labels;this.labels=[],r&&(this.strict=!0),this.checkParams(t,!a&&!r&&!e&&!i&&this.isSimpleParamList(t.params)),t.body=this.parseBlock(!1),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=o}this.exitScope(),this.strict&&t.id&&this.checkLVal(t.id,5),this.strict=a},tt.isSimpleParamList=function(t){for(var e=0,i=t;e-1||a.functions.indexOf(t)>-1||a.var.indexOf(t)>-1,a.lexical.push(t),this.inModule&&1&a.flags&&delete this.undefinedExports[t]}else if(4===e){this.currentScope().lexical.push(t)}else if(3===e){var r=this.currentScope();s=this.treatFunctionsAsVar?r.lexical.indexOf(t)>-1:r.lexical.indexOf(t)>-1||r.var.indexOf(t)>-1,r.functions.push(t)}else for(var n=this.scopeStack.length-1;n>=0;--n){var o=this.scopeStack[n];if(o.lexical.indexOf(t)>-1&&!(32&o.flags&&o.lexical[0]===t)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(t)>-1){s=!0;break}if(o.var.push(t),this.inModule&&1&o.flags&&delete this.undefinedExports[t],o.flags&O)break}s&&this.raiseRecoverable(i,"Identifier '"+t+"' has already been declared")},st.checkLocalExport=function(t){-1===this.scopeStack[0].lexical.indexOf(t.name)&&-1===this.scopeStack[0].var.indexOf(t.name)&&(this.undefinedExports[t.name]=t)},st.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},st.currentVarScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&O)return e}},st.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&O&&!(16&e.flags))return e}};var rt=function(t,e,i){this.type="",this.start=e,this.end=0,t.options.locations&&(this.loc=new V(t,i)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[e,0])},nt=G.prototype;function ot(t,e,i,s){return t.type=e,t.end=i,this.options.locations&&(t.loc.end=s),this.options.ranges&&(t.range[1]=i),t}nt.startNode=function(){return new rt(this,this.start,this.startLoc)},nt.startNodeAt=function(t,e){return new rt(this,t,e)},nt.finishNode=function(t,e){return ot.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)},nt.finishNodeAt=function(t,e,i,s){return ot.call(this,t,e,i,s)};var ht=function(t,e,i,s,a){this.token=t,this.isExpr=!!e,this.preserveSpace=!!i,this.override=s,this.generator=!!a},pt={b_stat:new ht("{",!1),b_expr:new ht("{",!0),b_tmpl:new ht("${",!1),p_stat:new ht("(",!1),p_expr:new ht("(",!0),q_tmpl:new ht("`",!0,!0,function(t){return t.tryReadTemplateToken()}),f_stat:new ht("function",!1),f_expr:new ht("function",!0),f_expr_gen:new ht("function",!0,!1,null,!0),f_gen:new ht("function",!1,!1,null,!0)},ct=G.prototype;ct.initialContext=function(){return[pt.b_stat]},ct.braceIsBlock=function(t){var e=this.curContext();return e===pt.f_expr||e===pt.f_stat||(t!==_.colon||e!==pt.b_stat&&e!==pt.b_expr?t===_._return||t===_.name&&this.exprAllowed?b.test(this.input.slice(this.lastTokEnd,this.start)):t===_._else||t===_.semi||t===_.eof||t===_.parenR||t===_.arrow||(t===_.braceL?e===pt.b_stat:t!==_._var&&t!==_._const&&t!==_.name&&!this.exprAllowed):!e.isExpr)},ct.inGeneratorContext=function(){for(var t=this.context.length-1;t>=1;t--){var e=this.context[t];if("function"===e.token)return e.generator}return!1},ct.updateContext=function(t){var e,i=this.type;i.keyword&&t===_.dot?this.exprAllowed=!1:(e=i.updateContext)?e.call(this,t):this.exprAllowed=i.beforeExpr},_.parenR.updateContext=_.braceR.updateContext=function(){if(1!==this.context.length){var t=this.context.pop();t===pt.b_stat&&"function"===this.curContext().token&&(t=this.context.pop()),this.exprAllowed=!t.isExpr}else this.exprAllowed=!0},_.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?pt.b_stat:pt.b_expr),this.exprAllowed=!0},_.dollarBraceL.updateContext=function(){this.context.push(pt.b_tmpl),this.exprAllowed=!0},_.parenL.updateContext=function(t){var e=t===_._if||t===_._for||t===_._with||t===_._while;this.context.push(e?pt.p_stat:pt.p_expr),this.exprAllowed=!0},_.incDec.updateContext=function(){},_._function.updateContext=_._class.updateContext=function(t){!t.beforeExpr||t===_.semi||t===_._else||t===_._return&&b.test(this.input.slice(this.lastTokEnd,this.start))||(t===_.colon||t===_.braceL)&&this.curContext()===pt.b_stat?this.context.push(pt.f_stat):this.context.push(pt.f_expr),this.exprAllowed=!1},_.backQuote.updateContext=function(){this.curContext()===pt.q_tmpl?this.context.pop():this.context.push(pt.q_tmpl),this.exprAllowed=!1},_.star.updateContext=function(t){if(t===_._function){var e=this.context.length-1;this.context[e]===pt.f_expr?this.context[e]=pt.f_expr_gen:this.context[e]=pt.f_gen}this.exprAllowed=!0},_.name.updateContext=function(t){var e=!1;this.options.ecmaVersion>=6&&t!==_.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e};var ut="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",lt=ut+" Extended_Pictographic",dt={9:ut,10:lt,11:"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS Extended_Pictographic"},ft="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",mt="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",gt=mt+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",xt={9:mt,10:gt,11:"Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},vt={};function yt(t){var e=vt[t]={binary:L(dt[t]+" "+ft),nonBinary:{General_Category:L(ft),Script:L(xt[t])}};e.nonBinary.Script_Extensions=e.nonBinary.Script,e.nonBinary.gc=e.nonBinary.General_Category,e.nonBinary.sc=e.nonBinary.Script,e.nonBinary.scx=e.nonBinary.Script_Extensions}yt(9),yt(10),yt(11);var _t=G.prototype,bt=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":""),this.unicodeProperties=vt[t.options.ecmaVersion>=11?11:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function kt(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function St(t){return 36===t||t>=40&&t<=43||46===t||63===t||t>=91&&t<=94||t>=123&&t<=125}function Ct(t){return t>=65&&t<=90||t>=97&&t<=122}function wt(t){return Ct(t)||95===t}function Et(t){return wt(t)||At(t)}function At(t){return t>=48&&t<=57}function It(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function Pt(t){return t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:t-48}function Tt(t){return t>=48&&t<=55}bt.prototype.reset=function(t,e,i){var s=-1!==i.indexOf("u");this.start=0|t,this.source=e+"",this.flags=i,this.switchU=s&&this.parser.options.ecmaVersion>=6,this.switchN=s&&this.parser.options.ecmaVersion>=9},bt.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)},bt.prototype.at=function(t){var e=this.source,i=e.length;if(t>=i)return-1;var s=e.charCodeAt(t);if(!this.switchU||s<=55295||s>=57344||t+1>=i)return s;var a=e.charCodeAt(t+1);return a>=56320&&a<=57343?(s<<10)+a-56613888:s},bt.prototype.nextIndex=function(t){var e=this.source,i=e.length;if(t>=i)return i;var s,a=e.charCodeAt(t);return!this.switchU||a<=55295||a>=57344||t+1>=i||(s=e.charCodeAt(t+1))<56320||s>57343?t+1:t+2},bt.prototype.current=function(){return this.at(this.pos)},bt.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},bt.prototype.advance=function(){this.pos=this.nextIndex(this.pos)},bt.prototype.eat=function(t){return this.current()===t&&(this.advance(),!0)},_t.validateRegExpFlags=function(t){for(var e=t.validFlags,i=t.flags,s=0;s-1&&this.raise(t.start,"Duplicate regular expression flag")}},_t.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&t.groupNames.length>0&&(t.switchN=!0,this.regexp_pattern(t))},_t.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames.length=0,t.backReferenceNames.length=0,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(var e=0,i=t.backReferenceNames;e=9&&(i=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!i,!0}return t.pos=e,!1},_t.regexp_eatQuantifier=function(t,e){return void 0===e&&(e=!1),!!this.regexp_eatQuantifierPrefix(t,e)&&(t.eat(63),!0)},_t.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)},_t.regexp_eatBracedQuantifier=function(t,e){var i=t.pos;if(t.eat(123)){var s=0,a=-1;if(this.regexp_eatDecimalDigits(t)&&(s=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(a=t.lastIntValue),t.eat(125)))return-1!==a&&a=9?this.regexp_groupSpecifier(t):63===t.current()&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1},_t.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)},_t.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1},_t.regexp_eatSyntaxCharacter=function(t){var e=t.current();return!!St(e)&&(t.lastIntValue=e,t.advance(),!0)},_t.regexp_eatPatternCharacters=function(t){for(var e=t.pos,i=0;-1!==(i=t.current())&&!St(i);)t.advance();return t.pos!==e},_t.regexp_eatExtendedPatternCharacter=function(t){var e=t.current();return!(-1===e||36===e||e>=40&&e<=43||46===e||63===e||91===e||94===e||124===e)&&(t.advance(),!0)},_t.regexp_groupSpecifier=function(t){if(t.eat(63)){if(this.regexp_eatGroupName(t))return-1!==t.groupNames.indexOf(t.lastStringValue)&&t.raise("Duplicate capture group name"),void t.groupNames.push(t.lastStringValue);t.raise("Invalid group")}},_t.regexp_eatGroupName=function(t){if(t.lastStringValue="",t.eat(60)){if(this.regexp_eatRegExpIdentifierName(t)&&t.eat(62))return!0;t.raise("Invalid capture group name")}return!1},_t.regexp_eatRegExpIdentifierName=function(t){if(t.lastStringValue="",this.regexp_eatRegExpIdentifierStart(t)){for(t.lastStringValue+=kt(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=kt(t.lastIntValue);return!0}return!1},_t.regexp_eatRegExpIdentifierStart=function(t){var e=t.pos,i=t.current();return t.advance(),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(t)&&(i=t.lastIntValue),function(t){return l(t,!0)||36===t||95===t}(i)?(t.lastIntValue=i,!0):(t.pos=e,!1)},_t.regexp_eatRegExpIdentifierPart=function(t){var e=t.pos,i=t.current();return t.advance(),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(t)&&(i=t.lastIntValue),function(t){return d(t,!0)||36===t||95===t||8204===t||8205===t}(i)?(t.lastIntValue=i,!0):(t.pos=e,!1)},_t.regexp_eatAtomEscape=function(t){return!!(this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t))||(t.switchU&&(99===t.current()&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)},_t.regexp_eatBackReference=function(t){var e=t.pos;if(this.regexp_eatDecimalEscape(t)){var i=t.lastIntValue;if(t.switchU)return i>t.maxBackReference&&(t.maxBackReference=i),!0;if(i<=t.numCapturingParens)return!0;t.pos=e}return!1},_t.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1},_t.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)},_t.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1},_t.regexp_eatZero=function(t){return 48===t.current()&&!At(t.lookahead())&&(t.lastIntValue=0,t.advance(),!0)},_t.regexp_eatControlEscape=function(t){var e=t.current();return 116===e?(t.lastIntValue=9,t.advance(),!0):110===e?(t.lastIntValue=10,t.advance(),!0):118===e?(t.lastIntValue=11,t.advance(),!0):102===e?(t.lastIntValue=12,t.advance(),!0):114===e&&(t.lastIntValue=13,t.advance(),!0)},_t.regexp_eatControlLetter=function(t){var e=t.current();return!!Ct(e)&&(t.lastIntValue=e%32,t.advance(),!0)},_t.regexp_eatRegExpUnicodeEscapeSequence=function(t){var e,i=t.pos;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){var s=t.lastIntValue;if(t.switchU&&s>=55296&&s<=56319){var a=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){var r=t.lastIntValue;if(r>=56320&&r<=57343)return t.lastIntValue=1024*(s-55296)+(r-56320)+65536,!0}t.pos=a,t.lastIntValue=s}return!0}if(t.switchU&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&((e=t.lastIntValue)>=0&&e<=1114111))return!0;t.switchU&&t.raise("Invalid unicode escape"),t.pos=i}return!1},_t.regexp_eatIdentityEscape=function(t){if(t.switchU)return!!this.regexp_eatSyntaxCharacter(t)||!!t.eat(47)&&(t.lastIntValue=47,!0);var e=t.current();return!(99===e||t.switchN&&107===e)&&(t.lastIntValue=e,t.advance(),!0)},_t.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;var e=t.current();if(e>=49&&e<=57){do{t.lastIntValue=10*t.lastIntValue+(e-48),t.advance()}while((e=t.current())>=48&&e<=57);return!0}return!1},_t.regexp_eatCharacterClassEscape=function(t){var e=t.current();if(function(t){return 100===t||68===t||115===t||83===t||119===t||87===t}(e))return t.lastIntValue=-1,t.advance(),!0;if(t.switchU&&this.options.ecmaVersion>=9&&(80===e||112===e)){if(t.lastIntValue=-1,t.advance(),t.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(t)&&t.eat(125))return!0;t.raise("Invalid property name")}return!1},_t.regexp_eatUnicodePropertyValueExpression=function(t){var e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){var i=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){var s=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,i,s),!0}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){var a=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,a),!0}return!1},_t.regexp_validateUnicodePropertyNameAndValue=function(t,e,i){P(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(i)||t.raise("Invalid property value")},_t.regexp_validateUnicodePropertyNameOrValue=function(t,e){t.unicodeProperties.binary.test(e)||t.raise("Invalid property name")},_t.regexp_eatUnicodePropertyName=function(t){var e=0;for(t.lastStringValue="";wt(e=t.current());)t.lastStringValue+=kt(e),t.advance();return""!==t.lastStringValue},_t.regexp_eatUnicodePropertyValue=function(t){var e=0;for(t.lastStringValue="";Et(e=t.current());)t.lastStringValue+=kt(e),t.advance();return""!==t.lastStringValue},_t.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)},_t.regexp_eatCharacterClass=function(t){if(t.eat(91)){if(t.eat(94),this.regexp_classRanges(t),t.eat(93))return!0;t.raise("Unterminated character class")}return!1},_t.regexp_classRanges=function(t){for(;this.regexp_eatClassAtom(t);){var e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){var i=t.lastIntValue;!t.switchU||-1!==e&&-1!==i||t.raise("Invalid character class"),-1!==e&&-1!==i&&e>i&&t.raise("Range out of order in character class")}}},_t.regexp_eatClassAtom=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){var i=t.current();(99===i||Tt(i))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}var s=t.current();return 93!==s&&(t.lastIntValue=s,t.advance(),!0)},_t.regexp_eatClassEscape=function(t){var e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)},_t.regexp_eatClassControlLetter=function(t){var e=t.current();return!(!At(e)&&95!==e)&&(t.lastIntValue=e%32,t.advance(),!0)},_t.regexp_eatHexEscapeSequence=function(t){var e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1},_t.regexp_eatDecimalDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;At(i=t.current());)t.lastIntValue=10*t.lastIntValue+(i-48),t.advance();return t.pos!==e},_t.regexp_eatHexDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;It(i=t.current());)t.lastIntValue=16*t.lastIntValue+Pt(i),t.advance();return t.pos!==e},_t.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){var e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){var i=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=64*e+8*i+t.lastIntValue:t.lastIntValue=8*e+i}else t.lastIntValue=e;return!0}return!1},_t.regexp_eatOctalDigit=function(t){var e=t.current();return Tt(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)},_t.regexp_eatFixedHexDigits=function(t,e){var i=t.pos;t.lastIntValue=0;for(var s=0;s>10),56320+(1023&t)))}Nt.next=function(t){!t&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Lt(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Nt.getToken=function(){return this.next(),new Lt(this)},"undefined"!=typeof Symbol&&(Nt[Symbol.iterator]=function(){var t=this;return{next:function(){var e=t.getToken();return{done:e.type===_.eof,value:e}}}}),Nt.curContext=function(){return this.context[this.context.length-1]},Nt.nextToken=function(){var t=this.curContext();return t&&t.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(_.eof):t.override?t.override(this):void this.readToken(this.fullCharCodeAtPos())},Nt.readToken=function(t){return l(t,this.options.ecmaVersion>=6)||92===t?this.readWord():this.getTokenFromCode(t)},Nt.fullCharCodeAtPos=function(){var t=this.input.charCodeAt(this.pos);return t<=55295||t>=57344?t:(t<<10)+this.input.charCodeAt(this.pos+1)-56613888},Nt.skipBlockComment=function(){var t,e=this.options.onComment&&this.curPosition(),i=this.pos,s=this.input.indexOf("*/",this.pos+=2);if(-1===s&&this.raise(this.pos-2,"Unterminated comment"),this.pos=s+2,this.options.locations)for(k.lastIndex=i;(t=k.exec(this.input))&&t.index8&&t<14||t>=5760&&C.test(String.fromCharCode(t))))break t;++this.pos}}},Nt.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=t,this.value=e,this.updateContext(i)},Nt.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===t&&46===e?(this.pos+=3,this.finishToken(_.ellipsis)):(++this.pos,this.finishToken(_.dot))},Nt.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===t?this.finishOp(_.assign,2):this.finishOp(_.slash,1)},Nt.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),i=1,s=42===t?_.star:_.modulo;return this.options.ecmaVersion>=7&&42===t&&42===e&&(++i,s=_.starstar,e=this.input.charCodeAt(this.pos+2)),61===e?this.finishOp(_.assign,i+1):this.finishOp(s,i)},Nt.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?this.finishOp(124===t?_.logicalOR:_.logicalAND,2):61===e?this.finishOp(_.assign,2):this.finishOp(124===t?_.bitwiseOR:_.bitwiseAND,1)},Nt.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(_.assign,2):this.finishOp(_.bitwiseXOR,1)},Nt.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?45!==e||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!b.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(_.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===e?this.finishOp(_.assign,2):this.finishOp(_.plusMin,1)},Nt.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),i=1;return e===t?(i=62===t&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(_.assign,i+1):this.finishOp(_.bitShift,i)):33!==e||60!==t||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===e&&(i=2),this.finishOp(_.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Nt.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return 61===e?this.finishOp(_.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===t&&62===e&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(_.arrow)):this.finishOp(61===t?_.eq:_.prefix,1)},Nt.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(_.parenL);case 41:return++this.pos,this.finishToken(_.parenR);case 59:return++this.pos,this.finishToken(_.semi);case 44:return++this.pos,this.finishToken(_.comma);case 91:return++this.pos,this.finishToken(_.bracketL);case 93:return++this.pos,this.finishToken(_.bracketR);case 123:return++this.pos,this.finishToken(_.braceL);case 125:return++this.pos,this.finishToken(_.braceR);case 58:return++this.pos,this.finishToken(_.colon);case 63:return++this.pos,this.finishToken(_.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(_.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(120===e||88===e)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===e||79===e)return this.readRadixNumber(8);if(98===e||66===e)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 126:return this.finishOp(_.prefix,1)}this.raise(this.pos,"Unexpected character '"+Vt(t)+"'")},Nt.finishOp=function(t,e){var i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)},Nt.readRegexp=function(){for(var t,e,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(b.test(s)&&this.raise(i,"Unterminated regular expression"),t)t=!1;else{if("["===s)e=!0;else if("]"===s&&e)e=!1;else if("/"===s&&!e)break;t="\\"===s}++this.pos}var a=this.input.slice(i,this.pos);++this.pos;var r=this.pos,n=this.readWord1();this.containsEsc&&this.unexpected(r);var o=this.regexpState||(this.regexpState=new bt(this));o.reset(i,a,n),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var h=null;try{h=new RegExp(a,n)}catch(t){}return this.finishToken(_.regexp,{pattern:a,flags:n,value:h})},Nt.readInt=function(t,e){for(var i=this.pos,s=0,a=0,r=null==e?1/0:e;a=97?n-97+10:n>=65?n-65+10:n>=48&&n<=57?n-48:1/0)>=t)break;++this.pos,s=s*t+o}return this.pos===i||null!=e&&this.pos-i!==e?null:s},Nt.readRadixNumber=function(t){var e=this.pos;this.pos+=2;var i=this.readInt(t);return null==i&&this.raise(this.start+2,"Expected number in radix "+t),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(i="undefined"!=typeof BigInt?BigInt(this.input.slice(e,this.pos)):null,++this.pos):l(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(_.num,i)},Nt.readNumber=function(t){var e=this.pos;t||null!==this.readInt(10)||this.raise(e,"Invalid number");var i=this.pos-e>=2&&48===this.input.charCodeAt(e);i&&this.strict&&this.raise(e,"Invalid number");var s=this.input.charCodeAt(this.pos);if(!i&&!t&&this.options.ecmaVersion>=11&&110===s){var a=this.input.slice(e,this.pos),r="undefined"!=typeof BigInt?BigInt(a):null;return++this.pos,l(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(_.num,r)}i&&/[89]/.test(this.input.slice(e,this.pos))&&(i=!1),46!==s||i||(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),69!==s&&101!==s||i||(43!==(s=this.input.charCodeAt(++this.pos))&&45!==s||++this.pos,null===this.readInt(10)&&this.raise(e,"Invalid number")),l(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=this.input.slice(e,this.pos),o=i?parseInt(n,8):parseFloat(n);return this.finishToken(_.num,o)},Nt.readCodePoint=function(){var t;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var e=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(e,"Code point out of bounds")}else t=this.readHexChar(4);return t},Nt.readString=function(t){for(var e="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var s=this.input.charCodeAt(this.pos);if(s===t)break;92===s?(e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(!1),i=this.pos):(S(s,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(i,this.pos++),this.finishToken(_.string,e)};var Rt={};Nt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t!==Rt)throw t;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Nt.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Rt;this.raise(t,e)},Nt.readTmplToken=function(){for(var t="",e=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(96===i||36===i&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==_.template&&this.type!==_.invalidTemplate?(t+=this.input.slice(e,this.pos),this.finishToken(_.template,t)):36===i?(this.pos+=2,this.finishToken(_.dollarBraceL)):(++this.pos,this.finishToken(_.backQuote));if(92===i)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(S(i)){switch(t+=this.input.slice(e,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:t+="\n";break;default:t+=String.fromCharCode(i)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}},Nt.readInvalidTemplateToken=function(){for(;this.pos=48&&e<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],a=parseInt(s,8);return a>255&&(s=s.slice(0,-1),a=parseInt(s,8)),this.pos+=s.length-1,e=this.input.charCodeAt(this.pos),"0"===s&&56!==e&&57!==e||!this.strict&&!t||this.invalidStringToken(this.pos-1-s.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(a)}return S(e)?"":String.fromCharCode(e)}},Nt.readHexChar=function(t){var e=this.pos,i=this.readInt(16,t);return null===i&&this.invalidStringToken(e,"Bad character escape sequence"),i},Nt.readWord1=function(){this.containsEsc=!1;for(var t="",e=!0,i=this.pos,s=this.options.ecmaVersion>=6;this.pos=0||r<0&&parseInt(r)===r}var binaryOperators={"+":"add","-":"sub","*":"multiply","/":"divide","**":"power","%":"modulo",">":"greater",">=":"greaterorequal","<":"less","<=":"lessorequal","+=":"plusequal","-=":"minusequal","*=":"timesequal","/=":"divideequal"},unaryOperators={"-":"negate","+":"plus"};function papercompile(r){var e=[];function a(r){for(var a=0,n=e.length;a=r)break;r+=t[1]}return r}function n(e){return r.substring(a(e.range[0]),a(e.range[1]))}function t(n,t){for(var i=a(n.range[0]),o=a(n.range[1]),s=0,u=e.length-1;u>=0;u--)if(i>e[u][0]){s=u+1;break}e.splice(s,0,[i,t.length-o+i]),r=r.substring(0,i)+t+r.substring(o)}return function r(e,a){if(e){for(var i in e)if("range"!==i){var o=e[i];if(Array.isArray(o))for(var s=0,u=o.length;s-1)}).__argnames__||Object.defineProperties(_,{__argnames__:{value:["x"]},__module__:{value:"__main__"}}),_}function options_object(e){return(_=function(){return"object"==typeof arguments[arguments.length-1]&&(arguments[ρσ_bound_index(arguments.length-1,arguments)][ρσ_kwargs_symbol]=!0),e.apply(this,arguments)}).__module__||Object.defineProperties(_,{__module__:{value:"__main__"}}),_;var _}function ρσ_id(e){return e.ρσ_object_id}function ρσ_dir(e){var _;for(var t in _=ρσ_list_decorate([]),e)_.push(t);return _}function ρσ_ord(e){var _,t;if(55296<=(_=e.charCodeAt(0))&&_<=56319){if(56320<=(t=e.charCodeAt(1))&&t<=57343)return 1024*(_-55296)+t-56320+65536;throw new TypeError("string is missing the low surrogate char")}return _}function ρσ_chr(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function ρσ_callable(e){return"function"==typeof e}function ρσ_bin(e){var _;if("number"!=typeof e||e%1!=0)throw new TypeError("integer required");return _="-"===(_=e.toString(2))[0]?"-0b"+_.slice(1):"0b"+_}function ρσ_hex(e){var _;if("number"!=typeof e||e%1!=0)throw new TypeError("integer required");return _="-"===(_=e.toString(16))[0]?"-0x"+_.slice(1):"0x"+_}function ρσ_enumerate(e){var _,t,r;return(_={_i:-1})[ρσ_iterator_symbol]=((r=function(){return this}).__module__||Object.defineProperties(r,{__module__:{value:"__main__"}}),r),ρσ_arraylike(e)?(_.next=function(){var _=function(){return this._i+=1,this._i-1?{done:!1,value:e[this._i]}:{done:!0}}).__module__||Object.defineProperties(t,{__module__:{value:"__main__"}}),t),_[ρσ_iterator_symbol]=function(){var e=function(){return this};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),_;throw new TypeError("reversed() can only be called on arrays or strings")}function ρσ_iter(e){var _,t;return"function"==typeof e[ρσ_iterator_symbol]?"function"==typeof Map&&e instanceof Map?e.keys():e[ρσ_iterator_symbol]():ρσ_arraylike(e)?((_={_i:-1})[ρσ_iterator_symbol]=((t=function(){return this}).__module__||Object.defineProperties(t,{__module__:{value:"__main__"}}),t),_.next=function(){var _=function(){return this._i+=1,this._i=_?(t=[this.__i,-1],this._i=t[0],this._idx=t[1],{done:!0}):{done:!1,value:this._i}}function ρσ_range(e,_,t){var r,n,i;return arguments.length<=1&&(_=e||0,e=0),t=arguments[2]||1,r=Math.max(Math.ceil((_-e)/t),0),(n={start:e,step:t,stop:_})[ρσ_iterator_symbol]=((i=function(){var _,n;return(_={_i:e-t,_idx:-1}).next=ρσ_range_next.bind(_,t,r),_[ρσ_iterator_symbol]=((n=function(){return this}).__module__||Object.defineProperties(n,{__module__:{value:"__main__"}}),n),_}).__module__||Object.defineProperties(i,{__module__:{value:"__main__"}}),i),n.count=function(){var e=function(e){return this._cached||(this._cached=list(this)),this._cached.count(e)};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["val"]},__module__:{value:"__main__"}}),e}(),n.index=function(){var e=function(e){return this._cached||(this._cached=list(this)),this._cached.index(e)};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["val"]},__module__:{value:"__main__"}}),e}(),n.__len__=function(){var e=function(){return r};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),n.__repr__=function(){var r=function(){return"range("+ρσ_str.format("{}",e)+", "+ρσ_str.format("{}",_)+", "+ρσ_str.format("{}",t)+")"};return r.__module__||Object.defineProperties(r,{__module__:{value:"__main__"}}),r}(),n.__str__=n.toString=n.__repr__,"function"==typeof Proxy&&(n=new Proxy(n,function(){var e,_={};return _.get=((e=function(e,_){var t;return"string"==typeof _&&(t=parseInt(_),isNaN(t)||(_=t)),"number"==typeof _?(e._cached||(e._cached=list(e)),(ρσ_expr_temp=e._cached)["number"==typeof _&&_<0?ρσ_expr_temp.length+_:_]):e["number"==typeof _&&_<0?e.length+_:_]}).__argnames__||Object.defineProperties(e,{__argnames__:{value:["obj","prop"]},__module__:{value:"__main__"}}),e),_}.call(this))),n}function ρσ_getattr(e,_,t){var r;try{r=e["number"==typeof _&&_<0?e.length+_:_]}catch(e){if(ρσ_last_exception=e,e instanceof TypeError){if(void 0===t)throw new AttributeError("The attribute "+_+" is not present");return t}throw e}if(void 0===r&&!(_ in e)){if(void 0===t)throw new AttributeError("The attribute "+_+" is not present");r=t}return r}function ρσ_setattr(e,_,t){e["number"==typeof _&&_<0?e.length+_:_]=t}function ρσ_hasattr(e,_){return _ in e}function ρσ_get_module(e){return ρσ_modules["number"==typeof e&&e<0?ρσ_modules.length+e:e]}function ρσ_pow(e,_,t){var r;return r=Math.pow(e,_),void 0!==t&&(r%=t),r}function ρσ_type(e){return e.constructor}function ρσ_divmod(e,_){var t;if(0===_)throw new ZeroDivisionError("integer division or modulo by zero");return[t=Math.floor(e/_),e-t*_]}function ρσ_max(){var e=arguments[arguments.length-1];null!==e&&"object"==typeof e&&!0===e[ρσ_kwargs_symbol]||(e={});var _=Array.prototype.slice.call(arguments,0);if(null!==e&&"object"==typeof e&&!0===e[ρσ_kwargs_symbol]&&_.pop(),0===_.length){if(void 0!==e.defval)return e.defval;throw new TypeError("expected at least one argument")}if(1===_.length&&(_=_[0]),e.key&&(_=function(){for(var t,r=ρσ_Iterable(_),n=[],i=0;ie;t--)(ρσ_expr_temp=this)["number"==typeof t&&t<0?ρσ_expr_temp.length+t:t]=(ρσ_expr_temp=this)[ρσ_bound_index(t-1,ρσ_expr_temp)];(ρσ_expr_temp=this)["number"==typeof e&&e<0?ρσ_expr_temp.length+e:e]=_}else this.unshift(_)}function ρσ_list_copy(){return ρσ_list_constructor(this)}function ρσ_list_clear(){this.length=0}function ρσ_list_as_array(){return Array.prototype.slice.call(this)}function ρσ_list_count(e){return this.reduce(((_=function(_,t){return _+(t===e)}).__argnames__||Object.defineProperties(_,{__argnames__:{value:["n","val"]},__module__:{value:"__main__"}}),_),0);var _}function ρσ_list_sort_key(e){var _;return"string"===(_=typeof e)||"number"===_?e:e.toString()}function ρσ_list_sort_cmp(e,_,t,r){return e<_?-1:e>_?1:t-r}function ρσ_list_sort(){var e,_,t,r,n,i=void 0===arguments[0]||0==arguments.length-1&&null!==arguments[arguments.length-1]&&"object"==typeof arguments[arguments.length-1]&&!0===arguments[arguments.length-1][ρσ_kwargs_symbol]?ρσ_list_sort.__defaults__.key:arguments[0],o=void 0===arguments[1]||1==arguments.length-1&&null!==arguments[arguments.length-1]&&"object"==typeof arguments[arguments.length-1]&&!0===arguments[arguments.length-1][ρσ_kwargs_symbol]?ρσ_list_sort.__defaults__.reverse:arguments[1],a=arguments[arguments.length-1];null!==a&&"object"==typeof a&&!0===a[ρσ_kwargs_symbol]||(a={}),Object.prototype.hasOwnProperty.call(a,"key")&&(i=a.key),Object.prototype.hasOwnProperty.call(a,"reverse")&&(o=a.reverse),i=i||ρσ_list_sort_key,e=o?-1:1,_=dict(),t=dict();for(var s=0;s=this._list.length?function(){var e={done:!0};return e}.call(this):function(){var e={done:!1};return e.value=(ρσ_expr_temp=this._list)[ρσ_bound_index(this._i,ρσ_expr_temp)],e}.call(this)}).__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e),t}.call(this)}function ρσ_list_len(){return this.length}function ρσ_list_contains(e){for(var _=0;_=this._keys.length?{done:!0}:{done:!1,value:this._s[this._keys[this._i]]}};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),_};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["x"]},__module__:{value:"__main__"}}),e}(),ρσ_set_implementation="function"!=typeof Set||"function"!=typeof Set.prototype.delete?ρσ_set_polyfill:Set,ρσ_set.__argnames__||Object.defineProperties(ρσ_set,{__argnames__:{value:["iterable"]},__module__:{value:"__main__"}}),ρσ_set.prototype.__name__="set",Object.defineProperties(ρσ_set.prototype,function(){var e={};return e.length=function(){var e,_={};return _.get=((e=function(){return this.jsset.size}).__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e),_}.call(this),e.size=function(){var e,_={};return _.get=((e=function(){return this.jsset.size}).__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e),_}.call(this),e}.call(this)),ρσ_set.prototype.__len__=function(){var e=function(){return this.jsset.size};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),ρσ_set.prototype.has=ρσ_set.prototype.__contains__=function(){var e=function(e){return this.jsset.has(e)};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["x"]},__module__:{value:"__main__"}}),e}(),ρσ_set.prototype.add=function(){var e=function(e){this.jsset.add(e)};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["x"]},__module__:{value:"__main__"}}),e}(),ρσ_set.prototype.clear=function(){var e=function(){this.jsset.clear()};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),ρσ_set.prototype.copy=function(){var e=function(){return ρσ_set(this)};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),ρσ_set.prototype.discard=function(){var e=function(e){this.jsset.delete(e)};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["x"]},__module__:{value:"__main__"}}),e}(),ρσ_set.prototype[ρσ_iterator_symbol]=function(){var e=function(){return this.jsset.values()};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),ρσ_set.prototype.difference=function(){var e=function(){var e,_,t,r,n,i;for(_=(e=new ρσ_set).jsset,r=(t=this.jsset.values()).next();!r.done;){n=r.value,i=!1;for(var o=0;o=this._keys.length?{done:!0}:{done:!1,value:this._s[this._keys[this._i]][1]}};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),_};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["x"]},__module__:{value:"__main__"}}),e}(),ρσ_dict_polyfill.prototype.keys=function(){var e=function(e){var _,t;return(_={_keys:Object.keys(this._store),_i:-1,_s:this._store})[ρσ_iterator_symbol]=((t=function(){return this}).__module__||Object.defineProperties(t,{__module__:{value:"__main__"}}),t),_.next=function(){var e=function(){return this._i+=1,this._i>=this._keys.length?{done:!0}:{done:!1,value:this._s[this._keys[this._i]][0]}};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),_};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["x"]},__module__:{value:"__main__"}}),e}(),ρσ_dict_polyfill.prototype.entries=function(){var e=function(e){var _,t;return(_={_keys:Object.keys(this._store),_i:-1,_s:this._store})[ρσ_iterator_symbol]=((t=function(){return this}).__module__||Object.defineProperties(t,{__module__:{value:"__main__"}}),t),_.next=function(){var e=function(){return this._i+=1,this._i>=this._keys.length?{done:!0}:{done:!1,value:this._s[this._keys[this._i]]}};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),_};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["x"]},__module__:{value:"__main__"}}),e}(),ρσ_dict_implementation="function"!=typeof Map||"function"!=typeof Map.prototype.delete?ρσ_dict_polyfill:Map,ρσ_dict.__handles_kwarg_interpolation__||Object.defineProperties(ρσ_dict,{__handles_kwarg_interpolation__:{value:!0},__argnames__:{value:["iterable"]},__module__:{value:"__main__"}}),ρσ_dict.prototype.__name__="dict",Object.defineProperties(ρσ_dict.prototype,function(){var e={};return e.length=function(){var e,_={};return _.get=((e=function(){return this.jsmap.size}).__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e),_}.call(this),e.size=function(){var e,_={};return _.get=((e=function(){return this.jsmap.size}).__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e),_}.call(this),e}.call(this)),ρσ_dict.prototype.__len__=function(){var e=function(){return this.jsmap.size};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),ρσ_dict.prototype.has=ρσ_dict.prototype.__contains__=function(){var e=function(e){return this.jsmap.has(e)};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["x"]},__module__:{value:"__main__"}}),e}(),ρσ_dict.prototype.set=ρσ_dict.prototype.__setitem__=function(){var e=function(e,_){this.jsmap.set(e,_)};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["key","value"]},__module__:{value:"__main__"}}),e}(),ρσ_dict.prototype.__delitem__=function(){var e=function(e){this.jsmap.delete(e)};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["key"]},__module__:{value:"__main__"}}),e}(),ρσ_dict.prototype.clear=function(){var e=function(){this.jsmap.clear()};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),ρσ_dict.prototype.copy=function(){var e=function(){return ρσ_dict(this)};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),ρσ_dict.prototype.keys=function(){var e=function(){return this.jsmap.keys()};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),ρσ_dict.prototype.values=function(){var e=function(){return this.jsmap.values()};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),ρσ_dict.prototype.items=ρσ_dict.prototype.entries=function(){var e=function(){return this.jsmap.entries()};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),ρσ_dict.prototype[ρσ_iterator_symbol]=function(){var e=function(){return this.jsmap.keys()};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),ρσ_dict.prototype.__getitem__=function(){var e=function(e){var _;if(void 0===(_=this.jsmap.get(e))&&!this.jsmap.has(e))throw new KeyError(e+"");return _};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["key"]},__module__:{value:"__main__"}}),e}(),ρσ_dict.prototype.get=function(){var e=function(e,_){var t;return void 0!==(t=this.jsmap.get(e))||this.jsmap.has(e)?t:void 0===_?null:_};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["key","defval"]},__module__:{value:"__main__"}}),e}(),ρσ_dict.prototype.set_default=ρσ_dict.prototype.setdefault=function(){var e=function(e,_){var t;return(t=this.jsmap).has(e)?t.get(e):(t.set(e,_),_)};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["key","defval"]},__module__:{value:"__main__"}}),e}(),ρσ_dict.fromkeys=ρσ_dict.prototype.fromkeys=function(){var e=function(){var _,t,r,n=0==arguments.length-1&&null!==arguments[arguments.length-1]&&"object"==typeof arguments[arguments.length-1]&&!0===arguments[arguments.length-1][ρσ_kwargs_symbol]?void 0:arguments[0],i=void 0===arguments[1]||1==arguments.length-1&&null!==arguments[arguments.length-1]&&"object"==typeof arguments[arguments.length-1]&&!0===arguments[arguments.length-1][ρσ_kwargs_symbol]?e.__defaults__.value:arguments[1],o=arguments[arguments.length-1];for(null!==o&&"object"==typeof o&&!0===o[ρσ_kwargs_symbol]||(o={}),Object.prototype.hasOwnProperty.call(o,"value")&&(i=o.value),_=ρσ_dict(),r=(t=iter(n)).next();!r.done;)_.set(r.value,i),r=t.next();return _};return e.__defaults__||Object.defineProperties(e,{__defaults__:{value:{value:null}},__handles_kwarg_interpolation__:{value:!0},__argnames__:{value:["iterable","value"]},__module__:{value:"__main__"}}),e}(),ρσ_dict.prototype.pypop=function(){var e=function(e,_){var t;if(void 0===(t=this.jsmap.get(e))&&!this.jsmap.has(e)){if(void 0===_)throw new KeyError(e);return _}return this.jsmap.delete(e),t};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["key","defval"]},__module__:{value:"__main__"}}),e}(),ρσ_dict.prototype.popitem=function(){var e=function(){var e,_,t;for(e=null,_=this.jsmap.entries();;){if((t=_.next()).done){if(null===e)throw new KeyError("dict is empty");return this.jsmap.delete(e.value[0]),e.value}e=t}};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),ρσ_dict.prototype.update=function(){var e=function(){var e,_,t,r,n;if(0!==arguments.length){if(e=this.jsmap,_=arguments[0],Array.isArray(_))for(var i=0;i<_.length;i++)e.set(_["number"==typeof i&&i<0?_.length+i:i][0],_["number"==typeof i&&i<0?_.length+i:i][1]);else if(_ instanceof ρσ_dict)for(r=(t=_.items()).next();!r.done;)e.set(r.value[0],r.value[1]),r=t.next();else if("function"==typeof Map&&_ instanceof Map)for(r=(t=_.entries()).next();!r.done;)e.set(r.value[0],r.value[1]),r=t.next();else if("function"==typeof _[ρσ_iterator_symbol])for(r=(t=_[ρσ_iterator_symbol]()).next();!r.done;)e.set(r.value[0],r.value[1]),r=t.next();else{n=Object.keys(_);for(var o=0;o1&&ρσ_dict.prototype.update.call(this,arguments[1])}};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),ρσ_dict.prototype.toString=ρσ_dict.prototype.inspect=ρσ_dict.prototype.__str__=ρσ_dict.prototype.__repr__=function(){var e=function(){var e,_,t;for(e=[],t=(_=this.jsmap.entries()).next();!t.done;)e.push(ρσ_repr(t.value[0])+": "+ρσ_repr(t.value[1])),t=_.next();return"{"+e.join(", ")+"}"};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}(),ρσ_dict.prototype.__eq__=function(){var e=function(e){var _,t,r;if(!(e instanceof this.constructor))return!1;if(e.size!==this.size)return!1;if(0===e.size)return!0;for(t=(_=e.items()).next();!t.done;){if(void 0===(r=this.jsmap.get(t.value[0]))&&!this.jsmap.has(t.value[0])||r!==t.value[1])return!1;t=_.next()}return!0};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["other"]},__module__:{value:"__main__"}}),e}(),ρσ_dict.prototype.as_object=function(){var e=function(e){var _,t,r;for(_={},r=(t=this.jsmap.entries()).next();!r.done;)_[ρσ_bound_index(r.value[0],_)]=r.value[1],r=t.next();return _};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["other"]},__module__:{value:"__main__"}}),e}(),ρσ_dict_wrap.__argnames__||Object.defineProperties(ρσ_dict_wrap,{__argnames__:{value:["x"]},__module__:{value:"__main__"}});var NameError,ρσ_in,ρσ_desugar_kwargs,ρσ_exists,decimal_sep,define_str_func,ρσ_unpack,ρσ_orig_split,ρσ_orig_replace,dict=ρσ_dict,dict_wrap=ρσ_dict_wrap;function Exception(){void 0===this.ρσ_object_id&&Object.defineProperty(this,"ρσ_object_id",{value:++ρσ_object_counter}),Exception.prototype.__init__.apply(this,arguments)}function AttributeError(){void 0===this.ρσ_object_id&&Object.defineProperty(this,"ρσ_object_id",{value:++ρσ_object_counter}),AttributeError.prototype.__init__.apply(this,arguments)}function IndexError(){void 0===this.ρσ_object_id&&Object.defineProperty(this,"ρσ_object_id",{value:++ρσ_object_counter}),IndexError.prototype.__init__.apply(this,arguments)}function KeyError(){void 0===this.ρσ_object_id&&Object.defineProperty(this,"ρσ_object_id",{value:++ρσ_object_counter}),KeyError.prototype.__init__.apply(this,arguments)}function ValueError(){void 0===this.ρσ_object_id&&Object.defineProperty(this,"ρσ_object_id",{value:++ρσ_object_counter}),ValueError.prototype.__init__.apply(this,arguments)}function UnicodeDecodeError(){void 0===this.ρσ_object_id&&Object.defineProperty(this,"ρσ_object_id",{value:++ρσ_object_counter}),UnicodeDecodeError.prototype.__init__.apply(this,arguments)}function AssertionError(){void 0===this.ρσ_object_id&&Object.defineProperty(this,"ρσ_object_id",{value:++ρσ_object_counter}),AssertionError.prototype.__init__.apply(this,arguments)}function ZeroDivisionError(){void 0===this.ρσ_object_id&&Object.defineProperty(this,"ρσ_object_id",{value:++ρσ_object_counter}),ZeroDivisionError.prototype.__init__.apply(this,arguments)}function ρσ_eslice(e,_,t,r){var n,i;return("string"==typeof e||e instanceof String)&&(n=!0,e=e.split("")),_<0&&(_=-_,e=e.slice().reverse(),void 0!==t&&(t=e.length-t-1),void 0!==r&&(r=e.length-r-1)),void 0===t&&(t=0),void 0===r&&(r=e.length),e=e.slice(t,r).filter(((i=function(e,t){return t%_==0}).__argnames__||Object.defineProperties(i,{__argnames__:{value:["e","i"]},__module__:{value:"__main__"}}),i)),n&&(e=e.join("")),e}function ρσ_delslice(e,_,t,r){var n,i,o;if(("string"==typeof e||e instanceof String)&&(n=!0,e=e.split("")),_<0&&(void 0===t&&(t=e.length),void 0===r&&(r=0),t=(i=[r,t,-_])[0],r=i[1],_=i[2]),void 0===t&&(t=0),void 0===r&&(r=e.length),1===_)e.splice(t,r-t);else if(r>t){o=[];for(var a=t;a=0;a--)e.splice(o["number"==typeof a&&a<0?o.length+a:a],1)}return n&&(e=e.join("")),e}function ρσ_flatten(e){var _,t;_=ρσ_list_decorate([]);for(var r=0;r1)for(var o=1;o<_.length;o++)for(r=_["number"==typeof o&&o<0?_.length+o:o];r;){if(t===r)return!0;if(!(n=Object.getPrototypeOf(r.prototype)))break;r=n.constructor}}return!1}function sum(e,_){var t,r,n,i;if(Array.isArray(e))return e.reduce(((i=function(e,_){return e+_}).__argnames__||Object.defineProperties(i,{__argnames__:{value:["prev","cur"]},__module__:{value:"__main__"}}),i),_||0);for(t=_||0,n=(r=iter(e)).next();!n.done;)t+=n.value,n=r.next();return t}function map(){var e,_,t,r,n;e=new Array(arguments.length-1),_=arguments[0],t=new Array(arguments.length-1);for(var i=1;i10&&(t=t.slice(0,15)+"..."),t=JSON.stringify(t),_.push(ρσ_str.format("{}",r.name)+"="+ρσ_str.format("{}",t)));return _=_.length?" "+_.join(" "):"","<"+ρσ_str.format("{}",e.tagName)+ρσ_str.format("{}",_)+">"}function ρσ_repr(e){var _,t,r;if(null===e)return"None";if(void 0===e)return"undefined";if(_=e,"function"==typeof e.__repr__)_=e.__repr__();else if(!0===e||!1===e)_=e?"True":"False";else if(Array.isArray(e))_=ρσ_repr_js_builtin(e,!0);else if("function"==typeof e)_=e.toString();else if("object"!=typeof e||e.toString){if(t=Object.prototype.toString.call(e).slice(8,-1),ρσ_not_equals("Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".indexOf(t),-1))return t+"(["+e.map((r=function(e){return str.format("0x{:02x}",e)},r.__argnames__||Object.defineProperties(r,{__argnames__:{value:["i"]},__module__:{value:"__main__"}}),r)).join(", ")+"])";if("[object Object]"===(_="undefined"!=typeof HTMLElement&&e instanceof HTMLElement?ρσ_html_element_to_string(e):"function"==typeof e.toString?e.toString():e))return ρσ_repr_js_builtin(e);try{_=JSON.stringify(e)}catch(e){ρσ_last_exception=e}}else _=ρσ_repr_js_builtin(e);return _+""}function ρσ_str(e){var _,t,r;if(null===e)return"None";if(void 0===e)return"undefined";if(_=e,"function"==typeof e.__str__)_=e.__str__();else if("function"==typeof e.__repr__)_=e.__repr__();else if(!0===e||!1===e)_=e?"True":"False";else if(Array.isArray(e))_=ρσ_repr_js_builtin(e,!0);else if("function"==typeof e.toString){if(t=Object.prototype.toString.call(e).slice(8,-1),ρσ_not_equals("Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".indexOf(t),-1))return t+"(["+e.map((r=function(e){return str.format("0x{:02x}",e)},r.__argnames__||Object.defineProperties(r,{__argnames__:{value:["i"]},__module__:{value:"__main__"}}),r)).join(", ")+"])";"[object Object]"===(_="undefined"!=typeof HTMLElement&&e instanceof HTMLElement?ρσ_html_element_to_string(e):e.toString())&&(_=ρσ_repr_js_builtin(e))}else"object"!=typeof e||e.toString||(_=ρσ_repr_js_builtin(e));return _+""}NameError=ReferenceError,ρσ_extends(Exception,Error),Exception.prototype.__init__=function(e){this.message=e,this.stack=(new Error).stack,this.name=this.constructor.name},Exception.prototype.__init__.__argnames__||Object.defineProperties(Exception.prototype.__init__,{__argnames__:{value:["message"]},__module__:{value:"__main__"}}),Exception.__argnames__=Exception.prototype.__init__.__argnames__,Exception.__handles_kwarg_interpolation__=Exception.prototype.__init__.__handles_kwarg_interpolation__,Exception.prototype.__repr__=function(){return this.name+": "+this.message},Exception.prototype.__repr__.__module__||Object.defineProperties(Exception.prototype.__repr__,{__module__:{value:"__main__"}}),Exception.prototype.__str__=function(){return Error.prototype.__str__?Error.prototype.__str__.call(this):this.__repr__()},Object.defineProperty(Exception.prototype,"__bases__",{value:[Error]}),ρσ_extends(AttributeError,Exception),AttributeError.prototype.__init__=function(){Exception.prototype.__init__&&Exception.prototype.__init__.apply(this,arguments)},AttributeError.prototype.__repr__=function(){return Exception.prototype.__repr__?Exception.prototype.__repr__.call(this):"<"+__name__+"."+this.constructor.name+" #"+this.ρσ_object_id+">"},AttributeError.prototype.__str__=function(){return Exception.prototype.__str__?Exception.prototype.__str__.call(this):this.__repr__()},Object.defineProperty(AttributeError.prototype,"__bases__",{value:[Exception]}),ρσ_extends(IndexError,Exception),IndexError.prototype.__init__=function(){Exception.prototype.__init__&&Exception.prototype.__init__.apply(this,arguments)},IndexError.prototype.__repr__=function(){return Exception.prototype.__repr__?Exception.prototype.__repr__.call(this):"<"+__name__+"."+this.constructor.name+" #"+this.ρσ_object_id+">"},IndexError.prototype.__str__=function(){return Exception.prototype.__str__?Exception.prototype.__str__.call(this):this.__repr__()},Object.defineProperty(IndexError.prototype,"__bases__",{value:[Exception]}),ρσ_extends(KeyError,Exception),KeyError.prototype.__init__=function(){Exception.prototype.__init__&&Exception.prototype.__init__.apply(this,arguments)},KeyError.prototype.__repr__=function(){return Exception.prototype.__repr__?Exception.prototype.__repr__.call(this):"<"+__name__+"."+this.constructor.name+" #"+this.ρσ_object_id+">"},KeyError.prototype.__str__=function(){return Exception.prototype.__str__?Exception.prototype.__str__.call(this):this.__repr__()},Object.defineProperty(KeyError.prototype,"__bases__",{value:[Exception]}),ρσ_extends(ValueError,Exception),ValueError.prototype.__init__=function(){Exception.prototype.__init__&&Exception.prototype.__init__.apply(this,arguments)},ValueError.prototype.__repr__=function(){return Exception.prototype.__repr__?Exception.prototype.__repr__.call(this):"<"+__name__+"."+this.constructor.name+" #"+this.ρσ_object_id+">"},ValueError.prototype.__str__=function(){return Exception.prototype.__str__?Exception.prototype.__str__.call(this):this.__repr__()},Object.defineProperty(ValueError.prototype,"__bases__",{value:[Exception]}),ρσ_extends(UnicodeDecodeError,Exception),UnicodeDecodeError.prototype.__init__=function(){Exception.prototype.__init__&&Exception.prototype.__init__.apply(this,arguments)},UnicodeDecodeError.prototype.__repr__=function(){return Exception.prototype.__repr__?Exception.prototype.__repr__.call(this):"<"+__name__+"."+this.constructor.name+" #"+this.ρσ_object_id+">"},UnicodeDecodeError.prototype.__str__=function(){return Exception.prototype.__str__?Exception.prototype.__str__.call(this):this.__repr__()},Object.defineProperty(UnicodeDecodeError.prototype,"__bases__",{value:[Exception]}),ρσ_extends(AssertionError,Exception),AssertionError.prototype.__init__=function(){Exception.prototype.__init__&&Exception.prototype.__init__.apply(this,arguments)},AssertionError.prototype.__repr__=function(){return Exception.prototype.__repr__?Exception.prototype.__repr__.call(this):"<"+__name__+"."+this.constructor.name+" #"+this.ρσ_object_id+">"},AssertionError.prototype.__str__=function(){return Exception.prototype.__str__?Exception.prototype.__str__.call(this):this.__repr__()},Object.defineProperty(AssertionError.prototype,"__bases__",{value:[Exception]}),ρσ_extends(ZeroDivisionError,Exception),ZeroDivisionError.prototype.__init__=function(){Exception.prototype.__init__&&Exception.prototype.__init__.apply(this,arguments)},ZeroDivisionError.prototype.__repr__=function(){return Exception.prototype.__repr__?Exception.prototype.__repr__.call(this):"<"+__name__+"."+this.constructor.name+" #"+this.ρσ_object_id+">"},ZeroDivisionError.prototype.__str__=function(){return Exception.prototype.__str__?Exception.prototype.__str__.call(this):this.__repr__()},Object.defineProperty(ZeroDivisionError.prototype,"__bases__",{value:[Exception]}),ρσ_eslice.__argnames__||Object.defineProperties(ρσ_eslice,{__argnames__:{value:["arr","step","start","end"]},__module__:{value:"__main__"}}),ρσ_delslice.__argnames__||Object.defineProperties(ρσ_delslice,{__argnames__:{value:["arr","step","start","end"]},__module__:{value:"__main__"}}),ρσ_flatten.__argnames__||Object.defineProperties(ρσ_flatten,{__argnames__:{value:["arr"]},__module__:{value:"__main__"}}),ρσ_unpack_asarray.__argnames__||Object.defineProperties(ρσ_unpack_asarray,{__argnames__:{value:["num","iterable"]},__module__:{value:"__main__"}}),ρσ_extends.__argnames__||Object.defineProperties(ρσ_extends,{__argnames__:{value:["child","parent"]},__module__:{value:"__main__"}}),ρσ_in=function(){var e=function(){return"function"==typeof Map&&"function"==typeof Set?((e=function(e,_){return"string"==typeof _?-1!==_.indexOf(e):"function"==typeof _.__contains__?_.__contains__(e):_ instanceof Map||_ instanceof Set?_.has(e):_ instanceof vec?ρσ_list_contains.call(_,e):ρσ_arraylike(_)?ρσ_list_contains.call(_,e):Object.prototype.hasOwnProperty.call(_,e)}).__argnames__||Object.defineProperties(e,{__argnames__:{value:["val","arr"]},__module__:{value:"__main__"}}),e):function(){var e=function(e,_){return"string"==typeof _?-1!==_.indexOf(e):"function"==typeof _.__contains__?_.__contains__(e):_ instanceof vec?ρσ_list_contains.call(_,e):ρσ_arraylike(_)?ρσ_list_contains.call(_,e):Object.prototype.hasOwnProperty.call(_,e)};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["val","arr"]},__module__:{value:"__main__"}}),e}();var e};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}()(),ρσ_Iterable.__argnames__||Object.defineProperties(ρσ_Iterable,{__argnames__:{value:["iterable"]},__module__:{value:"__main__"}}),ρσ_desugar_kwargs=function(){var e=function(){return"function"==typeof Object.assign?((e=function(){var e;(e=Object.create(null))[ρσ_kwargs_symbol]=!0;for(var _=0;_=^]))?([<>=^])?([-+\x20])?(\#)?(0)?(\d+)?([,_])?(?:\.(\d+))?([bcdeEfFgGnosxX%])?/);try{r=(t=ρσ_unpack_asarray(9,t=_.match(ρσ_str.format._template_format_pat).slice(1)))[0],n=t[1],i=t[2],a=t[3],s=t[4],u=t[5],l=t[6],p=t[7],c=t[8]}catch(_){if(ρσ_last_exception=_,_ instanceof TypeError)return e;throw _}if(s?(r=r||"0",n=n||"="):(r=r||" ",n=n||">"),h=(m=Number(e)===e)&&e%1==0,p=parseInt(p,10),g=(c||"").toLowerCase(),"n"===c)if(m=!0,h){if(l)throw new ValueError("Cannot specify ',' with 'n'");e=parseInt(e,10).toLocaleString()}else e=parseFloat(e).toLocaleString();else if(-1!==["b","c","d","o","x"].indexOf(g))e=parseInt(e,10),m=!0,isNaN(e)||("b"===c?(e=(e>>>0).toString(2),a&&(e="0b"+e)):"c"===c?e>65535?(y=e-65536,e=String.fromCharCode(55296+(y>>10),56320+(1023&y))):e=String.fromCharCode(e):"d"===c?e=l?d(e,l):e.toString(10):"o"===c?(e=e.toString(8),a&&(e="0o"+e)):"x"===g&&(e=e.toString(16),e="x"===c?e.toLowerCase():e.toUpperCase(),a&&(e="0x"+e)));else if(-1!==["e","f","g","%"].indexOf(g))m=!0,e=parseFloat(e),b=isNaN(p)?6:p,"e"===g?(e=e.toExponential(b),e="E"===c?e.toUpperCase():e.toLowerCase()):"f"===g?(e=v(e,b,l),e="F"===c?e.toUpperCase():e.toLowerCase()):"%"===g?e=v(e*=100,b,l)+"%":"g"===g&&(b=max(1,b),j=parseInt(o(e.toExponential(b-1).toLowerCase(),"e")[1],10),(e=(e=-4<=j&&j=0)||" "!==i&&"+"!==i||(e=i+e)),w.__argnames__||Object.defineProperties(w,{__argnames__:{value:["char","num"]},__module__:{value:"__main__"}}),m&&u&&"0"===u[0]&&(u=u.slice(1),r=(t=["0","="])[0],n=t[1]),u=parseInt(u||"-1",10),isNaN(u))throw new ValueError("Invalid width specification: "+u);if(r&&e.length"===n)e=w(r,u-e.length)+e;else if("^"===n)P=u-(O=Math.floor((u-e.length)/2))-e.length,e=w(r,O)+e+w(r,P);else{if("="!==n)throw new ValueError("Unrecognized alignment: "+n);e=ρσ_in(e[0],"+- ")?e[0]+w(r,u-e.length)+e.slice(1):w(r,u-e.length)+e}return e}function g(e){var _,t,r,n,i,o;for(_=t=r="",n=0,i=0;n=_.length)throw new IndexError("Not enough arguments to match template: "+e);v=_["number"==typeof i&&i<0?_.length+i:i],i+=1}return"function"==typeof v&&(v=v()),y=""+v,p&&(y=h(y,p)),f&&(y=ρσ_str.format("{}",u)+"="+ρσ_str.format("{}",y)),y}for(_=Array.prototype.slice.call(arguments),t={},_[_.length-1]&&void 0!==_[_.length-1][ρσ_kwargs_symbol]&&(t=_[_.length-1],_=_.slice(0,-1)),r=n=!1,i=0,o=ρσ_orig_split,void 0===ρσ_str.format._template_resolve_pat&&(ρσ_str.format._template_resolve_pat=/[.\[]/),c.__argnames__||Object.defineProperties(c,{__argnames__:{value:["arg","object"]},__module__:{value:"__main__"}}),f.__argnames__||Object.defineProperties(f,{__argnames__:{value:["format_spec"]},__module__:{value:"__main__"}}),m.__argnames__||Object.defineProperties(m,{__argnames__:{value:["ans","comma"]},__module__:{value:"__main__"}}),d.__argnames__||Object.defineProperties(d,{__argnames__:{value:["value","comma"]},__module__:{value:"__main__"}}),v.__argnames__||Object.defineProperties(v,{__argnames__:{value:["value","precision","comma"]},__module__:{value:"__main__"}}),h.__argnames__||Object.defineProperties(h,{__argnames__:{value:["value","format_spec"]},__module__:{value:"__main__"}}),g.__argnames__||Object.defineProperties(g,{__argnames__:{value:["markup"]},__module__:{value:"__main__"}}),y.__argnames__||Object.defineProperties(y,{__argnames__:{value:["markup"]},__module__:{value:"__main__"}}),a="",s=0,u=0,l="";s0?l+="}":a+=y(l):l+=p:"{"===p?"{"===e[ρσ_bound_index(s+1,e)]?(s+=1,a+="{"):(u=1,l=""):(a+=p,"}"===p&&"}"===e[ρσ_bound_index(s+1,e)]&&(s+=1)),s+=1;if(u)throw new ValueError("expected '}' before end of string");return a};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}()),define_str_func("capitalize",function(){var e=function(){var e;return(e=this)&&(e=e[0].toUpperCase()+e.slice(1).toLowerCase()),e};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}()),define_str_func("center",function(){var e=function(e,_){var t,r;return r=e-(t=Math.floor((e-this.length)/2))-this.length,_=_||" ",new Array(t+1).join(_)+this+new Array(r+1).join(_)};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["width","fill"]},__module__:{value:"__main__"}}),e}()),define_str_func("count",function(){var e=function(e,_,t){var r,n,i,o,a;if(r=this,_=_||0,t=t||r.length,(_<0||t<0)&&(_=(n=[0,(r=r.slice(_,t)).length])[0],t=n[1]),i=_,!(o=e.length))return 0;for(a=0;-1!==i;)-1!==(i=r.indexOf(e,i))&&(a+=1,i+=o);return a};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["needle","start","end"]},__module__:{value:"__main__"}}),e}()),define_str_func("endswith",function(){var e=function(e,_,t){var r,n;r=this,_=_||0,"string"==typeof e&&(e=[e]),void 0!==t&&(r=r.slice(0,t));for(var i=0;i=r.length&&r===this.slice(_,_+r.length))return!0;return!1};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["prefixes","start","end"]},__module__:{value:"__main__"}}),e}()),define_str_func("find",function(){var e=function(e,_,t){for(var r;_<0;)_+=this.length;if(r=this.indexOf(e,_),void 0!==t&&-1!==r){for(;t<0;)t+=this.length;if(r>=t-e.length)return-1}return r};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["needle","start","end"]},__module__:{value:"__main__"}}),e}()),define_str_func("rfind",function(){var e=function(e,_,t){for(var r;t<0;)t+=this.length;if(r=this.lastIndexOf(e,t-1),void 0!==_&&-1!==r){for(;_<0;)_+=this.length;if(r<_)return-1}return r};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["needle","start","end"]},__module__:{value:"__main__"}}),e}()),define_str_func("index",function(){var e=function(e,_,t){var r;if(-1===(r=ρσ_str.prototype.find.apply(this,arguments)))throw new ValueError("substring not found");return r};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["needle","start","end"]},__module__:{value:"__main__"}}),e}()),define_str_func("rindex",function(){var e=function(e,_,t){var r;if(-1===(r=ρσ_str.prototype.rfind.apply(this,arguments)))throw new ValueError("substring not found");return r};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["needle","start","end"]},__module__:{value:"__main__"}}),e}()),define_str_func("islower",function(){var e=function(){return this.length>0&&this.toLowerCase()===this.toString()};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}()),define_str_func("isupper",function(){var e=function(){return this.length>0&&this.toUpperCase()===this.toString()};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}()),define_str_func("isspace",function(){var e=function(){return this.length>0&&/^\s+$/.test(this)};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}()),define_str_func("join",function(){var e=function(e){var _,t;if(Array.isArray(e))return e.join(this);for(_="",t=e.next();!t.done;)_&&(_+=this),_+=t.value,t=e.next();return _};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["iterable"]},__module__:{value:"__main__"}}),e}()),define_str_func("ljust",function(){var e=function(e,_){var t;return e>(t=this).length&&(_=_||" ",t+=new Array(e-t.length+1).join(_)),t};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["width","fill"]},__module__:{value:"__main__"}}),e}()),define_str_func("rjust",function(){var e=function(e,_){var t;return e>(t=this).length&&(_=_||" ",t=new Array(e-t.length+1).join(_)+t),t};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["width","fill"]},__module__:{value:"__main__"}}),e}()),define_str_func("lower",function(){var e=function(){return this.toLowerCase()};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}()),define_str_func("upper",function(){var e=function(){return this.toUpperCase()};return e.__module__||Object.defineProperties(e,{__module__:{value:"__main__"}}),e}()),define_str_func("lstrip",function(){var e=function(e){var _,t;for(_=this,t=0,e=e||ρσ_str.whitespace;-1!==e.indexOf(_["number"==typeof t&&t<0?_.length+t:t]);)t+=1;return t&&(_=_.slice(t)),_};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["chars"]},__module__:{value:"__main__"}}),e}()),define_str_func("rstrip",function(){var e=function(e){var _,t;for(t=(_=this).length-1,e=e||ρσ_str.whitespace;-1!==e.indexOf(_["number"==typeof t&&t<0?_.length+t:t]);)t-=1;return t<_.length-1&&(_=_.slice(0,t+1)),_};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["chars"]},__module__:{value:"__main__"}}),e}()),define_str_func("strip",function(){var e=function(e){return ρσ_str.prototype.lstrip.call(ρσ_str.prototype.rstrip.call(this,e),e)};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["chars"]},__module__:{value:"__main__"}}),e}()),define_str_func("partition",function(){var e=function(e){var _;return-1===(_=this.indexOf(e))?[this,"",""]:[this.slice(0,_),e,this.slice(_+e.length)]};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["sep"]},__module__:{value:"__main__"}}),e}()),define_str_func("rpartition",function(){var e=function(e){var _;return-1===(_=this.lastIndexOf(e))?["","",this]:[this.slice(0,_),e,this.slice(_+e.length)]};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["sep"]},__module__:{value:"__main__"}}),e}()),define_str_func("replace",function(){var e=function(e,_,t){var r,n,i;if(r=this,1===t)return ρσ_orig_replace(r,e,_);if(t<1)return r;for(t=t||Number.MAX_VALUE,n=0;t>0&&(t-=1,-1!==(i=r.indexOf(e,n)));)n=i+_.length,r=r.slice(0,i)+_+r.slice(i+e.length);return r};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["old","repl","count"]},__module__:{value:"__main__"}}),e}()),define_str_func("split",function(){var e=function(e,_){var t,r,n,i;if(0===_)return ρσ_list_decorate([this]);if(t=ρσ_orig_split,null==e)if(_>0){r=t(this,/(\s+)/),n="",i=[];for(var o=0;o=_+1?n+=r["number"==typeof o&&o<0?r.length+o:o]:o%2==0&&i.push(r["number"==typeof o&&o<0?r.length+o:o]);i[i.length-1]+=n,r=i}else r=t(this,/\s+/);else{if(""===e)throw new ValueError("empty separator");r=t(this,e),_>0&&r.length>_&&(n=r.slice(_).join(e),(r=r.slice(0,_)).push(n))}return ρσ_list_decorate(r)};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["sep","maxsplit"]},__module__:{value:"__main__"}}),e}()),define_str_func("rsplit",function(){var e=function(e,_){var t,r,n,i,o,a,s,u,l;if(!_)return ρσ_str.prototype.split.call(this,e);if(t=ρσ_orig_split,null==e)if(_>0){for(r=[],n=/\s/,i=this.length-1,o="";i>-1&&_>0;){for(a=!1,s=(ρσ_expr_temp=this)["number"==typeof i&&i<0?ρσ_expr_temp.length+i:i];i>-1&&n.test(s);)a=!0,s=this[--i];a?(o&&(r.push(o),_-=1),o=s):o+=s,i-=1}r.push(this.slice(0,i+1)+o),r.reverse()}else r=t(this,/\s+/);else{if(""===e)throw new ValueError("empty separator");for(r=[],i=u=this.length;i>-1&&_>0&&(_-=1,-1!==(l=this.lastIndexOf(e,i)));)r.push(this.slice(l+e.length,u)),i=l-1,u=l;r.push(this.slice(0,u)),r.reverse()}return ρσ_list_decorate(r)};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["sep","maxsplit"]},__module__:{value:"__main__"}}),e}()),define_str_func("splitlines",function(){var e=function(e){var _,t,r;if(_=ρσ_orig_split,e){t=_(this,/((?:\r?\n)|\r)/),r=[];for(var n=0;n(_=this).length&&(_=new Array(e-_.length+1).join("0")+_),_};return e.__argnames__||Object.defineProperties(e,{__argnames__:{value:["width"]},__module__:{value:"__main__"}}),e}()),ρσ_str.uchrs=function(){var e=function(e,_){return function(){var t,r={};return r._string=e,r._pos=0,r[ρσ_iterator_symbol]=((t=function(){return this}).__module__||Object.defineProperties(t,{__module__:{value:"__main__"}}),t),r.next=function(){var e=function(){var e,t,r,n,i;return e=this._string.length,this._pos>=e?function(){var e={done:!0};return e}.call(this):(t=this._pos,r=this._string.charCodeAt(this._pos++),n="�",55296<=r&&r<=56319?this._pos?@[\\]^_`{|}~",ρσ_str.printable="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\v\f",ρσ_str.whitespace=" \t\n\r\v\f",define_str_func=void 0;var str=ρσ_str,repr=ρσ_repr; \ No newline at end of file diff --git a/package/compiler.3.2.1.min.js b/package/compiler.3.2.1.min.js new file mode 100644 index 00000000..1f22399a --- /dev/null +++ b/package/compiler.3.2.1.min.js @@ -0,0 +1,3 @@ +/*This is a combined, compressed file. Look at https://github.com/BruceSherwood/glowscript for source code and copyright information.*/!function(){"use strict";var e=null,n=[];const i=new RegExp("^class\\s+(\\w+)[^:]*:"),t=new RegExp("(\\w+)\\s*\\("),l=new RegExp("^def\\s+(\\w+)\\s*\\("),r=new RegExp("\\Wfunction\\s*(\\w+)\\s*\\("),s=new RegExp("\\W([ρσ\\w]+)[ ]*\\("),a=new RegExp("\\Wfilter\\s*\\(\\s*(\\w+)+\\s*,"),c=new RegExp("\\.pysort\\s*\\(\\s*key\\s*=\\s*(\\w+)\\s*\\)");var o=["pause","waitfor","capture"],f=["rate","sleep","get_library","read_local_file"],p=[],h=[];const g="~!#";var d=[],u=[],x=[],_='"',v="ρσ_ls = ";function m(e){for(var n=0,i=0;i=0?new Error(l.message+" at line "+e.slice(t+1,e.length-1)+": "+i):new Error(l.message+": "+i)}}}window.glowscript_compile=function(w,y){y=y||{},window.__original={text:w.split("\n")},window.__GSlang=y.lang;var b='["'+y.version+'", "glowscript"]',R=/[^\.\w]text[\ ]*\(/.exec(w);R||(R=/^text[\ ]*\(/.exec(w)),w=w.replace(/\.delete/g,".remove");const k=["arrow","box","compound","cone","curve","cylinder","ellipsoid","extrusion","helix","points","pyramid","ring","sphere","simple_sphere","vec","vector","rate","sleep","update","color","paths","shapes","canvas","vertex","triangle","quad","label","distant_light","local_light","attach_trail","attach_arrow","attach_light","sqrt","pi","sin","cos","tan","asin","acos","atan","atan2","exp","log","pow","factorial","combin","button","radio","checkbox","slider","checkbox","text","download","radians","degrees","get_library","read_local_file"];if("vpython"==y.lang){let r="";var E="";if("ERROR: "==(w=function(r,s){if("rapydscript"==s)throw new Error("GlowScript RapydScript is not available after GlowScript 2.9.Choose GlowScript VPython instead.");var a,o,f,w,y,O,b,R;"vpython"==s&&u.push("self");var k=0,E=0,S=0,G=null,j=null,q=null,C="",M=/(^\s*)(.*)/,$="",A="",L=!1,T=!1,W=-1;const z=/(\.pick)\s*(.)/;var N=/^print_options/,P=!1;"javascript"==s&&(v=" "+v);var J="",U="";for("vpython"==s&&(r=r.replace(/arange/g,"range")),f=r.split("\n"),o=1;o=0){f[o]="";break}f[o]="",o++}continue}}if(w=w.replace(/\s+$/g,""),"vpython"!=s||"\\"!=w.slice(-1))if((K=w.match(N))&&(w=w.replace(/delete/,"remove")),"vpython"!=s||"@"!=w[0]){if(0!==w.length){"vpython"==s?(W===C.length&&(W=-1),w.match(i)&&(W=C.length)):w=" "+w,y=!1,O=!1,b=!1,R=!1;var Y=!1,B=L,D=!1;for(X=0;X0&&"f"==w[X-1]&&(D=!0),X<=w.length-3&&w[X+1]==ge&&w[X+2]==ge){if("javascript"==s)throw new Error("JavaScript doesn't recognize triple quotes.");b=!b,X+=2}else"'"==ge?O||b?D=!1:y=!y:'"'==ge?y||b?D=!1:O=!O:"`"==ge&&R&&(R=!R)}if(b&&X==w.length-1&&o0&&"\\"==w[X-1])break;0===k&&(G=o),k++;break;case")":if(X>0&&"\\"==w[X-1])break;k--,T&&0==k&&(T=!1);break;case"[":if(X>0&&"\\"==w[X-1])break;0===E&&(j=o),E++;break;case"]":if(X>0&&"\\"==w[X-1])break;E--;break;case"{":if(X>0&&"\\"==w[X-1])break;0===S&&(q=o),S++;break;case"}":if(X>0&&"\\"==w[X-1])break;S--}if("\\"==ge){X!=w.length-1&&" "!=w[X+1]&&"#"!=w[X+1]||(w=w.slice(0,X)),Y=!0;break}}}L=!T&&(Y||k>0||E>0||S>0),F||"vpython"==s&&(K=z.exec(w+" "))&&"("!=K[2]&&0!=K[2].search(/\w/)&&(X=K.index,w=w.slice(0,X)+".pick()"+w.slice(X+5));var H=w.split(" ");if("vpython"==s&&H.indexOf("import")>-1){if(H.indexOf("random")>-1){$+=" "+C+w+"\n";continue}if(null===e&&(n=[]),"__future__"==H[1])continue;if("visual.factorial"==H[1])continue;if("from"==H[0]&&"import"==H[2]&&H.length>=4){if("visual.graph"==H[1]){if("*"==H[3])continue;return'ERROR: Currently only "from visual.graph import *" is supported, line '+(o+2)+": "+f[o]}if("vpython"!=H[1]&&"visual"!=H[1]&&"vis"!=H[1])throw new Error("Line "+(o+1)+": cannot import from "+H[1]);if(null===e){if("*"==H[3])continue;e=H[1];for(var I=3;I0&&","!=H[I]){if(","==H[I].slice(-1)&&(H[I]=H[I].slice(0,-1))," "==H[I]||"("==H[I]||")"==H[I]||"("==H[I][0]||")"==H[I][-1])continue;n.push(H[I])}-1==n.indexOf("canvas")&&n.push("canvas")}continue}if("import"==H[0]&&2==H.length){if("visual.graph"==H[1])return'ERROR: Currently only "from visual.graph import *" is supported, line '+(o+1)+": "+f[o];if("vpython"!=H[1]&&"visual"!=H[1]&&"vis"!=H[1])return"ERROR: Cannot import from "+H[1]+", line "+(o+1)+": "+f[o];null===e&&(e=H[1]);continue}if("import"==H[0]){if("vpython"==H[1]||"visual"==H[1]||"vis"==H[1]){if(4==H.length&&"as"==H[2]){e=H[3];continue}return"ERROR: improper import statement, line "+(o+1)+": "+f[o]}return"ERROR: Cannot import from "+H[1]+", line "+(o+1)+": "+f[o]}}if("vpython"==s){const e=["def","class","while","for","if","elif","else","try","except","finally"],n=new RegExp("^(\\w+)");var K;let r=null;if(null!==(K=w.match(n))){let n=e.indexOf(K[1]);if(n>=0&&(r=e[n],w.search(":")<0))throw new Error("Line "+(o+1)+', "'+w+'", must include a colon.')}const s=["if","else","elif","except","finally"];if(a="",C.length=0)?a=A+v+_+(o+1)+_+"\n":P||(a=C+v+_+(o+1)+_+"\n"),P=!1,(C.length!=A.length||"elif"!=w.substr(0,4)&&"else"!=w.substr(0,4))&&'"""'!=w.substr(0,3)&&"'''"!=w.substr(0,3)&&")"!=w[0]||(a=""),"="==w[w.length-1])return"ERROR: Line "+(o+1)+" ends with equal sign: "+f[o];var Q="";B?(Q=C,C=A):Q=""==a?" "+C:" "+a+" "+C;var Z,ee,ne=0,ie=null,te=null,le=null,re=!1,se="",ae="";const g=new RegExp("^(\\w+)\\s*=\\s*(\\w+)\\.(\\w+)$"),y=new RegExp("^(\\w+)\\s*=\\s*(\\w+)\\s*");if(null===(ee=w.match(l))&&(ie=w.match(i)),null===ie&&(te=w.match(g)),null===te&&(le=w.match(y)),null!==ee)0===C.length||-1===W?p.push(ee[1]):W>=0&&C.length>W&&x.push(ee[1]),re=!0;else if(null!==ie)d.push(ie[1]),re=!0;else if(null!==te)u.indexOf(te[2])>=0&&x.indexOf(te[3])>=0&&x.push(te[1]);else if(null!==le){var ce=le[1],oe=le[2];if("("==w[le[0].length]){var fe=m(w.slice(le[0].length));null!==fe&&le[0].length+fe+1==w.length&&(d.indexOf(oe)>=0?u.push(ce):x.indexOf(oe)>=0?x.push(ce):p.indexOf(oe)>=0&&p.push(ce))}}null!==(K=w.match(c))&&h.push(K[1]),ne=0;const O=new RegExp("(\\w+)\\.(\\w+)\\s*");for(;null!==(K=w.slice(ne).match(O));)u.indexOf(K[1])>=0&&x.indexOf(K[2])>=0&&(ne+K.index+K[0].length>=w.length||"("!=w[ne+K.index+K[0].length])?(w=w.slice(0,ne+K.index)+w.slice(ne+K.index).replace(K[2],K[2]+".bind("+K[1]+")"),ne+=K.index+K[0].length+K[1].length+7):ne+=K.index+K[0].length;if(!re){const e=new RegExp("^(\\w+)\\s*=\\s*");null!==(K=w.match(e))&&(K[1],w.slice(K[0].length)),ne=0;for(var pe=0;;){if(null===(K=w.slice(ne).match(t))){se.length>0&&(ae+=w.slice(ne));break}Z=K[1];var he=ne+K.index+K[1].length;if(d.indexOf(Z)>=0){for(ce=0,X=he;;){var ge;if("("==(ge=w[X]))ce+=1;else if(")"==ge&&0==(ce-=1))break;if((X+=1)>w.length)break}if(X>w.length)break;se+="_GS_"+(pe+=1)+" = "+Z+"(); _GS_"+pe+".__init__"+w.slice(he,X+1)+"; ",ae+=w.slice(ne,he-K[1].length)+"_GS_"+pe,ne=X+1}else ae+=w.slice(ne,he),ne=he}}se.length>0&&(w=se+ae);const b=new RegExp("input\\s*\\(");if(null!==(K=w.match(b))){let e=!0,n=K.index-1;if(n>=0){let i=w[n];e="w"==i||"."==i||" "==i||"="==i||"("==i}e&&($+=" "+C+"sleep(0.1)")}else w.indexOf(".autoscale")>=0&&($+=" "+C+"sleep(0.1)");$+=Q+w+"\n"}if(A=C,k<0)return"ERROR: Too many right parentheses, line "+(o+1)+": "+f[o];if(E<0)return"ERROR: Too many right brackets, line "+(o+1)+": "+f[o];if(S<0)return"ERROR: Too many right braces, line "+(o+1)+": "+f[o]}}else $+=" "+C+_+v+(o+2)+_+"\n "+w+"\n",P=!0;else J=w.slice(0,-1),U=C}return k>0?"ERROR: Missing right parenthesis, see line "+(G+2)+": "+f[G]:E>0?"ERROR: Missing right bracket, see line "+(j+2)+": "+f[j]:S>0?"ERROR: Missing right brace, see line "+(q+2)+": "+f[q]:$}(w,y.lang)).slice(0,7))O(w);else{var S;if(w=(w=w.replace(/(\.pop\s*\(\s*)([^)]*)/g,function(e,n,i){return".py"+e.slice(1)})).replace(/\.sort\s*\(/g,".pysort("),S="def __main__():\n version = "+b+"\n",S+=" from __python__ import dict_literals, overload_getitem\n",S+=" window.__GSlang = 'vpython'\n",null===e);else if(n.length>0){r="var ";for(let e of k)n.indexOf(e)<0&&(r+=e+", ");r=r.slice(0,-2)}else{let n=new RegExp(e+"\\.(\\w+)","g"),i=w.match(n);n=new RegExp(e+"\\.(\\w+)");let t={};E=" var "+e+" = {";for(let e=0;e0){let e="function __main__() {";w=w.replace(e,"\n"+e+" "+r)}var G=(w=w.replace("function __main__() {",'async function __main__() {\n"use strict";\n var display = canvas;\n var scene = canvas();\n')).indexOf("window.__GSlang"),j="Array.prototype['+'] = function(r) {return this.concat(r)}\n";j+=" Array.prototype['*'] = function(r) {return __array_times_number(this, r)}\n",n.length<=0&&(j+=E),w=w.slice(0,G)+j+w.slice(G-4)}}else{let e=w.search("\n");if(e<0)throw new Error("Missing GlowScript X.Y initial line.");var q='async function __main__() {\n"use strict";\n';q+="var version = "+b+";\n",q+="Array.prototype.toString = function() { return __parsearray(this) };\n",w=(q+="var scene = canvas();\n")+(w=w.substr(e+1))+"\n}"}G=w.indexOf("async function __main__()"),S=w.slice(G),S=papercompile(S),S=";\n"+(S=w.slice(0,G)+S);let C=["if","elif","return","for","while","function","else","dict","str","float","hex","int","iter","len","list","vec","vector","catch","enumerate","oct","ord","print","range","arange","update","print","GSprint","clock","msclock","canvas","graph","gcurve","gdots","gvbars","ghbars","rotate","box","cylinder","cone","pyramid","sphere","simple_sphere","arrow","curve","points","paths","shapes","helix","ring","compound","vertex","triangle","quad","label","distant_light","local_light","attach_trail","attach_arrow","attach_light","text","extrusion","wtext","winput","radio","checkbox","button","slider","menu","input","js_generator","yield","clear","copy","get","items","keys","values","pypop","popitem","fromkeys","update","setdefault","mag","mag2","norm","hat","dot","cross","proj","diff_angle","abs","filter","set","sin","cos","tan","asin","acos","atan","atan2","exp","log","log10","pow","sqrt","ceil","floor","sign","round","max","min","random","factorial","combin"];if("vpython"==y.lang){const n=new RegExp("\\w+\\.prototype\\."+v+'"\\w+";',"g");var M,$,A=(S=S.replace(n,"")).search(v);G=A;let i=[];for(;null!==(M=S.slice(G).match(a));)i.push(M[1]),C.indexOf(M[1]>=0)&&C.push(M[1]),G+=M.index+M[0].length;for(G=A;"vpython"==y.lang&&(M=S.slice(G).match(r)),null!==(M=S.slice(G).match(r));)$=M[1],d.indexOf($)>=0?G+=M[0].length:h.indexOf($)>=0?(C.push($),G+=M[0].length):i.indexOf($)>=0?G+=M[0].length:(S=S.slice(0,G+M.index+1)+"async function "+$+g+S.slice(G+M.index+M[0].length),G+=M.index+"async function ".length+M[1].length+g.length+1);for(G=A;;){var L=!1;if(null===(M=S.slice(G).match(s))||"\\"==S[G+M.index])break;if(L="."==S[G+M.index],$=M[1],!L&&C.indexOf($)>=0){G+=M.index+$.length+1;continue}if("vpython"==y.lang&&!L&&d.indexOf($)>=0){G+=M.index+$.length+1;var T=S.slice(G).search("{"),W=S.slice(G).search("arguments");S=S.slice(0,G+T+1)+S.slice(G+"arguments".length+W+1);continue}if("ρσ_"==$.slice(0,3)){G+=M.index+$.length+1;continue}let n,i=G+M.index+1,t=0,l=0,r=!1,a=!1;for(;;){if('"'==(n=S[--i]))r=!r;else if("'"==n);else if("]"!=n||r||a)if("["!=n||r||a)if(")"!=n||r||a){if("("==n&&!r&&!a){if(0===l)break;l++}}else l--;else{if(0===t)break;t++}else t--;if(" "==n&&0===t&&0===l&&!r&&!a)break}let c=i+1;if("s.jsset.add"==S.slice(c,c+11)){G+=M.index+$.length+1;continue}let h="";if(L){const e="ρσ_interpolate_kwargs",t="ρσ_list_decorate(";if((h=S.slice(c,G+M.index))==e&&"call"==$){let e=S.slice(G+M.index+6).search(","),i=S.slice(G+M.index+6,G+M.index+6+e),r=S.slice(G+M.index+6+e+1).search(","),s=S.slice(G+M.index+6+e+2,G+M.index+6+e+r+1);if("paths"==i||"shapes"==i||"this"==i){e=G+M.index+6+e+2,l=1;let r=!1,a=!1,o=S[e-1];for(;;){if("'"!=(n=S[e])||a)if('"'!=n||r||"\\"==o){if(!r&&!a)if("("==n)l++;else if(")"==n&&0==--l)break}else a=!a;else r=!r;o=n,e++}if("this"==i){p.indexOf(s)>=0&&(S=S.slice(0,c)+"await "+t+S.slice(c,e)+")"+S.slice(e));let n="ρσ_desugar_kwargs(";G=c+=S.slice(c).indexOf(n)+n.length}else S=S.slice(0,c)+t+S.slice(c,e)+")"+S.slice(e),G=e+t.length;continue}G+=M.index+$.length+2;continue}if("paths"==h||"shapes"==h){for(i=S.slice(G+M.index+$.length+1).search("\\(")+G+M.index+$.length+2,l=1;;){if("("==(n=S[i]))l++;else if(")"==n&&0==--l)break;i++}S=S.slice(0,c)+t+S.slice(c,i)+")"+S.slice(i),G=i+t.length;continue}}if("vpython"==y.lang&&L&&u.indexOf(h)<0&&"replace"==$){S=S.slice(0,G+M.index+1)+"__GSrep"+S.slice(G+M.index+$.length+1),G+=M.index+$.length+1;continue}let g=["remove","select","append_to_title","append_to_caption","bind","unbind","call","append","rgb_to_hsv","hsv_to_rgb","mag","mag2","norm","hat","rotate","random","pow","equals","format","trigger","follow","defineProperties","textures","bumpmaps","slice","plot","pypop","insert","find","extend","copy","count","reverse","pysort","set","clear","copy","get","items","keys","values","popitem","fromkeys","update","setdefault","npoints","unshift","splice","modify","clear","shift","point","slice"];if(L&&"self"==h||L&&"ρσ_getitem"==h.slice(0,10)&&x.indexOf($)>=0||L&&d.indexOf(h)>=0&&x.indexOf($)>=0||L&&u.indexOf(h)<0&&o.indexOf($)>=0||L&&h===e&&f.indexOf($)>=0||L&&u.indexOf(h)>=0&&x.indexOf($)>=0||L&&u.indexOf(h)>=0&&g.indexOf($)<0||L&&x.indexOf($)>=0||!L&&p.indexOf($)>=0||!L&&x.indexOf($)>=0||!L&&d.indexOf($)>=0||!L&&C.indexOf($)<0||!L&&C.indexOf($)<0&&g.indexOf($)<0&&p.indexOf($)<0)if(h==e&&f.indexOf($)<0)G+=M.index+$.length+1;else if("Object"!=h)if(!(S.slice(c,G+M.index).search("ρσ_")>=0)||L&&"ρσ_getitem"==h.slice(0,10)&&x.indexOf($)>=0){var z=G+M.index+$.length+1,N=m(S.slice(z));N+=z,S=S.slice(0,c)+"(await "+S.slice(c,N)+")"+S.slice(N),G+=M.index+$.length+7}else G+=M.index+$.length+1;else G+=M.index+$.length+1;else{if(L&&"ρσ_interpolate_kwargs"==h&&"call"==$){let e=S.slice(G+M.index).search("\n");e<0&&(e=S.length-(G+M.index));let n=S.slice(G+M.index,G+M.index+e),i=n.indexOf("concat(");const t=new RegExp("\\s*\\(\\s*([^,]*),\\s*([^,]*)");let l=n.match(t);$=l[1];let r=l[2],s="";if((L=r.indexOf("."))>0){let e=r.length-1;for(;e>0&&"."!=r[e];)e-=1;s=r.slice(0,e),r=r.slice(e+1),L=!0}else L=!1;if("this"==$&&($=r),x.indexOf(r)>=0||"_GS_"==$.slice(0,4)||L&&"self"==s||!L&&p.indexOf($)>=0||L&&d.indexOf($)>=0&&x.indexOf(r)>=0||!L&&x.indexOf($)>=0||!L&&d.indexOf($)>=0||L&&u.indexOf($)<0&&o.indexOf(r)>=0){S=S.slice(0,G+M.index-h.length)+"await "+S.slice(G+M.index-h.length),G+=-1==i?M.index+l.index+7:M.index+l.index+i+14;continue}G+=i>=0?M.index+i:M.index+l.index+5;continue}G+=M.index+$.length+1}}}let P="scene = canvas();\n",J=(w=(w=(w=(w=S.replace(/\n\n\n\n/g,"")).replace(new RegExp(v,"g"),"")).replace(new RegExp("\\n\\s*var ρσ_ls;","g"),"")).replace(new RegExp(g,"g"),"(")).indexOf(P)+P.length;return R&&(P=" fontloading();\n await waitforfonts();\n",w=w.slice(0,J)+P+w.slice(J,w.length)),w.indexOf("input")>=0&&(P="\n function input(arg) {\n",P+=" \targ = arg || {}\n",P+=" \tif (arg.prompt !== undefined && arg.prompt != '') return prompt(arg.prompt)\n",P+=" \telse if (typeof arg === 'string') return prompt(arg)\n",P+=" \telse return prompt()\n",P+=" }\n",w=w.slice(0,J)+P+w.slice(J,w.length)),w}}(); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).acorn={})}(this,function(t){"use strict";var e={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},i="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",s={5:i,"5module":i+" export import",6:i+" const class extends export import super"},a=/^in(stanceof)?$/,r="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿯ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-Ᶎꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭧꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",n="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",o=new RegExp("["+r+"]"),h=new RegExp("["+r+n+"]");r=n=null;var p=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,155,22,13,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,0,33,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,0,161,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,754,9486,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541],c=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,232,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,792487,239];function u(t,e){for(var i=65536,s=0;st)return!1;if((i+=e[s+1])>=t)return!0}}function l(t,e){return t<65?36===t:t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&o.test(String.fromCharCode(t)):!1!==e&&u(t,p)))}function d(t,e){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&h.test(String.fromCharCode(t)):!1!==e&&(u(t,p)||u(t,c)))))}var f=function(t,e){void 0===e&&(e={}),this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.updateContext=null};function m(t,e){return new f(t,{beforeExpr:!0,binop:e})}var g={beforeExpr:!0},x={startsExpr:!0},v={};function y(t,e){return void 0===e&&(e={}),e.keyword=t,v[t]=new f(t,e)}var _={num:new f("num",x),regexp:new f("regexp",x),string:new f("string",x),name:new f("name",x),eof:new f("eof"),bracketL:new f("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new f("]"),braceL:new f("{",{beforeExpr:!0,startsExpr:!0}),braceR:new f("}"),parenL:new f("(",{beforeExpr:!0,startsExpr:!0}),parenR:new f(")"),comma:new f(",",g),semi:new f(";",g),colon:new f(":",g),dot:new f("."),question:new f("?",g),arrow:new f("=>",g),template:new f("template"),invalidTemplate:new f("invalidTemplate"),ellipsis:new f("...",g),backQuote:new f("`",x),dollarBraceL:new f("${",{beforeExpr:!0,startsExpr:!0}),eq:new f("=",{beforeExpr:!0,isAssign:!0}),assign:new f("_=",{beforeExpr:!0,isAssign:!0}),incDec:new f("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new f("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:m("||",1),logicalAND:m("&&",2),bitwiseOR:m("|",3),bitwiseXOR:m("^",4),bitwiseAND:m("&",5),equality:m("==/!=/===/!==",6),relational:m("/<=/>=",7),bitShift:m("<>/>>>",8),plusMin:new f("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:m("%",10),star:m("*",10),slash:m("/",10),starstar:new f("**",{beforeExpr:!0}),_break:y("break"),_case:y("case",g),_catch:y("catch"),_continue:y("continue"),_debugger:y("debugger"),_default:y("default",g),_do:y("do",{isLoop:!0,beforeExpr:!0}),_else:y("else",g),_finally:y("finally"),_for:y("for",{isLoop:!0}),_function:y("function",x),_if:y("if"),_return:y("return",g),_switch:y("switch"),_throw:y("throw",g),_try:y("try"),_var:y("var"),_const:y("const"),_while:y("while",{isLoop:!0}),_with:y("with"),_new:y("new",{beforeExpr:!0,startsExpr:!0}),_this:y("this",x),_super:y("super",x),_class:y("class",x),_extends:y("extends",g),_export:y("export"),_import:y("import",x),_null:y("null",x),_true:y("true",x),_false:y("false",x),_in:y("in",{beforeExpr:!0,binop:7}),_instanceof:y("instanceof",{beforeExpr:!0,binop:7}),_typeof:y("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:y("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:y("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},b=/\r\n?|\n|\u2028|\u2029/,k=new RegExp(b.source,"g");function S(t,e){return 10===t||13===t||!e&&(8232===t||8233===t)}var C=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,w=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,E=Object.prototype,A=E.hasOwnProperty,I=E.toString;function P(t,e){return A.call(t,e)}var T=Array.isArray||function(t){return"[object Array]"===I.call(t)};function L(t){return new RegExp("^(?:"+t.replace(/ /g,"|")+")$")}var N=function(t,e){this.line=t,this.column=e};N.prototype.offset=function(t){return new N(this.line,this.column+t)};var V=function(t,e,i){this.start=e,this.end=i,null!==t.sourceFile&&(this.source=t.sourceFile)};function R(t,e){for(var i=1,s=0;;){k.lastIndex=s;var a=k.exec(t);if(!(a&&a.index=2015&&(e.ecmaVersion-=2009),null==e.allowReserved&&(e.allowReserved=e.ecmaVersion<5),T(e.onToken)){var s=e.onToken;e.onToken=function(t){return s.push(t)}}return T(e.onComment)&&(e.onComment=function(t,e){return function(i,s,a,r,n,o){var h={type:i?"Block":"Line",value:s,start:a,end:r};t.locations&&(h.loc=new V(this,n,o)),t.ranges&&(h.range=[a,r]),e.push(h)}}(e,e.onComment)),e}var D=2,O=1|D,U=4,F=8;function H(t,e){return D|(t?U:0)|(e?F:0)}var G=function(t,i,a){this.options=t=B(t),this.sourceFile=t.sourceFile,this.keywords=L(s[t.ecmaVersion>=6?6:"module"===t.sourceType?"5module":5]);var r="";if(!0!==t.allowReserved){for(var n=t.ecmaVersion;!(r=e[n]);n--);"module"===t.sourceType&&(r+=" await")}this.reservedWords=L(r);var o=(r?r+" ":"")+e.strict;this.reservedWordsStrict=L(o),this.reservedWordsStrictBind=L(o+" "+e.strictBind),this.input=String(i),this.containsEsc=!1,a?(this.pos=a,this.lineStart=this.input.lastIndexOf("\n",a-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(b).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=_.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===t.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&t.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null},W={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};G.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)},W.inFunction.get=function(){return(this.currentVarScope().flags&D)>0},W.inGenerator.get=function(){return(this.currentVarScope().flags&F)>0},W.inAsync.get=function(){return(this.currentVarScope().flags&U)>0},W.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},W.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},W.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},G.prototype.inNonArrowFunction=function(){return(this.currentThisScope().flags&D)>0},G.extend=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];for(var i=this,s=0;s-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var i=e?t.parenthesizedAssign:t.parenthesizedBind;i>-1&&this.raiseRecoverable(i,"Parenthesized pattern")}},j.checkExpressionErrors=function(t,e){if(!t)return!1;var i=t.shorthandAssign,s=t.doubleProto;if(!e)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")},j.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!t);case _._class:return t&&this.unexpected(),this.parseClass(r,!0);case _._if:return this.parseIfStatement(r);case _._return:return this.parseReturnStatement(r);case _._switch:return this.parseSwitchStatement(r);case _._throw:return this.parseThrowStatement(r);case _._try:return this.parseTryStatement(r);case _._const:case _._var:return s=s||this.value,t&&"var"!==s&&this.unexpected(),this.parseVarStatement(r,s);case _._while:return this.parseWhileStatement(r);case _._with:return this.parseWithStatement(r);case _.braceL:return this.parseBlock(!0,r);case _.semi:return this.parseEmptyStatement(r);case _._export:case _._import:if(this.options.ecmaVersion>10&&a===_._import){w.lastIndex=this.pos;var n=w.exec(this.input),o=this.pos+n[0].length;if(40===this.input.charCodeAt(o))return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),a===_._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return t&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!t);var h=this.value,p=this.parseExpression();return a===_.name&&"Identifier"===p.type&&this.eat(_.colon)?this.parseLabeledStatement(r,h,p,t):this.parseExpressionStatement(r,p)}},z.parseBreakContinueStatement=function(t,e){var i="break"===e;this.next(),this.eat(_.semi)||this.insertSemicolon()?t.label=null:this.type!==_.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var s=0;s=6?this.eat(_.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")},z.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Q),this.enterScope(0),this.expect(_.parenL),this.type===_.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);var i=this.isLet();if(this.type===_._var||this.type===_._const||i){var s=this.startNode(),a=i?"let":this.value;return this.next(),this.parseVar(s,!0,a),this.finishNode(s,"VariableDeclaration"),(this.type===_._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===s.declarations.length?(this.options.ecmaVersion>=9&&(this.type===_._in?e>-1&&this.unexpected(e):t.await=e>-1),this.parseForIn(t,s)):(e>-1&&this.unexpected(e),this.parseFor(t,s))}var r=new K,n=this.parseExpression(!0,r);return this.type===_._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===_._in?e>-1&&this.unexpected(e):t.await=e>-1),this.toAssignable(n,!1,r),this.checkLVal(n),this.parseForIn(t,n)):(this.checkExpressionErrors(r,!0),e>-1&&this.unexpected(e),this.parseFor(t,n))},z.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,Y|(i?0:J),!1,e)},z.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(_._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")},z.parseReturnStatement=function(t){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(_.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")},z.parseSwitchStatement=function(t){var e;this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(_.braceL),this.labels.push(X),this.enterScope(0);for(var i=!1;this.type!==_.braceR;)if(this.type===_._case||this.type===_._default){var s=this.type===_._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),s?e.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,e.test=null),this.expect(_.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")},z.parseThrowStatement=function(t){return this.next(),b.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var Z=[];z.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===_._catch){var e=this.startNode();if(this.next(),this.eat(_.parenL)){e.param=this.parseBindingAtom();var i="Identifier"===e.param.type;this.enterScope(i?32:0),this.checkLVal(e.param,i?4:2),this.expect(_.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0);e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(_._finally)?this.parseBlock():null,t.handler||t.finalizer||this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")},z.parseVarStatement=function(t,e){return this.next(),this.parseVar(t,!1,e),this.semicolon(),this.finishNode(t,"VariableDeclaration")},z.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(Q),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")},z.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")},z.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")},z.parseLabeledStatement=function(t,e,i,s){for(var a=0,r=this.labels;a=0;o--){var h=this.labels[o];if(h.statementStart!==t.start)break;h.statementStart=this.start,h.kind=n}return this.labels.push({name:e,kind:n,statementStart:this.start}),t.body=this.parseStatement(s?-1===s.indexOf("label")?s+"label":s:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")},z.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")},z.parseBlock=function(t,e){for(void 0===t&&(t=!0),void 0===e&&(e=this.startNode()),e.body=[],this.expect(_.braceL),t&&this.enterScope(0);!this.eat(_.braceR);){var i=this.parseStatement(null);e.body.push(i)}return t&&this.exitScope(),this.finishNode(e,"BlockStatement")},z.parseFor=function(t,e){return t.init=e,this.expect(_.semi),t.test=this.type===_.semi?null:this.parseExpression(),this.expect(_.semi),t.update=this.type===_.parenR?null:this.parseExpression(),this.expect(_.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")},z.parseForIn=function(t,e){var i=this.type===_._in;return this.next(),"VariableDeclaration"===e.type&&null!=e.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==e.kind||"Identifier"!==e.declarations[0].id.type)?this.raise(e.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===e.type&&this.raise(e.start,"Invalid left-hand side in for-loop"),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(_.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")},z.parseVar=function(t,e,i){for(t.declarations=[],t.kind=i;;){var s=this.startNode();if(this.parseVarId(s,i),this.eat(_.eq)?s.init=this.parseMaybeAssign(e):"const"!==i||this.type===_._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===s.id.type||e&&(this.type===_._in||this.isContextual("of"))?s.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),t.declarations.push(this.finishNode(s,"VariableDeclarator")),!this.eat(_.comma))break}return t},z.parseVarId=function(t,e){t.id=this.parseBindingAtom(),this.checkLVal(t.id,"var"===e?1:2,!1)};var Y=1,J=2;z.parseFunction=function(t,e,i,s){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===_.star&&e&J&&this.unexpected(),t.generator=this.eat(_.star)),this.options.ecmaVersion>=8&&(t.async=!!s),e&Y&&(t.id=4&e&&this.type!==_.name?null:this.parseIdent(),!t.id||e&J||this.checkLVal(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?1:2:3));var a=this.yieldPos,r=this.awaitPos,n=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(H(t.async,t.generator)),e&Y||(t.id=this.type===_.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,i,!1),this.yieldPos=a,this.awaitPos=r,this.awaitIdentPos=n,this.finishNode(t,e&Y?"FunctionDeclaration":"FunctionExpression")},z.parseFunctionParams=function(t){this.expect(_.parenL),t.params=this.parseBindingList(_.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},z.parseClass=function(t,e){this.next();var i=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);var s=this.startNode(),a=!1;for(s.body=[],this.expect(_.braceL);!this.eat(_.braceR);){var r=this.parseClassElement(null!==t.superClass);r&&(s.body.push(r),"MethodDefinition"===r.type&&"constructor"===r.kind&&(a&&this.raise(r.start,"Duplicate constructor in the same class"),a=!0))}return t.body=this.finishNode(s,"ClassBody"),this.strict=i,this.finishNode(t,e?"ClassDeclaration":"ClassExpression")},z.parseClassElement=function(t){var e=this;if(this.eat(_.semi))return null;var i=this.startNode(),s=function(t,s){void 0===s&&(s=!1);var a=e.start,r=e.startLoc;return!!e.eatContextual(t)&&(!(e.type===_.parenL||s&&e.canInsertSemicolon())||(i.key&&e.unexpected(),i.computed=!1,i.key=e.startNodeAt(a,r),i.key.name=t,e.finishNode(i.key,"Identifier"),!1))};i.kind="method",i.static=s("static");var a=this.eat(_.star),r=!1;a||(this.options.ecmaVersion>=8&&s("async",!0)?(r=!0,a=this.options.ecmaVersion>=9&&this.eat(_.star)):s("get")?i.kind="get":s("set")&&(i.kind="set")),i.key||this.parsePropertyName(i);var n=i.key,o=!1;return i.computed||i.static||!("Identifier"===n.type&&"constructor"===n.name||"Literal"===n.type&&"constructor"===n.value)?i.static&&"Identifier"===n.type&&"prototype"===n.name&&this.raise(n.start,"Classes may not have a static property named prototype"):("method"!==i.kind&&this.raise(n.start,"Constructor can't have get/set modifier"),a&&this.raise(n.start,"Constructor can't be a generator"),r&&this.raise(n.start,"Constructor can't be an async method"),i.kind="constructor",o=t),this.parseClassMethod(i,a,r,o),"get"===i.kind&&0!==i.value.params.length&&this.raiseRecoverable(i.value.start,"getter should have no params"),"set"===i.kind&&1!==i.value.params.length&&this.raiseRecoverable(i.value.start,"setter should have exactly one param"),"set"===i.kind&&"RestElement"===i.value.params[0].type&&this.raiseRecoverable(i.value.params[0].start,"Setter cannot use rest params"),i},z.parseClassMethod=function(t,e,i,s){return t.value=this.parseMethod(e,i,s),this.finishNode(t,"MethodDefinition")},z.parseClassId=function(t,e){this.type===_.name?(t.id=this.parseIdent(),e&&this.checkLVal(t.id,2,!1)):(!0===e&&this.unexpected(),t.id=null)},z.parseClassSuper=function(t){t.superClass=this.eat(_._extends)?this.parseExprSubscripts():null},z.parseExport=function(t,e){if(this.next(),this.eat(_.star))return this.expectContextual("from"),this.type!==_.string&&this.unexpected(),t.source=this.parseExprAtom(),this.semicolon(),this.finishNode(t,"ExportAllDeclaration");if(this.eat(_._default)){var i;if(this.checkExport(e,"default",this.lastTokStart),this.type===_._function||(i=this.isAsyncFunction())){var s=this.startNode();this.next(),i&&this.next(),t.declaration=this.parseFunction(s,4|Y,!1,i)}else if(this.type===_._class){var a=this.startNode();t.declaration=this.parseClass(a,"nullableID")}else t.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(t,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())t.declaration=this.parseStatement(null),"VariableDeclaration"===t.declaration.type?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id.name,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==_.string&&this.unexpected(),t.source=this.parseExprAtom();else{for(var r=0,n=t.specifiers;r=6&&t)switch(t.type){case"Identifier":this.inAsync&&"await"===t.name&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var s=0,a=t.properties;s=8&&!r&&"async"===n.name&&!this.canInsertSemicolon()&&this.eat(_._function))return this.parseFunction(this.startNodeAt(s,a),0,!1,!0);if(i&&!this.canInsertSemicolon()){if(this.eat(_.arrow))return this.parseArrowExpression(this.startNodeAt(s,a),[n],!1);if(this.options.ecmaVersion>=8&&"async"===n.name&&this.type===_.name&&!r)return n=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(_.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(s,a),[n],!0)}return n;case _.regexp:var o=this.value;return(e=this.parseLiteral(o.value)).regex={pattern:o.pattern,flags:o.flags},e;case _.num:case _.string:return this.parseLiteral(this.value);case _._null:case _._true:case _._false:return(e=this.startNode()).value=this.type===_._null?null:this.type===_._true,e.raw=this.type.keyword,this.next(),this.finishNode(e,"Literal");case _.parenL:var h=this.start,p=this.parseParenAndDistinguishExpression(i);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(t.parenthesizedAssign=h),t.parenthesizedBind<0&&(t.parenthesizedBind=h)),p;case _.bracketL:return e=this.startNode(),this.next(),e.elements=this.parseExprList(_.bracketR,!0,!0,t),this.finishNode(e,"ArrayExpression");case _.braceL:return this.parseObj(!1,t);case _._function:return e=this.startNode(),this.next(),this.parseFunction(e,0);case _._class:return this.parseClass(this.startNode(),!1);case _._new:return this.parseNew();case _.backQuote:return this.parseTemplate();case _._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},tt.parseExprImport=function(){var t=this.startNode();switch(this.next(),this.type){case _.parenL:return this.parseDynamicImport(t);default:this.unexpected()}},tt.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),!this.eat(_.parenR)){var e=this.start;this.eat(_.comma)&&this.eat(_.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)}return this.finishNode(t,"ImportExpression")},tt.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),110===e.raw.charCodeAt(e.raw.length-1)&&(e.bigint=e.raw.slice(0,-1)),this.next(),this.finishNode(e,"Literal")},tt.parseParenExpression=function(){this.expect(_.parenL);var t=this.parseExpression();return this.expect(_.parenR),t},tt.parseParenAndDistinguishExpression=function(t){var e,i=this.start,s=this.startLoc,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var r,n=this.start,o=this.startLoc,h=[],p=!0,c=!1,u=new K,l=this.yieldPos,d=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==_.parenR;){if(p?p=!1:this.expect(_.comma),a&&this.afterTrailingComma(_.parenR,!0)){c=!0;break}if(this.type===_.ellipsis){r=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===_.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}h.push(this.parseMaybeAssign(!1,u,this.parseParenItem))}var f=this.start,m=this.startLoc;if(this.expect(_.parenR),t&&!this.canInsertSemicolon()&&this.eat(_.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=l,this.awaitPos=d,this.parseParenArrowList(i,s,h);h.length&&!c||this.unexpected(this.lastTokStart),r&&this.unexpected(r),this.checkExpressionErrors(u,!0),this.yieldPos=l||this.yieldPos,this.awaitPos=d||this.awaitPos,h.length>1?((e=this.startNodeAt(n,o)).expressions=h,this.finishNodeAt(e,"SequenceExpression",f,m)):e=h[0]}else e=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(i,s);return g.expression=e,this.finishNode(g,"ParenthesizedExpression")}return e},tt.parseParenItem=function(t){return t},tt.parseParenArrowList=function(t,e,i){return this.parseArrowExpression(this.startNodeAt(t,e),i)};var et=[];tt.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var t=this.startNode(),e=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(_.dot)){t.meta=e;var i=this.containsEsc;return t.property=this.parseIdent(!0),("target"!==t.property.name||i)&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is new.target"),this.inNonArrowFunction()||this.raiseRecoverable(t.start,"new.target can only be used in functions"),this.finishNode(t,"MetaProperty")}var s=this.start,a=this.startLoc,r=this.type===_._import;return t.callee=this.parseSubscripts(this.parseExprAtom(),s,a,!0),r&&"ImportExpression"===t.callee.type&&this.raise(s,"Cannot use new with import()"),this.eat(_.parenL)?t.arguments=this.parseExprList(_.parenR,this.options.ecmaVersion>=8,!1):t.arguments=et,this.finishNode(t,"NewExpression")},tt.parseTemplateElement=function(t){var e=t.isTagged,i=this.startNode();return this.type===_.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value,cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),i.tail=this.type===_.backQuote,this.finishNode(i,"TemplateElement")},tt.parseTemplate=function(t){void 0===t&&(t={});var e=t.isTagged;void 0===e&&(e=!1);var i=this.startNode();this.next(),i.expressions=[];var s=this.parseTemplateElement({isTagged:e});for(i.quasis=[s];!s.tail;)this.type===_.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(_.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(_.braceR),i.quasis.push(s=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(i,"TemplateLiteral")},tt.isAsyncProp=function(t){return!t.computed&&"Identifier"===t.key.type&&"async"===t.key.name&&(this.type===_.name||this.type===_.num||this.type===_.string||this.type===_.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===_.star)&&!b.test(this.input.slice(this.lastTokEnd,this.start))},tt.parseObj=function(t,e){var i=this.startNode(),s=!0,a={};for(i.properties=[],this.next();!this.eat(_.braceR);){if(s)s=!1;else if(this.expect(_.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(_.braceR))break;var r=this.parseProperty(t,e);t||this.checkPropClash(r,a,e),i.properties.push(r)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")},tt.parseProperty=function(t,e){var i,s,a,r,n=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(_.ellipsis))return t?(n.argument=this.parseIdent(!1),this.type===_.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(n,"RestElement")):(this.type===_.parenL&&e&&(e.parenthesizedAssign<0&&(e.parenthesizedAssign=this.start),e.parenthesizedBind<0&&(e.parenthesizedBind=this.start)),n.argument=this.parseMaybeAssign(!1,e),this.type===_.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(n,"SpreadElement"));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(t||e)&&(a=this.start,r=this.startLoc),t||(i=this.eat(_.star)));var o=this.containsEsc;return this.parsePropertyName(n),!t&&!o&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(n)?(s=!0,i=this.options.ecmaVersion>=9&&this.eat(_.star),this.parsePropertyName(n,e)):s=!1,this.parsePropertyValue(n,t,i,s,a,r,e,o),this.finishNode(n,"Property")},tt.parsePropertyValue=function(t,e,i,s,a,r,n,o){if((i||s)&&this.type===_.colon&&this.unexpected(),this.eat(_.colon))t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,n),t.kind="init";else if(this.options.ecmaVersion>=6&&this.type===_.parenL)e&&this.unexpected(),t.kind="init",t.method=!0,t.value=this.parseMethod(i,s);else if(e||o||!(this.options.ecmaVersion>=5)||t.computed||"Identifier"!==t.key.type||"get"!==t.key.name&&"set"!==t.key.name||this.type===_.comma||this.type===_.braceR)this.options.ecmaVersion>=6&&!t.computed&&"Identifier"===t.key.type?((i||s)&&this.unexpected(),this.checkUnreserved(t.key),"await"!==t.key.name||this.awaitIdentPos||(this.awaitIdentPos=a),t.kind="init",e?t.value=this.parseMaybeDefault(a,r,t.key):this.type===_.eq&&n?(n.shorthandAssign<0&&(n.shorthandAssign=this.start),t.value=this.parseMaybeDefault(a,r,t.key)):t.value=t.key,t.shorthand=!0):this.unexpected();else{(i||s)&&this.unexpected(),t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1);var h="get"===t.kind?0:1;if(t.value.params.length!==h){var p=t.value.start;"get"===t.kind?this.raiseRecoverable(p,"getter should have no params"):this.raiseRecoverable(p,"setter should have exactly one param")}else"set"===t.kind&&"RestElement"===t.value.params[0].type&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")}},tt.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(_.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(_.bracketR),t.key;t.computed=!1}return t.key=this.type===_.num||this.type===_.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},tt.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)},tt.parseMethod=function(t,e,i){var s=this.startNode(),a=this.yieldPos,r=this.awaitPos,n=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=t),this.options.ecmaVersion>=8&&(s.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|H(e,s.generator)|(i?128:0)),this.expect(_.parenL),s.params=this.parseBindingList(_.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0),this.yieldPos=a,this.awaitPos=r,this.awaitIdentPos=n,this.finishNode(s,"FunctionExpression")},tt.parseArrowExpression=function(t,e,i){var s=this.yieldPos,a=this.awaitPos,r=this.awaitIdentPos;return this.enterScope(16|H(i,!1)),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1),this.yieldPos=s,this.awaitPos=a,this.awaitIdentPos=r,this.finishNode(t,"ArrowFunctionExpression")},tt.parseFunctionBody=function(t,e,i){var s=e&&this.type!==_.braceL,a=this.strict,r=!1;if(s)t.body=this.parseMaybeAssign(),t.expression=!0,this.checkParams(t,!1);else{var n=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);a&&!n||(r=this.strictDirective(this.end))&&n&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list");var o=this.labels;this.labels=[],r&&(this.strict=!0),this.checkParams(t,!a&&!r&&!e&&!i&&this.isSimpleParamList(t.params)),t.body=this.parseBlock(!1),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=o}this.exitScope(),this.strict&&t.id&&this.checkLVal(t.id,5),this.strict=a},tt.isSimpleParamList=function(t){for(var e=0,i=t;e-1||a.functions.indexOf(t)>-1||a.var.indexOf(t)>-1,a.lexical.push(t),this.inModule&&1&a.flags&&delete this.undefinedExports[t]}else if(4===e){this.currentScope().lexical.push(t)}else if(3===e){var r=this.currentScope();s=this.treatFunctionsAsVar?r.lexical.indexOf(t)>-1:r.lexical.indexOf(t)>-1||r.var.indexOf(t)>-1,r.functions.push(t)}else for(var n=this.scopeStack.length-1;n>=0;--n){var o=this.scopeStack[n];if(o.lexical.indexOf(t)>-1&&!(32&o.flags&&o.lexical[0]===t)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(t)>-1){s=!0;break}if(o.var.push(t),this.inModule&&1&o.flags&&delete this.undefinedExports[t],o.flags&O)break}s&&this.raiseRecoverable(i,"Identifier '"+t+"' has already been declared")},st.checkLocalExport=function(t){-1===this.scopeStack[0].lexical.indexOf(t.name)&&-1===this.scopeStack[0].var.indexOf(t.name)&&(this.undefinedExports[t.name]=t)},st.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},st.currentVarScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&O)return e}},st.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&O&&!(16&e.flags))return e}};var rt=function(t,e,i){this.type="",this.start=e,this.end=0,t.options.locations&&(this.loc=new V(t,i)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[e,0])},nt=G.prototype;function ot(t,e,i,s){return t.type=e,t.end=i,this.options.locations&&(t.loc.end=s),this.options.ranges&&(t.range[1]=i),t}nt.startNode=function(){return new rt(this,this.start,this.startLoc)},nt.startNodeAt=function(t,e){return new rt(this,t,e)},nt.finishNode=function(t,e){return ot.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)},nt.finishNodeAt=function(t,e,i,s){return ot.call(this,t,e,i,s)};var ht=function(t,e,i,s,a){this.token=t,this.isExpr=!!e,this.preserveSpace=!!i,this.override=s,this.generator=!!a},pt={b_stat:new ht("{",!1),b_expr:new ht("{",!0),b_tmpl:new ht("${",!1),p_stat:new ht("(",!1),p_expr:new ht("(",!0),q_tmpl:new ht("`",!0,!0,function(t){return t.tryReadTemplateToken()}),f_stat:new ht("function",!1),f_expr:new ht("function",!0),f_expr_gen:new ht("function",!0,!1,null,!0),f_gen:new ht("function",!1,!1,null,!0)},ct=G.prototype;ct.initialContext=function(){return[pt.b_stat]},ct.braceIsBlock=function(t){var e=this.curContext();return e===pt.f_expr||e===pt.f_stat||(t!==_.colon||e!==pt.b_stat&&e!==pt.b_expr?t===_._return||t===_.name&&this.exprAllowed?b.test(this.input.slice(this.lastTokEnd,this.start)):t===_._else||t===_.semi||t===_.eof||t===_.parenR||t===_.arrow||(t===_.braceL?e===pt.b_stat:t!==_._var&&t!==_._const&&t!==_.name&&!this.exprAllowed):!e.isExpr)},ct.inGeneratorContext=function(){for(var t=this.context.length-1;t>=1;t--){var e=this.context[t];if("function"===e.token)return e.generator}return!1},ct.updateContext=function(t){var e,i=this.type;i.keyword&&t===_.dot?this.exprAllowed=!1:(e=i.updateContext)?e.call(this,t):this.exprAllowed=i.beforeExpr},_.parenR.updateContext=_.braceR.updateContext=function(){if(1!==this.context.length){var t=this.context.pop();t===pt.b_stat&&"function"===this.curContext().token&&(t=this.context.pop()),this.exprAllowed=!t.isExpr}else this.exprAllowed=!0},_.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?pt.b_stat:pt.b_expr),this.exprAllowed=!0},_.dollarBraceL.updateContext=function(){this.context.push(pt.b_tmpl),this.exprAllowed=!0},_.parenL.updateContext=function(t){var e=t===_._if||t===_._for||t===_._with||t===_._while;this.context.push(e?pt.p_stat:pt.p_expr),this.exprAllowed=!0},_.incDec.updateContext=function(){},_._function.updateContext=_._class.updateContext=function(t){!t.beforeExpr||t===_.semi||t===_._else||t===_._return&&b.test(this.input.slice(this.lastTokEnd,this.start))||(t===_.colon||t===_.braceL)&&this.curContext()===pt.b_stat?this.context.push(pt.f_stat):this.context.push(pt.f_expr),this.exprAllowed=!1},_.backQuote.updateContext=function(){this.curContext()===pt.q_tmpl?this.context.pop():this.context.push(pt.q_tmpl),this.exprAllowed=!1},_.star.updateContext=function(t){if(t===_._function){var e=this.context.length-1;this.context[e]===pt.f_expr?this.context[e]=pt.f_expr_gen:this.context[e]=pt.f_gen}this.exprAllowed=!0},_.name.updateContext=function(t){var e=!1;this.options.ecmaVersion>=6&&t!==_.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e};var ut="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",lt=ut+" Extended_Pictographic",dt={9:ut,10:lt,11:"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS Extended_Pictographic"},ft="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",mt="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",gt=mt+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",xt={9:mt,10:gt,11:"Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},vt={};function yt(t){var e=vt[t]={binary:L(dt[t]+" "+ft),nonBinary:{General_Category:L(ft),Script:L(xt[t])}};e.nonBinary.Script_Extensions=e.nonBinary.Script,e.nonBinary.gc=e.nonBinary.General_Category,e.nonBinary.sc=e.nonBinary.Script,e.nonBinary.scx=e.nonBinary.Script_Extensions}yt(9),yt(10),yt(11);var _t=G.prototype,bt=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":""),this.unicodeProperties=vt[t.options.ecmaVersion>=11?11:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function kt(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function St(t){return 36===t||t>=40&&t<=43||46===t||63===t||t>=91&&t<=94||t>=123&&t<=125}function Ct(t){return t>=65&&t<=90||t>=97&&t<=122}function wt(t){return Ct(t)||95===t}function Et(t){return wt(t)||At(t)}function At(t){return t>=48&&t<=57}function It(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function Pt(t){return t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:t-48}function Tt(t){return t>=48&&t<=55}bt.prototype.reset=function(t,e,i){var s=-1!==i.indexOf("u");this.start=0|t,this.source=e+"",this.flags=i,this.switchU=s&&this.parser.options.ecmaVersion>=6,this.switchN=s&&this.parser.options.ecmaVersion>=9},bt.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)},bt.prototype.at=function(t){var e=this.source,i=e.length;if(t>=i)return-1;var s=e.charCodeAt(t);if(!this.switchU||s<=55295||s>=57344||t+1>=i)return s;var a=e.charCodeAt(t+1);return a>=56320&&a<=57343?(s<<10)+a-56613888:s},bt.prototype.nextIndex=function(t){var e=this.source,i=e.length;if(t>=i)return i;var s,a=e.charCodeAt(t);return!this.switchU||a<=55295||a>=57344||t+1>=i||(s=e.charCodeAt(t+1))<56320||s>57343?t+1:t+2},bt.prototype.current=function(){return this.at(this.pos)},bt.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},bt.prototype.advance=function(){this.pos=this.nextIndex(this.pos)},bt.prototype.eat=function(t){return this.current()===t&&(this.advance(),!0)},_t.validateRegExpFlags=function(t){for(var e=t.validFlags,i=t.flags,s=0;s-1&&this.raise(t.start,"Duplicate regular expression flag")}},_t.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&t.groupNames.length>0&&(t.switchN=!0,this.regexp_pattern(t))},_t.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames.length=0,t.backReferenceNames.length=0,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(var e=0,i=t.backReferenceNames;e=9&&(i=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!i,!0}return t.pos=e,!1},_t.regexp_eatQuantifier=function(t,e){return void 0===e&&(e=!1),!!this.regexp_eatQuantifierPrefix(t,e)&&(t.eat(63),!0)},_t.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)},_t.regexp_eatBracedQuantifier=function(t,e){var i=t.pos;if(t.eat(123)){var s=0,a=-1;if(this.regexp_eatDecimalDigits(t)&&(s=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(a=t.lastIntValue),t.eat(125)))return-1!==a&&a=9?this.regexp_groupSpecifier(t):63===t.current()&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1},_t.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)},_t.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1},_t.regexp_eatSyntaxCharacter=function(t){var e=t.current();return!!St(e)&&(t.lastIntValue=e,t.advance(),!0)},_t.regexp_eatPatternCharacters=function(t){for(var e=t.pos,i=0;-1!==(i=t.current())&&!St(i);)t.advance();return t.pos!==e},_t.regexp_eatExtendedPatternCharacter=function(t){var e=t.current();return!(-1===e||36===e||e>=40&&e<=43||46===e||63===e||91===e||94===e||124===e)&&(t.advance(),!0)},_t.regexp_groupSpecifier=function(t){if(t.eat(63)){if(this.regexp_eatGroupName(t))return-1!==t.groupNames.indexOf(t.lastStringValue)&&t.raise("Duplicate capture group name"),void t.groupNames.push(t.lastStringValue);t.raise("Invalid group")}},_t.regexp_eatGroupName=function(t){if(t.lastStringValue="",t.eat(60)){if(this.regexp_eatRegExpIdentifierName(t)&&t.eat(62))return!0;t.raise("Invalid capture group name")}return!1},_t.regexp_eatRegExpIdentifierName=function(t){if(t.lastStringValue="",this.regexp_eatRegExpIdentifierStart(t)){for(t.lastStringValue+=kt(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=kt(t.lastIntValue);return!0}return!1},_t.regexp_eatRegExpIdentifierStart=function(t){var e=t.pos,i=t.current();return t.advance(),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(t)&&(i=t.lastIntValue),function(t){return l(t,!0)||36===t||95===t}(i)?(t.lastIntValue=i,!0):(t.pos=e,!1)},_t.regexp_eatRegExpIdentifierPart=function(t){var e=t.pos,i=t.current();return t.advance(),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(t)&&(i=t.lastIntValue),function(t){return d(t,!0)||36===t||95===t||8204===t||8205===t}(i)?(t.lastIntValue=i,!0):(t.pos=e,!1)},_t.regexp_eatAtomEscape=function(t){return!!(this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t))||(t.switchU&&(99===t.current()&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)},_t.regexp_eatBackReference=function(t){var e=t.pos;if(this.regexp_eatDecimalEscape(t)){var i=t.lastIntValue;if(t.switchU)return i>t.maxBackReference&&(t.maxBackReference=i),!0;if(i<=t.numCapturingParens)return!0;t.pos=e}return!1},_t.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1},_t.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)},_t.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1},_t.regexp_eatZero=function(t){return 48===t.current()&&!At(t.lookahead())&&(t.lastIntValue=0,t.advance(),!0)},_t.regexp_eatControlEscape=function(t){var e=t.current();return 116===e?(t.lastIntValue=9,t.advance(),!0):110===e?(t.lastIntValue=10,t.advance(),!0):118===e?(t.lastIntValue=11,t.advance(),!0):102===e?(t.lastIntValue=12,t.advance(),!0):114===e&&(t.lastIntValue=13,t.advance(),!0)},_t.regexp_eatControlLetter=function(t){var e=t.current();return!!Ct(e)&&(t.lastIntValue=e%32,t.advance(),!0)},_t.regexp_eatRegExpUnicodeEscapeSequence=function(t){var e,i=t.pos;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){var s=t.lastIntValue;if(t.switchU&&s>=55296&&s<=56319){var a=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){var r=t.lastIntValue;if(r>=56320&&r<=57343)return t.lastIntValue=1024*(s-55296)+(r-56320)+65536,!0}t.pos=a,t.lastIntValue=s}return!0}if(t.switchU&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&((e=t.lastIntValue)>=0&&e<=1114111))return!0;t.switchU&&t.raise("Invalid unicode escape"),t.pos=i}return!1},_t.regexp_eatIdentityEscape=function(t){if(t.switchU)return!!this.regexp_eatSyntaxCharacter(t)||!!t.eat(47)&&(t.lastIntValue=47,!0);var e=t.current();return!(99===e||t.switchN&&107===e)&&(t.lastIntValue=e,t.advance(),!0)},_t.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;var e=t.current();if(e>=49&&e<=57){do{t.lastIntValue=10*t.lastIntValue+(e-48),t.advance()}while((e=t.current())>=48&&e<=57);return!0}return!1},_t.regexp_eatCharacterClassEscape=function(t){var e=t.current();if(function(t){return 100===t||68===t||115===t||83===t||119===t||87===t}(e))return t.lastIntValue=-1,t.advance(),!0;if(t.switchU&&this.options.ecmaVersion>=9&&(80===e||112===e)){if(t.lastIntValue=-1,t.advance(),t.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(t)&&t.eat(125))return!0;t.raise("Invalid property name")}return!1},_t.regexp_eatUnicodePropertyValueExpression=function(t){var e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){var i=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){var s=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,i,s),!0}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){var a=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,a),!0}return!1},_t.regexp_validateUnicodePropertyNameAndValue=function(t,e,i){P(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(i)||t.raise("Invalid property value")},_t.regexp_validateUnicodePropertyNameOrValue=function(t,e){t.unicodeProperties.binary.test(e)||t.raise("Invalid property name")},_t.regexp_eatUnicodePropertyName=function(t){var e=0;for(t.lastStringValue="";wt(e=t.current());)t.lastStringValue+=kt(e),t.advance();return""!==t.lastStringValue},_t.regexp_eatUnicodePropertyValue=function(t){var e=0;for(t.lastStringValue="";Et(e=t.current());)t.lastStringValue+=kt(e),t.advance();return""!==t.lastStringValue},_t.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)},_t.regexp_eatCharacterClass=function(t){if(t.eat(91)){if(t.eat(94),this.regexp_classRanges(t),t.eat(93))return!0;t.raise("Unterminated character class")}return!1},_t.regexp_classRanges=function(t){for(;this.regexp_eatClassAtom(t);){var e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){var i=t.lastIntValue;!t.switchU||-1!==e&&-1!==i||t.raise("Invalid character class"),-1!==e&&-1!==i&&e>i&&t.raise("Range out of order in character class")}}},_t.regexp_eatClassAtom=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){var i=t.current();(99===i||Tt(i))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}var s=t.current();return 93!==s&&(t.lastIntValue=s,t.advance(),!0)},_t.regexp_eatClassEscape=function(t){var e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)},_t.regexp_eatClassControlLetter=function(t){var e=t.current();return!(!At(e)&&95!==e)&&(t.lastIntValue=e%32,t.advance(),!0)},_t.regexp_eatHexEscapeSequence=function(t){var e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1},_t.regexp_eatDecimalDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;At(i=t.current());)t.lastIntValue=10*t.lastIntValue+(i-48),t.advance();return t.pos!==e},_t.regexp_eatHexDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;It(i=t.current());)t.lastIntValue=16*t.lastIntValue+Pt(i),t.advance();return t.pos!==e},_t.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){var e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){var i=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=64*e+8*i+t.lastIntValue:t.lastIntValue=8*e+i}else t.lastIntValue=e;return!0}return!1},_t.regexp_eatOctalDigit=function(t){var e=t.current();return Tt(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)},_t.regexp_eatFixedHexDigits=function(t,e){var i=t.pos;t.lastIntValue=0;for(var s=0;s>10),56320+(1023&t)))}Nt.next=function(t){!t&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Lt(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Nt.getToken=function(){return this.next(),new Lt(this)},"undefined"!=typeof Symbol&&(Nt[Symbol.iterator]=function(){var t=this;return{next:function(){var e=t.getToken();return{done:e.type===_.eof,value:e}}}}),Nt.curContext=function(){return this.context[this.context.length-1]},Nt.nextToken=function(){var t=this.curContext();return t&&t.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(_.eof):t.override?t.override(this):void this.readToken(this.fullCharCodeAtPos())},Nt.readToken=function(t){return l(t,this.options.ecmaVersion>=6)||92===t?this.readWord():this.getTokenFromCode(t)},Nt.fullCharCodeAtPos=function(){var t=this.input.charCodeAt(this.pos);return t<=55295||t>=57344?t:(t<<10)+this.input.charCodeAt(this.pos+1)-56613888},Nt.skipBlockComment=function(){var t,e=this.options.onComment&&this.curPosition(),i=this.pos,s=this.input.indexOf("*/",this.pos+=2);if(-1===s&&this.raise(this.pos-2,"Unterminated comment"),this.pos=s+2,this.options.locations)for(k.lastIndex=i;(t=k.exec(this.input))&&t.index8&&t<14||t>=5760&&C.test(String.fromCharCode(t))))break t;++this.pos}}},Nt.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=t,this.value=e,this.updateContext(i)},Nt.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===t&&46===e?(this.pos+=3,this.finishToken(_.ellipsis)):(++this.pos,this.finishToken(_.dot))},Nt.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===t?this.finishOp(_.assign,2):this.finishOp(_.slash,1)},Nt.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),i=1,s=42===t?_.star:_.modulo;return this.options.ecmaVersion>=7&&42===t&&42===e&&(++i,s=_.starstar,e=this.input.charCodeAt(this.pos+2)),61===e?this.finishOp(_.assign,i+1):this.finishOp(s,i)},Nt.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?this.finishOp(124===t?_.logicalOR:_.logicalAND,2):61===e?this.finishOp(_.assign,2):this.finishOp(124===t?_.bitwiseOR:_.bitwiseAND,1)},Nt.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(_.assign,2):this.finishOp(_.bitwiseXOR,1)},Nt.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?45!==e||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!b.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(_.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===e?this.finishOp(_.assign,2):this.finishOp(_.plusMin,1)},Nt.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),i=1;return e===t?(i=62===t&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(_.assign,i+1):this.finishOp(_.bitShift,i)):33!==e||60!==t||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===e&&(i=2),this.finishOp(_.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Nt.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return 61===e?this.finishOp(_.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===t&&62===e&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(_.arrow)):this.finishOp(61===t?_.eq:_.prefix,1)},Nt.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(_.parenL);case 41:return++this.pos,this.finishToken(_.parenR);case 59:return++this.pos,this.finishToken(_.semi);case 44:return++this.pos,this.finishToken(_.comma);case 91:return++this.pos,this.finishToken(_.bracketL);case 93:return++this.pos,this.finishToken(_.bracketR);case 123:return++this.pos,this.finishToken(_.braceL);case 125:return++this.pos,this.finishToken(_.braceR);case 58:return++this.pos,this.finishToken(_.colon);case 63:return++this.pos,this.finishToken(_.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(_.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(120===e||88===e)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===e||79===e)return this.readRadixNumber(8);if(98===e||66===e)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 126:return this.finishOp(_.prefix,1)}this.raise(this.pos,"Unexpected character '"+Vt(t)+"'")},Nt.finishOp=function(t,e){var i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)},Nt.readRegexp=function(){for(var t,e,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(b.test(s)&&this.raise(i,"Unterminated regular expression"),t)t=!1;else{if("["===s)e=!0;else if("]"===s&&e)e=!1;else if("/"===s&&!e)break;t="\\"===s}++this.pos}var a=this.input.slice(i,this.pos);++this.pos;var r=this.pos,n=this.readWord1();this.containsEsc&&this.unexpected(r);var o=this.regexpState||(this.regexpState=new bt(this));o.reset(i,a,n),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var h=null;try{h=new RegExp(a,n)}catch(t){}return this.finishToken(_.regexp,{pattern:a,flags:n,value:h})},Nt.readInt=function(t,e){for(var i=this.pos,s=0,a=0,r=null==e?1/0:e;a=97?n-97+10:n>=65?n-65+10:n>=48&&n<=57?n-48:1/0)>=t)break;++this.pos,s=s*t+o}return this.pos===i||null!=e&&this.pos-i!==e?null:s},Nt.readRadixNumber=function(t){var e=this.pos;this.pos+=2;var i=this.readInt(t);return null==i&&this.raise(this.start+2,"Expected number in radix "+t),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(i="undefined"!=typeof BigInt?BigInt(this.input.slice(e,this.pos)):null,++this.pos):l(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(_.num,i)},Nt.readNumber=function(t){var e=this.pos;t||null!==this.readInt(10)||this.raise(e,"Invalid number");var i=this.pos-e>=2&&48===this.input.charCodeAt(e);i&&this.strict&&this.raise(e,"Invalid number");var s=this.input.charCodeAt(this.pos);if(!i&&!t&&this.options.ecmaVersion>=11&&110===s){var a=this.input.slice(e,this.pos),r="undefined"!=typeof BigInt?BigInt(a):null;return++this.pos,l(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(_.num,r)}i&&/[89]/.test(this.input.slice(e,this.pos))&&(i=!1),46!==s||i||(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),69!==s&&101!==s||i||(43!==(s=this.input.charCodeAt(++this.pos))&&45!==s||++this.pos,null===this.readInt(10)&&this.raise(e,"Invalid number")),l(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=this.input.slice(e,this.pos),o=i?parseInt(n,8):parseFloat(n);return this.finishToken(_.num,o)},Nt.readCodePoint=function(){var t;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var e=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(e,"Code point out of bounds")}else t=this.readHexChar(4);return t},Nt.readString=function(t){for(var e="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var s=this.input.charCodeAt(this.pos);if(s===t)break;92===s?(e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(!1),i=this.pos):(S(s,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(i,this.pos++),this.finishToken(_.string,e)};var Rt={};Nt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t!==Rt)throw t;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Nt.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Rt;this.raise(t,e)},Nt.readTmplToken=function(){for(var t="",e=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(96===i||36===i&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==_.template&&this.type!==_.invalidTemplate?(t+=this.input.slice(e,this.pos),this.finishToken(_.template,t)):36===i?(this.pos+=2,this.finishToken(_.dollarBraceL)):(++this.pos,this.finishToken(_.backQuote));if(92===i)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(S(i)){switch(t+=this.input.slice(e,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:t+="\n";break;default:t+=String.fromCharCode(i)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}},Nt.readInvalidTemplateToken=function(){for(;this.pos=48&&e<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],a=parseInt(s,8);return a>255&&(s=s.slice(0,-1),a=parseInt(s,8)),this.pos+=s.length-1,e=this.input.charCodeAt(this.pos),"0"===s&&56!==e&&57!==e||!this.strict&&!t||this.invalidStringToken(this.pos-1-s.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(a)}return S(e)?"":String.fromCharCode(e)}},Nt.readHexChar=function(t){var e=this.pos,i=this.readInt(16,t);return null===i&&this.invalidStringToken(e,"Bad character escape sequence"),i},Nt.readWord1=function(){this.containsEsc=!1;for(var t="",e=!0,i=this.pos,s=this.options.ecmaVersion>=6;this.pos=0||r<0&&parseInt(r)===r}var binaryOperators={"+":"add","-":"sub","*":"multiply","/":"divide","**":"power","%":"modulo",">":"greater",">=":"greaterorequal","<":"less","<=":"lessorequal","+=":"plusequal","-=":"minusequal","*=":"timesequal","/=":"divideequal"},unaryOperators={"-":"negate","+":"plus"};function papercompile(r){var e=[];function a(r){for(var a=0,n=e.length;a=r)break;r+=t[1]}return r}function n(e){return r.substring(a(e.range[0]),a(e.range[1]))}function t(n,t){for(var i=a(n.range[0]),o=a(n.range[1]),s=0,u=e.length-1;u>=0;u--)if(i>e[u][0]){s=u+1;break}e.splice(s,0,[i,t.length-o+i]),r=r.substring(0,i)+t+r.substring(o)}return function r(e,a){if(e){for(var i in e)if("range"!==i){var o=e[i];if(Array.isArray(o))for(var s=0,u=o.length;s=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],l=Array.prototype.slice;if(e.event.fixHooks)for(var s=n.length;s;)e.event.fixHooks[n[--s]]=e.event.mouseHooks;var a=e.event.special.mousewheel={version:"3.1.11",setup:function(){if(this.addEventListener)for(var t=o.length;t;)this.addEventListener(o[--t],h,!1);else this.onmousewheel=h;e.data(this,"mousewheel-line-height",a.getLineHeight(this)),e.data(this,"mousewheel-page-height",a.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=o.length;t;)this.removeEventListener(o[--t],h,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var i=e(t)["offsetParent"in e.fn?"offsetParent":"parent"]();return i.length||(i=e("body")),parseInt(i.css("fontSize"),10)},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function h(n){var o,s=n||window.event,h=l.call(arguments,1),f=0,d=0,c=0,m=0,g=0;if((n=e.event.fix(s)).type="mousewheel","detail"in s&&(c=-1*s.detail),"wheelDelta"in s&&(c=s.wheelDelta),"wheelDeltaY"in s&&(c=s.wheelDeltaY),"wheelDeltaX"in s&&(d=-1*s.wheelDeltaX),"axis"in s&&s.axis===s.HORIZONTAL_AXIS&&(d=-1*c,c=0),f=0===c?d:c,"deltaY"in s&&(f=c=-1*s.deltaY),"deltaX"in s&&(d=s.deltaX,0===c&&(f=-1*d)),0!==c||0!==d){if(1===s.deltaMode){var w=e.data(this,"mousewheel-line-height");f*=w,c*=w,d*=w}else if(2===s.deltaMode){var v=e.data(this,"mousewheel-page-height");f*=v,c*=v,d*=v}if(o=Math.max(Math.abs(c),Math.abs(d)),(!i||o=1?"floor":"ceil"](f/i),d=Math[d>=1?"floor":"ceil"](d/i),c=Math[c>=1?"floor":"ceil"](c/i),a.settings.normalizeOffset&&this.getBoundingClientRect){var p=this.getBoundingClientRect();m=n.clientX-p.left,g=n.clientY-p.top}return n.deltaX=d,n.deltaY=c,n.deltaFactor=i,n.offsetX=m,n.offsetY=g,n.deltaMode=0,h.unshift(n,f,d,c),t&&clearTimeout(t),t=setTimeout(r,200),(e.event.dispatch||e.event.handle).apply(this,h)}}function r(){i=null}function u(e,t){return a.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}); +!function(t){t.color={},t.color.make=function(i,e,n,o){var a={};return a.r=i||0,a.g=e||0,a.b=n||0,a.a=null!=o?o:1,a.add=function(t,i){for(var e=0;e=1?"rgb("+[a.r,a.g,a.b].join(",")+")":"rgba("+[a.r,a.g,a.b,a.a].join(",")+")"},a.normalize=function(){function t(t,i,e){return ie?e:i}return a.r=t(0,parseInt(a.r),255),a.g=t(0,parseInt(a.g),255),a.b=t(0,parseInt(a.b),255),a.a=t(0,a.a,1),a},a.clone=function(){return t.color.make(a.r,a.b,a.g,a.a)},a.normalize()},t.color.extract=function(i,e){var n;do{if(""!=(n=i.css(e).toLowerCase())&&"transparent"!=n)break;i=i.parent()}while(!t.nodeName(i.get(0),"body"));return"rgba(0, 0, 0, 0)"==n&&(n="transparent"),t.color.parse(n)},t.color.parse=function(e){var n,o=t.color.make;if(n=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e))return o(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10));if(n=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(e))return o(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),parseFloat(n[4]));if(n=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(e))return o(2.55*parseFloat(n[1]),2.55*parseFloat(n[2]),2.55*parseFloat(n[3]));if(n=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(e))return o(2.55*parseFloat(n[1]),2.55*parseFloat(n[2]),2.55*parseFloat(n[3]),parseFloat(n[4]));if(n=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(e))return o(parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16));if(n=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(e))return o(parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16));var a=t.trim(e).toLowerCase();return"transparent"==a?o(255,255,255,0):o((n=i[a]||[0,0,0])[0],n[1],n[2])};var i={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}}(jQuery),function(t){function e(e,o,a,r){var l=[],s={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:!0,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85},xaxis:{show:null,position:"bottom",mode:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null,monthNames:null,timeformat:null,twelveHourClock:!1},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,align:"left",horizontal:!1},shadowSize:3},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:10},hooks:{}},c=null,u=null,f=null,h=null,d=null,m=[],p=[],x={left:0,right:0,top:0,bottom:0},g=0,v=0,b=0,k=0,y={processOptions:[],processRawData:[],processDatapoints:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},T=this;function w(t,i){i=[T].concat(i);for(var e=0;e=s.colors.length&&(i=0,++c)}var h,d=0;for(i=0;it.datamax&&e!=m&&(t.datamax=e)}for(t.each(S(),function(t,i){i.datamin=h,i.datamax=d,i.used=!1}),i=0;i0&&null!=r[n-s]&&r[n-s]!=r[n]&&r[n-s+1]!=r[n+1]){for(o=0;oT&&(T=c)),u.y&&(cM&&(M=c)));if(a.bars.show){var C="left"==a.bars.align?0:-a.bars.barWidth/2;a.bars.horizontal?(k+=C,M+=C+a.bars.barWidth):(b+=C,T+=C+a.bars.barWidth)}p(a.xaxis,b,T),p(a.yaxis,k,M)}t.each(S(),function(t,i){i.datamin==h&&(i.datamin=null),i.datamax==d&&(i.datamax=null)})}()}function C(t,i){var e=t[i+"axis"];return"object"==typeof e&&(e=e.n),"number"!=typeof e&&(e=1),e}function S(){return t.grep(m.concat(p),function(t){return t})}function z(t){var i,e,n={};for(i=0;i=0&&(e=0),null==i.max&&(n+=o*r)>0&&null!=t.datamax&&t.datamax<=0&&(n=0))}t.min=e,t.max=n}(i)}),allocatedAxes=t.grep(o,function(t){return t.reserveSpace}),x.left=x.right=x.top=x.bottom=0,void 0!==s.grid.offsets){var a=s.grid.offsets;x.left=a.left,x.right=a.right,x.top=a.top,x.bottom=a.bottom}if(s.grid.show){for(t.each(allocatedAxes,function(i,o){!function(i){var e,o=i.options;e="number"==typeof o.ticks&&o.ticks>0?o.ticks:.3*Math.sqrt("x"==i.direction?g:v);var a,r,l,s,c,u,f=(i.max-i.min)/e;if("time"==o.mode){var h={second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,year:525949.2*60*1e3},d=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"],[3,"month"],[6,"month"],[1,"year"]],x=0;null!=o.minTickSize&&(x="number"==typeof o.tickSize?o.tickSize:o.minTickSize[0]*h[o.minTickSize[1]]);for(var b=0;b=x);++b);a=d[b][0],"year"==(l=d[b][1])&&(c=Math.pow(10,Math.floor(Math.log(f/h.year)/Math.LN10)),a=(u=f/h.year/c)<1.5?1:u<3?2:u<7.5?5:10,a*=c),i.tickSize=o.tickSize||[a,l],r=function(t){var i=[],e=t.tickSize[0],o=t.tickSize[1],a=new Date(t.min),r=e*h[o];"second"==o&&a.setUTCSeconds(n(a.getUTCSeconds(),e)),"minute"==o&&a.setUTCMinutes(n(a.getUTCMinutes(),e)),"hour"==o&&a.setUTCHours(n(a.getUTCHours(),e)),"month"==o&&a.setUTCMonth(n(a.getUTCMonth(),e)),"year"==o&&a.setUTCFullYear(n(a.getUTCFullYear(),e)),a.setUTCMilliseconds(0),r>=h.minute&&a.setUTCSeconds(0),r>=h.hour&&a.setUTCMinutes(0),r>=h.day&&a.setUTCHours(0),r>=4*h.day&&a.setUTCDate(1),r>=h.year&&a.setUTCMonth(0);var l,s=0,c=Number.NaN;do{if(l=c,c=a.getTime(),i.push(c),"month"==o)if(e<1){a.setUTCDate(1);var u=a.getTime();a.setUTCMonth(a.getUTCMonth()+1);var f=a.getTime();a.setTime(c+s*h.hour+(f-u)*e),s=a.getUTCHours(),a.setUTCHours(0)}else a.setUTCMonth(a.getUTCMonth()+e);else"year"==o?a.setUTCFullYear(a.getUTCFullYear()+e):a.setTime(c+r)}while(ck&&(y=k),c=Math.pow(10,-y),(u=f/c)<1.5?a=1:u<3?(a=2,u>2.25&&(null==k||y+1<=k)&&(a=2.5,++y)):a=u<7.5?5:10,a*=c,null!=o.minTickSize&&a0&&(null==o.min&&(i.min=Math.min(i.min,w[0])),null==o.max&&w.length>1&&(i.max=Math.max(i.max,w[w.length-1]))),r=function(t){var i,e,n=[];for(e=0;e1&&/\..*0$/.test((C[1]-C[0]).toFixed(M))||(i.tickDecimals=M)}}}i.tickGenerator=r,t.isFunction(o.tickFormatter)?i.tickFormatter=function(t,i){return""+o.tickFormatter(t,i)}:i.tickFormatter=s}(o),function(i){var e,n,o=i.options.ticks,a=[];null==o||"number"==typeof o&&o>0?a=i.tickGenerator(i):o&&(a=t.isFunction(o)?o({min:i.min,max:i.max}):o);for(i.ticks=[],e=0;e1&&(r=l[1])):n=+l,null==r&&(r=i.tickFormatter(n,i)),isNaN(n)||i.ticks.push({v:n,label:r})}}(o),function(t,i){t.options.autoscaleMargin&&i.length>0&&(null==t.options.min&&(t.min=Math.min(t.min,i[0].v)),null==t.options.max&&i.length>1&&(t.max=Math.max(t.max,i[i.length-1].v)))}(o,o.ticks),function(i){var n,o,a,r=i.options,l=i.ticks||[],s=[],c=r.labelWidth,u=r.labelHeight;function f(n,o){return t('
'+n.join("")+"
").appendTo(e)}if("x"==i.direction){if(null==c&&(c=Math.floor(g/(l.length>0?l.length:1))),null==u){for(s=[],n=0;n'+o+"");s.length>0&&(s.push('
'),u=(a=f(s,"width:10000px;")).height(),a.remove())}}else if(null==c||null==u){for(n=0;n'+o+"");s.length>0&&(a=f(s,""),null==c&&(c=a.children().width()),null==u&&(u=a.find("div.tickLabel").height()),a.remove())}null==c&&(c=0),null==u&&(u=0),i.labelWidth=c,i.labelHeight=u}(o)}),i=allocatedAxes.length-1;i>=0;--i)U(allocatedAxes[i]);var r=s.grid.minBorderMargin;if(null==r)for(r=0,i=0;i'],i=S(),n=0;n');for(var r=0;ro.max)){var s,c={};"x"==o.direction?(s="center",c.left=Math.round(x.left+o.p2c(l.v)-o.labelWidth/2),"bottom"==o.position?c.top=a.top+a.padding:c.bottom=v-(a.top+a.height-a.padding)):(c.top=Math.round(x.top+o.p2c(l.v)-o.labelHeight/2),"left"==o.position?(c.right=g-(a.left+a.width-a.padding),s="right"):(c.left=a.left+a.padding,s="left")),c.width=o.labelWidth;var u=["position:absolute","text-align:"+s];for(var f in c)u.push(f+":"+c[f]+"px");t.push('
'+l.label+"
")}}t.push("")}}t.push(""),e.append(t.join(""))}()),function(){if(e.find(".legend").remove(),!s.legend.show)return;for(var i,n,o=[],a=!1,r=s.legend.labelFormatter,c=0;c"),o.push(""),a=!0),r&&(n=r(n,i)),o.push('
'+n+""));a&&o.push("");if(0==o.length)return;var u=''+o.join("")+"
";if(null!=s.legend.container)t(s.legend.container).html(u);else{var f="",h=s.legend.position,d=s.legend.margin;null==d[0]&&(d=[d,d]),"n"==h.charAt(0)?f+="top:"+(d[1]+x.top)+"px;":"s"==h.charAt(0)&&(f+="bottom:"+(d[1]+x.bottom)+"px;"),"e"==h.charAt(1)?f+="right:"+(d[0]+x.right)+"px;":"w"==h.charAt(1)&&(f+="left:"+(d[0]+x.left)+"px;");var m=t('
'+u.replace('style="','style="position:absolute;'+f+";")+"
").appendTo(e);if(0!=s.legend.backgroundOpacity){var p=s.legend.backgroundColor;null==p&&((p=(p=s.grid.backgroundColor)&&"string"==typeof p?t.color.parse(p):t.color.extract(m,"background-color")).a=1,p=p.toString());var g=m.children();t('
').prependTo(m).css("opacity",s.legend.backgroundOpacity)}}}()}function D(){var t=s.grid.offsets;h.clearRect(t.left,t.top,g-t.left,v-t.bottom-t.top);var i=s.grid;i.show&&i.backgroundColor&&(h.save(),h.translate(x.left,x.top),h.fillStyle=Z(s.grid.backgroundColor,k,0,"rgba(255, 255, 255, 0)"),h.fillRect(0,0,b,k),h.restore()),i.show&&!i.aboveData&&P();for(var e=0;ea){var s=o;o=a,a=s}return{from:o,to:a,axis:n}}function P(){var i;h.save(),h.translate(x.left,x.top);var e=s.grid.markings;if(e){if(t.isFunction(e))(r=T.getAxes()).xmin=r.xaxis.min,r.xmax=r.xaxis.max,r.ymin=r.yaxis.min,r.ymax=r.yaxis.max,e=e(r);for(i=0;io.axis.max||a.toa.axis.max||(o.from=Math.max(o.from,o.axis.min),o.to=Math.min(o.to,o.axis.max),a.from=Math.max(a.from,a.axis.min),a.to=Math.min(a.to,a.axis.max),o.from==o.to&&a.from==a.to||(o.from=o.axis.p2c(o.from),o.to=o.axis.p2c(o.to),a.from=a.axis.p2c(a.from),a.to=a.axis.p2c(a.to),o.from==o.to||a.from==a.to?(h.beginPath(),h.strokeStyle=n.color||s.grid.markingsColor,h.lineWidth=n.lineWidth||s.grid.markingsLineWidth,h.moveTo(o.from,a.from),h.lineTo(o.to,a.to),h.stroke()):(h.fillStyle=n.color||s.grid.markingsColor,h.fillRect(o.from,a.to,o.to-o.from,a.from-a.to))))}}for(var r=S(),l=s.grid.borderWidth,c=0;cp.max||"full"==v&&l>0&&(y==p.min||y==p.max)||("x"==p.direction?(u=p.p2c(y),m="full"==v?-k:v,"top"==p.position&&(m=-m)):(f=p.p2c(y),d="full"==v?-b:v,"left"==p.position&&(d=-d)),1==h.lineWidth&&("x"==p.direction?u=Math.floor(u)+.5:f=Math.floor(f)+.5),h.moveTo(u,f),h.lineTo(u+d,f+m))}h.stroke()}}l&&(h.lineWidth=l,h.strokeStyle=s.grid.borderColor,h.strokeRect(-l/2,-l/2,b+l,k+l)),h.restore()}function H(t){t.lines.show&&function(t){function i(t,i,e,n,o){var a=t.points,r=t.pointsize,l=null,s=null;h.beginPath();for(var c=r;c=m&&f>o.max){if(m>o.max)continue;u=(o.max-f)/(m-f)*(d-u)+u,f=o.max}else if(m>=f&&m>o.max){if(f>o.max)continue;d=(o.max-f)/(m-f)*(d-u)+u,m=o.max}if(u<=d&&u=d&&u>n.max){if(d>n.max)continue;f=(n.max-u)/(d-u)*(m-f)+f,u=n.max}else if(d>=u&&d>n.max){if(u>n.max)continue;m=(n.max-u)/(d-u)*(m-f)+f,d=n.max}u==l&&f==s||h.moveTo(n.p2c(u)+i,o.p2c(f)+e),l=d,s=m,h.lineTo(n.p2c(d)+i,o.p2c(m)+e)}}h.stroke()}h.save(),h.translate(x.left,x.top),h.lineJoin="round";var e=t.lines.lineWidth,n=t.shadowSize;if(e>0&&n>0){h.lineWidth=n,h.strokeStyle="rgba(0,0,0,0.1)";var o=Math.PI/18;i(t.datapoints,Math.sin(o)*(e/2+n/2),Math.cos(o)*(e/2+n/2),t.xaxis,t.yaxis),h.lineWidth=n/2,i(t.datapoints,Math.sin(o)*(e/2+n/4),Math.cos(o)*(e/2+n/4),t.xaxis,t.yaxis)}h.lineWidth=e,h.strokeStyle=t.color;var a=Y(t.lines,t.color,0,k);a&&(h.fillStyle=a,function(t,i,e){var n=t.points,o=t.pointsize,a=Math.min(Math.max(0,e.min),e.max),r=0,l=!1,s=1,c=0,u=0;for(;!(o>0&&r>n.length+o);){var f=n[(r+=o)-o],d=n[r-o+s],m=n[r],p=n[r+s];if(l){if(o>0&&null!=f&&null==m){u=r,o=-o,s=2;continue}if(o<0&&r==c+o){h.fill(),l=!1,s=1,r=c=u+(o=-o);continue}}if(null!=f&&null!=m){if(f<=m&&f=m&&f>i.max){if(m>i.max)continue;d=(i.max-f)/(m-f)*(p-d)+d,f=i.max}else if(m>=f&&m>i.max){if(f>i.max)continue;p=(i.max-f)/(m-f)*(p-d)+d,m=i.max}if(l||(h.beginPath(),h.moveTo(i.p2c(f),e.p2c(a)),l=!0),d>=e.max&&p>=e.max)h.lineTo(i.p2c(f),e.p2c(e.max)),h.lineTo(i.p2c(m),e.p2c(e.max));else if(d<=e.min&&p<=e.min)h.lineTo(i.p2c(f),e.p2c(e.min)),h.lineTo(i.p2c(m),e.p2c(e.min));else{var x=f,g=m;d<=p&&d=e.min?(f=(e.min-d)/(p-d)*(m-f)+f,d=e.min):p<=d&&p=e.min&&(m=(e.min-d)/(p-d)*(m-f)+f,p=e.min),d>=p&&d>e.max&&p<=e.max?(f=(e.max-d)/(p-d)*(m-f)+f,d=e.max):p>=d&&p>e.max&&d<=e.max&&(m=(e.max-d)/(p-d)*(m-f)+f,p=e.max),f!=x&&h.lineTo(i.p2c(x),e.p2c(d)),h.lineTo(i.p2c(f),e.p2c(d)),h.lineTo(i.p2c(m),e.p2c(p)),m!=g&&(h.lineTo(i.p2c(m),e.p2c(p)),h.lineTo(i.p2c(g),e.p2c(p)))}}}}(t.datapoints,t.xaxis,t.yaxis));e>0&&i(t.datapoints,0,0,t.xaxis,t.yaxis);h.restore()}(t),t.bars.show&&function(t){h.save(),h.translate(x.left,x.top),h.lineWidth=t.bars.lineWidth,h.strokeStyle=t.color;var i="left"==t.bars.align?0:-t.bars.barWidth/2,e=t.bars.fill?function(i,e){return Y(t.bars,t.color,i,e)}:null;(function(i,e,n,o,a,r,l){for(var s=i.points,c=i.pointsize,u=0;ua.max||dr.max||(h.beginPath(),f=a.p2c(f),d=r.p2c(d)+n,"circle"==l?h.arc(f,d,i,0,o?Math.PI:2*Math.PI,!1):l(h,f,d,i,o),h.closePath(),e&&(h.fillStyle=e,h.fill()),h.stroke())}}h.save(),h.translate(x.left,x.top);var e=t.points.lineWidth,n=t.shadowSize,o=t.points.radius,a=t.points.symbol;if(e>0&&n>0){var r=n/2;h.lineWidth=r,h.strokeStyle="rgba(0,0,0,0.1)",i(t.datapoints,o,null,r+r/2,!0,t.xaxis,t.yaxis,a),h.strokeStyle="rgba(0,0,0,0.2)",i(t.datapoints,o,null,r/2,!0,t.xaxis,t.yaxis,a)}h.lineWidth=e,h.strokeStyle=t.color,i(t.datapoints,o,Y(t.points,t.color),0,!1,t.xaxis,t.yaxis,a),h.restore()}(t)}function O(t,i,e,n,o,a,r,l,s,c,u,f){var h,d,m,p,x,g,v,b,k;u?(b=g=v=!0,x=!1,p=i+n,m=i+o,(d=t)<(h=e)&&(k=d,d=h,h=k,x=!0,g=!1)):(x=g=v=!0,b=!1,h=t+n,d=t+o,(p=i)<(m=e)&&(k=p,p=m,m=k,b=!0,v=!1)),dl.max||ps.max||(hl.max&&(d=l.max,g=!1),ms.max&&(p=s.max,v=!1),h=l.p2c(h),m=s.p2c(m),d=l.p2c(d),p=s.p2c(p),r&&(c.beginPath(),c.moveTo(h,m),c.lineTo(h,p),c.lineTo(d,p),c.lineTo(d,m),c.fillStyle=r(m,p),c.fill()),f>0&&(x||g||v||b)&&(c.beginPath(),c.moveTo(h,m+a),x?c.lineTo(h,p+a):c.moveTo(h,p+a),v?c.lineTo(d,p+a):c.moveTo(d,p+a),g?c.lineTo(d,m+a):c.moveTo(d,m+a),b?c.lineTo(h,m+a):c.moveTo(h,m+a),c.stroke()))}function Y(i,e,n,o){var a=i.fill;if(!a)return null;if(i.fillColor)return Z(i.fillColor,n,o,e);var r=t.color.parse(e);return r.a="number"==typeof a?a:.4,r.normalize(),r.toString()}T.setData=M,T.setupGrid=N,T.draw=D,T.getPlaceholder=function(){return e},T.getCanvas=function(){return c},T.getPlotOffset=function(){return x},T.width=function(){return b},T.height=function(){return k},T.offset=function(){var t=f.offset();return t.left+=x.left,t.top+=x.top,t},T.getData=function(){return l},T.getAxes=function(){var i={};return t.each(m.concat(p),function(t,e){e&&(i[e.direction+(1!=e.n?e.n:"")+"axis"]=e)}),i},T.getXAxes=function(){return m},T.getYAxes=function(){return p},T.c2p=z,T.p2c=function(t){var i,e,n,o={};for(i=0;i=0;--n)if(e(l[n])){var u=l[n],f=u.xaxis,h=u.yaxis,d=u.datapoints.points,m=u.datapoints.pointsize,p=f.c2p(t),x=h.c2p(i),g=a/f.scale,v=a/h.scale;if(f.options.inverseTransform&&(g=Number.MAX_VALUE),h.options.inverseTransform&&(v=Number.MAX_VALUE),u.lines.show||u.points.show)for(o=0;og||b-p<-g||k-x>v||k-x<-v)){var y=Math.abs(f.p2c(b)-t),T=Math.abs(h.p2c(k)-i),w=y*y+T*T;w=Math.min(S,b)&&x>=k+M&&x<=k+C:p>=b+M&&p<=b+C&&x>=Math.min(S,k)&&x<=Math.max(S,k))&&(c=[n,o/m])}}}return c?(n=c[0],o=c[1],m=l[n].datapoints.pointsize,{datapoint:l[n].datapoints.points.slice(o*m,(o+1)*m),dataIndex:o,series:l[n],seriesIndex:n}):null}(a,r,n);if(u&&(u.pageX=parseInt(u.series.xaxis.p2c(u.datapoint[0])+o.left+x.left),u.pageY=parseInt(u.series.yaxis.p2c(u.datapoint[1])+o.top+x.top)),s.grid.autoHighlight){for(var h=0;ha.max||or.max)){var l=i.points.radius+i.points.lineWidth/2;d.lineWidth=l,d.strokeStyle=t.color.parse(i.color).scale("a",.5).toString();var s=1.5*l;n=a.p2c(n),o=r.p2c(o);d.beginPath(),"circle"==i.points.symbol?d.arc(n,o,s,0,2*Math.PI,!1):i.points.symbol(d,n,o,s,!1),d.closePath(),d.stroke()}}function K(i,e){d.lineWidth=i.bars.lineWidth,d.strokeStyle=t.color.parse(i.color).scale("a",.5).toString();var n=t.color.parse(i.color).scale("a",.5).toString(),o="left"==i.bars.align?0:-i.bars.barWidth/2;O(e[0],e[1],e[2]||0,o,o+i.bars.barWidth,0,function(){return n},i.xaxis,i.yaxis,d,i.bars.horizontal,i.bars.lineWidth)}function Z(i,e,n,o){if("string"==typeof i)return i;for(var a=h.createLinearGradient(0,n,0,e),r=0,l=i.colors.length;r12?l-=12:0==l&&(l=12));for(var c=0;c=0?"":"-";t=Math.abs(t);var i=Math.floor(function(t){return Math.log(t)/Math.LN10}(t))+1;if(i>e)return o+(t=t.toPrecision(e)).replace("+","");if(i<0){var r=t*pow(10,abs(i)+1);return i-=1,o+r.toFixed(e-1)+"e"+i}return o+t.toFixed(e-i)}jQuery.plot.plugins.push({init:function(t){var o={x:-1,y:-1,locked:!1};function i(e){o.locked||-1!=o.x&&(o.x=-1,t.triggerRedrawOverlay())}function r(e){if(!o.locked)if(t.getSelection&&t.getSelection())o.x=-1;else{var i=t.offset();o.x=Math.max(0,Math.min(e.pageX-i.left,t.width())),o.y=Math.max(0,Math.min(e.pageY-i.top,t.height())),t.triggerRedrawOverlay()}}t.setCrosshair=function(e){if(e){var i=t.p2c(e);o.x=Math.max(0,Math.min(i.left,t.width())),o.y=Math.max(0,Math.min(i.top,t.height()))}else o.x=-1;t.triggerRedrawOverlay()},t.clearCrosshair=t.setCrosshair,t.lockCrosshair=function(e){e&&t.setCrosshair(e),o.locked=!0},t.unlockCrosshair=function(){o.locked=!1},t.hooks.bindEvents.push(function(t,e){t.getOptions().crosshair.mode&&(e.mouseout(i),e.mousemove(r))}),t.hooks.drawOverlay.push(function(t,i){var r=t.getOptions().crosshair;if(r.mode){var n=t.getPlotOffset();if(i.save(),i.translate(n.left,n.top),-1!=o.x){var a=t.c2p({left:o.x,top:o.y});text=e(a.x,3)+","+e(a.y,3),i.fillStyle=r.color,i.font="13px Verdana";var s=i.measureText(text).width,h=0,l=0;o.y<16?(s+=14,l=13,o.x<=t.width()-(s+5)&&(h+=14)):l=-5,o.x>t.width()-(s+5)?(i.textAlign="right",h+=-3):(i.textAlign="left",h+=3),i.fillText(text,o.x+h,o.y+l),i.strokeStyle=r.color,i.lineWidth=r.lineWidth,i.lineJoin="round",i.beginPath(),-1!=r.mode.indexOf("x")&&(i.moveTo(o.x,0),i.lineTo(o.x,t.height())),-1!=r.mode.indexOf("y")&&(i.moveTo(0,o.y),i.lineTo(t.width(),o.y)),i.stroke()}i.restore()}}),t.hooks.shutdown.push(function(t,e){e.unbind("mouseout",i),e.unbind("mousemove",r)})},options:{crosshair:{mode:null,color:"rgba(0, 0, 0, 0.5)",lineWidth:1}},name:"crosshair_GS",version:"1.0"})}(); +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}(function(){return function(){return function t(e,r,n){function i(o,s){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[o]={exports:{}};e[o][0].call(u.exports,function(t){var r=e[o][1][t];return i(r||t)},u,u.exports,t,e,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;oMath.abs(e))c.rotate(o,0,0,-t*i*Math.PI*d.rotateSpeed/window.innerWidth);else{var s=d.zoomSpeed*a*e/window.innerHeight*(o-c.lastT())/100;c.pan(o,0,0,h*(Math.exp(s)-1))}},!0),d};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset"),l=t("has-passive-events")},{"3d-view":43,"has-passive-events":379,"mouse-change":402,"mouse-event-offset":403,"mouse-wheel":405,"right-now":465}],43:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],c=t.mode||"turntable",u=n(),h=i(),f=a();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),new o({turntable:u,orbit:h,matrix:f},c)};var n=t("turntable-camera-controller"),i=t("orbit-camera-controller"),a=t("matrix-camera-controller");function o(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach(function(t){for(var e=t[0],r=[],n=0;n halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:t,draw:e,atlas:{}}},w.prototype.update=function(t){var e=this;if("string"==typeof t)t={text:t};else if(!t)return;null!=(t=i(t,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(t.opacity)?this.opacity=t.opacity.map(function(t){return parseFloat(t)}):this.opacity=parseFloat(t.opacity)),null!=t.viewport&&(this.viewport=h(t.viewport),w.normalViewport&&(this.viewport.y=this.canvas.height-this.viewport.y-this.viewport.height),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=t.kerning&&(this.kerning=t.kerning),null!=t.offset&&("number"==typeof t.offset&&(t.offset=[t.offset,0]),this.positionOffset=y(t.offset)),t.direction&&(this.direction=t.direction),t.range&&(this.range=t.range,this.scale=[1/(t.range[2]-t.range[0]),1/(t.range[3]-t.range[1])],this.translate=[-t.range[0],-t.range[1]]),t.scale&&(this.scale=t.scale),t.translate&&(this.translate=t.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||t.font||(t.font=w.baseFontSize+"px sans-serif");var r,a=!1,o=!1;if(t.font&&(Array.isArray(t.font)?t.font:[t.font]).forEach(function(t,r){if("string"==typeof t)try{t=n.parse(t)}catch(e){t=n.parse(w.baseFontSize+"px "+t)}else t=n.parse(n.stringify(t));var i=n.stringify({size:w.baseFontSize,family:t.family,stretch:b?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),s=p(t.size),l=Math.round(s[0]*d(s[1]));if(l!==e.fontSize[r]&&(o=!0,e.fontSize[r]=l),!(e.font[r]&&i==e.font[r].baseString||(a=!0,e.font[r]=w.fonts[i],e.font[r]))){var c=t.family.join(", "),u=[t.style];t.style!=t.variant&&u.push(t.variant),t.variant!=t.weight&&u.push(t.weight),b&&t.weight!=t.stretch&&u.push(t.stretch),e.font[r]={baseString:i,family:c,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:v(c,{origin:"top",fontSize:w.baseFontSize,fontStyle:u.join(" ")})},w.fonts[i]=e.font[r]}}),(a||o)&&this.font.forEach(function(r,i){var a=n.stringify({size:e.fontSize[i],family:r.family,stretch:b?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(e.fontAtlas[i]=e.shader.atlas[a],!e.fontAtlas[i]){var o=r.metrics;e.shader.atlas[a]=e.fontAtlas[i]={fontString:a,step:2*Math.ceil(e.fontSize[i]*o.bottom*.5),em:e.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:e.regl.texture()}}null==t.text&&(t.text=e.text)}),"string"==typeof t.text&&t.position&&t.position.length>2){for(var s=Array(.5*t.position.length),f=0;f2){for(var _=!t.position[0].length,k=u.mallocFloat(2*this.count),M=0,A=0;M1?e.align[r]:e.align[0]:e.align;if("number"==typeof n)return n;switch(n){case"right":case"end":return-t;case"center":case"centre":case"middle":return.5*-t}return 0})),null==this.baseline&&null==t.baseline&&(t.baseline=0),null!=t.baseline&&(this.baseline=t.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(t,r){var n=(e.font[r]||e.font[0]).metrics,i=0;return i+=.5*n.bottom,i+="number"==typeof t?t-n.baseline:-n[t],w.normalViewport||(i*=-1),i})),null!=t.color)if(t.color||(t.color="transparent"),"string"!=typeof t.color&&isNaN(t.color)){var q;if("number"==typeof t.color[0]&&t.color.length>this.counts.length){var H=t.color.length;q=u.mallocUint8(H);for(var G=(t.color.subarray||t.color.slice).bind(t.color),W=0;W4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var Z=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(Z);for(var $=0;$1?e.counts[$]:e.counts[0],offset:e.textOffsets.length>1?e.textOffsets[$]:e.textOffsets[0],color:e.color?e.color.length<=4?e.color:e.color.subarray(4*$,4*$+4):[0,0,0,255],opacity:Array.isArray(e.opacity)?e.opacity[$]:e.opacity,baseline:null!=e.baselineOffset[$]?e.baselineOffset[$]:e.baselineOffset[0],align:e.align?null!=e.alignOffset[$]?e.alignOffset[$]:e.alignOffset[0]:0,atlas:e.fontAtlas[$]||e.fontAtlas[0],positionOffset:e.positionOffset.length>2?e.positionOffset.subarray(2*$,2*$+2):e.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},w.prototype.destroy=function(){},w.prototype.kerning=!0,w.prototype.position={constant:new Float32Array(2)},w.prototype.translate=null,w.prototype.scale=null,w.prototype.font=null,w.prototype.text="",w.prototype.positionOffset=[0,0],w.prototype.opacity=1,w.prototype.color=new Uint8Array([0,0,0,255]),w.prototype.alignOffset=[0,0],w.normalViewport=!1,w.maxAtlasSize=1024,w.atlasCanvas=document.createElement("canvas"),w.atlasContext=w.atlasCanvas.getContext("2d",{alpha:!1}),w.baseFontSize=64,w.fonts={},e.exports=w},{"color-normalize":45,"css-font":126,"detect-kerning":150,"es6-weak-map":208,"flatten-vertex-data":48,"font-atlas":217,"font-measure":218,"gl-util/context":304,"is-plain-obj":390,"object-assign":421,"parse-rect":426,"parse-unit":428,"pick-by-alias":432,regl:463,"to-px":501,"typedarray-pool":507}],45:[function(t,e,r){"use strict";var n=t("color-rgba"),i=t("clamp"),a=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=a(e),o=new r(4);if(t instanceof r)return Array.isArray(t)?t.slice():(o.set(t),o);var s="uint8"!==e&&"uint8_clamped"!==e;return t instanceof Uint8Array||t instanceof Uint8ClampedArray?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:255,s&&(o[0]/=255,o[1]/=255,o[2]/=255,o[3]/=255),o):(t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),s?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:1):(o[0]=i(Math.round(255*t[0]),0,255),o[1]=i(Math.round(255*t[1]),0,255),o[2]=i(Math.round(255*t[2]),0,255),o[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),o)}},{clamp:102,"color-rgba":47,dtype:153}],46:[function(t,e,r){(function(r){"use strict";var n=t("color-name"),i=t("is-plain-obj"),a=t("defined");e.exports=function(t){var e,s,l=[],c=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)c=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var u=t.slice(1),h=u.length,f=h<=4;c=1,f?(l=[parseInt(u[0]+u[0],16),parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16)],4===h&&(c=parseInt(u[3]+u[3],16)/255)):(l=[parseInt(u[0]+u[1],16),parseInt(u[2]+u[3],16),parseInt(u[4]+u[5],16)],8===h&&(c=parseInt(u[6]+u[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var p=e[1],u=p.replace(/a$/,"");s=u;var h="cmyk"===u?4:"gray"===u?1:3;l=e[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===h?parseFloat(t)/100:"rgb"===u?255*parseFloat(t)/100:parseFloat(t);if("h"===u[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),p===u&&l.push(1),c=void 0===l[h]?1:l[h],l=l.slice(0,h)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),s=t.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(t))if(i(t)){var d=a(t.r,t.red,t.R,null);null!==d?(s="rgb",l=[d,a(t.g,t.green,t.G),a(t.b,t.blue,t.B)]):(s="hsl",l=[a(t.h,t.hue,t.H),a(t.s,t.saturation,t.S),a(t.l,t.lightness,t.L,t.b,t.brightness)]),c=a(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(c/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",c=4===t.length?t[3]:1);else s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];return{space:s,values:l,alpha:c}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":106,defined:148,"is-plain-obj":390}],47:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t){var e,r=n(t);return r.space?((e=Array(3))[0]=a(r.values[0],0,255),e[1]=a(r.values[1],0,255),e[2]=a(r.values[2],0,255),"h"===r.space[0]&&(e=i.rgb(e)),e.push(a(r.alpha,0,1)),e):[]}},{clamp:102,"color-parse":46,"color-space/hsl":110}],48:[function(t,e,r){var n=t("dtype");e.exports=function(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&t[0]&&"number"==typeof t[0][0]){var i,a,o,s,l=t[0].length,c=t.length*l;e&&"string"!=typeof e||(e=new(n(e||"float32"))(c+r));var u=e.length-r;if(c!==u)throw new Error("source length "+c+" ("+l+"x"+t.length+") does not match destination length "+u);for(i=0,o=r;i0;--t)p(c*=.99),d(),f(c),d();function f(t){function r(t){return u(t.source)*t.value}i.forEach(function(n){n.forEach(function(n){if(n.targetLinks.length){var i=e.sum(n.targetLinks,r)/e.sum(n.targetLinks,h);n.y+=(i-u(n))*t}})})}function p(t){function r(t){return u(t.target)*t.value}i.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var i=e.sum(n.sourceLinks,r)/e.sum(n.sourceLinks,h);n.y+=(i-u(n))*t}})})}function d(){i.forEach(function(t){var e,r,n,i=0,s=t.length;for(t.sort(g),n=0;n0&&(e.y+=r),i=e.y+e.dy+a;if((r=i-a-o[1])>0)for(i=e.y-=r,n=s-2;n>=0;--n)e=t[n],(r=e.y+e.dy+a-i)>0&&(e.y-=r),i=e.y})}function g(t,e){return t.y-e.y}}(n),c(),t},t.relayout=function(){return c(),t},t.link=function(){var t=.5;function e(e){var r=e.source.x+e.source.dx,i=e.target.x,a=n.interpolateNumber(r,i),o=a(t),s=a(1-t),l=e.source.y+e.sy,c=l+e.dy,u=e.target.y+e.ty,h=u+e.dy;return"M"+r+","+l+"C"+o+","+l+" "+s+","+u+" "+i+","+u+"L"+i+","+h+"C"+s+","+h+" "+o+","+c+" "+r+","+c+"Z"}return e.curvature=function(r){return arguments.length?(t=+r,e):t},e},t},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof r&&void 0!==e?i(r,t("d3-array"),t("d3-collection"),t("d3-interpolate")):i(n.d3=n.d3||{},n.d3,n.d3,n.d3)},{"d3-array":139,"d3-collection":140,"d3-interpolate":144}],50:[function(t,e,r){"use strict";var n="undefined"==typeof WeakMap?t("weak-map"):WeakMap,i=t("gl-buffer"),a=t("gl-vao"),o=new n;e.exports=function(t){var e=o.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=i(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=a(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,o.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},{"gl-buffer":230,"gl-vao":308,"weak-map":517}],51:[function(t,e,r){e.exports=function(t){var e=0,r=0,n=0,i=0;return t.map(function(t){var a=(t=t.slice())[0],o=a.toUpperCase();if(a!=o)switch(t[0]=o,a){case"a":t[6]+=n,t[7]+=i;break;case"v":t[1]+=i;break;case"h":t[1]+=n;break;default:for(var s=1;si&&(i=t[o]),t[o]=0;c--)if(u[c]!==h[c])return!1;for(c=u.length-1;c>=0;c--)if(l=u[c],!y(t[l],e[l],r,n))return!1;return!0}(t,e,r,o))}return r?t===e:t==e}function x(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function b(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function _(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&m(i,r,"Missing expected exception"+n);var o="string"==typeof n,s=!t&&i&&!r;if((!t&&a.isError(i)&&o&&b(i,r)||s)&&m(i,r,"Got unwanted exception"+n),t&&i&&r&&!b(i,r)||!t&&i)throw i}h.AssertionError=function(t){var e;this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=d(g((e=this).actual),128)+" "+e.operator+" "+d(g(e.expected),128),this.generatedMessage=!0);var r=t.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,a=p(r),o=i.indexOf("\n"+a);if(o>=0){var s=i.indexOf("\n",o+1);i=i.substring(s+1)}this.stack=i}}},a.inherits(h.AssertionError,Error),h.fail=m,h.ok=v,h.equal=function(t,e,r){t!=e&&m(t,e,r,"==",h.equal)},h.notEqual=function(t,e,r){t==e&&m(t,e,r,"!=",h.notEqual)},h.deepEqual=function(t,e,r){y(t,e,!1)||m(t,e,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(t,e,r){y(t,e,!0)||m(t,e,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(t,e,r){y(t,e,!1)&&m(t,e,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function t(e,r,n){y(e,r,!0)&&m(e,r,n,"notDeepStrictEqual",t)},h.strictEqual=function(t,e,r){t!==e&&m(t,e,r,"===",h.strictEqual)},h.notStrictEqual=function(t,e,r){t===e&&m(t,e,r,"!==",h.notStrictEqual)},h.throws=function(t,e,r){_(!0,t,e,r)},h.doesNotThrow=function(t,e,r){_(!1,t,e,r)},h.ifError=function(t){if(t)throw t};var w=Object.keys||function(t){var e=[];for(var r in t)o.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":514}],60:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],61:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=e.length,a=new Array(r+1),o=0;o0?l-4:l;var u=0;for(e=0;e>16&255,s[u++]=n>>8&255,s[u++]=255&n;2===o?(n=i[t.charCodeAt(e)]<<2|i[t.charCodeAt(e+1)]>>4,s[u++]=255&n):1===o&&(n=i[t.charCodeAt(e)]<<10|i[t.charCodeAt(e+1)]<<4|i[t.charCodeAt(e+2)]>>2,s[u++]=n>>8&255,s[u++]=255&n);return s},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a="",o=[],s=0,l=r-i;sl?l:s+16383));1===i?(e=t[r-1],a+=n[e>>2],a+=n[e<<4&63],a+="=="):2===i&&(e=(t[r-2]<<8)+t[r-1],a+=n[e>>10],a+=n[e>>4&63],a+=n[e<<2&63],a+="=");return o.push(a),o.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function u(t,e,r){for(var i,a,o=[],s=e;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],63:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},{"./lib/rationalize":73}],64:[function(t,e,r){"use strict";e.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},{}],65:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},{"./lib/rationalize":73}],66:[function(t,e,r){"use strict";var n=t("./is-rat"),i=t("./lib/is-bn"),a=t("./lib/num-to-bn"),o=t("./lib/str-to-bn"),s=t("./lib/rationalize"),l=t("./div");e.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var c=0;var u,h;if(i(e))u=e.clone();else if("string"==typeof e)u=o(e);else{if(0===e)return[a(0),a(1)];if(e===Math.floor(e))u=a(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),c-=256;u=a(e)}}if(n(r))u.mul(r[1]),h=r[0].clone();else if(i(r))h=r.clone();else if("string"==typeof r)h=o(r);else if(r)if(r===Math.floor(r))h=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),c+=256;h=a(r)}else h=a(1);c>0?u=u.ushln(c):c<0&&(h=h.ushln(-c));return s(u,h)}},{"./div":65,"./is-rat":67,"./lib/is-bn":71,"./lib/num-to-bn":72,"./lib/rationalize":73,"./lib/str-to-bn":74}],67:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":71}],68:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":82}],69:[function(t,e,r){"use strict";var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a20)return 52;return r+32}},{"bit-twiddle":80,"double-bits":151}],71:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":82}],72:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("double-bits");e.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":82,"double-bits":151}],73:[function(t,e,r){"use strict";var n=t("./num-to-bn"),i=t("./bn-sign");e.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);if(o.cmpn(1))return[t.div(o),e.div(o)];return[t,e]}},{"./bn-sign":68,"./num-to-bn":72}],74:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":82}],75:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":73}],76:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":68}],77:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":73}],78:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),i=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4,h=n(l.ushln(u).divRound(r));return c*(s+h*Math.pow(2,-u))}var f=r.bitLength()-l.bitLength()+53,h=n(l.ushln(f).divRound(r));return f<1023?c*h*Math.pow(2,-f):(h*=Math.pow(2,-1023),c*h*Math.pow(2,1023-f))}},{"./lib/bn-to-num":69,"./lib/ctz":70}],79:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],80:[function(t,e,r){"use strict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],81:[function(t,e,r){"use strict";var n=t("clamp");e.exports=function(t,e){e||(e={});var r,o,s,l,c,u,h,f,p,d,g,m=null==e.cutoff?.25:e.cutoff,v=null==e.radius?8:e.radius,y=e.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!e.width||!e.height)throw Error("For raw data width and height should be provided by options");r=e.width,o=e.height,l=t,u=e.stride?e.stride:Math.floor(t.length/r/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(h=(f=t).getContext("2d"),r=f.width,o=f.height,p=h.getImageData(0,0,r,o),l=p.data,u=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(f=t.canvas,h=t,r=f.width,o=f.height,p=h.getImageData(0,0,r,o),l=p.data,u=4):window.ImageData&&t instanceof window.ImageData&&(p=t,r=t.width,o=t.height,l=p.data,u=4);if(s=Math.max(r,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(c=l,l=Array(r*o),d=0,g=c.length;d=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function l(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,c=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c>>26,h=67108863&l,f=Math.min(c,e.length-1),p=Math.max(0,c-t.length+1);p<=f;p++){var d=c-p|0;u+=(o=(i=0|t.words[d])*(a=0|e.words[p])+h)/67108864|0,h=67108863&o}r.words[c]=0|h,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?c[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var f=u[t],p=h[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var g=d.modn(p).toString(t);r=(d=d.idivn(p)).isZero()?g+r:c[f-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,p=0|o[1],d=8191&p,g=p>>>13,m=0|o[2],v=8191&m,y=m>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],k=8191&w,M=w>>>13,A=0|o[5],T=8191&A,S=A>>>13,E=0|o[6],C=8191&E,L=E>>>13,z=0|o[7],P=8191&z,I=z>>>13,O=0|o[8],D=8191&O,R=O>>>13,B=0|o[9],F=8191&B,N=B>>>13,j=0|s[0],V=8191&j,U=j>>>13,q=0|s[1],H=8191&q,G=q>>>13,W=0|s[2],Y=8191&W,X=W>>>13,Z=0|s[3],$=8191&Z,J=Z>>>13,K=0|s[4],Q=8191&K,tt=K>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ct=st>>>13,ut=0|s[8],ht=8191&ut,ft=ut>>>13,pt=0|s[9],dt=8191&pt,gt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(c+(n=Math.imul(h,V))|0)+((8191&(i=(i=Math.imul(h,U))+Math.imul(f,V)|0))<<13)|0;c=((a=Math.imul(f,U))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(d,V),i=(i=Math.imul(d,U))+Math.imul(g,V)|0,a=Math.imul(g,U);var vt=(c+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(f,H)|0))<<13)|0;c=((a=a+Math.imul(f,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,V),i=(i=Math.imul(v,U))+Math.imul(y,V)|0,a=Math.imul(y,U),n=n+Math.imul(d,H)|0,i=(i=i+Math.imul(d,G)|0)+Math.imul(g,H)|0,a=a+Math.imul(g,G)|0;var yt=(c+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(f,Y)|0))<<13)|0;c=((a=a+Math.imul(f,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,V),i=(i=Math.imul(b,U))+Math.imul(_,V)|0,a=Math.imul(_,U),n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(d,Y)|0,i=(i=i+Math.imul(d,X)|0)+Math.imul(g,Y)|0,a=a+Math.imul(g,X)|0;var xt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(f,$)|0))<<13)|0;c=((a=a+Math.imul(f,J)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(k,V),i=(i=Math.imul(k,U))+Math.imul(M,V)|0,a=Math.imul(M,U),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(_,H)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(v,Y)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,Y)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(d,$)|0,i=(i=i+Math.imul(d,J)|0)+Math.imul(g,$)|0,a=a+Math.imul(g,J)|0;var bt=(c+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,Q)|0))<<13)|0;c=((a=a+Math.imul(f,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(T,V),i=(i=Math.imul(T,U))+Math.imul(S,V)|0,a=Math.imul(S,U),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(M,H)|0,a=a+Math.imul(M,G)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(_,Y)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(d,Q)|0,i=(i=i+Math.imul(d,tt)|0)+Math.imul(g,Q)|0,a=a+Math.imul(g,tt)|0;var _t=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((a=a+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,U))+Math.imul(L,V)|0,a=Math.imul(L,U),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(S,H)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(M,Y)|0,a=a+Math.imul(M,X)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,Q)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(d,rt)|0,i=(i=i+Math.imul(d,nt)|0)+Math.imul(g,rt)|0,a=a+Math.imul(g,nt)|0;var wt=(c+(n=n+Math.imul(h,at)|0)|0)+((8191&(i=(i=i+Math.imul(h,ot)|0)+Math.imul(f,at)|0))<<13)|0;c=((a=a+Math.imul(f,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(P,V),i=(i=Math.imul(P,U))+Math.imul(I,V)|0,a=Math.imul(I,U),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(L,H)|0,a=a+Math.imul(L,G)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(S,Y)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(M,$)|0,a=a+Math.imul(M,J)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(d,at)|0,i=(i=i+Math.imul(d,ot)|0)+Math.imul(g,at)|0,a=a+Math.imul(g,ot)|0;var kt=(c+(n=n+Math.imul(h,lt)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(f,lt)|0))<<13)|0;c=((a=a+Math.imul(f,ct)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,U))+Math.imul(R,V)|0,a=Math.imul(R,U),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(I,H)|0,a=a+Math.imul(I,G)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(L,Y)|0,a=a+Math.imul(L,X)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(M,Q)|0,a=a+Math.imul(M,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(v,at)|0,i=(i=i+Math.imul(v,ot)|0)+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,n=n+Math.imul(d,lt)|0,i=(i=i+Math.imul(d,ct)|0)+Math.imul(g,lt)|0,a=a+Math.imul(g,ct)|0;var Mt=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((a=a+Math.imul(f,ft)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(F,V),i=(i=Math.imul(F,U))+Math.imul(N,V)|0,a=Math.imul(N,U),n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,G)|0)+Math.imul(R,H)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(I,Y)|0,a=a+Math.imul(I,X)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(L,$)|0,a=a+Math.imul(L,J)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(M,rt)|0,a=a+Math.imul(M,nt)|0,n=n+Math.imul(b,at)|0,i=(i=i+Math.imul(b,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ct)|0,n=n+Math.imul(d,ht)|0,i=(i=i+Math.imul(d,ft)|0)+Math.imul(g,ht)|0,a=a+Math.imul(g,ft)|0;var At=(c+(n=n+Math.imul(h,dt)|0)|0)+((8191&(i=(i=i+Math.imul(h,gt)|0)+Math.imul(f,dt)|0))<<13)|0;c=((a=a+Math.imul(f,gt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(F,H),i=(i=Math.imul(F,G))+Math.imul(N,H)|0,a=Math.imul(N,G),n=n+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(R,Y)|0,a=a+Math.imul(R,X)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,J)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(L,Q)|0,a=a+Math.imul(L,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(k,at)|0,i=(i=i+Math.imul(k,ot)|0)+Math.imul(M,at)|0,a=a+Math.imul(M,ot)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ct)|0,n=n+Math.imul(v,ht)|0,i=(i=i+Math.imul(v,ft)|0)+Math.imul(y,ht)|0,a=a+Math.imul(y,ft)|0;var Tt=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,gt)|0)+Math.imul(g,dt)|0))<<13)|0;c=((a=a+Math.imul(g,gt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(F,Y),i=(i=Math.imul(F,X))+Math.imul(N,Y)|0,a=Math.imul(N,X),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,J)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,J)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(I,Q)|0,a=a+Math.imul(I,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(L,rt)|0,a=a+Math.imul(L,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(M,lt)|0,a=a+Math.imul(M,ct)|0,n=n+Math.imul(b,ht)|0,i=(i=i+Math.imul(b,ft)|0)+Math.imul(_,ht)|0,a=a+Math.imul(_,ft)|0;var St=(c+(n=n+Math.imul(v,dt)|0)|0)+((8191&(i=(i=i+Math.imul(v,gt)|0)+Math.imul(y,dt)|0))<<13)|0;c=((a=a+Math.imul(y,gt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(F,$),i=(i=Math.imul(F,J))+Math.imul(N,$)|0,a=Math.imul(N,J),n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(I,rt)|0,a=a+Math.imul(I,nt)|0,n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ot)|0)+Math.imul(L,at)|0,a=a+Math.imul(L,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,ft)|0)+Math.imul(M,ht)|0,a=a+Math.imul(M,ft)|0;var Et=(c+(n=n+Math.imul(b,dt)|0)|0)+((8191&(i=(i=i+Math.imul(b,gt)|0)+Math.imul(_,dt)|0))<<13)|0;c=((a=a+Math.imul(_,gt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,tt))+Math.imul(N,Q)|0,a=Math.imul(N,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ot)|0)+Math.imul(I,at)|0,a=a+Math.imul(I,ot)|0,n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(L,lt)|0,a=a+Math.imul(L,ct)|0,n=n+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(S,ht)|0,a=a+Math.imul(S,ft)|0;var Ct=(c+(n=n+Math.imul(k,dt)|0)|0)+((8191&(i=(i=i+Math.imul(k,gt)|0)+Math.imul(M,dt)|0))<<13)|0;c=((a=a+Math.imul(M,gt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(F,rt),i=(i=Math.imul(F,nt))+Math.imul(N,rt)|0,a=Math.imul(N,nt),n=n+Math.imul(D,at)|0,i=(i=i+Math.imul(D,ot)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(I,lt)|0,a=a+Math.imul(I,ct)|0,n=n+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(L,ht)|0,a=a+Math.imul(L,ft)|0;var Lt=(c+(n=n+Math.imul(T,dt)|0)|0)+((8191&(i=(i=i+Math.imul(T,gt)|0)+Math.imul(S,dt)|0))<<13)|0;c=((a=a+Math.imul(S,gt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(F,at),i=(i=Math.imul(F,ot))+Math.imul(N,at)|0,a=Math.imul(N,ot),n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ct)|0,n=n+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(I,ht)|0,a=a+Math.imul(I,ft)|0;var zt=(c+(n=n+Math.imul(C,dt)|0)|0)+((8191&(i=(i=i+Math.imul(C,gt)|0)+Math.imul(L,dt)|0))<<13)|0;c=((a=a+Math.imul(L,gt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,n=Math.imul(F,lt),i=(i=Math.imul(F,ct))+Math.imul(N,lt)|0,a=Math.imul(N,ct),n=n+Math.imul(D,ht)|0,i=(i=i+Math.imul(D,ft)|0)+Math.imul(R,ht)|0,a=a+Math.imul(R,ft)|0;var Pt=(c+(n=n+Math.imul(P,dt)|0)|0)+((8191&(i=(i=i+Math.imul(P,gt)|0)+Math.imul(I,dt)|0))<<13)|0;c=((a=a+Math.imul(I,gt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(F,ht),i=(i=Math.imul(F,ft))+Math.imul(N,ht)|0,a=Math.imul(N,ft);var It=(c+(n=n+Math.imul(D,dt)|0)|0)+((8191&(i=(i=i+Math.imul(D,gt)|0)+Math.imul(R,dt)|0))<<13)|0;c=((a=a+Math.imul(R,gt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863;var Ot=(c+(n=Math.imul(F,dt))|0)+((8191&(i=(i=Math.imul(F,gt))+Math.imul(N,dt)|0))<<13)|0;return c=((a=Math.imul(N,gt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,l[0]=mt,l[1]=vt,l[2]=yt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=kt,l[8]=Mt,l[9]=At,l[10]=Tt,l[11]=St,l[12]=Et,l[13]=Ct,l[14]=Lt,l[15]=zt,l[16]=Pt,l[17]=It,l[18]=Ot,0!==c&&(l[19]=c,r.length++),r};function d(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=f),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):d(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var h=0|this.words[c];this.words[c]=u<<26-a|h>>>a,u=h&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=f)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),h=e.clone();!e.isZero();){for(var f=0,p=1;0==(e.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var d=0,g=1;0==(r.words[0]&g)&&d<26;++d,g<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(h)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var h=0,f=1;0==(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new w(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(y,v),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new x;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},w.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},w.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var h=this.pow(u,i),f=this.pow(t,i.addn(1).iushrn(1)),p=this.pow(t,i),d=o;0!==p.cmp(s);){for(var g=p,m=0;0!==g.cmp(s);m++)g=g.redSqr();n(m=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var h=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new k(t)},i(k,w),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:91}],83:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(u<=0)){var h,f=i.mallocDouble(2*u*s),p=i.mallocInt32(s);if((s=l(t,u,f,p))>0){if(1===u&&n)a.init(s),h=a.sweepComplete(u,r,0,s,f,p,0,s,f,p);else{var d=i.mallocDouble(2*u*c),g=i.mallocInt32(c);(c=l(e,u,d,g))>0&&(a.init(s+c),h=1===u?a.sweepBipartite(u,r,0,s,f,p,0,c,d,g):o(u,r,n,s,f,p,c,d,g),i.free(d),i.free(g))}i.free(f),i.free(p)}return h}}}function u(t,e){n.push([t,e])}},{"./lib/intersect":86,"./lib/sweep":90,"typedarray-pool":507}],85:[function(t,e,r){"use strict";var n="d",i="ax",a="vv",o="fp",s="es",l="rs",c="re",u="rb",h="ri",f="rp",p="bs",d="be",g="bb",m="bi",v="bp",y="rv",x="Q",b=[n,i,a,l,c,u,h,p,d,g,m];function _(t){var e="bruteForce"+(t?"Full":"Partial"),r=[],_=b.slice();t||_.splice(3,0,o);var w=["function "+e+"("+_.join()+"){"];function k(e,o){var _=function(t,e,r){var o="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),_=["function ",o,"(",b.join(),"){","var ",s,"=2*",n,";"],w="for(var i="+l+","+f+"="+s+"*"+l+";i<"+c+";++i,"+f+"+="+s+"){var x0="+u+"["+i+"+"+f+"],x1="+u+"["+i+"+"+f+"+"+n+"],xi="+h+"[i];",k="for(var j="+p+","+v+"="+s+"*"+p+";j<"+d+";++j,"+v+"+="+s+"){var y0="+g+"["+i+"+"+v+"],"+(r?"y1="+g+"["+i+"+"+v+"+"+n+"],":"")+"yi="+m+"[j];";return t?_.push(w,x,":",k):_.push(k,x,":",w),r?_.push("if(y1"+d+"-"+p+"){"),t?(k(!0,!1),w.push("}else{"),k(!1,!1)):(w.push("if("+o+"){"),k(!0,!0),w.push("}else{"),k(!0,!1),w.push("}}else{if("+o+"){"),k(!1,!0),w.push("}else{"),k(!1,!1),w.push("}")),w.push("}}return "+e);var M=r.join("")+w.join("");return new Function(M)()}r.partial=_(!1),r.full=_(!0)},{}],86:[function(t,e,r){"use strict";e.exports=function(t,e,r,a,u,S,E,C,L){!function(t,e){var r=8*i.log2(e+1)*(t+1)|0,a=i.nextPow2(b*r);w.length0;){var O=(P-=1)*b,D=w[O],R=w[O+1],B=w[O+2],F=w[O+3],N=w[O+4],j=w[O+5],V=P*_,U=k[V],q=k[V+1],H=1&j,G=!!(16&j),W=u,Y=S,X=C,Z=L;if(H&&(W=C,Y=L,X=u,Z=S),!(2&j&&(B=m(t,D,R,B,W,Y,q),R>=B)||4&j&&(R=v(t,D,R,B,W,Y,U))>=B)){var $=B-R,J=N-F;if(G){if(t*$*($+J)=p0)&&!(p1>=hi)",["p0","p1"]),g=u("lo===p0",["p0"]),m=u("lo>>1,f=2*t,p=h,d=s[f*h+e];for(;c=x?(p=y,d=x):v>=_?(p=m,d=v):(p=b,d=_):x>=_?(p=y,d=x):_>=v?(p=m,d=v):(p=b,d=_);for(var w=f*(u-1),k=f*p,M=0;Mr&&i[h+e]>c;--u,h-=o){for(var f=h,p=h+o,d=0;d=0&&i.push("lo=e[k+n]");t.indexOf("hi")>=0&&i.push("hi=e[k+o]");return r.push(n.replace("_",i.join()).replace("$",t)),Function.apply(void 0,r)};var n="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],89:[function(t,e,r){"use strict";e.exports=function(t,e){e<=4*n?i(0,e-1,t):function t(e,r,h){var f=(r-e+1)/6|0,p=e+f,d=r-f,g=e+r>>1,m=g-f,v=g+f,y=p,x=m,b=g,_=v,w=d,k=e+1,M=r-1,A=0;c(y,x,h)&&(A=y,y=x,x=A);c(_,w,h)&&(A=_,_=w,w=A);c(y,b,h)&&(A=y,y=b,b=A);c(x,b,h)&&(A=x,x=b,b=A);c(y,_,h)&&(A=y,y=_,_=A);c(b,_,h)&&(A=b,b=_,_=A);c(x,w,h)&&(A=x,x=w,w=A);c(x,b,h)&&(A=x,x=b,b=A);c(_,w,h)&&(A=_,_=w,w=A);var T=h[2*x];var S=h[2*x+1];var E=h[2*_];var C=h[2*_+1];var L=2*y;var z=2*b;var P=2*w;var I=2*p;var O=2*g;var D=2*d;for(var R=0;R<2;++R){var B=h[L+R],F=h[z+R],N=h[P+R];h[I+R]=B,h[O+R]=F,h[D+R]=N}o(m,e,h);o(v,r,h);for(var j=k;j<=M;++j)if(u(j,T,S,h))j!==k&&a(j,k,h),++k;else if(!u(j,E,C,h))for(;;){if(u(M,E,C,h)){u(M,T,S,h)?(s(j,k,M,h),++k,--M):(a(j,M,h),--M);break}if(--Mt;){var c=r[l-2],u=r[l-1];if(cr[e+1])}function u(t,e,r,n){var i=n[t*=2];return i>>1;a(p,S);for(var E=0,C=0,k=0;k=o)d(c,u,C--,L=L-o|0);else if(L>=0)d(s,l,E--,L);else if(L<=-o){L=-L-o|0;for(var z=0;z>>1;a(p,E);for(var C=0,L=0,z=0,M=0;M>1==p[2*M+3]>>1&&(I=2,M+=1),P<0){for(var O=-(P>>1)-1,D=0;D>1)-1;0===I?d(s,l,C--,O):1===I?d(c,u,L--,O):2===I&&d(h,f,z--,O)}}},scanBipartite:function(t,e,r,n,i,c,u,h,f,m,v,y){var x=0,b=2*t,_=e,w=e+t,k=1,M=1;n?M=o:k=o;for(var A=i;A>>1;a(p,C);for(var L=0,A=0;A=o?(P=!n,T-=o):(P=!!n,T-=1),P)g(s,l,L++,T);else{var I=y[T],O=b*T,D=v[O+e+1],R=v[O+e+1+t];t:for(var B=0;B>>1;a(p,k);for(var M=0,x=0;x=o)s[M++]=b-o;else{var T=d[b-=1],S=m*b,E=f[S+e+1],C=f[S+e+1+t];t:for(var L=0;L=0;--L)if(s[L]===b){for(var O=L+1;Oa)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return u(t)}return l(t,e,r)}function l(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return j(t)||t&&j(t.buffer)?function(t,e,r){if(e<0||t.byteLength=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function p(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||j(t))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(n)return B(t).length;e=(""+e).toLowerCase(),n=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),V(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var u=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var h=!0,f=0;fi&&(n=i):n=i;var a=e.length;n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function k(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function M(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:c>223?3:c>191?2:1;if(i+h<=r)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(a=t[i+1]))&&(l=(31&c)<<6|63&a)>127&&(u=l);break;case 3:a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&(l=(15&c)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,h=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=h}return function(t){var e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return E(this,e,r);case"utf8":case"utf-8":return M(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return S(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},s.prototype.compare=function(t,e,r,n,i){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0),l=Math.min(a,o),c=this.slice(n,i),u=t.slice(e,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return y(this,t,e,r);case"ascii":return x(this,t,e,r);case"latin1":case"binary":return b(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function T(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function z(t,e,r,n,i,a){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function P(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function I(t,e,r,n,a){return e=+e,r>>>=0,a||P(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function O(t,e,r,n,a){return e=+e,r>>>=0,a||P(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||L(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||L(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);for(var n=this[t],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},s.prototype.readInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||L(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||L(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||L(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||L(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||L(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||L(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||z(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n)||z(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||z(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||z(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||z(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||z(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||z(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);z(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);z(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||z(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||z(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||z(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||z(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||z(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return O(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return O(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--a)t[a+e]=this[a+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function F(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function N(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function j(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function V(t){return t!=t}},{"base64-js":62,ieee754:380}],93:[function(t,e,r){"use strict";var n=t("./lib/monotone"),i=t("./lib/triangulation"),a=t("./lib/delaunay"),o=t("./lib/filter");function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function c(t,e,r){return e in t?t[e]:r}e.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var u=!!c(r,"delaunay",!0),h=!!c(r,"interior",!0),f=!!c(r,"exterior",!0),p=!!c(r,"infinity",!1);if(!h&&!f||0===t.length)return[];var d=n(t,e);if(u||h!==f||p){for(var g=i(t.length,function(t){return t.map(s).sort(l)}(e)),m=0;m0;){for(var u=r.pop(),s=r.pop(),h=-1,f=-1,l=o[s],d=1;d=0||(e.flip(s,u),i(t,e,r,h,s,f),i(t,e,r,s,f,h),i(t,e,r,f,u,h),i(t,e,r,u,h,f)))}}},{"binary-search-bounds":98,"robust-in-sphere":469}],95:[function(t,e,r){"use strict";var n,i=t("binary-search-bounds");function a(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,i=0;i0||l.length>0;){for(;s.length>0;){var p=s.pop();if(c[p]!==-i){c[p]=i;u[p];for(var d=0;d<3;++d){var g=f[3*p+d];g>=0&&0===c[g]&&(h[3*p+d]?l.push(g):(s.push(g),c[g]=i))}}}var m=l;l=s,s=m,l.length=0,i=-i}var v=function(t,e,r){for(var n=0,i=0;i1&&i(r[f[p-2]],r[f[p-1]],a)>0;)t.push([f[p-1],f[p-2],o]),p-=1;f.length=p,f.push(o);var d=u.upperIds;for(p=d.length;p>1&&i(r[d[p-2]],r[d[p-1]],a)<0;)t.push([d[p-2],d[p-1],o]),p-=1;d.length=p,d.push(o)}}function p(t,e){var r;return(r=t.a[0]v[0]&&i.push(new c(v,m,s,h),new c(m,v,o,h))}i.sort(u);for(var y=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),x=[new l([y,1],[y,0],-1,[],[],[],[])],b=[],h=0,_=i.length;h<_;++h){var w=i[h],k=w.type;k===a?f(b,x,t,w.a,w.idx):k===s?d(x,t,w):g(x,t,w)}return b}},{"binary-search-bounds":98,"robust-orientation":471}],97:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function i(t,e){this.stars=t,this.edges=e}e.exports=function(t,e){for(var r=new Array(t),n=0;n=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],99:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1,r=1;rr?r:t:te?e:t}},{}],103:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n;if(r){n=e;for(var i=new Array(e.length),a=0;ae[2]?1:0)}function v(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var x=e[u=(S=n[a])[0]],b=x[0],_=x[1],w=t[b],k=t[_];if((w[0]-k[0]||w[1]-k[1])<0){var M=b;b=_,_=M}x[0]=b;var A,T=x[1]=S[1];for(i&&(A=x[2]);a>0&&n[a-1][0]===u;){var S,E=(S=n[--a])[1];i?e.push([T,E,A]):e.push([T,E]),T=E}i?e.push([T,_,A]):e.push([T,_])}return f}(t,e,f,m,r));return v(e,y,r),!!y||(f.length>0||m.length>0)}},{"./lib/rat-seg-intersect":104,"big-rat":66,"big-rat/cmp":64,"big-rat/to-float":78,"box-intersect":84,nextafter:418,"rat-vec":453,"robust-segment-intersect":474,"union-find":508}],104:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=s(e,t),h=s(n,r),f=u(a,h);if(0===o(f))return null;var p=s(t,r),d=u(h,p),g=i(d,f),m=c(a,g);return l(t,m)};var n=t("big-rat/mul"),i=t("big-rat/div"),a=t("big-rat/sub"),o=t("big-rat/sign"),s=t("rat-vec/sub"),l=t("rat-vec/add"),c=t("rat-vec/muls");function u(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},{"big-rat/div":65,"big-rat/mul":75,"big-rat/sign":76,"big-rat/sub":77,"rat-vec/add":452,"rat-vec/muls":454,"rat-vec/sub":455}],105:[function(t,e,r){"use strict";var n=t("clamp");function i(t,e){null==e&&(e=!0);var r=t[0],i=t[1],a=t[2],o=t[3];return null==o&&(o=e?1:255),e&&(r*=255,i*=255,a*=255,o*=255),16777216*(r=255&n(r,0,255))+((i=255&n(i,0,255))<<16)+((a=255&n(a,0,255))<<8)+(o=255&n(o,0,255))}e.exports=i,e.exports.to=i,e.exports.from=function(t,e){var r=(t=+t)>>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},{clamp:102}],106:[function(t,e,r){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],107:[function(t,e,r){"use strict";var n=t("color-rgba"),i=t("clamp"),a=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=a(e),o=new r(4);if(t instanceof r)return Array.isArray(t)?t.slice():(o.set(t),o);var s="uint8"!==e&&"uint8_clamped"!==e;return t instanceof Uint8Array||t instanceof Uint8ClampedArray?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:255,s&&(o[0]/=255,o[1]/=255,o[2]/=255,o[3]/=255),o):(t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),s?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:1):(o[0]=i(Math.round(255*t[0]),0,255),o[1]=i(Math.round(255*t[1]),0,255),o[2]=i(Math.round(255*t[2]),0,255),o[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),o)}},{clamp:102,"color-rgba":109,dtype:153}],108:[function(t,e,r){(function(r){"use strict";var n=t("color-name"),i=t("is-plain-obj"),a=t("defined");e.exports=function(t){var e,s,l=[],c=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)c=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var u=t.slice(1),h=u.length,f=h<=4;c=1,f?(l=[parseInt(u[0]+u[0],16),parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16)],4===h&&(c=parseInt(u[3]+u[3],16)/255)):(l=[parseInt(u[0]+u[1],16),parseInt(u[2]+u[3],16),parseInt(u[4]+u[5],16)],8===h&&(c=parseInt(u[6]+u[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var p=e[1],u=p.replace(/a$/,"");s=u;var h="cmyk"===u?4:"gray"===u?1:3;l=e[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===h?parseFloat(t)/100:"rgb"===u?255*parseFloat(t)/100:parseFloat(t);if("h"===u[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),p===u&&l.push(1),c=void 0===l[h]?1:l[h],l=l.slice(0,h)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),s=t.match(/([a-z])/gi).join("").toLowerCase());else if("number"==typeof t)s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];else if(i(t)){var d=a(t.r,t.red,t.R,null);null!==d?(s="rgb",l=[d,a(t.g,t.green,t.G),a(t.b,t.blue,t.B)]):(s="hsl",l=[a(t.h,t.hue,t.H),a(t.s,t.saturation,t.S),a(t.l,t.lightness,t.L,t.b,t.brightness)]),c=a(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(c/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",c=4===t.length?t[3]:1);return{space:s,values:l,alpha:c}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":106,defined:148,"is-plain-obj":390}],109:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t){var e;if("string"!=typeof t)throw Error("Argument should be a string");var r=n(t);return r.space?((e=Array(3))[0]=a(r.values[0],0,255),e[1]=a(r.values[1],0,255),e[2]=a(r.values[2],0,255),"h"===r.space[0]&&(e=i.rgb(e)),e.push(a(r.alpha,0,1)),e):[]}},{clamp:102,"color-parse":108,"color-space/hsl":110}],110:[function(t,e,r){"use strict";var n=t("./rgb");e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[a=255*l,a,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var c=0;c<3;c++)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[c]=255*a;return i}},n.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?e=0:n===s?e=(i-a)/l:i===s?e=2+(a-n)/l:a===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},{"./rgb":111}],111:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],112:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],113:[function(t,e,r){"use strict";var n=t("./colorScale"),i=t("lerp");function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}e.exports=function(t){var e,r,l,c,u,h,f,p,d,g;t||(t={});p=(t.nshades||72)-1,f=t.format||"hex",(h=t.colormap)||(h="jet");if("string"==typeof h){if(h=h.toLowerCase(),!n[h])throw Error(h+" not a supported colorscale");u=n[h]}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);u=h.slice()}if(u.length>p)throw new Error(h+" map requires nshades to be at least size "+u.length);d=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1];e=u.map(function(t){return Math.round(t.index*p)}),d[0]=Math.min(Math.max(d[0],0),1),d[1]=Math.min(Math.max(d[1],0),1);var m=u.map(function(t,e){var r=u[e].index,n=u[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1?n:(n[3]=d[0]+(d[1]-d[0])*r,n)}),v=[];for(g=0;g0?-1:l(t,e,a)?-1:1:0===s?c>0?1:l(t,e,r)?1:-1:i(c-s)}var f=n(t,e,r);if(f>0)return o>0&&n(t,e,a)>0?1:-1;if(f<0)return o>0||n(t,e,a)>0?1:-1;var p=n(t,e,a);return p>0?1:l(t,e,r)?1:-1};var n=t("robust-orientation"),i=t("signum"),a=t("two-sum"),o=t("robust-product"),s=t("robust-sum");function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),c=a(r[1],-e[1]),u=s(o(n,l),o(i,c));return u[u.length-1]>=0}},{"robust-orientation":471,"robust-product":472,"robust-sum":476,signum:477,"two-sum":506}],115:[function(t,e,r){e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||n(t[0],t[1])-n(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=n(t[0],t[1]),c=n(e[0],e[1]);return n(l,t[2])-n(c,e[2])||n(l+t[2],o)-n(c+e[2],s);case 4:var u=t[0],h=t[1],f=t[2],p=t[3],d=e[0],g=e[1],m=e[2],v=e[3];return u+h+f+p-(d+g+m+v)||n(u,h,f,p)-n(d,g,m,v,d)||n(u+h,u+f,u+p,h+f,h+p,f+p)-n(d+g,d+m,d+v,g+m,g+v,m+v)||n(u+h+f,u+h+p,u+f+p,h+f+p)-n(d+g+m,d+g+v,d+m+v,g+m+v);default:for(var y=t.slice().sort(i),x=e.slice().sort(i),b=0;bt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],119:[function(t,e,r){"use strict";e.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o=e[l]&&(s+=1);a[o]=s}}return t}(o,r)}};var n=t("incremental-convex-hull"),i=t("affine-hull")},{"affine-hull":53,"incremental-convex-hull":381}],121:[function(t,e,r){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|ç)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|é)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|é)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|ã)o.?tom(e|é)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],122:[function(t,e,r){e.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]},{}],123:[function(t,e,r){e.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]},{}],124:[function(t,e,r){e.exports=["normal","italic","oblique"]},{}],125:[function(t,e,r){e.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]},{}],126:[function(t,e,r){"use strict";e.exports={parse:t("./parse"),stringify:t("./stringify")}},{"./parse":128,"./stringify":129}],127:[function(t,e,r){"use strict";var n=t("css-font-size-keywords");e.exports={isSize:function(t){return/^[\d\.]/.test(t)||-1!==t.indexOf("/")||-1!==n.indexOf(t)}}},{"css-font-size-keywords":122}],128:[function(t,e,r){"use strict";var n=t("unquote"),i=t("css-global-keywords"),a=t("css-system-font-keywords"),o=t("css-font-weight-keywords"),s=t("css-font-style-keywords"),l=t("css-font-stretch-keywords"),c=t("string-split-by"),u=t("./lib/util").isSize;e.exports=f;var h=f.cache={};function f(t){if("string"!=typeof t)throw new Error("Font argument must be a string.");if(h[t])return h[t];if(""===t)throw new Error("Cannot parse an empty string.");if(-1!==a.indexOf(t))return h[t]={system:t};for(var e,r={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},f=c(t,/\s+/);e=f.shift();){if(-1!==i.indexOf(e))return["style","variant","weight","stretch"].forEach(function(t){r[t]=e}),h[t]=r;if(-1===s.indexOf(e))if("normal"!==e&&"small-caps"!==e)if(-1===l.indexOf(e)){if(-1===o.indexOf(e)){if(u(e)){var d=c(e,"/");if(r.size=d[0],null!=d[1]?r.lineHeight=p(d[1]):"/"===f[0]&&(f.shift(),r.lineHeight=p(f.shift())),!f.length)throw new Error("Missing required font-family.");return r.family=c(f.join(" "),/\s*,\s*/).map(n),h[t]=r}throw new Error("Unknown or unsupported font token: "+e)}r.weight=e}else r.stretch=e;else r.variant=e;else r.style=e}throw new Error("Missing required font-size.")}function p(t){var e=parseFloat(t);return e.toString()===t?e:t}},{"./lib/util":127,"css-font-stretch-keywords":123,"css-font-style-keywords":124,"css-font-weight-keywords":125,"css-global-keywords":130,"css-system-font-keywords":131,"string-split-by":490,unquote:510}],129:[function(t,e,r){"use strict";var n=t("pick-by-alias"),i=t("./lib/util").isSize,a=g(t("css-global-keywords")),o=g(t("css-system-font-keywords")),s=g(t("css-font-weight-keywords")),l=g(t("css-font-style-keywords")),c=g(t("css-font-stretch-keywords")),u={normal:1,"small-caps":1},h={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},f="1rem",p="serif";function d(t,e){if(t&&!e[t]&&!a[t])throw Error("Unknown keyword `"+t+"`");return t}function g(t){for(var e={},r=0;r=0;--p)a[p]=c*t[p]+u*e[p]+h*r[p]+f*n[p];return a}return c*t+u*e+h*r+f*n},e.exports.derivative=function(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},{}],133:[function(t,e,r){"use strict";var n=t("./lib/thunk.js");function i(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}e.exports=function(t){var e=new i;e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var a=0;a0)throw new Error("cwise: pre() block may not reference array args");if(a0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===o)e.scalarArgs.push(a),e.shimArgs.push("scalar"+a);else if("index"===o){if(e.indexArgs.push(a),a0)throw new Error("cwise: pre() block may not reference array index");if(a0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(e.shapeArgs.push(a),ar.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,n(e)}},{"./lib/thunk.js":135}],134:[function(t,e,r){"use strict";var n=t("uniq");function i(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],c=[],u=0,h=0;for(n=0;n0&&l.push("var "+c.join(",")),n=a-1;n>=0;--n)u=t[n],l.push(["for(i",n,"=0;i",n,"0&&l.push(["index[",h,"]-=s",h].join("")),l.push(["++index[",u,"]"].join(""))),l.push("}")}return l.join("\n")}function a(t,e,r){for(var n=t.body,i=[],a=[],o=0;o0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}e.exports=function(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,s=new Array(t.arrayArgs.length),l=new Array(t.arrayArgs.length),c=0;c0&&x.push("shape=SS.slice(0)"),t.indexArgs.length>0){var b=new Array(r);for(c=0;c0&&y.push("var "+x.join(",")),c=0;c3&&y.push(a(t.pre,t,l));var M=a(t.body,t,l),A=function(t){for(var e=0,r=t[0].length;e0,c=[],u=0;u0;){"].join("")),c.push(["if(j",u,"<",s,"){"].join("")),c.push(["s",e[u],"=j",u].join("")),c.push(["j",u,"=0"].join("")),c.push(["}else{s",e[u],"=",s].join("")),c.push(["j",u,"-=",s,"}"].join("")),l&&c.push(["index[",e[u],"]=j",u].join(""));for(u=0;u3&&y.push(a(t.post,t,l)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+y.join("\n")+"\n----------");var T=[t.funcName||"unnamed","_cwise_loop_",s[0].join("s"),"m",A,o(l)].join("");return new Function(["function ",T,"(",v.join(","),"){",y.join("\n"),"} return ",T].join(""))()}},{uniq:509}],135:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));for(var a=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],c=[],u=0;u0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+h+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[u]))),c.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+h+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[u])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),u=0;ue?1:t>=e?0:NaN},r=function(t){var r;return 1===t.length&&(r=t,t=function(t,n){return e(r(t),n)}),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}},n=r(e),i=n.right,a=n.left;function o(t,e){return[t,e]}var s=function(t){return null===t?NaN:+t},l=function(t,e){var r,n,i=t.length,a=0,o=-1,l=0,c=0;if(null==e)for(;++o1)return c/(a-1)},c=function(t,e){var r=l(t,e);return r?Math.sqrt(r):r},u=function(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o=r)for(n=i=r;++or&&(n=r),i=r)for(n=i=r;++or&&(n=r),i=0?(a>=v?10:a>=y?5:a>=x?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=v?10:a>=y?5:a>=x?2:1)}function _(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=v?i*=10:a>=y?i*=5:a>=x&&(i*=2),e=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}},M=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n},A=function(t){if(!(i=t.length))return[];for(var e=-1,r=M(t,T),n=new Array(r);++et?1:e>=t?0:NaN},t.deviation=c,t.extent=u,t.histogram=function(){var t=g,e=u,r=w;function n(n){var a,o,s=n.length,l=new Array(s);for(a=0;ah;)f.pop(),--p;var d,g=new Array(p+1);for(a=0;a<=p;++a)(d=g[a]=[]).x0=a>0?f[a-1]:u,d.x1=a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r},t.min=M,t.pairs=function(t,e){null==e&&(e=o);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r0)return[t];if((n=e0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s=l.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var s,c,h,f=-1,p=n.length,d=l[i++],g=r(),m=a();++fl.length)return r;var i,a=c[n-1];return null!=e&&n>=l.length?i=r.entries():(i=[],r.each(function(e,r){i.push({key:r,values:t(e,n)})})),null!=a?i.sort(function(t,e){return a(t.key,e.key)}):i}(u(t,0,a,o),0)},key:function(t){return l.push(t),s},sortKeys:function(t){return c[l.length-1]=t,s},sortValues:function(e){return t=e,s},rollup:function(t){return e=t,s}}},t.set=c,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],141:[function(t,e,r){var n;n=this,function(t){"use strict";var e=function(t,e,r){t.prototype=e.prototype=r,r.constructor=t};function r(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function n(){}var i="\\s*([+-]?\\d+)\\s*",a="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",o="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",s=/^#([0-9a-f]{3})$/,l=/^#([0-9a-f]{6})$/,c=new RegExp("^rgb\\("+i+","+i+","+i+"\\)$"),u=new RegExp("^rgb\\("+o+","+o+","+o+"\\)$"),h=new RegExp("^hsl\\("+a+","+o+","+o+"\\)$"),f=new RegExp("^rgba\\("+i+","+i+","+i+","+a+"\\)$"),p=new RegExp("^rgba\\("+o+","+o+","+o+","+a+"\\)$"),d=new RegExp("^hsla\\("+a+","+o+","+o+","+a+"\\)$"),g={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function m(t){var e;return t=(t+"").trim().toLowerCase(),(e=s.exec(t))?new _((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=l.exec(t))?v(parseInt(e[1],16)):(e=c.exec(t))?new _(e[1],e[2],e[3],1):(e=u.exec(t))?new _(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=f.exec(t))?y(e[1],e[2],e[3],e[4]):(e=p.exec(t))?y(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=h.exec(t))?w(e[1],e[2]/100,e[3]/100,1):(e=d.exec(t))?w(e[1],e[2]/100,e[3]/100,e[4]):g.hasOwnProperty(t)?v(g[t]):"transparent"===t?new _(NaN,NaN,NaN,0):null}function v(t){return new _(t>>16&255,t>>8&255,255&t,1)}function y(t,e,r,n){return n<=0&&(t=e=r=NaN),new _(t,e,r,n)}function x(t){return t instanceof n||(t=m(t)),t?new _((t=t.rgb()).r,t.g,t.b,t.opacity):new _}function b(t,e,r,n){return 1===arguments.length?x(t):new _(t,e,r,null==n?1:n)}function _(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function w(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new M(t,e,r,n)}function k(t,e,r,i){return 1===arguments.length?function(t){if(t instanceof M)return new M(t.h,t.s,t.l,t.opacity);if(t instanceof n||(t=m(t)),!t)return new M;if(t instanceof M)return t;var e=(t=t.rgb()).r/255,r=t.g/255,i=t.b/255,a=Math.min(e,r,i),o=Math.max(e,r,i),s=NaN,l=o-a,c=(o+a)/2;return l?(s=e===o?(r-i)/l+6*(r0&&c<1?0:s,new M(s,l,c,t.opacity)}(t):new M(t,e,r,null==i?1:i)}function M(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function A(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}e(n,m,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),e(_,b,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new _(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new _(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),e(M,k,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new M(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new M(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new _(A(t>=240?t-240:t+120,i,n),A(t,i,n),A(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var T=Math.PI/180,S=180/Math.PI,E=.95047,C=1,L=1.08883,z=4/29,P=6/29,I=3*P*P,O=P*P*P;function D(t){if(t instanceof B)return new B(t.l,t.a,t.b,t.opacity);if(t instanceof q){var e=t.h*T;return new B(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof _||(t=x(t));var r=V(t.r),n=V(t.g),i=V(t.b),a=F((.4124564*r+.3575761*n+.1804375*i)/E),o=F((.2126729*r+.7151522*n+.072175*i)/C);return new B(116*o-16,500*(a-o),200*(o-F((.0193339*r+.119192*n+.9503041*i)/L)),t.opacity)}function R(t,e,r,n){return 1===arguments.length?D(t):new B(t,e,r,null==n?1:n)}function B(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function F(t){return t>O?Math.pow(t,1/3):t/I+z}function N(t){return t>P?t*t*t:I*(t-z)}function j(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function V(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function U(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof q)return new q(t.h,t.c,t.l,t.opacity);t instanceof B||(t=D(t));var e=Math.atan2(t.b,t.a)*S;return new q(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new q(t,e,r,null==n?1:n)}function q(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}e(B,R,r(n,{brighter:function(t){return new B(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new B(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return t=C*N(t),new _(j(3.2404542*(e=E*N(e))-1.5371385*t-.4985314*(r=L*N(r))),j(-.969266*e+1.8760108*t+.041556*r),j(.0556434*e-.2040259*t+1.0572252*r),this.opacity)}})),e(q,U,r(n,{brighter:function(t){return new q(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new q(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return D(this).rgb()}}));var H=-.14861,G=1.78277,W=-.29227,Y=-.90649,X=1.97294,Z=X*Y,$=X*G,J=G*W-Y*H;function K(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof Q)return new Q(t.h,t.s,t.l,t.opacity);t instanceof _||(t=x(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(J*n+Z*e-$*r)/(J+Z-$),a=n-i,o=(X*(r-i)-W*a)/Y,s=Math.sqrt(o*o+a*a)/(X*i*(1-i)),l=s?Math.atan2(o,a)*S-120:NaN;return new Q(l<0?l+360:l,s,i,t.opacity)}(t):new Q(t,e,r,null==n?1:n)}function Q(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}e(Q,K,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Q(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Q(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*T,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new _(255*(e+r*(H*n+G*i)),255*(e+r*(W*n+Y*i)),255*(e+r*(X*n)),this.opacity)}})),t.color=m,t.rgb=b,t.hsl=k,t.lab=R,t.hcl=U,t.cubehelix=K,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],142:[function(t,e,r){var n;n=this,function(t){"use strict";var e={value:function(){}};function r(){for(var t,e=0,r=arguments.length,i={};e=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),l=-1,c=s.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++l0)for(var r,n,i=new Array(r),a=0;af+c||np+c||au.index){var h=f-s.x-s.vx,m=p-s.y-s.vy,v=h*h+m*m;vt.r&&(t.r=t[e].r)}function f(){if(r){var e,i,a=r.length;for(n=new Array(a),e=0;e=c)){(t.data!==r||t.next)&&(0===h&&(d+=(h=o())*h),0===f&&(d+=(f=o())*f),d1?(null==r?u.remove(t):u.set(t,y(r)),e):u.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c1?(f.on(t,r),e):f.on(t)}}},t.forceX=function(t){var e,r,n,i=a(.1);function o(t){for(var i,a=0,o=e.length;a=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=i180||r<-180?r-360*Math.round(r/360):r):a(isNaN(t)?e:t)}function l(t){return 1==(t=+t)?c:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):a(isNaN(e)?r:e)}}function c(t,e){var r=e-t;return r?o(t,r):a(isNaN(t)?e:t)}var u=function t(r){var n=l(r);function i(t,r){var i=n((t=e.rgb(t)).r,(r=e.rgb(r)).r),a=n(t.g,r.g),o=n(t.b,r.b),s=c(t.opacity,r.opacity);return function(e){return t.r=i(e),t.g=a(e),t.b=o(e),t.opacity=s(e),t+""}}return i.gamma=t,i}(1);function h(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;na&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:b(r,n)})),a=k.lastIndex;return a180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:b(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:b(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:b(t,r)},{i:s-2,x:b(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r=(a=(g+v)/2))?g=a:v=a,(u=r>=(o=(m+y)/2))?m=o:y=o,i=p,!(p=p[h=u<<1|c]))return i[h]=d,t;if(s=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===s&&r===l)return d.next=p,i?i[h]=d:t._root=d,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+v)/2))?g=a:v=a,(u=r>=(o=(m+y)/2))?m=o:y=o}while((h=u<<1|c)==(f=(l>=o)<<1|s>=a));return i[f]=p,i[h]=d,t}var r=function(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i};function n(t){return t[0]}function i(t){return t[1]}function a(t,e,r){var a=new o(null==e?n:e,null==r?i:r,NaN,NaN,NaN,NaN);return null==t?a:a.addAll(t)}function o(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function s(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var l=a.prototype=o.prototype;l.copy=function(){var t,e,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=s(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,h=-1/0,f=-1/0;for(n=0;nh&&(h=i),af&&(f=a));for(ht||t>i||n>e||e>a))return this;var o,s,l=i-r,c=this._root;switch(s=(e<(n+a)/2)<<1|t<(r+i)/2){case 0:do{(o=new Array(4))[s]=c,c=o}while(a=n+(l*=2),t>(i=r+l)||e>a);break;case 1:do{(o=new Array(4))[s]=c,c=o}while(a=n+(l*=2),(r=i-l)>t||e>a);break;case 2:do{(o=new Array(4))[s]=c,c=o}while(n=a-(l*=2),t>(i=r+l)||n>e);break;case 3:do{(o=new Array(4))[s]=c,c=o}while(n=a-(l*=2),(r=i-l)>t||n>e)}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},l.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},l.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},l.find=function(t,e,n){var i,a,o,s,l,c,u,h=this._x0,f=this._y0,p=this._x1,d=this._y1,g=[],m=this._root;for(m&&g.push(new r(m,h,f,p,d)),null==n?n=1/0:(h=t-n,f=e-n,p=t+n,d=e+n,n*=n);c=g.pop();)if(!(!(m=c.node)||(a=c.x0)>p||(o=c.y0)>d||(s=c.x1)=y)<<1|t>=v)&&(c=g[g.length-1],g[g.length-1]=g[g.length-1-u],g[g.length-1-u]=c)}else{var x=t-+this._x.call(null,m.data),b=e-+this._y.call(null,m.data),_=x*x+b*b;if(_=(s=(d+m)/2))?d=s:m=s,(u=o>=(l=(g+v)/2))?g=l:v=l,e=p,!(p=p[h=u<<1|c]))return this;if(!p.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(r=e,f=h)}for(;p.data!==t;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):e?(i?e[h]=i:delete e[h],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(r?r[f]=p:this._root=p),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,r=t.length;e=0&&r._call.call(null,t),r=r._next;--n}function v(){l=(s=u.now())+c,n=i=0;try{m()}finally{n=0,function(){var t,n,i=e,a=1/0;for(;i;)i._call?(a>i._time&&(a=i._time),t=i,i=i._next):(n=i._next,i._next=null,i=t?t._next=n:e=n);r=t,x(a)}(),l=0}}function y(){var t=u.now(),e=t-s;e>o&&(c-=e,s=t)}function x(t){n||(i&&(i=clearTimeout(i)),t-l>24?(t<1/0&&(i=setTimeout(v,t-u.now()-c)),a&&(a=clearInterval(a))):(a||(s=u.now(),a=setInterval(y,o)),n=1,h(v)))}d.prototype=g.prototype={constructor:d,restart:function(t,n,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?f():+i)+(null==n?0:+n),this._next||r===this||(r?r._next=this:e=this,r=this),this._call=t,this._time=i,x()},stop:function(){this._call&&(this._call=null,this._time=1/0,x())}},t.now=f,t.timer=g,t.timerFlush=m,t.timeout=function(t,e,r){var n=new d;return e=null==e?0:+e,n.restart(function(r){n.stop(),t(r+e)},e,r),n},t.interval=function(t,e,r){var n=new d,i=e;return null==e?(n.restart(t,e,r),n):(e=+e,r=null==r?f():+r,n.restart(function a(o){o+=i,n.restart(a,i+=e,r),t(o)},e,r),n)},Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],147:[function(t,e,r){!function(){var t={version:"3.5.17"},r=[].slice,n=function(t){return r.call(t)},i=this.document;function a(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(i)try{n(i.documentElement.childNodes)[0].nodeType}catch(t){n=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),i)try{i.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var s=this.Element.prototype,l=s.setAttribute,c=s.setAttributeNS,u=this.CSSStyleDeclaration.prototype,h=u.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){c.call(this,t,e,r+"")},u.setProperty=function(t,e,r){h.call(this,t,e+"",r)}}function f(t,e){return te?1:t>=e?0:NaN}function p(t){return null===t?NaN:+t}function d(t){return!isNaN(t)}function g(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}t.ascending=f,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},t.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},t.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var m=g(f);function v(t){return t.length}t.bisectLeft=m.left,t.bisect=t.bisectRight=m.right,t.bisector=function(t){return g(1===t.length?function(e,r){return f(t(e),r)}:t)},t.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;function x(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function b(){this._=Object.create(null)}t.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,i=[],a=function(t){var e=1;for(;t*e%1;)e*=10;return e}(y(r)),o=-1;if(t*=a,e*=a,(r*=a)<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)=i.length)return r?r.call(n,a):e?a.sort(e):a;for(var l,c,u,h,f=-1,p=a.length,d=i[s++],g=new b;++f=i.length)return e;var n=[],o=a[r++];return e.forEach(function(e,i){n.push({key:e,values:t(i,r)})}),o?n.sort(function(t,e){return o(t.key,e.key)}):n}(o(t.map,e,0),0)},n.key=function(t){return i.push(t),n},n.sortKeys=function(t){return a[i.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new L;if(t)for(var r=0,n=t.length;r=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(V,"\\$&")};var V=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,U={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function q(t){return U(t,Y),t}var H=function(t,e){return e.querySelector(t)},G=function(t,e){return e.querySelectorAll(t)},W=function(t,e){var r=t.matches||t[I(t,"matchesSelector")];return(W=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(H=function(t,e){return Sizzle(t,e)[0]||null},G=Sizzle,W=Sizzle.matchesSelector),t.selection=function(){return t.select(i.documentElement)};var Y=t.selection.prototype=[];function X(t){return"function"==typeof t?t:function(){return H(t,this)}}function Z(t){return"function"==typeof t?t:function(){return G(t,this)}}Y.select=function(t){var e,r,n,i,a=[];t=X(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),J.hasOwnProperty(r)?{space:J[r],local:t}:t}},Y.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(K(r,e[r]));return this}return this.each(K(e,r))},Y.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=et(t)).length,i=-1;if(e=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},Y.sort=function(t){t=function(t){arguments.length||(t=f);return function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e0&&(e=e.slice(0,o));var l=dt.get(e);function c(){var t=this[a];t&&(this.removeEventListener(e,t,t.$),delete this[a])}return l&&(e=l,s=mt),o?r?function(){var t=s(r,n(arguments));c.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:c:r?D:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}t.selection.enter=ht,t.selection.enter.prototype=ft,ft.append=Y.append,ft.empty=Y.empty,ft.node=Y.node,ft.call=Y.call,ft.size=Y.size,ft.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s=n&&(n=e+1);!(o=s[n])&&++n0?1:t<0?-1:0}function Pt(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function It(t){return t>1?0:t<-1?At:Math.acos(t)}function Ot(t){return t>1?Et:t<-1?-Et:Math.asin(t)}function Dt(t){return((t=Math.exp(t))+1/t)/2}function Rt(t){return(t=Math.sin(t/2))*t}var Bt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],c=e[2],u=s-i,h=l-a,f=u*u+h*h;if(f0&&(e=e.transition().duration(g)),e.call(w.event)}function S(){c&&c.domain(l.range().map(function(t){return(t-f.x)/f.k}).map(l.invert)),h&&h.domain(u.range().map(function(t){return(t-f.y)/f.k}).map(u.invert))}function E(t){m++||t({type:"zoomstart"})}function C(t){S(),t({type:"zoom",scale:f.k,translate:[f.x,f.y]})}function L(t){--m||(t({type:"zoomend"}),r=null)}function z(){var e=this,r=_.of(e,arguments),n=0,i=t.select(o(e)).on(y,function(){n=1,A(t.mouse(e),a),C(r)}).on(x,function(){i.on(y,null).on(x,null),s(n),L(r)}),a=k(t.mouse(e)),s=xt(e);ps.call(e),E(r)}function P(){var e,r=this,n=_.of(r,arguments),i={},a=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,u=[],h=t.select(r),p=xt(r);function d(){var n=t.touches(r);return e=f.k,n.forEach(function(t){t.identifier in i&&(i[t.identifier]=k(t))}),n}function g(){var e=t.event.target;t.select(e).on(l,m).on(c,y),u.push(e);for(var n=t.event.changedTouches,o=0,h=n.length;o1){v=p[0];var x=p[1],b=v[0]-x[0],_=v[1]-x[1];a=b*b+_*_}}function m(){var o,l,c,u,h=t.touches(r);ps.call(r);for(var f=0,p=h.length;f360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new ae(a(t+120),a(t),a(t-120))}function Gt(e,r,n){return this instanceof Gt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Gt?new Gt(e.h,e.c,e.l):ee(e instanceof Xt?e.l:(e=fe((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Gt(e,r,n)}qt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ut(this.h,this.s,this.l/t)},qt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ut(this.h,this.s,t*this.l)},qt.rgb=function(){return Ht(this.h,this.s,this.l)},t.hcl=Gt;var Wt=Gt.prototype=new Vt;function Yt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Xt(r,Math.cos(t*=Ct)*e,Math.sin(t)*e)}function Xt(t,e,r){return this instanceof Xt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Xt?new Xt(t.l,t.a,t.b):t instanceof Gt?Yt(t.h,t.c,t.l):fe((t=ae(t)).r,t.g,t.b):new Xt(t,e,r)}Wt.brighter=function(t){return new Gt(this.h,this.c,Math.min(100,this.l+Zt*(arguments.length?t:1)))},Wt.darker=function(t){return new Gt(this.h,this.c,Math.max(0,this.l-Zt*(arguments.length?t:1)))},Wt.rgb=function(){return Yt(this.h,this.c,this.l).rgb()},t.lab=Xt;var Zt=18,$t=.95047,Jt=1,Kt=1.08883,Qt=Xt.prototype=new Vt;function te(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new ae(ie(3.2404542*(i=re(i)*$t)-1.5371385*(n=re(n)*Jt)-.4985314*(a=re(a)*Kt)),ie(-.969266*i+1.8760108*n+.041556*a),ie(.0556434*i-.2040259*n+1.0572252*a))}function ee(t,e,r){return t>0?new Gt(Math.atan2(r,e)*Lt,Math.sqrt(e*e+r*r),t):new Gt(NaN,NaN,t)}function re(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ne(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ie(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ae(t,e,r){return this instanceof ae?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ae?new ae(t.r,t.g,t.b):ue(""+t,ae,Ht):new ae(t,e,r)}function oe(t){return new ae(t>>16,t>>8&255,255&t)}function se(t){return oe(t)+""}Qt.brighter=function(t){return new Xt(Math.min(100,this.l+Zt*(arguments.length?t:1)),this.a,this.b)},Qt.darker=function(t){return new Xt(Math.max(0,this.l-Zt*(arguments.length?t:1)),this.a,this.b)},Qt.rgb=function(){return te(this.l,this.a,this.b)},t.rgb=ae;var le=ae.prototype=new Vt;function ce(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ue(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(de(i[0]),de(i[1]),de(i[2]))}return(a=ge.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function he(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e0&&l<1?0:n),new Ut(n,i,l)}function fe(t,e,r){var n=ne((.4124564*(t=pe(t))+.3575761*(e=pe(e))+.1804375*(r=pe(r)))/$t),i=ne((.2126729*t+.7151522*e+.072175*r)/Jt);return Xt(116*i-16,500*(n-i),200*(i-ne((.0193339*t+.119192*e+.9503041*r)/Kt)))}function pe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function de(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}le.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=i.call(o,c)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,c)}return!this.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(e)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=h:c.onreadystatechange=function(){c.readyState>3&&h()},c.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,c)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(u=t,o):u},o.response=function(t){return i=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}}),o.send=function(t,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),c.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),c.setRequestHeader)for(var a in l)c.setRequestHeader(a,l[a]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=i&&o.on("error",i).on("load",function(t){i(null,t)}),s.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},t.rebind(o,s,"on"),null==a?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(a))}ge.forEach(function(t,e){ge.set(t,oe(e))}),t.functor=me,t.xhr=ve(z),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=ye(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var r;return i.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,r){return e(i(t),r)}:i})},i.parseRows=function(t,e){var r,i,a={},o={},s=[],l=t.length,c=0,u=0;function h(){if(c>=l)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(we),we=setTimeout(Ae,e)),_e=0):(_e=1,ke(Ae))}function Te(){for(var t=Date.now(),e=xe;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Se(){for(var t,e=xe,r=1/0;e;)e.c?(e.t8?function(t){return t/r}:function(t){return t*r},symbol:t}});function Le(e){var r=e.decimal,n=e.thousands,i=e.grouping,a=e.currency,o=i&&n?function(t,e){for(var r=t.length,a=[],o=0,s=i[0],l=0;r>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(r-=s,r+s)),!((l+=s+1)>e));)s=i[o=(o+1)%i.length];return a.reverse().join(n)}:z;return function(e){var n=ze.exec(e),i=n[1]||" ",s=n[2]||">",l=n[3]||"-",c=n[4]||"",u=n[5],h=+n[6],f=n[7],p=n[8],d=n[9],g=1,m="",v="",y=!1,x=!0;switch(p&&(p=+p.substring(1)),(u||"0"===i&&"="===s)&&(u=i="0",s="="),d){case"n":f=!0,d="g";break;case"%":g=100,v="%",d="f";break;case"p":g=100,v="%",d="r";break;case"b":case"o":case"x":case"X":"#"===c&&(m="0"+d.toLowerCase());case"c":x=!1;case"d":y=!0,p=0;break;case"s":g=-1,d="r"}"$"===c&&(m=a[0],v=a[1]),"r"!=d||p||(d="g"),null!=p&&("g"==d?p=Math.max(1,Math.min(21,p)):"e"!=d&&"f"!=d||(p=Math.max(0,Math.min(20,p)))),d=Pe.get(d)||Ie;var b=u&&f;return function(e){var n=v;if(y&&e%1)return"";var a=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===l?"":l;if(g<0){var c=t.formatPrefix(e,p);e=c.scale(e),n=c.symbol+v}else e*=g;var _,w,k=(e=d(e,p)).lastIndexOf(".");if(k<0){var M=x?e.lastIndexOf("e"):-1;M<0?(_=e,w=""):(_=e.substring(0,M),w=e.substring(M))}else _=e.substring(0,k),w=r+e.substring(k+1);!u&&f&&(_=o(_,1/0));var A=m.length+_.length+w.length+(b?0:a.length),T=A"===s?T+a+e:"^"===s?T.substring(0,A>>=1)+a+e+T.substring(A):a+(b?e:T+e))+n}}}t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Ee(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Ce[8+n/3]};var ze=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Pe=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,r){return(e=t.round(e,Ee(e,r))).toFixed(Math.max(0,Math.min(20,Ee(e*(1+1e-15),r))))}});function Ie(t){return t+""}var Oe=t.time={},De=Date;function Re(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Re.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Be.setUTCDate.apply(this._,arguments)},setDay:function(){Be.setUTCDay.apply(this._,arguments)},setFullYear:function(){Be.setUTCFullYear.apply(this._,arguments)},setHours:function(){Be.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Be.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Be.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Be.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Be.setUTCSeconds.apply(this._,arguments)},setTime:function(){Be.setTime.apply(this._,arguments)}};var Be=Date.prototype;function Fe(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r1)for(;o=c)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=w[o in Ve?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}u.utc=function(t){var e=u(t);function r(t){try{var r=new(De=Re);return r._=t,e(r)}finally{De=Date}}return r.parse=function(t){try{De=Re;var r=e.parse(t);return r&&r._}finally{De=Date}},r.toString=e.toString,r},u.multi=u.utc.multi=lr;var f=t.map(),p=Ge(o),d=We(o),g=Ge(s),m=We(s),v=Ge(l),y=We(l),x=Ge(c),b=We(c);a.forEach(function(t,e){f.set(t.toLowerCase(),e)});var _={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return l[t.getMonth()]},c:u(r),d:function(t,e){return He(t.getDate(),e,2)},e:function(t,e){return He(t.getDate(),e,2)},H:function(t,e){return He(t.getHours(),e,2)},I:function(t,e){return He(t.getHours()%12||12,e,2)},j:function(t,e){return He(1+Oe.dayOfYear(t),e,3)},L:function(t,e){return He(t.getMilliseconds(),e,3)},m:function(t,e){return He(t.getMonth()+1,e,2)},M:function(t,e){return He(t.getMinutes(),e,2)},p:function(t){return a[+(t.getHours()>=12)]},S:function(t,e){return He(t.getSeconds(),e,2)},U:function(t,e){return He(Oe.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return He(Oe.mondayOfYear(t),e,2)},x:u(n),X:u(i),y:function(t,e){return He(t.getFullYear()%100,e,2)},Y:function(t,e){return He(t.getFullYear()%1e4,e,4)},Z:or,"%":function(){return"%"}},w={a:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.w=m.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){p.lastIndex=0;var n=p.exec(e.slice(r));return n?(t.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){x.lastIndex=0;var n=x.exec(e.slice(r));return n?(t.m=b.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){v.lastIndex=0;var n=v.exec(e.slice(r));return n?(t.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return h(t,_.c.toString(),e,r)},d:tr,e:tr,H:rr,I:rr,j:er,L:ar,m:Qe,M:nr,p:function(t,e,r){var n=f.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:ir,U:Xe,w:Ye,W:Ze,x:function(t,e,r){return h(t,_.x.toString(),e,r)},X:function(t,e,r){return h(t,_.X.toString(),e,r)},y:Je,Y:$e,Z:Ke,"%":sr};return u}Oe.year=Fe(function(t){return(t=Oe.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),Oe.years=Oe.year.range,Oe.years.utc=Oe.year.utc.range,Oe.day=Fe(function(t){var e=new De(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),Oe.days=Oe.day.range,Oe.days.utc=Oe.day.utc.range,Oe.dayOfYear=function(t){var e=Oe.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var r=Oe[t]=Fe(function(t){return(t=Oe.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=Oe.year(t).getDay();return Math.floor((Oe.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});Oe[t+"s"]=r.range,Oe[t+"s"].utc=r.utc.range,Oe[t+"OfYear"]=function(t){var r=Oe.year(t).getDay();return Math.floor((Oe.dayOfYear(t)+(r+e)%7)/7)}}),Oe.week=Oe.sunday,Oe.weeks=Oe.sunday.range,Oe.weeks.utc=Oe.sunday.utc.range,Oe.weekOfYear=Oe.sundayOfYear;var Ve={"-":"",_:" ",0:"0"},Ue=/^\s*\d+/,qe=/^%/;function He(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a68?1900:2e3),r+i[0].length):-1}function Ke(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Qe(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function tr(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function er(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function rr(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function nr(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function ir(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function ar(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function or(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=y(e)/60|0,i=y(e)%60;return r+He(n,"0",2)+He(i,"0",2)}function sr(t,e,r){qe.lastIndex=0;var n=qe.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function lr(t){for(var e=t.length,r=-1;++r=0?1:-1,s=o*a,l=Math.cos(e),c=Math.sin(e),u=i*c,h=n*l+u*Math.cos(s),f=u*o*Math.sin(s);Lr.add(Math.atan2(f,h)),r=t,n=l,i=c}zr.point=function(o,s){zr.point=a,r=(t=o)*Ct,n=Math.cos(s=(e=s)*Ct/2+At/4),i=Math.sin(s)},zr.lineEnd=function(){a(t,e)}}function Ir(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function Or(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Dr(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Rr(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Br(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Fr(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Nr(t){return[Math.atan2(t[1],t[0]),Ot(t[2])]}function jr(t,e){return y(t[0]-e[0])kt?i=90:c<-kt&&(r=-90),h[0]=e,h[1]=n}};function p(t,a){u.push(h=[e=t,n=t]),ai&&(i=a)}function d(t,o){var s=Ir([t*Ct,o*Ct]);if(l){var c=Dr(l,s),u=Dr([c[1],-c[0],0],c);Fr(u),u=Nr(u);var h=t-a,f=h>0?1:-1,d=u[0]*Lt*f,g=y(h)>180;if(g^(f*ai&&(i=m);else if(g^(f*a<(d=(d+360)%360-180)&&di&&(i=o);g?t_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t):n>=e?(tn&&(n=t)):t>a?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t)}else p(t,o);l=s,a=t}function g(){f.point=d}function m(){h[0]=e,h[1]=n,f.point=p,l=null}function v(t,e){if(l){var r=t-a;c+=y(r)>180?r+(r>0?360:-360):r}else o=t,s=e;zr.point(t,e),d(t,e)}function x(){zr.lineStart()}function b(){v(o,s),zr.lineEnd(),y(c)>kt&&(e=-(n=180)),h[0]=e,h[1]=n,l=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function k(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t_(g[0],g[1])&&(g[1]=p[1]),_(p[0],g[1])>_(g[0],g[1])&&(g[0]=p[0])):s.push(g=p);for(var l,c,p,d=-1/0,g=(o=0,s[c=s.length-1]);o<=c;g=p,++o)p=s[o],(l=_(g[1],p[0]))>d&&(d=l,e=p[0],n=g[1])}return u=h=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,i]]}}(),t.geo.centroid=function(e){xr=br=_r=wr=kr=Mr=Ar=Tr=Sr=Er=Cr=0,t.geo.stream(e,Vr);var r=Sr,n=Er,i=Cr,a=r*r+n*n+i*i;return a=0;--s)i.point((h=u[s])[0],h[1]);else n(p.x,p.p.x,-1,i);p=p.p}u=(p=p.o).z,d=!d}while(!p.v);i.lineEnd()}}}function $r(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n=0?1:-1,k=w*_,M=k>At,A=d*x;if(Lr.add(Math.atan2(A*w*Math.sin(k),g*b+A*Math.cos(k))),a+=M?_+w*Tt:_,M^f>=r^v>=r){var T=Dr(Ir(h),Ir(t));Fr(T);var S=Dr(i,T);Fr(S);var E=(M^_>=0?-1:1)*Ot(S[2]);(n>E||n===E&&(T[0]||T[1]))&&(o+=M^_>=0?1:-1)}if(!m++)break;f=v,d=x,g=b,h=t}}return(a<-kt||a0){for(x||(o.polygonStart(),x=!0),o.lineStart();++a1&&2&e&&r.push(r.pop().concat(r.shift())),s.push(r.filter(Qr))}return u}}function Qr(t){return t.length>1}function tn(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:D,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function en(t,e){return((t=t.x)[0]<0?t[1]-Et-kt:Et-t[1])-((e=e.x)[0]<0?e[1]-Et-kt:Et-e[1])}var rn=Kr(Xr,function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?At:-At,l=y(a-r);y(l-At)0?Et:-Et),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=At&&(y(r-i)kt?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var i;if(null==t)i=r*Et,n.point(-At,i),n.point(0,i),n.point(At,i),n.point(At,0),n.point(At,-i),n.point(0,-i),n.point(-At,-i),n.point(-At,0),n.point(-At,i);else if(y(t[0]-e[0])>kt){var a=t[0]0)){if(a/=f,f<0){if(a0){if(a>h)return;a>u&&(u=a)}if(a=r-l,f||!(a<0)){if(a/=f,f<0){if(a>h)return;a>u&&(u=a)}else if(f>0){if(a0)){if(a/=p,p<0){if(a0){if(a>h)return;a>u&&(u=a)}if(a=n-c,p||!(a<0)){if(a/=p,p<0){if(a>h)return;a>u&&(u=a)}else if(p>0){if(a0&&(i.a={x:l+u*f,y:c+u*p}),h<1&&(i.b={x:l+h*f,y:c+h*p}),i}}}}}}var an=1e9;function on(e,r,n,i){return function(l){var c,u,h,f,p,d,g,m,v,y,x,b=l,_=tn(),w=nn(e,r,n,i),k={point:T,lineStart:function(){k.point=S,u&&u.push(h=[]);y=!0,v=!1,g=m=NaN},lineEnd:function(){c&&(S(f,p),d&&v&&_.rejoin(),c.push(_.buffer()));k.point=T,v&&l.lineEnd()},polygonStart:function(){l=_,c=[],u=[],x=!0},polygonEnd:function(){l=b,c=t.merge(c);var r=function(t){for(var e=0,r=u.length,n=t[1],i=0;in&&Pt(c,a,t)>0&&++e:a[1]<=n&&Pt(c,a,t)<0&&--e,c=a;return 0!==e}([e,i]),n=x&&r,a=c.length;(n||a)&&(l.polygonStart(),n&&(l.lineStart(),M(null,null,1,l),l.lineEnd()),a&&Zr(c,o,r,M,l),l.polygonEnd()),c=u=h=null}};function M(t,o,l,c){var u=0,h=0;if(null==t||(u=a(t,l))!==(h=a(o,l))||s(t,o)<0^l>0)do{c.point(0===u||3===u?e:n,u>1?i:r)}while((u=(u+l+4)%4)!==h);else c.point(o[0],o[1])}function A(t,a){return e<=t&&t<=n&&r<=a&&a<=i}function T(t,e){A(t,e)&&l.point(t,e)}function S(t,e){var r=A(t=Math.max(-an,Math.min(an,t)),e=Math.max(-an,Math.min(an,e)));if(u&&h.push([t,e]),y)f=t,p=e,d=r,y=!1,r&&(l.lineStart(),l.point(t,e));else if(r&&v)l.point(t,e);else{var n={a:{x:g,y:m},b:{x:t,y:e}};w(n)?(v||(l.lineStart(),l.point(n.a.x,n.a.y)),l.point(n.b.x,n.b.y),r||l.lineEnd(),x=!1):r&&(l.lineStart(),l.point(t,e),x=!1)}g=t,m=e,v=r}return k};function a(t,i){return y(t[0]-e)0?0:3:y(t[0]-n)0?2:1:y(t[1]-r)0?1:0:i>0?3:2}function o(t,e){return s(t.x,e.x)}function s(t,e){var r=a(t,1),n=a(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}}function sn(t){var e=0,r=At/3,n=zn(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*At/180,r=t[1]*At/180):[e/At*180,r/At*180]},i}function ln(t,e){var r=Math.sin(t),n=(r+Math.sin(e))/2,i=1+r*(2*n-r),a=Math.sqrt(i)/n;function o(t,e){var r=Math.sqrt(i-2*n*Math.sin(e))/n;return[r*Math.sin(t*=n),a-r*Math.cos(t)]}return o.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/n,Ot((i-(t*t+r*r)*n*n)/(2*n))]},o}t.geo.clipExtent=function(){var t,e,r,n,i,a,o={stream:function(t){return i&&(i.valid=!1),(i=a(t)).valid=!0,i},extent:function(s){return arguments.length?(a=on(t=+s[0][0],e=+s[0][1],r=+s[1][0],n=+s[1][1]),i&&(i.valid=!1,i=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(t.geo.conicEqualArea=function(){return sn(ln)}).raw=ln,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,r,n,i,a=t.geo.albers(),o=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};function c(t){var a=t[0],o=t[1];return e=null,r(a,o),e||(n(a,o),e)||i(a,o),e}return c.invert=function(t){var e=a.scale(),r=a.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},c.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},c.precision=function(t){return arguments.length?(a.precision(t),o.precision(t),s.precision(t),c):a.precision()},c.scale=function(t){return arguments.length?(a.scale(t),o.scale(.35*t),s.scale(t),c.translate(a.translate())):a.scale()},c.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),u=+t[0],h=+t[1];return r=a.translate(t).clipExtent([[u-.455*e,h-.238*e],[u+.455*e,h+.238*e]]).stream(l).point,n=o.translate([u-.307*e,h+.201*e]).clipExtent([[u-.425*e+kt,h+.12*e+kt],[u-.214*e-kt,h+.234*e-kt]]).stream(l).point,i=s.translate([u-.205*e,h+.212*e]).clipExtent([[u-.214*e+kt,h+.166*e+kt],[u-.115*e-kt,h+.234*e-kt]]).stream(l).point,c},c.scale(1070)};var cn,un,hn,fn,pn,dn,gn={point:D,lineStart:D,lineEnd:D,polygonStart:function(){un=0,gn.lineStart=mn},polygonEnd:function(){gn.lineStart=gn.lineEnd=gn.point=D,cn+=y(un/2)}};function mn(){var t,e,r,n;function i(t,e){un+=n*t-r*e,r=t,n=e}gn.point=function(a,o){gn.point=i,t=r=a,e=n=o},gn.lineEnd=function(){i(t,e)}}var vn={point:function(t,e){tpn&&(pn=t);edn&&(dn=e)},lineStart:D,lineEnd:D,polygonStart:D,polygonEnd:D};function yn(){var t=xn(4.5),e=[],r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=xn(e),r},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function n(r,n){e.push("M",r,",",n,t)}function i(t,n){e.push("M",t,",",n),r.point=a}function a(t,r){e.push("L",t,",",r)}function o(){r.point=n}function s(){e.push("Z")}return r}function xn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var bn,_n={point:wn,lineStart:kn,lineEnd:Mn,polygonStart:function(){_n.lineStart=An},polygonEnd:function(){_n.point=wn,_n.lineStart=kn,_n.lineEnd=Mn}};function wn(t,e){_r+=t,wr+=e,++kr}function kn(){var t,e;function r(r,n){var i=r-t,a=n-e,o=Math.sqrt(i*i+a*a);Mr+=o*(t+r)/2,Ar+=o*(e+n)/2,Tr+=o,wn(t=r,e=n)}_n.point=function(n,i){_n.point=r,wn(t=n,e=i)}}function Mn(){_n.point=wn}function An(){var t,e,r,n;function i(t,e){var i=t-r,a=e-n,o=Math.sqrt(i*i+a*a);Mr+=o*(r+t)/2,Ar+=o*(n+e)/2,Tr+=o,Sr+=(o=n*t-r*e)*(r+t),Er+=o*(n+e),Cr+=3*o,wn(r=t,n=e)}_n.point=function(a,o){_n.point=i,wn(t=r=a,e=n=o)},_n.lineEnd=function(){i(t,e)}}function Tn(t){var e=4.5,r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:D};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,Tt)}function i(e,n){t.moveTo(e,n),r.point=a}function a(e,r){t.lineTo(e,r)}function o(){r.point=n}function s(){t.closePath()}return r}function Sn(t){var e=.5,r=Math.cos(30*Ct),n=16;function i(e){return(n?function(e){var r,i,o,s,l,c,u,h,f,p,d,g,m={point:v,lineStart:y,lineEnd:b,polygonStart:function(){e.polygonStart(),m.lineStart=_},polygonEnd:function(){e.polygonEnd(),m.lineStart=y}};function v(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){h=NaN,m.point=x,e.lineStart()}function x(r,i){var o=Ir([r,i]),s=t(r,i);a(h,f,u,p,d,g,h=s[0],f=s[1],u=r,p=o[0],d=o[1],g=o[2],n,e),e.point(h,f)}function b(){m.point=v,e.lineEnd()}function _(){y(),m.point=w,m.lineEnd=k}function w(t,e){x(r=t,e),i=h,o=f,s=p,l=d,c=g,m.point=x}function k(){a(h,f,u,p,d,g,i,o,r,s,l,c,n,e),m.lineEnd=b,b()}return m}:function(e){return Cn(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function a(n,i,o,s,l,c,u,h,f,p,d,g,m,v){var x=u-n,b=h-i,_=x*x+b*b;if(_>4*e&&m--){var w=s+p,k=l+d,M=c+g,A=Math.sqrt(w*w+k*k+M*M),T=Math.asin(M/=A),S=y(y(M)-1)e||y((x*z+b*P)/_-.5)>.3||s*p+l*d+c*g0&&16,i):Math.sqrt(e)},i}function En(t){this.stream=t}function Cn(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Ln(t){return zn(function(){return t})()}function zn(e){var r,n,i,a,o,s,l=Sn(function(t,e){return[(t=r(t,e))[0]*c+a,o-t[1]*c]}),c=150,u=480,h=250,f=0,p=0,d=0,g=0,m=0,v=rn,x=z,b=null,_=null;function w(t){return[(t=i(t[0]*Ct,t[1]*Ct))[0]*c+a,o-t[1]*c]}function k(t){return(t=i.invert((t[0]-a)/c,(o-t[1])/c))&&[t[0]*Lt,t[1]*Lt]}function M(){i=Yr(n=Dn(d,g,m),r);var t=r(f,p);return a=u-t[0]*c,o=h+t[1]*c,A()}function A(){return s&&(s.valid=!1,s=null),w}return w.stream=function(t){return s&&(s.valid=!1),(s=Pn(v(n,l(x(t))))).valid=!0,s},w.clipAngle=function(t){return arguments.length?(v=null==t?(b=t,rn):function(t){var e=Math.cos(t),r=e>0,n=y(e)>kt;return Kr(i,function(t){var e,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(h,f){var p,d=[h,f],g=i(h,f),m=r?g?0:o(h,f):g?o(h+(h<0?At:-At),f):0;if(!e&&(c=l=g)&&t.lineStart(),g!==l&&(p=a(e,d),(jr(e,p)||jr(d,p))&&(d[0]+=kt,d[1]+=kt,g=i(d[0],d[1]))),g!==l)u=0,g?(t.lineStart(),p=a(d,e),t.point(p[0],p[1])):(p=a(e,d),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(n&&e&&r^g){var v;m&s||!(v=a(d,e,!0))||(u=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!g||e&&jr(e,d)||t.point(d[0],d[1]),e=d,l=g,s=m},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return u|(c&&l)<<1}}},Nn(t,6*Ct),r?[0,-t]:[-At,t-At]);function i(t,r){return Math.cos(t)*Math.cos(r)>e}function a(t,r,n){var i=[1,0,0],a=Dr(Ir(t),Ir(r)),o=Or(a,a),s=a[0],l=o-s*s;if(!l)return!n&&t;var c=e*o/l,u=-e*s/l,h=Dr(i,a),f=Br(i,c);Rr(f,Br(a,u));var p=h,d=Or(f,p),g=Or(p,p),m=d*d-g*(Or(f,f)-1);if(!(m<0)){var v=Math.sqrt(m),x=Br(p,(-d-v)/g);if(Rr(x,f),x=Nr(x),!n)return x;var b,_=t[0],w=r[0],k=t[1],M=r[1];w<_&&(b=_,_=w,w=b);var A=w-_,T=y(A-At)0^x[1]<(y(x[0]-_)At^(_<=x[0]&&x[0]<=w)){var S=Br(p,(-d+v)/g);return Rr(S,f),[x,Nr(S)]}}}function o(e,n){var i=r?t:At-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}}((b=+t)*Ct),A()):b},w.clipExtent=function(t){return arguments.length?(_=t,x=t?on(t[0][0],t[0][1],t[1][0],t[1][1]):z,A()):_},w.scale=function(t){return arguments.length?(c=+t,M()):c},w.translate=function(t){return arguments.length?(u=+t[0],h=+t[1],M()):[u,h]},w.center=function(t){return arguments.length?(f=t[0]%360*Ct,p=t[1]%360*Ct,M()):[f*Lt,p*Lt]},w.rotate=function(t){return arguments.length?(d=t[0]%360*Ct,g=t[1]%360*Ct,m=t.length>2?t[2]%360*Ct:0,M()):[d*Lt,g*Lt,m*Lt]},t.rebind(w,l,"precision"),function(){return r=e.apply(this,arguments),w.invert=r.invert&&k,M()}}function Pn(t){return Cn(t,function(e,r){t.point(e*Ct,r*Ct)})}function In(t,e){return[t,e]}function On(t,e){return[t>At?t-Tt:t<-At?t+Tt:t,e]}function Dn(t,e,r){return t?e||r?Yr(Bn(t),Fn(e,r)):Bn(t):e||r?Fn(e,r):On}function Rn(t){return function(e,r){return[(e+=t)>At?e-Tt:e<-At?e+Tt:e,r]}}function Bn(t){var e=Rn(t);return e.invert=Rn(-t),e}function Fn(t,e){var r=Math.cos(t),n=Math.sin(t),i=Math.cos(e),a=Math.sin(e);function o(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,c=Math.sin(e),u=c*r+s*n;return[Math.atan2(l*i-u*a,s*r-c*n),Ot(u*i+l*a)]}return o.invert=function(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,c=Math.sin(e),u=c*i-l*a;return[Math.atan2(l*i+c*a,s*r+u*n),Ot(u*r-s*n)]},o}function Nn(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=jn(r,i),a=jn(r,a),(o>0?ia)&&(i+=o*Tt)):(i=t+o*Tt,a=t-.5*l);for(var c,u=i;o>0?u>a:u2?t[2]*Ct:0),e.invert=function(e){return(e=t.invert(e[0]*Ct,e[1]*Ct))[0]*=Lt,e[1]*=Lt,e},e},On.invert=In,t.geo.circle=function(){var t,e,r=[0,0],n=6;function i(){var t="function"==typeof r?r.apply(this,arguments):r,n=Dn(-t[0]*Ct,-t[1]*Ct,0).invert,i=[];return e(null,null,1,{point:function(t,e){i.push(t=n(t,e)),t[0]*=Lt,t[1]*=Lt}}),{type:"Polygon",coordinates:[i]}}return i.origin=function(t){return arguments.length?(r=t,i):r},i.angle=function(r){return arguments.length?(e=Nn((t=+r)*Ct,n*Ct),i):t},i.precision=function(r){return arguments.length?(e=Nn(t*Ct,(n=+r)*Ct),i):n},i.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Ct,i=t[1]*Ct,a=e[1]*Ct,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),c=Math.cos(i),u=Math.sin(a),h=Math.cos(a);return Math.atan2(Math.sqrt((r=h*o)*r+(r=c*u-l*h*s)*r),l*u+c*h*s)},t.geo.graticule=function(){var e,r,n,i,a,o,s,l,c,u,h,f,p=10,d=p,g=90,m=360,v=2.5;function x(){return{type:"MultiLineString",coordinates:b()}}function b(){return t.range(Math.ceil(i/g)*g,n,g).map(h).concat(t.range(Math.ceil(l/m)*m,s,m).map(f)).concat(t.range(Math.ceil(r/p)*p,e,p).filter(function(t){return y(t%g)>kt}).map(c)).concat(t.range(Math.ceil(o/d)*d,a,d).filter(function(t){return y(t%m)>kt}).map(u))}return x.lines=function(){return b().map(function(t){return{type:"LineString",coordinates:t}})},x.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(f(s).slice(1),h(n).reverse().slice(1),f(l).reverse().slice(1))]}},x.extent=function(t){return arguments.length?x.majorExtent(t).minorExtent(t):x.minorExtent()},x.majorExtent=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],l=+t[0][1],s=+t[1][1],i>n&&(t=i,i=n,n=t),l>s&&(t=l,l=s,s=t),x.precision(v)):[[i,l],[n,s]]},x.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),o>a&&(t=o,o=a,a=t),x.precision(v)):[[r,o],[e,a]]},x.step=function(t){return arguments.length?x.majorStep(t).minorStep(t):x.minorStep()},x.majorStep=function(t){return arguments.length?(g=+t[0],m=+t[1],x):[g,m]},x.minorStep=function(t){return arguments.length?(p=+t[0],d=+t[1],x):[p,d]},x.precision=function(t){return arguments.length?(v=+t,c=Vn(o,a,90),u=Un(r,e,v),h=Vn(l,s,90),f=Un(i,n,v),x):v},x.majorExtent([[-180,-90+kt],[180,90-kt]]).minorExtent([[-180,-80-kt],[180,80+kt]])},t.geo.greatArc=function(){var e,r,n=qn,i=Hn;function a(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}return a.distance=function(){return t.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},a.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,a):n},a.target=function(t){return arguments.length?(i=t,r="function"==typeof t?null:t,a):i},a.precision=function(){return arguments.length?a:0},a},t.geo.interpolate=function(t,e){return r=t[0]*Ct,n=t[1]*Ct,i=e[0]*Ct,a=e[1]*Ct,o=Math.cos(n),s=Math.sin(n),l=Math.cos(a),c=Math.sin(a),u=o*Math.cos(r),h=o*Math.sin(r),f=l*Math.cos(i),p=l*Math.sin(i),d=2*Math.asin(Math.sqrt(Rt(a-n)+o*l*Rt(i-r))),g=1/Math.sin(d),(m=d?function(t){var e=Math.sin(t*=d)*g,r=Math.sin(d-t)*g,n=r*u+e*f,i=r*h+e*p,a=r*s+e*c;return[Math.atan2(i,n)*Lt,Math.atan2(a,Math.sqrt(n*n+i*i))*Lt]}:function(){return[r*Lt,n*Lt]}).distance=d,m;var r,n,i,a,o,s,l,c,u,h,f,p,d,g,m},t.geo.length=function(e){return bn=0,t.geo.stream(e,Gn),bn};var Gn={sphere:D,point:D,lineStart:function(){var t,e,r;function n(n,i){var a=Math.sin(i*=Ct),o=Math.cos(i),s=y((n*=Ct)-t),l=Math.cos(s);bn+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=r*a-e*o*l)*s),e*a+r*o*l),t=n,e=a,r=o}Gn.point=function(i,a){t=i*Ct,e=Math.sin(a*=Ct),r=Math.cos(a),Gn.point=n},Gn.lineEnd=function(){Gn.point=Gn.lineEnd=D}},lineEnd:D,polygonStart:D,polygonEnd:D};function Wn(t,e){function r(e,r){var n=Math.cos(e),i=Math.cos(r),a=t(n*i);return[a*i*Math.sin(e),a*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),i=e(n),a=Math.sin(i),o=Math.cos(i);return[Math.atan2(t*a,n*o),Math.asin(n&&r*a/n)]},r}var Yn=Wn(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(t.geo.azimuthalEqualArea=function(){return Ln(Yn)}).raw=Yn;var Xn=Wn(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},z);function Zn(t,e){var r=Math.cos(t),n=function(t){return Math.tan(At/4+t/2)},i=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(n(e)/n(t)),a=r*Math.pow(n(t),i)/i;if(!i)return Kn;function o(t,e){a>0?e<-Et+kt&&(e=-Et+kt):e>Et-kt&&(e=Et-kt);var r=a/Math.pow(n(e),i);return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}return o.invert=function(t,e){var r=a-e,n=zt(i)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/i,2*Math.atan(Math.pow(a/n,1/i))-Et]},o}function $n(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),i=r/n+t;if(y(n)1&&Pt(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function oi(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Ln(ei)}).raw=ei,ri.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Et]},(t.geo.transverseMercator=function(){var t=Qn(ri),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90])}).raw=ri,t.geom={},t.geom.hull=function(t){var e=ni,r=ii;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=me(e),a=me(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)p.push(t[s[c[n]][2]]);for(n=+h;nkt)s=s.L;else{if(!((i=a-Mi(s,o))>kt)){n>-kt?(e=s.P,r=s):i>-kt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=xi(t);if(pi.insert(e,l),e||r){if(e===r)return Ci(e),r=xi(e.site),pi.insert(l,r),l.edge=r.edge=Pi(e.site,l.site),Ei(e),void Ei(r);if(r){Ci(e),Ci(r);var c=e.site,u=c.x,h=c.y,f=t.x-u,p=t.y-h,d=r.site,g=d.x-u,m=d.y-h,v=2*(f*m-p*g),y=f*f+p*p,x=g*g+m*m,b={x:(m*y-p*x)/v+u,y:(f*x-g*y)/v+h};Ii(r.edge,c,d,b),l.edge=Pi(c,t,null,b),r.edge=Pi(t,d,null,b),Ei(e),Ei(r)}else l.edge=Pi(e.site,l.site)}}function ki(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,c=l-e;if(!c)return s;var u=s-n,h=1/a-1/c,f=u/c;return h?(-f+Math.sqrt(f*f-2*h*(u*u/(-2*c)-l+c/2+i-a/2)))/h+n:(n+s)/2}function Mi(t,e){var r=t.N;if(r)return ki(r,e);var n=t.site;return n.y===e?n.x:1/0}function Ai(t){this.site=t,this.edges=[]}function Ti(t,e){return e.angle-t.angle}function Si(){Ri(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ei(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,c=n.y-s,u=a.x-o,h=2*(l*(m=a.y-s)-c*u);if(!(h>=-Mt)){var f=l*l+c*c,p=u*u+m*m,d=(m*f-c*p)/h,g=(l*p-u*f)/h,m=g+s,v=vi.pop()||new Si;v.arc=t,v.site=i,v.x=d+o,v.y=m+Math.sqrt(d*d+g*g),v.cy=m,t.circle=v;for(var y=null,x=gi._;x;)if(v.y=s)return;if(f>d){if(a){if(a.y>=c)return}else a={x:m,y:l};r={x:m,y:c}}else{if(a){if(a.y1)if(f>d){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.xkt||y(i-r)>kt)&&(s.splice(o,0,new Oi((v=a.site,x=u,b=y(n-h)kt?{x:h,y:y(e-h)kt?{x:y(r-d)kt?{x:f,y:y(e-f)kt?{x:y(r-p)=r&&c.x<=i&&c.y>=n&&c.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]}),e}function s(t){return t.map(function(t,e){return{x:Math.round(n(t,e)/kt)*kt,y:Math.round(i(t,e)/kt)*kt,i:e}})}return o.links=function(t){return ji(s(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},o.triangles=function(t){var e=[];return ji(s(t)).cells.forEach(function(r,n){for(var i,a,o,s,l=r.site,c=r.edges.sort(Ti),u=-1,h=c.length,f=c[h-1].edge,p=f.l===l?f.r:f.l;++ua&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Yi(r,n)})),a=$i.lastIndex;return ag&&(g=l.x),l.y>m&&(m=l.y),c.push(l.x),u.push(l.y);else for(h=0;hg&&(g=b),_>m&&(m=_),c.push(b),u.push(_)}var w=g-p,k=m-d;function M(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(y(l-r)+y(c-n)<.01)A(t,e,r,n,i,a,o,s);else{var u=t.point;t.x=t.y=t.point=null,A(t,u,l,c,i,a,o,s),A(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else A(t,e,r,n,i,a,o,s)}function A(t,e,r,n,i,a,o,s){var l=.5*(i+o),c=.5*(a+s),u=r>=l,h=n>=c,f=h<<1|u;t.leaf=!1,u?i=l:o=l,h?a=c:s=c,M(t=t.nodes[f]||(t.nodes[f]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,i,a,o,s)}w>k?m=d+w:g=p+k;var T={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){M(T,t,+v(t,++h),+x(t,h),p,d,g,m)}};if(T.visit=function(t){!function t(e,r,n,i,a,o){if(!e(r,n,i,a,o)){var s=.5*(n+a),l=.5*(i+o),c=r.nodes;c[0]&&t(e,c[0],n,i,s,l),c[1]&&t(e,c[1],s,i,a,l),c[2]&&t(e,c[2],n,l,s,o),c[3]&&t(e,c[3],s,l,a,o)}}(t,T,p,d,g,m)},T.find=function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(c,u,h,f,p){if(!(u>a||h>o||f=_)<<1|e>=b,k=w+4;w=0&&!(n=t.interpolators[i](e,r)););return n}function Ki(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function sa(t){return 1-Math.cos(t*Et)}function la(t){return Math.pow(2,10*(t-1))}function ca(t){return 1-Math.sqrt(1-t*t)}function ua(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function ha(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function fa(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=da(i),s=pa(i,a),l=da(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]=0?t.slice(0,n):t,a=n>=0?t.slice(n+1):"in";return i=ta.get(i)||Qi,a=ea.get(a)||z,e=a(i.apply(null,r.call(arguments,1))),function(t){return t<=0?0:t>=1?1:e(t)}},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,i=e.c,a=e.l,o=r.h-n,s=r.c-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.c:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Yt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,i=e.s,a=e.l,o=r.h-n,s=r.s-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.s:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Ht(n+o*t,i+s*t,a+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,i=e.a,a=e.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(t){return te(n+o*t,i+s*t,a+l*t)+""}},t.interpolateRound=ha,t.transform=function(e){var r=i.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new fa(e?e.matrix:ga)})(e)},fa.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ga={a:1,b:0,c:0,d:1,e:0,f:0};function ma(t){return t.length?t.pop()+",":""}function va(e,r){var n=[],i=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:Yi(t[0],e[0])},{i:i-2,x:Yi(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,i),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(ma(r)+"rotate(",null,")")-2,x:Yi(t,e)})):e&&r.push(ma(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(ma(r)+"skewX(",null,")")-2,x:Yi(t,e)}):e&&r.push(ma(r)+"skewX("+e+")")}(e.skew,r.skew,n,i),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(ma(r)+"scale(",null,",",null,")");n.push({i:i-4,x:Yi(t[0],e[0])},{i:i-2,x:Yi(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(ma(r)+"scale("+e+")")}(e.scale,r.scale,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=Me(s.tick)),s):n},s.start=function(){var t,e,r,n=v.length,l=y.length,u=c[0],d=c[1];for(t=0;t=0;)r.push(i[n])}function za(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++o=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return za(i,function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)}),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(La(t,function(t){t.children&&(t.value=0)}),za(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var i=e.call(this,t,n);return function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,c=-1;for(n=e.value?n/e.value:0;++cs&&(s=n),o.push(n)}for(r=0;ri&&(n=r,i=e);return n}function Ga(t){return t.reduce(Wa,0)}function Wa(t,e){return t+e[1]}function Ya(t,e){return Xa(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Xa(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function Za(e){return[t.min(e),t.max(e)]}function $a(t,e){return t.value-e.value}function Ja(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Ka(t,e){t._pack_next=e,e._pack_prev=t}function Qa(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function to(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,c=1/0,u=-1/0,h=1/0,f=-1/0;if(e.forEach(eo),(r=e[0]).x=-r.r,r.y=0,x(r),l>1&&((n=e[1]).x=n.r,n.y=0,x(n),l>2))for(no(r,n,i=e[2]),x(i),Ja(r,i),r._pack_prev=i,Ja(i,n),n=r._pack_next,a=3;a0)for(o=-1;++o=h[0]&&l<=h[1]&&((s=c[t.bisect(f,l,1,d)-1]).y+=g,s.push(a[o]));return c}return a.value=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=me(t),a):n},a.bins=function(t){return arguments.length?(i="number"==typeof t?function(e){return Xa(e,t)}:me(t),a):i},a.frequency=function(t){return arguments.length?(e=!!t,a):e},a},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort($a),n=0,i=[1,1];function a(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,za(s,function(t){t.r=+u(t.value)}),za(s,to),n){var h=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;za(s,function(t){t.r+=h}),za(s,to),za(s,function(t){t.r-=h})}return function t(e,r,n,i){var a=e.children;e.x=r+=i*e.x;e.y=n+=i*e.y;e.r*=i;if(a)for(var o=-1,s=a.length;++op.x&&(p=t),t.depth>d.depth&&(d=t)});var g=r(f,p)/2-f.x,m=n[0]/(p.x+r(p,f)/2+g),v=n[1]/(d.depth||1);La(u,function(t){t.x=(t.x+g)*m,t.y=t.depth*v})}return c}function o(t){var e=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,i=t.children,a=i.length;for(;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(e[0].z+e[e.length-1].z)/2;i?(t.z=i.z+r(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+r(t._,i._));t.parent.A=function(t,e,n){if(e){for(var i,a=t,o=t,s=e,l=a.parent.children[0],c=a.m,u=o.m,h=s.m,f=l.m;s=oo(s),a=ao(a),s&&a;)l=ao(l),(o=oo(o)).a=t,(i=s.z+h-a.z-c+r(s._,a._))>0&&(so(lo(s,t,n),t,i),c+=i,u+=i),h+=s.m,c+=a.m,f+=l.m,u+=o.m;s&&!oo(o)&&(o.t=s,o.m+=h-u),a&&!ao(l)&&(l.t=a,l.m+=c-f,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t)?l:null,a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null==(n=t)?null:l,a):i?n:null},Ca(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=io,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),c=l[0],u=0;za(c,function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(n),e.y=function(e){return 1+t.max(e,function(t){return t.y})}(n)):(e.x=s?u+=r(e,s):0,e.y=0,s=e)});var h=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(c),f=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(c),p=h.x-r(h,f)/2,d=f.x+r(f,h)/2;return za(c,i?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(d-p)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),l}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t),a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null!=(n=t),a):i?n:null},Ca(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=co,s=!1,l="squarify",c=.5*(1+Math.sqrt(5));function u(t,e){for(var r,n,i=-1,a=t.length;++i0;)s.push(r=c[i-1]),s.area+=r.area,"squarify"!==l||(n=p(s,g))<=f?(c.pop(),f=n):(s.area-=s.pop().area,d(s,g,a,!1),g=Math.min(a.dx,a.dy),s.length=s.area=0,f=1/0);s.length&&(d(s,g,a,!0),s.length=s.area=0),e.forEach(h)}}function f(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(u(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(d(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(f)}}function p(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++oi&&(i=r));return e*=e,(n*=n)?Math.max(e*i*c/n,n/(e*a*c)):1/0}function d(t,e,r,i){var a,o=-1,s=t.length,l=r.x,c=r.y,u=e?n(t.area/e):0;if(e==r.dx){for((i||u>r.dy)&&(u=r.dy);++or.dx)&&(u=r.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?yo:po,s=i?xa:ya;return a=t(e,r,s,n),o=t(r,e,s,Ji),l}function l(t){return a(t)}l.invert=function(t){return o(t)};l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e};l.range=function(t){return arguments.length?(r=t,s()):r};l.rangeRound=function(t){return l.range(t).interpolate(ha)};l.clamp=function(t){return arguments.length?(i=t,s()):i};l.interpolate=function(t){return arguments.length?(n=t,s()):n};l.ticks=function(t){return wo(e,t)};l.tickFormat=function(t,r){return ko(e,t,r)};l.nice=function(t){return bo(e,t),s()};l.copy=function(){return t(e,r,n,i)};return s()}([0,1],[0,1],Ji,!1)};var Mo={s:1,g:1,p:1,r:1,e:1};function Ao(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(r,n,i,a){function o(t){return(i?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function s(t){return i?Math.pow(n,t):-Math.pow(n,-t)}function l(t){return r(o(t))}l.invert=function(t){return s(r.invert(t))};l.domain=function(t){return arguments.length?(i=t[0]>=0,r.domain((a=t.map(Number)).map(o)),l):a};l.base=function(t){return arguments.length?(n=+t,r.domain(a.map(o)),l):n};l.nice=function(){var t=go(a.map(o),i?Math:So);return r.domain(t),a=t.map(s),l};l.ticks=function(){var t=ho(a),e=[],r=t[0],l=t[1],c=Math.floor(o(r)),u=Math.ceil(o(l)),h=n%1?2:n;if(isFinite(u-c)){if(i){for(;c0;f--)e.push(s(c)*f);for(c=0;e[c]l;u--);e=e.slice(c,u)}return e};l.tickFormat=function(e,r){if(!arguments.length)return To;arguments.length<2?r=To:"function"!=typeof r&&(r=t.format(r));var i=Math.max(1,n*e/l.ticks().length);return function(t){var e=t/s(Math.round(o(t)));return e*n0?i[t-1]:r[0],th?0:1;if(c=St)return l(c,p)+(s?l(s,1-p):"")+"Z";var d,g,m,v,y,x,b,_,w,k,M,A,T=0,S=0,E=[];if((v=(+o.apply(this,arguments)||0)/2)&&(m=n===Oo?Math.sqrt(s*s+c*c):+n.apply(this,arguments),p||(S*=-1),c&&(S=Ot(m/c*Math.sin(v))),s&&(T=Ot(m/s*Math.sin(v)))),c){y=c*Math.cos(u+S),x=c*Math.sin(u+S),b=c*Math.cos(h-S),_=c*Math.sin(h-S);var C=Math.abs(h-u-2*S)<=At?0:1;if(S&&jo(y,x,b,_)===p^C){var L=(u+h)/2;y=c*Math.cos(L),x=c*Math.sin(L),b=_=null}}else y=x=0;if(s){w=s*Math.cos(h-T),k=s*Math.sin(h-T),M=s*Math.cos(u+T),A=s*Math.sin(u+T);var z=Math.abs(u-h+2*T)<=At?0:1;if(T&&jo(w,k,M,A)===1-p^z){var P=(u+h)/2;w=s*Math.cos(P),k=s*Math.sin(P),M=A=null}}else w=k=0;if(f>kt&&(d=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){g=s0?0:1}function Vo(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,c=-s*a,u=t[0]+l,h=t[1]+c,f=e[0]+l,p=e[1]+c,d=(u+f)/2,g=(h+p)/2,m=f-u,v=p-h,y=m*m+v*v,x=r-n,b=u*p-f*h,_=(v<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*v-m*_)/y,k=(-b*m-v*_)/y,M=(b*v+m*_)/y,A=(-b*m+v*_)/y,T=w-d,S=k-g,E=M-d,C=A-g;return T*T+S*S>E*E+C*C&&(w=M,k=A),[[w-l,k-c],[w*r/x,k*r/x]]}function Uo(t){var e=ni,r=ii,n=Xr,i=Ho,a=i.key,o=.7;function s(a){var s,l=[],c=[],u=-1,h=a.length,f=me(e),p=me(r);function d(){l.push("M",i(t(c),o))}for(;++u1&&i.push("H",n[0]);return i.join("")},"step-before":Wo,"step-after":Yo,basis:$o,"basis-open":function(t){if(t.length<4)return Ho(t);var e,r=[],n=-1,i=t.length,a=[0],o=[0];for(;++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);r.push(Jo(ts,a)+","+Jo(ts,o)),--n;for(;++n9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));s=-1;for(;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(t))}});function Ho(t){return t.length>1?t.join("L"):t+"Z"}function Go(t){return t.join("L")+"Z"}function Wo(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1){s=e[1],a=t[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var c=2;cAt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return a.radius=function(t){return arguments.length?(r=me(t),a):r},a.source=function(e){return arguments.length?(t=me(e),a):t},a.target=function(t){return arguments.length?(e=me(t),a):e},a.startAngle=function(t){return arguments.length?(n=me(t),a):n},a.endAngle=function(t){return arguments.length?(i=me(t),a):i},a},t.svg.diagonal=function(){var t=qn,e=Hn,r=os;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=me(e),n):t},n.target=function(t){return arguments.length?(e=me(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=os,n=e.projection;return e.projection=function(t){return arguments.length?n(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Et;return[r*Math.cos(n),r*Math.sin(n)]}}(r=t)):r},e},t.svg.symbol=function(){var t=ls,e=ss;function r(r,n){return(us.get(t.call(this,r,n))||cs)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=me(e),r):t},r.size=function(t){return arguments.length?(e=me(t),r):e},r};var us=t.map({circle:cs,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*fs)),r=e*fs;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/hs),r=e*hs/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/hs),r=e*hs/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=us.keys();var hs=Math.sqrt(3),fs=Math.tan(30*Ct);Y.transition=function(t){for(var e,r,n=ms||++xs,i=ws(t),a=[],o=vs||{time:Date.now(),ease:oa,delay:0,duration:250},s=-1,l=this.length;++s0;)c[--f].call(t,o);if(a>=1)return h.event&&h.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}h||(a=i.time,o=Me(function(t){var e=h.delay;if(o.t=e+a,e<=t)return f(t-e);o.c=f},0,a),h=u[n]={tween:new b,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++u.count)}ys.call=Y.call,ys.empty=Y.empty,ys.node=Y.node,ys.size=Y.size,t.transition=function(e,r){return e&&e.transition?ms?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=ys,ys.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=X(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function g(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function m(){var h,m,v=this,y=t.select(t.event.target),x=n.of(v,arguments),b=t.select(v),_=y.datum(),w=!/^(n|s)$/.test(_)&&i,k=!/^(e|w)$/.test(_)&&a,M=y.classed("extent"),A=xt(v),T=t.mouse(v),S=t.select(o(v)).on("keydown.brush",function(){32==t.event.keyCode&&(M||(h=null,T[0]-=s[1],T[1]-=l[1],M=2),F())}).on("keyup.brush",function(){32==t.event.keyCode&&2==M&&(T[0]+=s[1],T[1]+=l[1],M=0,F())});if(t.event.changedTouches?S.on("touchmove.brush",L).on("touchend.brush",P):S.on("mousemove.brush",L).on("mouseup.brush",P),b.interrupt().selectAll("*").interrupt(),M)T[0]=s[0]-T[0],T[1]=l[0]-T[1];else if(_){var E=+/w$/.test(_),C=+/^n/.test(_);m=[s[1-E]-T[0],l[1-C]-T[1]],T[0]=s[E],T[1]=l[C]}else t.event.altKey&&(h=T.slice());function L(){var e=t.mouse(v),r=!1;m&&(e[0]+=m[0],e[1]+=m[1]),M||(t.event.altKey?(h||(h=[(s[0]+s[1])/2,(l[0]+l[1])/2]),T[0]=s[+(e[0]1?{floor:function(e){for(;s(e=t.floor(e));)e=Ds(e-1);return e},ceil:function(e){for(;s(e=t.ceil(e));)e=Ds(+e+1);return e}}:t))},i.ticks=function(t,e){var r=ho(i.domain()),n=null==t?a(r,10):"number"==typeof t?a(r,t):!t.range&&[{range:t},e];return n&&(t=n[0],e=n[1]),t.range(r[0],Ds(+r[1]+1),e<1?1:e)},i.tickFormat=function(){return n},i.copy=function(){return Os(e.copy(),r,n)},xo(i,e)}function Ds(t){return new Date(t)}Ls.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Is:Ps,Is.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Is.toString=Ps.toString,Oe.second=Fe(function(t){return new De(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),Oe.seconds=Oe.second.range,Oe.seconds.utc=Oe.second.utc.range,Oe.minute=Fe(function(t){return new De(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),Oe.minutes=Oe.minute.range,Oe.minutes.utc=Oe.minute.utc.range,Oe.hour=Fe(function(t){var e=t.getTimezoneOffset()/60;return new De(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),Oe.hours=Oe.hour.range,Oe.hours.utc=Oe.hour.utc.range,Oe.month=Fe(function(t){return(t=Oe.day(t)).setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),Oe.months=Oe.month.range,Oe.months.utc=Oe.month.utc.range;var Rs=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Bs=[[Oe.second,1],[Oe.second,5],[Oe.second,15],[Oe.second,30],[Oe.minute,1],[Oe.minute,5],[Oe.minute,15],[Oe.minute,30],[Oe.hour,1],[Oe.hour,3],[Oe.hour,6],[Oe.hour,12],[Oe.day,1],[Oe.day,2],[Oe.week,1],[Oe.month,1],[Oe.month,3],[Oe.year,1]],Fs=Ls.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Xr]]),Ns={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(Ds)},floor:z,ceil:z};Bs.year=Oe.year,Oe.scale=function(){return Os(t.scale.linear(),Bs,Fs)};var js=Bs.map(function(t){return[t[0].utc,t[1]]}),Vs=zs.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Xr]]);function Us(t){return JSON.parse(t.responseText)}function qs(t){var e=i.createRange();return e.selectNode(i.body),e.createContextualFragment(t.responseText)}js.year=Oe.year.utc,Oe.scale.utc=function(){return Os(t.scale.linear(),js,Vs)},t.text=ve(function(t){return t.responseText}),t.json=function(t,e){return ye(t,"application/json",Us,e)},t.html=function(t,e){return ye(t,"text/html",qs,e)},t.xml=ve(function(t){return t.responseXML}),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],148:[function(t,e,r){e.exports=function(){for(var t=0;t=2)return!1;t[r]=n}return!0}):_.filter(function(t){for(var e=0;e<=s;++e){var r=v[t[e]];if(r<0)return!1;t[e]=r}return!0});if(1&s)for(var u=0;u<_.length;++u){var b=_[u],f=b[0];b[0]=b[1],b[1]=f}return _}},{"incremental-convex-hull":381,uniq:509}],150:[function(t,e,r){"use strict";e.exports=a;var n=(a.canvas=document.createElement("canvas")).getContext("2d"),i=o([32,126]);function a(t,e){Array.isArray(t)&&(t=t.join(", "));var r,a={},s=16,l=.05;e&&(2===e.length&&"number"==typeof e[0]?r=o(e):Array.isArray(e)?r=e:(e.o?r=o(e.o):e.pairs&&(r=e.pairs),e.fontSize&&(s=e.fontSize),null!=e.threshold&&(l=e.threshold))),r||(r=i),n.font=s+"px "+t;for(var c=0;cs*l){var p=(f-h)/s;a[u]=1e3*p}}return a}function o(t){for(var e=[],r=t[0];r<=t[1];r++)for(var n=String.fromCharCode(r),i=t[0];i>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this,t("buffer").Buffer)},{buffer:92}],152:[function(t,e,r){var n=t("abs-svg-path"),i=t("normalize-svg-path"),a={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),i(n(e)).forEach(function(e){var r=e[0],n=e.slice(1);t[a[r]].apply(t,n)}),t.closePath()}},{"abs-svg-path":51,"normalize-svg-path":419}],153:[function(t,e,r){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],154:[function(t,e,r){"use strict";e.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n80*r){n=l=t[0],s=c=t[1];for(var b=r;bl&&(l=u),p>c&&(c=p);g=0!==(g=Math.max(l-n,c-s))?1/g:0}return o(y,x,r,n,s,g),x}function i(t,e,r,n,i){var a,o;if(i===A(t,e,r,n)>0)for(a=e;a=e;a-=n)o=w(a,t[a],t[a+1],o);return o&&y(o,o.next)&&(k(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!y(n,n.next)&&0!==v(n.prev,n,n.next))n=n.next;else{if(k(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,h,f){if(t){!f&&h&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=p(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,h);for(var d,g,m=t;t.prev!==t.next;)if(d=t.prev,g=t.next,h?l(t,n,i,h):s(t))e.push(d.i/r),e.push(t.i/r),e.push(g.i/r),k(t),t=g.next,m=g.next;else if((t=g)===m){f?1===f?o(t=c(t,e,r),e,r,n,i,h,2):2===f&&u(t,e,r,n,i,h):o(a(t),e,r,n,i,h,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(v(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(g(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&v(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function l(t,e,r,n){var i=t.prev,a=t,o=t.next;if(v(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=p(s,l,e,r,n),f=p(c,u,e,r,n),d=t.prevZ,m=t.nextZ;d&&d.z>=h&&m&&m.z<=f;){if(d!==t.prev&&d!==t.next&&g(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&v(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,m!==t.prev&&m!==t.next&&g(i.x,i.y,a.x,a.y,o.x,o.y,m.x,m.y)&&v(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;d&&d.z>=h;){if(d!==t.prev&&d!==t.next&&g(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&v(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;m&&m.z<=f;){if(m!==t.prev&&m!==t.next&&g(i.x,i.y,a.x,a.y,o.x,o.y,m.x,m.y)&&v(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function c(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!y(i,a)&&x(i,n,n.next,a)&&b(i,a)&&b(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),k(n),k(n.next),n=t=a),n=n.next}while(n!==t);return n}function u(t,e,r,n,i,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&m(l,c)){var u=_(l,c);return l=a(l,l.next),u=a(u,u.next),o(l,e,r,n,i,s),void o(u,e,r,n,i,s)}c=c.next}l=l.next}while(l!==t)}function h(t,e){return t.x-e.x}function f(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=u&&i!==n.x&&g(ar.x)&&b(n,t)&&(r=n,f=l),n=n.next;return r}(t,e)){var r=_(e,t);a(r,r.next)}}function p(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function d(t){var e=t,r=t;do{e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&x(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&b(t,e)&&b(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)}function v(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,r,n){return!!(y(t,e)&&y(r,n)||y(t,n)&&y(r,e))||v(t,e,r)>0!=v(t,e,n)>0&&v(r,n,t)>0!=v(r,n,e)>0}function b(t,e){return v(t.prev,t,t.next)<0?v(t,e,t.next)>=0&&v(t,t.prev,e)>=0:v(t,e,t.prev)<0||v(t,t.next,e)<0}function _(t,e){var r=new M(t.i,t.x,t.y),n=new M(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function w(t,e,r,n){var i=new M(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function k(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function M(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],156:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var i=0;i=55296&&y<=56319&&(w+=t[++r]),w=k?f.call(k,M,w,g):w,e?(p.value=w,d(m,g,p)):m[g]=w,++g;v=g}if(void 0===v)for(v=o(t.length),e&&(m=new e(v)),r=0;r0?1:-1}},{}],167:[function(t,e,r){"use strict";var n=t("../math/sign"),i=Math.abs,a=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*a(i(t)):t}},{"../math/sign":164}],168:[function(t,e,r){"use strict";var n=t("./to-integer"),i=Math.max;e.exports=function(t){return i(0,n(t))}},{"./to-integer":167}],169:[function(t,e,r){"use strict";var n=t("./valid-callable"),i=t("./valid-value"),a=Function.prototype.bind,o=Function.prototype.call,s=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(r,c){var u,h=arguments[2],f=arguments[3];return r=Object(i(r)),n(c),u=s(r),f&&u.sort("function"==typeof f?a.call(f,r):void 0),"function"!=typeof t&&(t=u[t]),o.call(t,u,function(t,n){return l.call(r,t)?o.call(c,h,r[t],t,r,n):e})}}},{"./valid-callable":187,"./valid-value":189}],170:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Object.assign:t("./shim")},{"./is-implemented":171,"./shim":172}],171:[function(t,e,r){"use strict";e.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},{}],172:[function(t,e,r){"use strict";var n=t("../keys"),i=t("../valid-value"),a=Math.max;e.exports=function(t,e){var r,o,s,l=a(arguments.length,2);for(t=Object(i(t)),s=function(n){try{t[n]=e[n]}catch(t){r||(r=t)}},o=1;o-1}},{}],193:[function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||n.call(t)===i)||!1}},{}],194:[function(t,e,r){"use strict";var n=Object.create(null),i=Math.random;e.exports=function(){var t;do{t=i().toString(36).slice(2)}while(n[t]);return t}},{}],195:[function(t,e,r){"use strict";var n,i=t("es5-ext/object/set-prototype-of"),a=t("es5-ext/string/#/contains"),o=t("d"),s=t("es6-symbol"),l=t("./"),c=Object.defineProperty;n=e.exports=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");l.call(this,t),e=e?a.call(e,"key+value")?"key+value":a.call(e,"key")?"key":"value":"value",c(this,"__kind__",o("",e))},i&&i(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:o(function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t})}),c(n.prototype,s.toStringTag,o("c","Array Iterator"))},{"./":198,d:138,"es5-ext/object/set-prototype-of":184,"es5-ext/string/#/contains":190,"es6-symbol":203}],196:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),i=t("es5-ext/object/valid-callable"),a=t("es5-ext/string/is-string"),o=t("./get"),s=Array.isArray,l=Function.prototype.call,c=Array.prototype.some;e.exports=function(t,e){var r,u,h,f,p,d,g,m,v=arguments[2];if(s(t)||n(t)?r="array":a(t)?r="string":t=o(t),i(e),h=function(){f=!0},"array"!==r)if("string"!==r)for(u=t.next();!u.done;){if(l.call(e,v,u.value,h),f)return;u=t.next()}else for(d=t.length,p=0;p=55296&&m<=56319&&(g+=t[++p]),l.call(e,v,g,h),!f);++p);else c.call(t,function(t){return l.call(e,v,t,h),f})}},{"./get":197,"es5-ext/function/is-arguments":161,"es5-ext/object/valid-callable":187,"es5-ext/string/is-string":193}],197:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),i=t("es5-ext/string/is-string"),a=t("./array"),o=t("./string"),s=t("./valid-iterable"),l=t("es6-symbol").iterator;e.exports=function(t){return"function"==typeof s(t)[l]?t[l]():n(t)?new a(t):i(t)?new o(t):new a(t)}},{"./array":195,"./string":200,"./valid-iterable":201,"es5-ext/function/is-arguments":161,"es5-ext/string/is-string":193,"es6-symbol":203}],198:[function(t,e,r){"use strict";var n,i=t("es5-ext/array/#/clear"),a=t("es5-ext/object/assign"),o=t("es5-ext/object/valid-callable"),s=t("es5-ext/object/valid-value"),l=t("d"),c=t("d/auto-bind"),u=t("es6-symbol"),h=Object.defineProperty,f=Object.defineProperties;e.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");f(this,{__list__:l("w",s(t)),__context__:l("w",e),__nextIndex__:l("w",0)}),e&&(o(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete n.prototype.constructor,f(n.prototype,a({_next:l(function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach(function(e,r){e>=t&&(this.__redo__[r]=++e)},this),this.__redo__.push(t)):h(this,"__redo__",l("c",[t])))}),_onDelete:l(function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach(function(e,r){e>t&&(this.__redo__[r]=--e)},this)))}),_onClear:l(function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0})}))),h(n.prototype,u.iterator,l(function(){return this}))},{d:138,"d/auto-bind":137,"es5-ext/array/#/clear":157,"es5-ext/object/assign":170,"es5-ext/object/valid-callable":187,"es5-ext/object/valid-value":189,"es6-symbol":203}],199:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),i=t("es5-ext/object/is-value"),a=t("es5-ext/string/is-string"),o=t("es6-symbol").iterator,s=Array.isArray;e.exports=function(t){return!!i(t)&&(!!s(t)||(!!a(t)||(!!n(t)||"function"==typeof t[o])))}},{"es5-ext/function/is-arguments":161,"es5-ext/object/is-value":178,"es5-ext/string/is-string":193,"es6-symbol":203}],200:[function(t,e,r){"use strict";var n,i=t("es5-ext/object/set-prototype-of"),a=t("d"),o=t("es6-symbol"),s=t("./"),l=Object.defineProperty;n=e.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),s.call(this,t),l(this,"__length__",a("",t.length))},i&&i(n,s),delete n.prototype.constructor,n.prototype=Object.create(s.prototype,{_next:a(function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r})}),l(n.prototype,o.toStringTag,a("c","String Iterator"))},{"./":198,d:138,"es5-ext/object/set-prototype-of":184,"es6-symbol":203}],201:[function(t,e,r){"use strict";var n=t("./is-iterable");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},{"./is-iterable":199}],202:[function(t,e,r){(function(n,i){!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():t.ES6Promise=n()}(this,function(){"use strict";function e(t){return"function"==typeof t}var r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},a=0,o=void 0,s=void 0,l=function(t,e){g[a]=t,g[a+1]=e,2===(a+=2)&&(s?s(m):_())};var c="undefined"!=typeof window?window:void 0,u=c||{},h=u.MutationObserver||u.WebKitMutationObserver,f="undefined"==typeof self&&void 0!==n&&"[object process]"==={}.toString.call(n),p="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function d(){var t=setTimeout;return function(){return t(m,1)}}var g=new Array(1e3);function m(){for(var t=0;t0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){if(!i(e))throw TypeError("listener must be a function");var r=!1;function n(){this.removeListener(t,n),r||(r=!0,e.apply(this,arguments))}return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var r,n,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(o=(r=this._events[t]).length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(a(r)){for(s=o;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(i(r=this._events[t]))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],213:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=e||0,i=r||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}},{}],214:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&function(t){for(var e,r=t.length,n=0;n13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],215:[function(t,e,r){"use strict";e.exports=function(t,e,r){switch(arguments.length){case 0:return new o([0],[0],0);case 1:if("number"==typeof t){var n=l(t);return new o(n,n,0)}return new o(t,l(t.length),0);case 2:if("number"==typeof e){var n=l(t.length);return new o(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error("state and velocity lengths must match");return new o(t,e,r)}};var n=t("cubic-hermite"),i=t("binary-search-bounds");function a(t,e,r){return Math.min(e,Math.max(t,r))}function o(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n=r-1){f=l.length-1;var d=t-e[r-1];for(p=0;p=r-1)for(var u=s.length-1,h=(e[r-1],0);h=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--h)n.push(a(l[h-1],c[h-1],arguments[h])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var f=r;f>0;--f){var p=a(c[f-1],u[f-1],arguments[f]);n.push(p),i.push((p-n[o++])*h)}}},s.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,h=u>1e-6?1/u:0;this._time.push(t);for(var f=r;f>0;--f){var p=arguments[f];n.push(a(l[f-1],c[f-1],n[o++]+p)),i.push(p*h)}}},s.idle=function(t){var e=this.lastT();if(!(t=0;--h)n.push(a(l[h],c[h],n[o]+u*i[o])),i.push(0),o+=1}}},{"binary-search-bounds":79,"cubic-hermite":132}],216:[function(t,e,r){var n=t("dtype");e.exports=function(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&Array.isArray(t[0])){var i=t[0].length,a=t.length*i;e&&"string"!=typeof e||(e=new(n(e||"float32"))(a+r));var o=e.length-r;if(a!==o)throw new Error("source length "+a+" ("+i+"x"+t.length+") does not match destination length "+o);for(var s=0,l=r;se[0]-o[0]/2&&(f=o[0]/2,p+=o[1]);return r}},{"css-font/stringify":129}],218:[function(t,e,r){"use strict";function n(t,e){e||(e={}),("string"==typeof t||Array.isArray(t))&&(e.family=t);var r=Array.isArray(e.family)?e.family.join(", "):e.family;if(!r)throw Error("`family` must be defined");var s=e.size||e.fontSize||e.em||48,l=e.weight||e.fontWeight||"",c=(t=[e.style||e.fontStyle||"",l,s].join(" ")+"px "+r,e.origin||"top");if(n.cache[r]&&s<=n.cache[r].em)return i(n.cache[r],c);var u=e.canvas||n.canvas,h=u.getContext("2d"),f={upper:void 0!==e.upper?e.upper:"H",lower:void 0!==e.lower?e.lower:"x",descent:void 0!==e.descent?e.descent:"p",ascent:void 0!==e.ascent?e.ascent:"h",tittle:void 0!==e.tittle?e.tittle:"i",overshoot:void 0!==e.overshoot?e.overshoot:"O"},p=Math.ceil(1.5*s);u.height=p,u.width=.5*p,h.font=t;var d={top:0};h.clearRect(0,0,p,p),h.textBaseline="top",h.fillStyle="black",h.fillText("H",0,0);var g=a(h.getImageData(0,0,p,p));h.clearRect(0,0,p,p),h.textBaseline="bottom",h.fillText("H",0,p);var m=a(h.getImageData(0,0,p,p));d.lineHeight=d.bottom=p-m+g,h.clearRect(0,0,p,p),h.textBaseline="alphabetic",h.fillText("H",0,p);var v=p-a(h.getImageData(0,0,p,p))-1+g;d.baseline=d.alphabetic=v,h.clearRect(0,0,p,p),h.textBaseline="middle",h.fillText("H",0,.5*p);var y=a(h.getImageData(0,0,p,p));d.median=d.middle=p-y-1+g-.5*p,h.clearRect(0,0,p,p),h.textBaseline="hanging",h.fillText("H",0,.5*p);var x=a(h.getImageData(0,0,p,p));d.hanging=p-x-1+g-.5*p,h.clearRect(0,0,p,p),h.textBaseline="ideographic",h.fillText("H",0,p);var b=a(h.getImageData(0,0,p,p));if(d.ideographic=p-b-1+g,f.upper&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.upper,0,0),d.upper=a(h.getImageData(0,0,p,p)),d.capHeight=d.baseline-d.upper),f.lower&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.lower,0,0),d.lower=a(h.getImageData(0,0,p,p)),d.xHeight=d.baseline-d.lower),f.tittle&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.tittle,0,0),d.tittle=a(h.getImageData(0,0,p,p))),f.ascent&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.ascent,0,0),d.ascent=a(h.getImageData(0,0,p,p))),f.descent&&(h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.descent,0,0),d.descent=o(h.getImageData(0,0,p,p))),f.overshoot){h.clearRect(0,0,p,p),h.textBaseline="top",h.fillText(f.overshoot,0,0);var _=o(h.getImageData(0,0,p,p));d.overshoot=_-v}for(var w in d)d[w]/=s;return d.em=s,n.cache[r]=d,i(d,c)}function i(t,e){var r={};for(var n in"string"==typeof e&&(e=t[e]),t)"em"!==n&&(r[n]=t[n]-e);return r}function a(t){for(var e=t.height,r=t.data,n=3;n0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}e.exports=n,n.canvas=document.createElement("canvas"),n.cache={}},{}],219:[function(t,e,r){"use strict";e.exports=function(t){return new c(t||d,null)};var n=0,i=1;function a(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function o(t){return new a(t._color,t.key,t.value,t.left,t.right,t._count)}function s(t,e){return new a(t,e.key,e.value,e.left,e.right,e._count)}function l(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function c(t,e){this._compare=t,this.root=e}var u=c.prototype;function h(t,e){this.tree=t,this._stack=e}Object.defineProperty(u,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(u,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(u,"length",{get:function(){return this.root?this.root._count:0}}),u.insert=function(t,e){for(var r=this._compare,o=this.root,u=[],h=[];o;){var f=r(t,o.key);u.push(o),h.push(f),o=f<=0?o.left:o.right}u.push(new a(n,t,e,null,null,1));for(var p=u.length-2;p>=0;--p){o=u[p];h[p]<=0?u[p]=new a(o._color,o.key,o.value,u[p+1],o.right,o._count+1):u[p]=new a(o._color,o.key,o.value,o.left,u[p+1],o._count+1)}for(p=u.length-1;p>1;--p){var d=u[p-1];o=u[p];if(d._color===i||o._color===i)break;var g=u[p-2];if(g.left===d)if(d.left===o){if(!(m=g.right)||m._color!==n){if(g._color=n,g.left=d.right,d._color=i,d.right=g,u[p-2]=d,u[p-1]=o,l(g),l(d),p>=3)(v=u[p-3]).left===g?v.left=d:v.right=d;break}d._color=i,g.right=s(i,m),g._color=n,p-=1}else{if(!(m=g.right)||m._color!==n){if(d.right=o.left,g._color=n,g.left=o.right,o._color=i,o.left=d,o.right=g,u[p-2]=o,u[p-1]=d,l(g),l(d),l(o),p>=3)(v=u[p-3]).left===g?v.left=o:v.right=o;break}d._color=i,g.right=s(i,m),g._color=n,p-=1}else if(d.right===o){if(!(m=g.left)||m._color!==n){if(g._color=n,g.right=d.left,d._color=i,d.left=g,u[p-2]=d,u[p-1]=o,l(g),l(d),p>=3)(v=u[p-3]).right===g?v.right=d:v.left=d;break}d._color=i,g.left=s(i,m),g._color=n,p-=1}else{var m;if(!(m=g.left)||m._color!==n){var v;if(d.left=o.right,g._color=n,g.right=o.left,o._color=i,o.right=d,o.left=g,u[p-2]=o,u[p-1]=d,l(g),l(d),l(o),p>=3)(v=u[p-3]).right===g?v.right=o:v.left=o;break}d._color=i,g.left=s(i,m),g._color=n,p-=1}}return u[0]._color=i,new c(r,u[0])},u.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return function t(e,r){var n;if(r.left&&(n=t(e,r.left)))return n;return(n=e(r.key,r.value))||(r.right?t(e,r.right):void 0)}(t,this.root);case 2:return function t(e,r,n,i){if(r(e,i.key)<=0){var a;if(i.left&&(a=t(e,r,n,i.left)))return a;if(a=n(i.key,i.value))return a}if(i.right)return t(e,r,n,i.right)}(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return function t(e,r,n,i,a){var o,s=n(e,a.key),l=n(r,a.key);if(s<=0){if(a.left&&(o=t(e,r,n,i,a.left)))return o;if(l>0&&(o=i(a.key,a.value)))return o}if(l>0&&a.right)return t(e,r,n,i,a.right)}(e,r,this._compare,t,this.root)}},Object.defineProperty(u,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(u,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),u.at=function(t){if(t<0)return new h(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new h(this,[])},u.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new h(this,n)},u.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new h(this,n)},u.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new h(this,n)},u.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new h(this,n)},u.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new h(this,n);r=i<=0?r.left:r.right}return new h(this,[])},u.remove=function(t){var e=this.find(t);return e?e.remove():this},u.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var f=h.prototype;function p(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function d(t,e){return te?1:0}Object.defineProperty(f,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(f,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),f.clone=function(){return new h(this.tree,this._stack.slice())},f.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new a(r._color,r.key,r.value,r.left,r.right,r._count);for(var u=t.length-2;u>=0;--u){(r=t[u]).left===t[u+1]?e[u]=new a(r._color,r.key,r.value,e[u+1],r.right,r._count):e[u]=new a(r._color,r.key,r.value,r.left,e[u+1],r._count)}if((r=e[e.length-1]).left&&r.right){var h=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var f=e[h-1];e.push(new a(r._color,f.key,f.value,r.left,r.right,r._count)),e[h-1].key=r.key,e[h-1].value=r.value;for(u=e.length-2;u>=h;--u)r=e[u],e[u]=new a(r._color,r.key,r.value,r.left,e[u+1],r._count);e[h-1].left=e[h]}if((r=e[e.length-1])._color===n){var d=e[e.length-2];d.left===r?d.left=null:d.right===r&&(d.right=null),e.pop();for(u=0;u=0;--u){if(e=t[u],0===u)return void(e._color=i);if((r=t[u-1]).left===e){if((a=r.right).right&&a.right._color===n)return c=(a=r.right=o(a)).right=o(a.right),r.right=a.left,a.left=r,a.right=c,a._color=r._color,e._color=i,r._color=i,c._color=i,l(r),l(a),u>1&&((h=t[u-2]).left===r?h.left=a:h.right=a),void(t[u-1]=a);if(a.left&&a.left._color===n)return c=(a=r.right=o(a)).left=o(a.left),r.right=c.left,a.left=c.right,c.left=r,c.right=a,c._color=r._color,r._color=i,a._color=i,e._color=i,l(r),l(a),l(c),u>1&&((h=t[u-2]).left===r?h.left=c:h.right=c),void(t[u-1]=c);if(a._color===i){if(r._color===n)return r._color=i,void(r.right=s(n,a));r.right=s(n,a);continue}a=o(a),r.right=a.left,a.left=r,a._color=r._color,r._color=n,l(r),l(a),u>1&&((h=t[u-2]).left===r?h.left=a:h.right=a),t[u-1]=a,t[u]=r,u+11&&((h=t[u-2]).right===r?h.right=a:h.left=a),void(t[u-1]=a);if(a.right&&a.right._color===n)return c=(a=r.left=o(a)).right=o(a.right),r.left=c.right,a.right=c.left,c.right=r,c.left=a,c._color=r._color,r._color=i,a._color=i,e._color=i,l(r),l(a),l(c),u>1&&((h=t[u-2]).right===r?h.right=c:h.left=c),void(t[u-1]=c);if(a._color===i){if(r._color===n)return r._color=i,void(r.left=s(n,a));r.left=s(n,a);continue}var h;a=o(a),r.left=a.right,a.right=r,a._color=r._color,r._color=n,l(r),l(a),u>1&&((h=t[u-2]).right===r?h.right=a:h.left=a),t[u-1]=a,t[u]=r,u+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(f,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(f,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),f.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(f,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),f.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),n=e[e.length-1];r[r.length-1]=new a(n._color,n.key,t,n.left,n.right,n._count);for(var i=e.length-2;i>=0;--i)(n=e[i]).left===e[i+1]?r[i]=new a(n._color,n.key,n.value,r[i+1],n.right,n._count):r[i]=new a(n._color,n.key,n.value,n.left,r[i+1],n._count);return new c(this.tree._compare,r[0])},f.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(f,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],220:[function(t,e,r){var n=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],i=607/128,a=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function o(t){if(t<0)return Number("0/0");for(var e=a[0],r=a.length-1;r>0;--r)e+=a[r]/(t+r);var n=t+i+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(o(e));e-=1;for(var r=n[0],i=1;i<9;i++)r+=n[i]/(e+i);var a=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(a,e+.5)*Math.exp(-a)*r},e.exports.log=o},{}],221:[function(t,e,r){e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},"undefined"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"==typeof e.width&&(r.width=e.width);"number"==typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf("webgl")&&a.push("experimental-"+t);for(var o=0;o0?(p[u]=-1,d[u]=0):(p[u]=0,d[u]=1)}}var g=[0,0,0],m={model:l,view:l,projection:l};h.isOpaque=function(){return!0},h.isTransparent=function(){return!1},h.drawTransparent=function(t){};var v=[0,0,0],y=[0,0,0],x=[0,0,0];h.draw=function(t){t=t||m;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=o(r,n,i,a),u=s.cubeEdges,h=s.axis,f=n[12],b=n[13],_=n[14],w=n[15],k=this.pixelRatio*(i[3]*f+i[7]*b+i[11]*_+i[15]*w)/e.drawingBufferHeight,M=0;M<3;++M)this.lastCubeProps.cubeEdges[M]=u[M],this.lastCubeProps.axis[M]=h[M];var A=p;for(M=0;M<3;++M)d(p[M],M,this.bounds,u,h);e=this.gl;var T=g;for(M=0;M<3;++M)this.backgroundEnable[M]?T[M]=h[M]:T[M]=0;this._background.draw(r,n,i,a,T,this.backgroundColor),this._lines.bind(r,n,i,this);for(M=0;M<3;++M){var S=[0,0,0];h[M]>0?S[M]=a[1][M]:S[M]=a[0][M];for(var E=0;E<2;++E){var C=(M+1+E)%3,L=(M+1+(1^E))%3;this.gridEnable[C]&&this._lines.drawGrid(C,L,this.bounds,S,this.gridColor[C],this.gridWidth[C]*this.pixelRatio)}for(E=0;E<2;++E){C=(M+1+E)%3,L=(M+1+(1^E))%3;this.zeroEnable[L]&&a[0][L]<=0&&a[1][L]>=0&&this._lines.drawZero(C,L,this.bounds,S,this.zeroLineColor[L],this.zeroLineWidth[L]*this.pixelRatio)}}for(M=0;M<3;++M){this.lineEnable[M]&&this._lines.drawAxisLine(M,this.bounds,A[M].primalOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio),this.lineMirror[M]&&this._lines.drawAxisLine(M,this.bounds,A[M].mirrorOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio);var z=c(v,A[M].primalMinor),P=c(y,A[M].mirrorMinor),I=this.lineTickLength;for(E=0;E<3;++E){var O=k/r[5*E];z[E]*=I[E]*O,P[E]*=I[E]*O}this.lineTickEnable[M]&&this._lines.drawAxisTicks(M,A[M].primalOffset,z,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio),this.lineTickMirror[M]&&this._lines.drawAxisTicks(M,A[M].mirrorOffset,P,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio)}this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio);for(M=0;M<3;++M){var D=A[M].primalMinor,R=c(x,A[M].primalOffset);for(E=0;E<3;++E)this.lineTickEnable[M]&&(R[E]+=k*D[E]*Math.max(this.lineTickLength[E],0)/r[5*E]);if(this.tickEnable[M]){for(E=0;E<3;++E)R[E]+=k*D[E]*this.tickPad[E]/r[5*E];this._text.drawTicks(M,this.tickSize[M],this.tickAngle[M],R,this.tickColor[M])}if(this.labelEnable[M]){for(E=0;E<3;++E)R[E]+=k*D[E]*this.labelPad[E]/r[5*E];R[M]+=.5*(a[0][M]+a[1][M]),this._text.drawLabel(M,this.labelSize[M],this.labelAngle[M],R,this.labelColor[M])}}this._text.unbind()},h.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":223,"./lib/cube.js":224,"./lib/lines.js":225,"./lib/text.js":227,"./lib/ticks.js":228}],223:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,h=[0,0,0],f=[0,0,0],p=-1;p<=1;p+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),h[l]=p,f[l]=p;for(var d=-1;d<=1;d+=2){h[c]=d;for(var g=-1;g<=1;g+=2)h[u]=g,e.push(h[0],h[1],h[2],f[0],f[1],f[2]),s+=1}var m=c;c=u,u=m}var v=n(t,new Float32Array(e)),y=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=i(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),b=a(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(t,v,x,b)};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders").bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":226,"gl-buffer":230,"gl-vao":308}],224:[function(t,e,r){"use strict";e.exports=function(t,e,r,a){i(s,e,t),i(s,r,s);for(var p=0,y=0;y<2;++y){u[2]=a[y][2];for(var x=0;x<2;++x){u[1]=a[x][1];for(var b=0;b<2;++b)u[0]=a[b][0],f(l[p],u,s),p+=1}}for(var _=-1,y=0;y<8;++y){for(var w=l[y][3],k=0;k<3;++k)c[y][k]=l[y][k]/w;w<0&&(_<0?_=y:c[y][2]S&&(_|=1<S&&(_|=1<c[y][1]&&(D=y));for(var R=-1,y=0;y<3;++y){var B=D^1<c[F][0]&&(F=B)}}var N=g;N[0]=N[1]=N[2]=0,N[n.log2(R^D)]=D&R,N[n.log2(D^F)]=D&F;var j=7^F;j===_||j===O?(j=7^R,N[n.log2(F^j)]=j&F):N[n.log2(R^j)]=j&R;for(var V=m,U=_,M=0;M<3;++M)V[M]=U&1< 0.0) {\n vec3 nPosition = mix(bounds[0], bounds[1], 0.5 * (position + 1.0));\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n colorChannel = abs(normal);\n}"]),u=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] + \n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);r.bg=function(t){return i(t,c,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":287,glslify:377}],227:[function(t,e,r){(function(r){"use strict";e.exports=function(t,e,r,a,s,l){var u=n(t),h=i(t,[{buffer:u,size:3}]),f=o(t);f.attributes.position.location=0;var p=new c(t,f,u,h);return p.update(e,r,a,s,l),p};var n=t("gl-buffer"),i=t("gl-vao"),a=t("vectorize-text"),o=t("./shaders").text,s=window||r.global||{},l=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};function c(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var u=c.prototype,h=[0,0];u.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,h[0]=this.gl.drawingBufferWidth,h[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=h},u.unbind=function(){this.vao.unbind()},u.update=function(t,e,r,n,i){this.gl;var o=[];function s(t,e,r,n){var i=l[r];i||(i=l[r]={});var s=i[e];s||(s=i[e]=function(t,e){try{return a(t,e)}catch(t){return console.warn("error vectorizing text:",t),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle"}));for(var c=(n||12)/12,u=s.positions,h=s.cells,f=0,p=h.length;f=0;--g){var m=u[d[g]];o.push(c*m[0],-c*m[1],t)}}for(var c=[0,0,0],u=[0,0,0],h=[0,0,0],f=[0,0,0],p=0;p<3;++p){h[p]=o.length/3|0,s(.5*(t[0][p]+t[1][p]),e[p],r),f[p]=(o.length/3|0)-h[p],c[p]=o.length/3|0;for(var d=0;d=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var h=""+c;h.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r},r.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function u(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,t.data,e):this.length=c(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=a(s,t.shape);i.assign(l,t),this.length=c(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(t,"uint16"):u(t,"float32"),this.length=c(this.gl,this.type,this.length,this.usage,e<0?h:h.subarray(0,t.length),e),n.free(h)}else if("object"==typeof t&&"number"==typeof t.length)this.length=c(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=t.createBuffer(),a=new s(t,r,i,0,n);return a.update(e),a}},{ndarray:417,"ndarray-ops":411,"typedarray-pool":507}],231:[function(t,e,r){"use strict";var n=t("gl-vec3"),i=(t("gl-vec4"),function(t,e){for(var r=0;r=e)return r-1;return r}),a=n.create(),o=n.create(),s=function(t,e,r){return tr?r:t},l=function(t,e,r,l){var c=t[0],u=t[1],h=t[2],f=r[0].length,p=r[1].length,d=r[2].length,g=i(r[0],c),m=i(r[1],u),v=i(r[2],h),y=g+1,x=m+1,b=v+1;if(l&&(g=s(g,0,f-1),y=s(y,0,f-1),m=s(m,0,p-1),x=s(x,0,p-1),v=s(v,0,d-1),b=s(b,0,d-1)),g<0||m<0||v<0||y>=f||x>=p||b>=d)return n.create();var _=(c-r[0][g])/(r[0][y]-r[0][g]),w=(u-r[1][m])/(r[1][x]-r[1][m]),k=(h-r[2][v])/(r[2][b]-r[2][v]);(_<0||_>1||isNaN(_))&&(_=0),(w<0||w>1||isNaN(w))&&(w=0),(k<0||k>1||isNaN(k))&&(k=0);var M=v*f*p,A=b*f*p,T=m*f,S=x*f,E=g,C=y,L=e[T+M+E],z=e[T+M+C],P=e[S+M+E],I=e[S+M+C],O=e[T+A+E],D=e[T+A+C],R=e[S+A+E],B=e[S+A+C],F=n.create();return n.lerp(F,L,z,_),n.lerp(a,P,I,_),n.lerp(F,F,a,w),n.lerp(a,O,D,_),n.lerp(o,R,B,_),n.lerp(a,a,o,w),n.lerp(F,F,a,k),F};e.exports=function(t,e){var r;r=t.positions?t.positions:function(t){for(var e=t[0],r=t[1],n=t[2],i=[],a=0;as&&(s=n.length(b)),x&&(y=Math.min(y,2*n.distance(g,_)/(n.length(m)+n.length(b)))),g=_,m=b,v.push(b)}var w=[c,h,p],k=[u,f,d];e&&(e[0]=w,e[1]=k),0===s&&(s=1);var M=1/s;isFinite(y)&&!isNaN(y)||(y=1),o.vectorScale=y;var A=function(t,e,r){var i=n.create();return void 0!==t&&n.set(i,t,e,r),i}(0,1,0),T=t.coneSize||.5;t.absoluteConeSize&&(T=t.absoluteConeSize*M),o.coneScale=T;x=0;for(var S=0;x1.0001)return null;v+=m[h]}if(Math.abs(v-1)>.001)return null;return[f,s(t,m),m]}},{barycentric:61,"polytope-closest-point/lib/closest_point_2d.js":448}],233:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),c=t("gl-mat4/invert"),u=t("ndarray"),h=t("colormap"),f=t("simplicial-complex-contour"),p=t("typedarray-pool"),d=t("./shaders"),g=(t("./closest-point"),d.meshShader),m=d.pickShader,v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function y(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,g,m,y,x,b,_,w,k,M,A,T,S,E){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleVectors=c,this.triangleColors=h,this.triangleNormals=p,this.triangleUVs=f,this.triangleIds=u,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=g,this.edgeColors=y,this.edgeUVs=x,this.edgeIds=m,this.edgeVAO=b,this.edgeCount=0,this.pointPositions=_,this.pointColors=k,this.pointUVs=M,this.pointSizes=A,this.pointIds=w,this.pointVAO=T,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=S,this.contourVAO=E,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.coneScale=2,this.vectorScale=1,this.coneOffset=.25,this._model=v,this._view=v,this._projection=v,this._resolution=[1,1]}var x=y.prototype;function b(t){var e=n(t,m.vertex,m.fragment,null,m.attributes);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.vector.location=5,e}x.isOpaque=function(){return this.opacity>=1},x.isTransparent=function(){return this.opacity<1},x.pickSlots=1,x.setPickBase=function(t){this.pickId=t},x.highlight=function(t){if(t&&this.contourEnable){for(var e=f(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0&&((h=this.triShader).bind(),h.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind());this.edgeCount>0&&this.lineWidth>0&&((h=this.lineShader).bind(),h.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind());this.pointCount>0&&((h=this.pointShader).bind(),h.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind());this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((h=this.contourShader).bind(),h.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},x.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||v,n=t.view||v,i=t.projection||v,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255};((s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0)&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},x.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3);return{index:Math.floor(r[1]/48),position:n,dataCoordinate:n}},x.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose()},e.exports=function(t,e){1===arguments.length&&(t=(e=t).gl);var r=e.triShader||function(t){var e=n(t,g.vertex,g.fragment,null,g.attributes);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.vector.location=5,e}(t),s=b(t),l=o(t,u(new Uint8Array([255,255,255,255]),[1,1,4]));l.generateMipmap(),l.minFilter=t.LINEAR_MIPMAP_LINEAR,l.magFilter=t.LINEAR;var c=i(t),h=i(t),f=i(t),p=i(t),d=i(t),m=i(t),v=a(t,[{buffer:c,type:t.FLOAT,size:4},{buffer:m,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:f,type:t.FLOAT,size:4},{buffer:p,type:t.FLOAT,size:2},{buffer:d,type:t.FLOAT,size:3},{buffer:h,type:t.FLOAT,size:3}]),x=i(t),_=i(t),w=i(t),k=i(t),M=a(t,[{buffer:x,type:t.FLOAT,size:3},{buffer:k,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:_,type:t.FLOAT,size:4},{buffer:w,type:t.FLOAT,size:2}]),A=i(t),T=i(t),S=i(t),E=i(t),C=i(t),L=a(t,[{buffer:A,type:t.FLOAT,size:3},{buffer:C,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:T,type:t.FLOAT,size:4},{buffer:S,type:t.FLOAT,size:2},{buffer:E,type:t.FLOAT,size:1}]),z=i(t),P=new y(t,l,r,null,null,s,null,null,c,h,m,f,p,d,v,x,k,_,w,M,A,C,T,S,E,L,z,a(t,[{buffer:z,type:t.FLOAT,size:3}]));return P.update(e),P}},{"./closest-point":232,"./shaders":234,colormap:113,"gl-buffer":230,"gl-mat4/invert":254,"gl-mat4/multiply":256,"gl-shader":287,"gl-texture2d":303,"gl-vao":308,ndarray:417,normals:420,"simplicial-complex-contour":479,"typedarray-pool":507}],234:[function(t,e,r){var n=t("glslify"),i=n(["precision mediump float;\n#define GLSLIFY 1\n\nfloat inverse(float m) {\n return 1.0 / m;\n}\n\nmat2 inverse(mat2 m) {\n return mat2(m[1][1],-m[0][1],\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n}\n\nmat3 inverse(mat3 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nmat4 inverse(mat4 m) {\n float\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00) / det;\n}\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float index, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n index = mod(index, segmentCount * 6.0);\n\n float segment = floor(index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex == 3.0) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n // angle = 2pi * ((segment + ((segmentIndex == 1.0 || segmentIndex == 5.0) ? 1.0 : 0.0)) / segmentCount)\n float nextAngle = float(segmentIndex == 1.0 || segmentIndex == 5.0);\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex <= 2.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\nuniform float vectorScale;\nuniform float coneScale;\n\nuniform float coneOffset;\n\nuniform mat4 model\n , view\n , projection;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal), 0.0);\n normal = normalize(normal * inverse(mat3(model)));\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n f_color = color; //vec4(position.w, color.r, 0, 0);\n f_normal = normal;\n f_data = conePosition.xyz;\n f_eyeDirection = eyePosition - conePosition.xyz;\n f_lightDirection = lightPosition - conePosition.xyz;\n f_uv = uv;\n}\n"]),a=n(["precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n //if(any(lessThan(f_data, clipBounds[0])) || \n // any(greaterThan(f_data, clipBounds[1]))) {\n // discard;\n //}\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n \n if(!gl_FrontFacing) {\n N = -N;\n }\n\n float specular = cookTorranceSpecular(L, V, N, roughness, fresnel);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float index, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n index = mod(index, segmentCount * 6.0);\n\n float segment = floor(index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex == 3.0) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n // angle = 2pi * ((segment + ((segmentIndex == 1.0 || segmentIndex == 5.0) ? 1.0 : 0.0)) / segmentCount)\n float nextAngle = float(segmentIndex == 1.0 || segmentIndex == 5.0);\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex <= 2.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nuniform float vectorScale;\nuniform float coneScale;\nuniform float coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal), 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(f_position, clipBounds[0])) || \n any(greaterThan(f_position, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},{glslify:377}],235:[function(t,e,r){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34000:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],236:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":235}],237:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),o=i(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(e,r,o,l);return c.update(t),c};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders/index"),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1}var l=s.prototype;function c(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}l.isOpaque=function(){return this.opacity>=1},l.isTransparent=function(){return this.opacity<1},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],c=n[15],u=this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*c)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]),r.capSize=this.capSize[h]*u,this.lineCount[h]&&e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var u=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();function h(t,e,r,n){for(var i=u[n],a=0;a0)(g=u.slice())[s]+=p[1][s],i.push(u[0],u[1],u[2],d[0],d[1],d[2],d[3],0,0,0,g[0],g[1],g[2],d[0],d[1],d[2],d[3],0,0,0),c(this.bounds,g),o+=2+h(i,g,d,s)}}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":238,"gl-buffer":230,"gl-vao":308}],238:[function(t,e,r){"use strict";var n=t("glslify"),i=t("gl-shader"),a=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * view * worldPosition;\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(fragPosition, clipBounds[0])) || any(greaterThan(fragPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},{"gl-shader":287,glslify:377}],239:[function(t,e,r){"use strict";var n=t("gl-texture2d");e.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=t.getExtension("WEBGL_draw_buffers");!l&&c&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;au||r<0||r>u)throw new Error("gl-fbo: Parameters are too large for FBO");var h=1;if("color"in(n=n||{})){if((h=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(h>1){if(!c)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(h>t.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+h+" draw buffers")}}var f=t.UNSIGNED_BYTE,p=t.getExtension("OES_texture_float");if(n.float&&h>0){if(!p)throw new Error("gl-fbo: Context does not support floating point textures");f=t.FLOAT}else n.preferFloat&&h>0&&p&&(f=t.FLOAT);var g=!0;"depth"in n&&(g=!!n.depth);var m=!1;"stencil"in n&&(m=!!n.stencil);return new d(t,e,r,f,h,g,m,c)};var i,a,o,s,l=null;function c(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function u(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function h(t){switch(t){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function f(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function p(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function d(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var d=0;d1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?d?t.depth=f(r,i,a,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g&&(t.depth=f(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):g&&d?t._depth_rb=p(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g?t._depth_rb=p(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=p(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){for(t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null),v=0;vi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var a=c(n),o=0;o>8*p&255;this.pickOffset=r,i.bind();var d=i.uniforms;d.viewTransform=t,d.pickOffset=e,d.shape=this.shape;var g=i.attributes;return this.positionBuffer.bind(),g.position.pointer(),this.weightBuffer.bind(),g.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),g.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),h.pick=function(t,e,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},h.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||i(e[0]),o=t.y||i(e[1]),s=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=o;var l=t.colorLevels||[0],c=t.colorValues||[0,0,0,1],u=l.length,h=this.bounds,p=h[0]=r[0],d=h[1]=o[0],g=1/((h[2]=r[r.length-1])-p),m=1/((h[3]=o[o.length-1])-d),v=e[0],y=e[1];this.shape=[v,y];var x=(v-1)*(y-1)*(f.length>>>1);this.numVertices=x;for(var b=a.mallocUint8(4*x),_=a.mallocFloat32(2*x),w=a.mallocUint8(2*x),k=a.mallocUint32(x),M=0,A=0;A FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp float m = av * pow(2.0, -e) - 1.0;\n \n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n \n //Unpack exponent\n highp float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0; \n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId/255.0, encode_float_1540259130(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];r.createShader=function(t){return i(t,a,o,null,l)},r.createPickShader=function(t){return i(t,a,s,null,l)}},{"gl-shader":287,glslify:377}],245:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=u(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=h(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),c=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),f=l(new Array(1024),[256,1,4]),p=0;p<1024;++p)f.data[p]=255;var d=a(e,f);d.wrap=e.REPEAT;var g=new m(e,r,o,s,c,d);return g.update(t),g};var n=t("gl-buffer"),i=t("gl-vao"),a=t("gl-texture2d"),o=t("glsl-read-float"),s=t("binary-search-bounds"),l=t("ndarray"),c=t("./lib/shaders"),u=c.createShader,h=c.createPickShader,f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function p(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function d(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function g(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function m(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.dirty=!0,this.pixelRatio=1}var v=m.prototype;v.isTransparent=function(){return this.opacity<1},v.isOpaque=function(){return this.opacity>=1},v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.drawTransparent=v.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||f,view:t.view||f,projection:t.projection||f,clipBounds:d(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()},v.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||f,view:t.view||f,projection:t.projection||f,pickId:this.pickId,clipBounds:d(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()},v.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),"opacity"in t&&(this.opacity=+t.opacity);var i=t.position||t.positions;if(i){var a=t.color||t.colors||[0,0,0,1],o=t.lineWidth||1,c=[],u=[],h=[],f=0,d=0,g=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],m=!1;t:for(e=1;e0){for(var w=0;w<24;++w)c.push(c[c.length-12]);d+=2,m=!0}continue t}g[0][r]=Math.min(g[0][r],b[r],_[r]),g[1][r]=Math.max(g[1][r],b[r],_[r])}Array.isArray(a[0])?(v=a[e-1],y=a[e]):v=y=a,3===v.length&&(v=[v[0],v[1],v[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),x=Array.isArray(o)?o[e-1]:o;var k=f;if(f+=p(b,_),m){for(r=0;r<2;++r)c.push(b[0],b[1],b[2],_[0],_[1],_[2],k,x,v[0],v[1],v[2],v[3]);d+=2,m=!1}c.push(b[0],b[1],b[2],_[0],_[1],_[2],k,x,v[0],v[1],v[2],v[3],b[0],b[1],b[2],_[0],_[1],_[2],k,-x,v[0],v[1],v[2],v[3],_[0],_[1],_[2],b[0],b[1],b[2],f,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],f,x,y[0],y[1],y[2],y[3]),d+=4}if(this.buffer.update(c),u.push(f),h.push(i[i.length-1].slice()),this.bounds=g,this.vertexCount=d,this.points=h,this.arcLength=u,"dashes"in t){var M=t.dashes.slice();for(M.unshift(0),e=1;e1.0001)return null;v+=m[h]}if(Math.abs(v-1)>.001)return null;return[f,s(t,m),m]}},{barycentric:61,"polytope-closest-point/lib/closest_point_2d.js":448}],267:[function(t,e,r){var n=t("glslify"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec4 m_position = model * vec4(position, 1.0);\n vec4 t_position = view * m_position;\n gl_Position = projection * t_position;\n f_color = color;\n f_normal = normal;\n f_data = position;\n f_eyeDirection = eyePosition - position;\n f_lightDirection = lightPosition - position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nvec3 normals(vec3 pos) {\n vec3 fdx = dFdx(pos);\n vec3 fdy = dFdy(pos);\n return normalize(cross(fdx, fdy));\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) ||\n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n vec3 normal = normals(f_data);\n\n if (\n dot(N, normal) < 0.0\n ) {\n N = -N;\n }\n\n float specular = cookTorranceSpecular(L, V, N, roughness, fresnel);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),c=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5,0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),u=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}"]),h=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(f_position, clipBounds[0])) || \n any(greaterThan(f_position, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),f=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),p=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}"]),d=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:l,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:u,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:f,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:p,fragment:d,attributes:[{name:"position",type:"vec3"}]}},{glslify:377}],268:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),c=t("gl-mat4/invert"),u=t("ndarray"),h=t("colormap"),f=t("simplicial-complex-contour"),p=t("typedarray-pool"),d=t("./lib/shaders"),g=t("./lib/closest-point"),m=d.meshShader,v=d.wireShader,y=d.pointShader,x=d.pickShader,b=d.pointPickShader,_=d.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function k(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,g,m,v,y,x,b,_,k,M,A,T,S){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=u,this.triangleNormals=f,this.triangleUVs=h,this.triangleIds=c,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=m,this.edgeUVs=v,this.edgeIds=g,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=k,this.pointSizes=M,this.pointIds=b,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=T,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var M=k.prototype;function A(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function T(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function S(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function E(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}M.isOpaque=function(){return this.opacity>=1},M.isTransparent=function(){return this.opacity<1},M.pickSlots=1,M.setPickBase=function(t){this.pickId=t},M.highlight=function(t){if(t&&this.contourEnable){for(var e=f(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0&&((h=this.triShader).bind(),h.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind());this.edgeCount>0&&this.lineWidth>0&&((h=this.lineShader).bind(),h.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind());this.pointCount>0&&((h=this.pointShader).bind(),h.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind());this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((h=this.contourShader).bind(),h.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},M.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};((s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0)&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},M.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;ai[M]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=m[t],r.uniforms.angle=v[t],a.drawArrays(a.TRIANGLES,i[M],i[A]-i[M]))),y[t]&&k&&(u[1^t]-=T*p*x[t],r.uniforms.dataAxis=h,r.uniforms.screenOffset=u,r.uniforms.color=b[t],r.uniforms.angle=_[t],a.drawArrays(a.TRIANGLES,w,k)),u[1^t]=T*s[2+(1^t)]-1,d[t+2]&&(u[1^t]+=T*p*g[t+2],Mi[M]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=m[t+2],r.uniforms.angle=v[t+2],a.drawArrays(a.TRIANGLES,i[M],i[A]-i[M]))),y[t+2]&&k&&(u[1^t]+=T*p*x[t+2],r.uniforms.dataAxis=h,r.uniforms.screenOffset=u,r.uniforms.color=b[t+2],r.uniforms.angle=_[t+2],a.drawArrays(a.TRIANGLES,w,k))}),g.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-a[u])/(a[2+u]-a[u])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),g.bind=(f=[0,0],p=[0,0],d=[0,0],function(){var t=this.plot,e=this.shader,r=t._tickBounds,n=t.dataBox,i=t.screenBox,a=t.viewBox;e.bind();for(var o=0;o<2;++o){var s=r[o],l=r[o+2]-s,c=.5*(n[o+2]+n[o]),u=n[o+2]-n[o],h=a[o],g=a[o+2]-h,m=i[o],v=i[o+2]-m;p[o]=2*l/u*g/v,f[o]=2*(s-c)/u*g/v}d[1]=2*t.pixelRatio/(i[3]-i[1]),d[0]=d[1]*(i[3]-i[1])/(i[2]-i[0]),e.uniforms.dataScale=p,e.uniforms.dataShift=f,e.uniforms.textScale=d,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),g.update=function(t){var e,r,n,i,o,s=[],l=t.ticks,c=t.bounds;for(o=0;o<2;++o){var u=[Math.floor(s.length/3)],h=[-1/0],f=l[o];for(e=0;e=0){var g=e[d]-n[d]*(e[d+2]-e[d])/(n[d+2]-n[d]);0===d?o.drawLine(g,e[1],g,e[3],p[d],f[d]):o.drawLine(e[0],g,e[2],g,p[d],f[d])}}for(d=0;d=0;--t)this.objects[t].dispose();this.objects.length=0;for(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},c.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},c.removeObject=function(t){for(var e=this.objects,r=0;r0&&0===L[e-1];)L.pop(),z.pop().dispose()}window.addEventListener("resize",j),F.update=function(t){e||(t=t||{},P=!0,I=!0)},F.add=function(t){e||(t.axes=A,E.push(t),C.push(-1),P=!0,I=!0,V())},F.remove=function(t){if(!e){var r=E.indexOf(t);r<0||(E.splice(r,1),C.pop(),P=!0,I=!0,V())}},F.dispose=function(){if(!e&&(e=!0,window.removeEventListener("resize",j),r.removeEventListener("webglcontextlost",H),F.mouseListener.enabled=!1,!F.contextLost)){A.dispose(),S.dispose();for(var t=0;tb.distance)continue;for(var u=0;u0){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function m(t){return"boolean"!=typeof t||t}},{"./lib/shader":276,"3d-view-controls":42,"a-big-triangle":50,"gl-axes3d":222,"gl-axes3d/properties":229,"gl-fbo":239,"gl-mat4/perspective":257,"gl-select-static":286,"gl-spikes3d":296,"is-mobile":388,"mouse-change":402}],278:[function(t,e,r){var n=t("glslify");r.pointVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform float pointCloud;\n\nhighp float rand(vec2 co) {\n highp float a = 12.9898;\n highp float b = 78.233;\n highp float c = 43758.5453;\n highp float d = dot(co.xy, vec2(a, b));\n highp float e = mod(d, 3.14);\n return fract(sin(e) * c);\n}\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n // if we don't jitter the point size a bit, overall point cloud\n // saturation 'jumps' on zooming, which is disturbing and confusing\n gl_PointSize = pointSize * ((19.5 + rand(position)) / 20.0);\n if(pointCloud != 0.0) { // pointCloud is truthy\n // get the same square surface as circle would be\n gl_PointSize *= 0.886;\n }\n}"]),r.pointFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color, borderColor;\nuniform float centerFraction;\nuniform float pointCloud;\n\nvoid main() {\n float radius;\n vec4 baseColor;\n if(pointCloud != 0.0) { // pointCloud is truthy\n if(centerFraction == 1.0) {\n gl_FragColor = color;\n } else {\n gl_FragColor = mix(borderColor, color, centerFraction);\n }\n } else {\n radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n baseColor = mix(borderColor, color, step(radius, centerFraction));\n gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\n }\n}\n"]),r.pickVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n\n vec4 id = pickId + pickOffset;\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n fragId = id;\n}\n"]),r.pickFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n gl_FragColor = fragId / 255.0;\n}\n"])},{glslify:377}],279:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("typedarray-pool"),o=t("./lib/shader");function s(t,e,r,n,i){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}e.exports=function(t,e){var r=t.gl,a=i(r),l=i(r),c=n(r,o.pointVertex,o.pointFragment),u=n(r,o.pickVertex,o.pickFragment),h=new s(t,a,l,c,u);return h.update(e),t.addObject(h),h};var l,c,u=s.prototype;u.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},u.update=function(t){var e;function r(e,r){return e in t?t[e]:r}t=t||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:a.mallocFloat32(s.length),c=o?t.idToIndex:a.mallocInt32(n);if(i||l.set(s),!o)for(l.set(s),e=0;e>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,i),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/a,l[4]=2/o,l[6]=-2*i[0]/a-1,l[7]=-2*i[1]/o-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=u<5,r.uniforms.pointSize=u,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),e&&(c[0]=255&t,c[1]=t>>8&255,c[2]=t>>16&255,c[3]=t>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=c,this.pickOffset=t);var h=n.getParameter(n.BLEND),f=n.getParameter(n.DITHER);return h&&!this.blend&&n.disable(n.BLEND),f&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),h&&!this.blend&&n.enable(n.BLEND),f&&n.enable(n.DITHER),t+this.pointCount}),u.draw=u.unifiedDraw,u.drawPick=u.unifiedDraw,u.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},{"./lib/shader":278,"gl-buffer":230,"gl-shader":287,"typedarray-pool":507}],280:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],h=e[2],f=e[3],p=r[0],d=r[1],g=r[2],m=r[3];(a=c*p+u*d+h*g+f*m)<0&&(a=-a,p=-p,d=-d,g=-g,m=-m);1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n);return t[0]=s*c+l*p,t[1]=s*u+l*d,t[2]=s*h+l*g,t[3]=s*f+l*m,t}},{}],281:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e){var r=i[e];r||(r=i[e]={});if(t in r)return r[t];for(var a=n(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),o=n(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;l=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var g=[0,0],m=[0,0,0],v=[0,0,0],y=[0,0,0,1],x=[0,0,0,1],b=c.slice(),_=[0,0,0],w=[[0,0,0],[0,0,0]];function k(t){return t[0]=t[1]=t[2]=0,t}function M(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function A(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function T(t,e,r,n,i){var a,s=e.axesProject,l=e.gl,u=t.uniforms,f=r.model||c,p=r.view||c,d=r.projection||c,T=e.axesBounds,S=function(t){for(var e=w,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}(e.clipBounds);a=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],g[0]=2/l.drawingBufferWidth,g[1]=2/l.drawingBufferHeight,t.bind(),u.view=p,u.projection=d,u.screenSize=g,u.highlightId=e.highlightId,u.highlightScale=e.highlightScale,u.clipBounds=S,u.pickGroup=e.pickId/255,u.pixelRatio=e.pixelRatio;for(var E=0;E<3;++E)if(s[E]&&e.projectOpacity[E]<1===n){u.scale=e.projectScale[E],u.opacity=e.projectOpacity[E];for(var C=b,L=0;L<16;++L)C[L]=0;for(L=0;L<4;++L)C[5*L]=1;C[5*E]=0,a[E]<0?C[12+E]=T[0][E]:C[12+E]=T[1][E],o(C,f,C),u.model=C;var z=(E+1)%3,P=(E+2)%3,I=k(m),O=k(v);I[z]=1,O[P]=1;var D=h(0,0,0,M(y,I)),R=h(0,0,0,M(x,O));if(Math.abs(D[1])>Math.abs(R[1])){var B=D;D=R,R=B,B=I,I=O,O=B;var F=z;z=P,P=F}D[0]<0&&(I[z]=-1),R[1]>0&&(O[P]=-1);var N=0,j=0;for(L=0;L<4;++L)N+=Math.pow(f[4*z+L],2),j+=Math.pow(f[4*P+L],2);I[z]/=Math.sqrt(N),O[P]/=Math.sqrt(j),u.axes[0]=I,u.axes[1]=O,u.fragClipBounds[0]=A(_,S[0],E,-1e8),u.fragClipBounds[1]=A(_,S[1],E,1e8),e.vao.draw(l.TRIANGLES,e.vertexCount),e.lineWidth>0&&(l.lineWidth(e.lineWidth),e.vao.draw(l.LINES,e.lineVertexCount,e.vertexCount))}}var S=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function E(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||c,s.view=n.view||c,s.projection=n.projection||c,g[0]=2/o.drawingBufferWidth,g[1]=2/o.drawingBufferHeight,s.screenSize=g,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=S,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}T(e,r,n,i),r.vao.unbind()}d.draw=function(t){E(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},d.drawTransparent=function(t){E(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},d.drawPick=function(t){E(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},d.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},d.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},d.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",o=t.alignment||[0,0],s=[1/0,1/0,1/0],c=[-1/0,-1/0,-1/0],u=t.glyph,h=t.color,f=t.size,p=t.angle,d=t.lineColor,g=0,m=0,v=0,y=n.length;t:for(var x=0;x0&&(L[0]=-o[0]*(1+M[0][0]));var q=w.cells,H=w.positions;for(_=0;_0){var v=r*u;o.drawBox(h-v,f-v,p+v,f+v,a),o.drawBox(h-v,d-v,p+v,d+v,a),o.drawBox(h-v,f-v,h+v,d+v,a),o.drawBox(p-v,f-v,p+v,d+v,a)}}}},s.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":284,"gl-buffer":230,"gl-shader":287}],286:[function(t,e,r){"use strict";e.exports=function(t,e){var r=n(t,e),a=i.mallocUint8(e[0]*e[1]*4);return new c(t,r,a)};var n=t("gl-fbo"),i=t("typedarray-pool"),a=t("ndarray"),o=t("bit-twiddle").nextPow2,s=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_16_arg0_<255||_inline_16_arg1_<255||_inline_16_arg2_<255||_inline_16_arg3_<255){var _inline_16_l=_inline_16_arg4_-_inline_16_arg6_[0],_inline_16_a=_inline_16_arg5_-_inline_16_arg6_[1],_inline_16_f=_inline_16_l*_inline_16_l+_inline_16_a*_inline_16_a;_inline_16_fthis.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;ar)for(t=r;te)for(t=e;t=0){for(var k=0|w.type.charAt(w.type.length-1),M=new Array(k),A=0;A=0;)T+=1;_[y]=T}var S=new Array(r.length);function E(){f.program=o.program(p,f._vref,f._fref,b,_);for(var t=0;t=0){var d=f.charCodeAt(f.length-1)-48;if(d<2||d>4)throw new n("","Invalid data type for attribute "+h+": "+f);o(t,e,p[0],i,d,a,h)}else{if(!(f.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+h+": "+f);var d=f.charCodeAt(f.length-1)-48;if(d<2||d>4)throw new n("","Invalid data type for attribute "+h+": "+f);s(t,e,p,i,d,a,h)}}}return a};var n=t("./GLError");function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;function o(t,e,r,n,a,o,s){for(var l=["gl","v"],c=[],u=0;u4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+a+"fv(locations["+e+"],false,obj"+t+")"}throw new i("","Unknown uniform data type for "+name+": "+r)}var a=r.charCodeAt(r.length-1)-48;if(a<2||a>4)throw new i("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+a+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+a+"fv(locations["+e+"],obj"+t+")";default:throw new i("","Unrecognized data type for vector "+name+": "+r)}}}function c(e){for(var n=["return function updateProperty(obj){"],i=function t(e,r){if("object"!=typeof r)return[[e,r]];var n=[];for(var i in r){var a=r[i],o=e;parseInt(i)+""===i?o+="["+i+"]":o+="."+i,"object"==typeof a?n.push.apply(n,t(o,a)):n.push([o,a])}return n}("",e),a=0;a4)throw new i("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+t)}}(r[u].type);var p,d}function h(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var c=1;c1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\nuniform float tubeScale;\n\nuniform mat4 model\n , view\n , projection;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal), 0.0);\n normal = normalize(normal * inverse(mat3(model)));\n\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n f_color = color;\n f_normal = normal;\n f_data = tubePosition.xyz;\n f_eyeDirection = eyePosition - tubePosition.xyz;\n f_lightDirection = lightPosition - tubePosition.xyz;\n f_uv = uv;\n}\n"]),a=n(["precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n \n if(!gl_FrontFacing) {\n N = -N;\n }\n\n float specular = cookTorranceSpecular(L, V, N, roughness, fresnel);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal), 0.0);\n gl_Position = projection * view * tubePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},{glslify:377}],299:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),c=t("gl-mat4/invert"),u=t("ndarray"),h=t("colormap"),f=t("simplicial-complex-contour"),p=t("typedarray-pool"),d=t("./shaders"),g=(t("./closest-point"),d.meshShader),m=d.pickShader,v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function y(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,g,m,y,x,b,_,w,k,M,A,T,S,E){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleVectors=c,this.triangleColors=h,this.triangleNormals=p,this.triangleUVs=f,this.triangleIds=u,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=g,this.edgeColors=y,this.edgeUVs=x,this.edgeIds=m,this.edgeVAO=b,this.edgeCount=0,this.pointPositions=_,this.pointColors=k,this.pointUVs=M,this.pointSizes=A,this.pointIds=w,this.pointVAO=T,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=S,this.contourVAO=E,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!1,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.tubeScale=1,this._model=v,this._view=v,this._projection=v,this._resolution=[1,1]}var x=y.prototype;function b(t){var e=n(t,m.vertex,m.fragment,null,m.attributes);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.vector.location=5,e}x.isOpaque=function(){return this.opacity>=1},x.isTransparent=function(){return this.opacity<1},x.pickSlots=1,x.setPickBase=function(t){this.pickId=t},x.highlight=function(t){if(t&&this.contourEnable){for(var e=f(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0&&((h=this.triShader).bind(),h.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind());this.edgeCount>0&&this.lineWidth>0&&((h=this.lineShader).bind(),h.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind());this.pointCount>0&&((h=this.pointShader).bind(),h.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind());this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((h=this.contourShader).bind(),h.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},x.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||v,n=t.view||v,i=t.projection||v,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,pickId:this.pickId/255};((s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0)&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},x.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3);return{index:e,position:n,intensity:this.intensity[r[1]],velocity:this.vectors[r[1]].slice(0,3),divergence:this.vectors[r[1]][3],dataCoordinate:n}},x.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose()},e.exports=function(t,e){1===arguments.length&&(t=(e=t).gl);var r=e.triShader||function(t){var e=n(t,g.vertex,g.fragment,null,g.attributes);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.vector.location=5,e}(t),s=b(t),l=o(t,u(new Uint8Array([255,255,255,255]),[1,1,4]));l.generateMipmap(),l.minFilter=t.LINEAR_MIPMAP_LINEAR,l.magFilter=t.LINEAR;var c=i(t),h=i(t),f=i(t),p=i(t),d=i(t),m=i(t),v=a(t,[{buffer:c,type:t.FLOAT,size:4},{buffer:m,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:f,type:t.FLOAT,size:4},{buffer:p,type:t.FLOAT,size:2},{buffer:d,type:t.FLOAT,size:3},{buffer:h,type:t.FLOAT,size:4}]),x=i(t),_=i(t),w=i(t),k=i(t),M=a(t,[{buffer:x,type:t.FLOAT,size:3},{buffer:k,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:_,type:t.FLOAT,size:4},{buffer:w,type:t.FLOAT,size:2}]),A=i(t),T=i(t),S=i(t),E=i(t),C=i(t),L=a(t,[{buffer:A,type:t.FLOAT,size:3},{buffer:C,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:T,type:t.FLOAT,size:4},{buffer:S,type:t.FLOAT,size:2},{buffer:E,type:t.FLOAT,size:1}]),z=i(t),P=new y(t,l,r,null,null,s,null,null,c,h,m,f,p,d,v,x,k,_,w,M,A,C,T,S,E,L,z,a(t,[{buffer:z,type:t.FLOAT,size:3}]));return P.update(e),P}},{"./closest-point":297,"./shaders":298,colormap:113,"gl-buffer":230,"gl-mat4/invert":254,"gl-mat4/multiply":256,"gl-shader":287,"gl-texture2d":303,"gl-vao":308,ndarray:417,normals:420,"simplicial-complex-contour":479,"typedarray-pool":507}],300:[function(t,e,r){"use strict";var n=t("gl-vec3"),i=t("gl-vec4"),a=function(t,e,r,a){for(var o=0,s=0;so&&(o=u)}var h=t.map(function(t){return function(t,e,r,a){var o,s,l,c=t.points,u=t.velocities,h=t.divergences;n.set(n.create(),0,1,0),n.create(),n.create();n.create();for(var f=[],p=[],d=[],g=[],m=[],v=[],y=0,x=0,b=i.create(),_=i.create(),w=0;w0)for(k=0;k<8;k++){var M=(k+1)%8;f.push(g[k],m[k],m[M],m[M],g[M],g[k]),d.push(_,b,b,b,_,_),v.push(y,x,x,x,y,y),p.push([f.length-6,f.length-5,f.length-4],[f.length-3,f.length-2,f.length-1])}var A=g;g=m,m=A,A=_,_=b,b=A,A=y,y=x,x=A}return{positions:f,cells:p,vectors:d,vertexIntensity:v}}(t,r,a,o)}),f=[],p=[],d=[],g=[];for(s=0;se)return r-1}return r},c=n.create(),u=n.create(),h=function(t,e,r){return tr?r:t},f=function(t,e,r,i){var a=t[0],o=t[1],s=t[2],f=r[0].length,p=r[1].length,d=r[2].length,g=l(r[0],a),m=l(r[1],o),v=l(r[2],s),y=g+1,x=m+1,b=v+1;if(r[0][g]===a&&(y=g),r[1][m]===o&&(x=m),r[2][v]===s&&(b=v),i&&(g=h(g,0,f-1),y=h(y,0,f-1),m=h(m,0,p-1),x=h(x,0,p-1),v=h(v,0,d-1),b=h(b,0,d-1)),g<0||m<0||v<0||y>=f||x>=p||b>=d)return n.create();var _=(a-r[0][g])/(r[0][y]-r[0][g]),w=(o-r[1][m])/(r[1][x]-r[1][m]),k=(s-r[2][v])/(r[2][b]-r[2][v]);(_<0||_>1||isNaN(_))&&(_=0),(w<0||w>1||isNaN(w))&&(w=0),(k<0||k>1||isNaN(k))&&(k=0);var M=v*f*p,A=b*f*p,T=m*f,S=x*f,E=g,C=y,L=e[T+M+E],z=e[T+M+C],P=e[S+M+E],I=e[S+M+C],O=e[T+A+E],D=e[T+A+C],R=e[S+A+E],B=e[S+A+C],F=n.create();return n.lerp(F,L,z,_),n.lerp(c,P,I,_),n.lerp(F,F,c,w),n.lerp(c,O,D,_),n.lerp(u,R,B,_),n.lerp(c,c,u,w),n.lerp(F,F,c,k),F},p=function(t){var e=1/0;t.sort(function(t,e){return t-e});for(var r=1;r=h&&r<=g&&n>=f&&n<=m&&i>=d&&i<=v},x=10*n.distance(e[0],e[1])/i,b=x*x,_=1,w=0;n.create();r.length>=2&&(_=function(t){for(var e=[],r=[],n=[],i={},a={},o={},s=0;sw&&!isNaN(O)&&isFinite(O)&&(w=O),C.push(O),u.push({points:A,velocities:T,divergences:C});for(var z=0;z<100*i&&A.lengthb&&n.scale(P,P,x/Math.sqrt(I)),n.add(P,P,M),S=t.getVelocity(P),n.squaredDistance(E,P)-b>-1e-4*b){A.push(P),E=P,T.push(S);L=t.getDivergence(P,S);(O=n.length(L))>w&&!isNaN(O)&&isFinite(O)&&(w=O),C.push(O)}M=P}}for(k=0;k 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color — in vertex or in fragment\n vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z = clipPosition.z + zOffset;\n\n gl_Position = clipPosition;\n value = f;\n kill = -1.0;\n worldCoordinate = dataCoordinate;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if(kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);r.createShader=function(t){var e=n(t,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":287,glslify:377}],302:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=y(e),n=b(e),s=x(e),l=_(e),c=i(e),u=a(e,[{buffer:c,size:4,stride:w,offset:0},{buffer:c,size:3,stride:w,offset:16},{buffer:c,size:3,stride:w,offset:28}]),h=i(e),f=a(e,[{buffer:h,size:4,stride:20,offset:0},{buffer:h,size:1,stride:20,offset:16}]),p=i(e),d=a(e,[{buffer:p,size:2,type:e.FLOAT}]),g=o(e,1,S,e.RGBA,e.UNSIGNED_BYTE);g.minFilter=e.LINEAR,g.magFilter=e.LINEAR;var m=new E(e,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,g,s,l,h,f,p,d),v={levels:[[],[],[]]};for(var k in t)v[k]=t[k];return v.colormap=v.colormap||"jet",m.update(v),m};var n=t("bit-twiddle"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("typedarray-pool"),l=t("colormap"),c=t("ndarray-ops"),u=t("ndarray-pack"),h=t("ndarray"),f=t("surface-nets"),p=t("gl-mat4/multiply"),d=t("gl-mat4/invert"),g=t("binary-search-bounds"),m=t("ndarray-gradient"),v=t("./lib/shaders"),y=v.createShader,x=v.createContourShader,b=v.createPickShader,_=v.createPickContourShader,w=40,k=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],M=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],A=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function T(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var t=0;t<3;++t){var e=A[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();var S=256;function E(t,e,r,n,i,a,o,l,c,u,f,p,d,g){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=f,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new T([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=g,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var C=E.prototype;C.isTransparent=function(){return this.opacity<1},C.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},C.pickSlots=1,C.setPickBase=function(t){this.pickId=t};var L=[0,0,0],z={showSurface:!1,showContour:!1,projections:[k.slice(),k.slice(),k.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function P(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||L,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=z.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],p(l,t.model,l);var c=z.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return z.showSurface=o,z.showContour=s,z}var I={model:k,view:k,projection:k,inverseModel:k.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},O=k.slice(),D=[1,0,0,0,1,0,0,0,1];function R(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=I;n.model=t.model||k,n.view=t.view||k,n.projection=t.projection||k,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.contourColor=this.contourColor[0],n.inverseModel=d(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=D,n.vertexColor=this.vertexColor;var s=O;for(p(s,n.view,n.model),p(s,n.projection,s),d(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var c=s[12+i];for(o=0;o<3;++o)c+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=c/l}var u=P(n,this);if(u.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=u.projections[i],this._shader.uniforms.clipBounds=u.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour&&!e){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var f=this._contourVAO;for(f.bind(),i=0;i<3;++i)for(h.uniforms.permutation=A[i],r.lineWidth(this.contourWidth[i]),o=0;o>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var h=u?a:1-a,f=0;f<2;++f)for(var p=i+u,d=s+f,m=h*(f?l:1-l),v=0;v<3;++v)c[v]+=this._field[v].get(p,d)*m;for(var y=this._pickResult.level,x=0;x<3;++x)if(y[x]=g.le(this.contourLevels[x],c[x]),y[x]<0)this.contourLevels[x].length>0&&(y[x]=0);else if(y[x]Math.abs(_-c[x])&&(y[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],v=0;v<3;++v)r.dataCoordinate[v]=this._field[v].get(r.index[0],r.index[1]);return r},C.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=N(t.contourWidth,Number)),"showContour"in t&&(this.showContour=N(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=N(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=V(t.contourColor)),"contourProject"in t&&(this.contourProject=N(t.contourProject,function(t){return N(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=V(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=N(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=N(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=h(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),F(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var p=t.coords;if(!Array.isArray(p)||3!==p.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var d=p[o];for(b=0;b<2;++b)if(d.shape[b]!==a[b])throw new Error("gl-surface: coords have incorrect shape");F(this._field[o],d)}}else if(t.ticks){var g=t.ticks;if(!Array.isArray(g)||2!==g.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var v=g[o];if((Array.isArray(v)||v.length)&&(v=h(v)),v.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var y=h(v.data,a);y.stride[o]=v.stride[0],y.stride[1^o]=0,F(this._field[o],y)}}else{for(o=0;o<2;++o){var x=[0,0];x[o]=1,this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2],x,0)}this._field[0].set(0,0,0);for(var b=0;b0){for(var kt=0;kt<5;++kt)nt.pop();W-=1}continue t}nt.push(st[0],st[1],ut[0],ut[1],st[2]),W+=1}}ot.push(W)}this._contourOffsets[it]=at,this._contourCounts[it]=ot}var Mt=s.mallocFloat(nt.length);for(o=0;os||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=d(o,e.stride.slice()),c=0;"float32"===r?c=t.FLOAT:"float64"===r?(c=t.FLOAT,l=!1,r="float32"):"uint8"===r?c=t.UNSIGNED_BYTE:(c=t.UNSIGNED_BYTE,l=!1,r="uint8");var h,p,m=0;if(2===o.length)m=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])m=t.ALPHA;else if(2===o[2])m=t.LUMINANCE_ALPHA;else if(3===o[2])m=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");m=t.RGBA}}c!==t.FLOAT||t.getExtension("OES_texture_float")||(c=t.UNSIGNED_BYTE,l=!1);var v=e.size;if(l)h=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var y=[o[2],o[2]*o[0],1];p=a.malloc(v,r);var x=n(p,o,y,0);"float32"!==r&&"float64"!==r||c!==t.UNSIGNED_BYTE?i.assign(x,e):u(x,e),h=p.subarray(0,v)}var b=g(t);t.texImage2D(t.TEXTURE_2D,0,m,o[0],o[1],0,m,c,h),l||a.free(p);return new f(t,b,o[0],o[1],m,c)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function c(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&t instanceof ImageData}var u=function(t,e){i.muls(t,e,255)};function h(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function f(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}var p=f.prototype;function d(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function g(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function m(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=g(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new f(t,o,e,r,n,i)}Object.defineProperties(p,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(l.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return h(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return h(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t}}}),p.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},p.dispose=function(){this.gl.deleteTexture(this.handle)},p.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},p.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=c(t)?t:t.raw;if(l){this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,c,h){var f=h.dtype,p=h.shape.slice();if(p.length<2||p.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var g=0,m=0,v=d(p,h.stride.slice());"float32"===f?g=t.FLOAT:"float64"===f?(g=t.FLOAT,v=!1,f="float32"):"uint8"===f?g=t.UNSIGNED_BYTE:(g=t.UNSIGNED_BYTE,v=!1,f="uint8");if(2===p.length)m=t.LUMINANCE,p=[p[0],p[1],1],h=n(h.data,p,[h.stride[0],h.stride[1],1],h.offset);else{if(3!==p.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===p[2])m=t.ALPHA;else if(2===p[2])m=t.LUMINANCE_ALPHA;else if(3===p[2])m=t.RGB;else{if(4!==p[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");m=t.RGBA}p[2]}m!==t.LUMINANCE&&m!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(m=s);if(m!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=h.size,x=c.indexOf(o)<0;x&&c.push(o);if(g===l&&v)0===h.offset&&h.data.length===y?x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,h.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,h.data):x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,h.data.subarray(h.offset,h.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,h.data.subarray(h.offset,h.offset+y));else{var b;b=l===t.FLOAT?a.mallocFloat32(y):a.mallocUint8(y);var _=n(b,p,[p[2],p[2]*p[0],1]);g===t.FLOAT&&l===t.UNSIGNED_BYTE?u(_,h):i.assign(_,h),x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,b.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,b.subarray(0,y)),l===t.FLOAT?a.freeFloat32(b):a.freeUint8(b)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:417,"ndarray-ops":411,"typedarray-pool":507}],304:[function(t,e,r){"use strict";var n=t("pick-by-alias");function i(t){if(t.container)if(t.container==document.body)document.body.style.width||(t.canvas.width=t.width||t.pixelRatio*window.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*window.innerHeight);else{var e=t.container.getBoundingClientRect();t.canvas.width=t.width||e.right-e.left,t.canvas.height=t.height||e.bottom-e.top}}function a(t){return"function"==typeof t.getContext&&"width"in t&&"height"in t}e.exports=function(t){var e;if(t?"string"==typeof t&&(t={container:t}):t={},a(t)?t={container:t}:t="string"==typeof(e=t).nodeName&&"function"==typeof e.appendChild&&"function"==typeof e.getBoundingClientRect?{container:t}:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(t)?{gl:t}:n(t,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio"},!0),t.pixelRatio||(t.pixelRatio=window.pixelRatio||1),t.gl)return t.gl;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if("string"==typeof t.container){var r=document.querySelector(t.container);if(!r)throw Error("Element "+t.container+" is not found");t.container=r}a(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=document.createElement("canvas"),t.container.appendChild(t.canvas),i(t))}else t.canvas||(t.container=document.body||document.documentElement,t.canvas=document.createElement("canvas"),t.canvas.style.position="absolute",t.canvas.style.top=0,t.canvas.style.left=0,t.container.appendChild(t.canvas),i(t));if(!t.gl)try{t.gl=t.canvas.getContext("webgl",t.attrs)}catch(e){try{t.gl=t.canvas.getContext("experimental-webgl",t.attrs)}catch(e){t.gl=t.canvas.getContext("webgl-experimental",t.attrs)}}return t.gl}},{"pick-by-alias":432}],305:[function(t,e,r){"use strict";e.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i1?0:Math.acos(s)};var n=t("./fromValues"),i=t("./normalize"),a=t("./dot")},{"./dot":317,"./fromValues":319,"./normalize":328}],311:[function(t,e,r){e.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},{}],312:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},{}],313:[function(t,e,r){e.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},{}],314:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}},{}],315:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}},{}],316:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},{}],317:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{}],318:[function(t,e,r){e.exports=function(t,e,r,i,a,o){var s,l;e||(e=3);r||(r=0);l=i?Math.min(i*e+r,t.length):t.length;for(s=r;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a);return t}},{}],329:[function(t,e,r){e.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}},{}],330:[function(t,e,r){e.exports=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}},{}],331:[function(t,e,r){e.exports=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}},{}],332:[function(t,e,r){e.exports=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}},{}],333:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},{}],334:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}},{}],335:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},{}],336:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}},{}],337:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},{}],338:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},{}],339:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}},{}],340:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t}},{}],341:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,f=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+h*-l-f*-s,t[1]=h*c+p*-s+f*-o-u*-l,t[2]=f*c+p*-l+u*-s-h*-o,t}},{}],342:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}},{}],343:[function(t,e,r){e.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},{}],344:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},{}],345:[function(t,e,r){e.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},{}],346:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},{}],347:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}},{}],348:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},{}],349:[function(t,e,r){e.exports=function(t,e,r,n){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}},{}],350:[function(t,e,r){e.exports={create:t("./create"),clone:t("./clone"),fromValues:t("./fromValues"),copy:t("./copy"),set:t("./set"),add:t("./add"),subtract:t("./subtract"),multiply:t("./multiply"),divide:t("./divide"),min:t("./min"),max:t("./max"),scale:t("./scale"),scaleAndAdd:t("./scaleAndAdd"),distance:t("./distance"),squaredDistance:t("./squaredDistance"),length:t("./length"),squaredLength:t("./squaredLength"),negate:t("./negate"),inverse:t("./inverse"),normalize:t("./normalize"),dot:t("./dot"),lerp:t("./lerp"),random:t("./random"),transformMat4:t("./transformMat4"),transformQuat:t("./transformQuat")}},{"./add":342,"./clone":343,"./copy":344,"./create":345,"./distance":346,"./divide":347,"./dot":348,"./fromValues":349,"./inverse":351,"./length":352,"./lerp":353,"./max":354,"./min":355,"./multiply":356,"./negate":357,"./normalize":358,"./random":359,"./scale":360,"./scaleAndAdd":361,"./set":362,"./squaredDistance":363,"./squaredLength":364,"./subtract":365,"./transformMat4":366,"./transformQuat":367}],351:[function(t,e,r){e.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}},{}],352:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}},{}],353:[function(t,e,r){e.exports=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}},{}],354:[function(t,e,r){e.exports=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}},{}],355:[function(t,e,r){e.exports=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}},{}],356:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}},{}],357:[function(t,e,r){e.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},{}],358:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o);return t}},{}],359:[function(t,e,r){var n=t("./normalize"),i=t("./scale");e.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),i(t,t,e),t}},{"./normalize":358,"./scale":360}],360:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}},{}],361:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}},{}],362:[function(t,e,r){e.exports=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}},{}],363:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a}},{}],364:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}},{}],365:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}},{}],366:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},{}],367:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,f=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+h*-l-f*-s,t[1]=h*c+p*-s+f*-o-u*-l,t[2]=f*c+p*-l+u*-s-h*-o,t[3]=e[3],t}},{}],368:[function(t,e,r){e.exports=function(t,e,r,a){return n[0]=a,n[1]=r,n[2]=e,n[3]=t,i[0]};var n=new Uint8Array(4),i=new Float32Array(n.buffer)},{}],369:[function(t,e,r){var n=t("glsl-tokenizer"),i=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return B(r),z+=r.length,(S=S.slice(r.length)).length}}function H(){return/[^a-fA-F0-9]/.test(e)?(B(S.join("")),T=l,M):(S.push(e),r=e,M+1)}function G(){return"."===e?(S.push(e),T=g,r=e,M+1):/[eE]/.test(e)?(S.push(e),T=g,r=e,M+1):"x"===e&&1===S.length&&"0"===S[0]?(T=_,S.push(e),r=e,M+1):/[^\d]/.test(e)?(B(S.join("")),T=l,M):(S.push(e),r=e,M+1)}function W(){return"f"===e&&(S.push(e),r=e,M+=1),/[eE]/.test(e)?(S.push(e),r=e,M+1):"-"===e&&/[eE]/.test(r)?(S.push(e),r=e,M+1):/[^\d]/.test(e)?(B(S.join("")),T=l,M):(S.push(e),r=e,M+1)}function Y(){if(/[^\d\w_]/.test(e)){var t=S.join("");return T=R.indexOf(t)>-1?y:D.indexOf(t)>-1?v:m,B(S.join("")),T=l,M}return S.push(e),r=e,M+1}};var n=t("./lib/literals"),i=t("./lib/operators"),a=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=999,c=9999,u=0,h=1,f=2,p=3,d=4,g=5,m=6,v=7,y=8,x=9,b=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":372,"./lib/builtins-300es":371,"./lib/literals":374,"./lib/literals-300es":373,"./lib/operators":375}],371:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":372}],372:[function(t,e,r){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],373:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":374}],374:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],375:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],376:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),i=[];return i=(i=i.concat(r(t))).concat(r(null))}},{"./index":370}],377:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n>1,u=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*g}},{}],381:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var o=t.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),u=0;u<=i;++u)l[u]=u;s<0&&(l[0]=1,l[1]=0);for(var h=new a(l,new Array(i+1),!1),f=h.adjacent,p=new Array(i+2),u=0;u<=i;++u){for(var d=l.slice(),g=0;g<=i;++g)g===u&&(d[g]=-1);var m=d[0];d[0]=d[1],d[1]=m;var v=new a(d,new Array(i+1),!0);f[u]=v,p[u]=v}p[i+1]=h;for(var u=0;u<=i;++u)for(var d=f[u].vertices,y=f[u].adjacent,g=0;g<=i;++g){var x=d[g];if(x<0)y[g]=h;else for(var b=0;b<=i;++b)f[b].vertices.indexOf(x)<0&&(y[g]=f[b])}for(var _=new c(i,o,p),w=!!e,u=i+1;u0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var i=new Function("test",e.join("")),a=n[t+1];return a||(a=n),i(a)}(t)),this.orient=a}var u=c.prototype;u.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,i=this.tuple,a=this.vertices,o=[t];for(t.lastVisited=-n;o.length>0;){(t=o.pop()).vertices;for(var s=t.adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,h=0;h<=r;++h){var f=u[h];i[h]=f<0?e:a[f]}var p=this.orient();if(p>0)return c;c.lastVisited=-n,0===p&&o.push(c)}}}return null},u.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];s.lastVisited=r;for(u=0;u<=n;++u){var h=c[u];if(!(h.lastVisited>=r)){var f=a[u];a[u]=t;var p=this.orient();if(a[u]=f,p<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,h=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var f=[];h.length>0;){var p=(e=h.pop()).vertices,d=e.adjacent,g=p.indexOf(r);if(!(g<0))for(var m=0;m<=n;++m)if(m!==g){var v=d[m];if(v.boundary&&!(v.lastVisited>=r)){var y=v.vertices;if(v.lastVisited!==-r){for(var x=0,b=0;b<=n;++b)y[b]<0?(x=b,l[b]=t):l[b]=i[y[b]];if(this.orient()>0){y[x]=r,v.boundary=!1,c.push(v),h.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var _=v.adjacent,w=p.slice(),k=d.slice(),M=new a(w,k,!0);u.push(M);var A=_.indexOf(e);if(!(A<0)){_[A]=M,k[g]=v,w[m]=-1,k[m]=e,d[m]=M,M.flip();for(b=0;b<=n;++b){var T=w[b];if(!(T<0||T===r)){for(var S=new Array(n-1),E=0,C=0;C<=n;++C){var L=w[C];L<0||C===b||(S[E++]=L)}f.push(new o(S,M,b))}}}}}}f.sort(s);for(m=0;m+1=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var h=o[0];o[0]=o[1],o[1]=h}e.push(o)}}return e}},{"robust-orientation":471,"simplicial-complex":481}],382:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),i=0,a=1;function o(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}e.exports=function(t){if(!t||0===t.length)return new x(null);return new x(y(t))};var s=o.prototype;function l(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function c(t,e){var r=y(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function u(t,e){var r=t.intervals([]);r.push(e),c(t,r)}function h(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?i:(r.splice(n,1),c(t,r),a)}function f(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function d(t,e){for(var r=0;r>1],i=[],a=[],s=[];for(r=0;r3*(e+1)?u(this,t):this.left.insert(t):this.left=y([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?u(this,t):this.right.insert(t):this.right=y([t]);else{var r=n.ge(this.leftPoints,t,m),i=n.ge(this.rightPoints,t,v);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},s.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?h(this,t):2===(c=this.left.remove(t))?(this.left=null,this.count-=1,a):(c===a&&(this.count-=1),c):i;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?h(this,t):2===(c=this.right.remove(t))?(this.right=null,this.count-=1,a):(c===a&&(this.count-=1),c):i;if(1===this.count)return this.leftPoints[0]===t?2:i;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,o=this.left;o.right;)r=o,o=o.right;if(r===this)o.right=this.right;else{var s=this.left,c=this.right;r.count-=o.count,r.right=o.left,o.left=s,o.right=c}l(this,o),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?l(this,this.left):l(this,this.right);return a}for(s=n.ge(this.leftPoints,t,m);sthis.mid){var r;if(this.right)if(r=this.right.queryPoint(t,e))return r;return p(this.rightPoints,t,e)}return d(this.leftPoints,e)},s.queryInterval=function(t,e,r){var n;if(tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r)))return n;return ethis.mid?p(this.rightPoints,t,r):d(this.leftPoints,r)};var b=x.prototype;b.insert=function(t){this.root?this.root.insert(t):this.root=new o(t[0],null,null,[t],[t])},b.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==i}return!1},b.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},b.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(b,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(b,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":79}],383:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r4))}},{}],392:[function(t,e,r){e.exports=function(t,e,r){return t*(1-r)+e*r}},{}],393:[function(t,e,r){(function(t){!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():t.mapboxgl=n()}(this,function(){"use strict";var e,r,n;function i(t,i){if(e)if(r){var a="var sharedChunk = {}; ("+e+")(sharedChunk); ("+r+")(sharedChunk);",o={};e(o),(n=i(o)).workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))}else r=i;else e=i}return i(0,function(e){var r="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function i(t,e){return t(e={exports:{}},e.exports),e.exports}var a=o;function o(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}o.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},o.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},o.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},o.prototype.solveCurveX=function(t,e){var r,n,i,a,o;for(void 0===e&&(e=1e-6),i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)(n=1))return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},o.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var s=function(t,e,r){this.column=t,this.row=e,this.zoom=r};s.prototype.clone=function(){return new s(this.column,this.row,this.zoom)},s.prototype.zoomTo=function(t){return this.clone()._zoomTo(t)},s.prototype.sub=function(t){return this.clone()._sub(t)},s.prototype._zoomTo=function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},s.prototype._sub=function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this};var l=c;function c(t,e){this.x=t,this.y=e}function u(t,e,r,n){var i=new a(t,e,r,n);return function(t){return i.solve(t)}}c.prototype={clone:function(){return new c(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),a=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},c.convert=function(t){return t instanceof c?t:Array.isArray(t)?new c(t[0],t[1]):t};var h=u(.25,.1,.25,1);function f(t,e,r){return Math.min(r,Math.max(e,t))}function p(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n(e.y-t.y)*(r.x-t.x)}function k(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r=200&&r.status<300&&r.response?e(null,{data:n,cacheControl:r.getResponseHeader("Cache-Control"),expires:r.getResponseHeader("Expires")}):e(new A(r.statusText,r.status,t.url))},r.send(),r};function E(t,e,r){r[t]=r[t]||[],r[t].push(e)}function C(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}var L=function(t,e){void 0===e&&(e={}),p(this,e),this.type=t},z=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",p({error:e},r))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(L),P=function(){};P.prototype.on=function(t,e){return this._listeners=this._listeners||{},E(t,e,this._listeners),this},P.prototype.off=function(t,e){return C(t,e,this._listeners),C(t,e,this._oneTimeListeners),this},P.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},E(t,e,this._oneTimeListeners),this},P.prototype.fire=function(t){"string"==typeof t&&(t=new L(t,arguments[1]||{}));var e=t.type;if(this.listens(e)){t.target=this;for(var r=0,n=this._listeners&&this._listeners[e]?this._listeners[e].slice():[];r0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},P.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var I={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.0511,180,85.0511]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.0511,180,85.0511]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.0511,180,85.0511]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},lineMetrics:{type:"boolean",default:!1}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_fill:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_circle:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{butt:{},round:{},square:{}},default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{bevel:{},round:{},miter:{}},default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{point:{},line:{}},default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"factor of the original icon size",requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}]},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"]},"icon-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"]},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"ems",function:"interpolated","zoom-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{left:{},center:{},right:{}},default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field"]},"text-max-angle":{type:"number",default:45,units:"degrees",function:"interpolated","zoom-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Heatmap"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},transition:!1,"zoom-function":!0,"property-function":!1,function:"piecewise-constant"},position:{type:"array",default:[1.15,210,30],length:3,value:"number",transition:!0,function:"interpolated","zoom-function":!0,"property-function":!1},color:{type:"color",default:"#ffffff",function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0},intensity:{type:"number",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"line-gradient":{type:"color",function:"interpolated","zoom-function":!1,"property-function":!1,transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}]}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map"},"circle-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"viewport"},"circle-stroke-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-stroke-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"heatmap-weight":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!1},"heatmap-intensity":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],function:"interpolated","zoom-function":!1,"property-function":!1,transition:!1},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!1,units:"milliseconds"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,function:"interpolated","zoom-function":!0,transition:!1},"hillshade-illumination-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"viewport"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"hillshade-shadow-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",function:"interpolated","zoom-function":!0,transition:!0},"hillshade-accent-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible"}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!1,default:1,minimum:0,maximum:1,transition:!0},"fill-extrusion-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-extrusion-pattern"}]},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"fill-extrusion-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"]},"fill-extrusion-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"fill-extrusion-height":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0},"fill-extrusion-base":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"]}}},O=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function D(t){var e=t.key,r=t.value;return r?[new O(e,r,"constants have been deprecated as of v8")]:[]}function R(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var J=[V,U,q,H,G,W,Z(Y)];function K(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&!K(t.itemType,e.itemType)&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=J;r255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=i.indexOf("("),c=i.indexOf(")");if(-1!==l&&c+1===i.length){var u=i.substr(0,l),h=i.substr(l+1,c-(l+1)).split(","),f=1;switch(u){case"rgba":if(4!==h.length)return null;f=o(h.pop());case"rgb":return 3!==h.length?null:[a(h[0]),a(h[1]),a(h[2]),f];case"hsla":if(4!==h.length)return null;f=o(h.pop());case"hsl":if(3!==h.length)return null;var p=(parseFloat(h[0])%360+360)%360/360,d=o(h[1]),g=o(h[2]),m=g<=.5?g*(d+1):g+d-g*d,v=2*g-m;return[n(255*s(v,m,p+1/3)),n(255*s(v,m,p)),n(255*s(v,m,p-1/3)),f];default:return null}}return null}}catch(t){}}).parseCSSColor,tt=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};tt.parse=function(t){if(t){if(t instanceof tt)return t;if("string"==typeof t){var e=Q(t);if(e)return new tt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},tt.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},tt.prototype.toArray=function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]},tt.black=new tt(0,0,0,1),tt.white=new tt(1,1,1,1),tt.transparent=new tt(0,0,0,0);var et=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};et.prototype.compare=function(t,e){return this.collator.compare(t,e)},et.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var rt=function(t,e,r){this.type=X,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};function nt(t,e,r,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function it(t){if(null===t)return V;if("string"==typeof t)return q;if("boolean"==typeof t)return H;if("number"==typeof t)return U;if(t instanceof tt)return G;if(t instanceof et)return X;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n4)return e.error("Expected 1, 2, or 3 arguments, but found "+(t.length-1)+" instead.");var r,n;if(t.length>2){var i=t[1];if("string"!=typeof i||!(i in ct))return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=ct[i]}else r=Y;if(t.length>3){if("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2]))return e.error('The length argument to "array" must be a positive integer literal',2);n=t[2]}var a=Z(r,n),o=e.parse(t[t.length-1],t.length-1,Y);return o?new ut(a,o):null},ut.prototype.evaluate=function(t){var e=this.input.evaluate(t);if(K(this.type,it(e)))throw new ot("Expected value to be of type "+$(this.type)+", but found "+$(it(e))+" instead.");return e},ut.prototype.eachChild=function(t){t(this.input)},ut.prototype.possibleOutputs=function(){return this.input.possibleOutputs()},ut.prototype.serialize=function(){var t=["array"],e=this.type.itemType;if("string"===e.kind||"number"===e.kind||"boolean"===e.kind){t.push(e.kind);var r=this.type.N;"number"==typeof r&&t.push(r)}return t.push(this.input.serialize()),t};var ht={"to-number":U,"to-color":G},ft=function(t,e){this.type=t,this.args=e};ft.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");for(var r=t[0],n=ht[r],i=[],a=1;a4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":nt(e[0],e[1],e[2],e[3])))return new tt(e[0]/255,e[1]/255,e[2]/255,e[3]);throw new ot(r||"Could not parse color from value '"+("string"==typeof e?e:JSON.stringify(e))+"'")}for(var o=null,s=0,l=this.args;s=0)return!1;var r=!0;return t.eachChild(function(t){r&&!vt(t,e)&&(r=!1)}),r}gt.prototype.evaluate=function(t){return this._evaluate(t,this.args)},gt.prototype.eachChild=function(t){this.args.forEach(t)},gt.prototype.possibleOutputs=function(){return[void 0]},gt.prototype.serialize=function(){return[this.name].concat(this.args.map(function(t){return t.serialize()}))},gt.parse=function(t,e){var r=t[0],n=gt.definitions[r];if(!n)return e.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0);for(var i=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=a.filter(function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1}),s=[],l=1;lr&&ee))throw new ot("Input is not a number.");a=o-1}}return Math.max(o-1,0)}xt.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},xt.prototype._parse=function(t,e){if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[r];if(n){var i=n.parse(t,this);if(!i)return null;if(this.expectedType){var a=this.expectedType,o=i.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind||"value"!==o.kind)if("array"===a.kind&&"value"===o.kind)e.omitTypeAnnotations||(i=new ut(a,i));else if("color"!==a.kind||"value"!==o.kind&&"string"!==o.kind){if(this.checkSubtype(this.expectedType,i.type))return null}else e.omitTypeAnnotations||(i=new ft(a,[i]));else e.omitTypeAnnotations||(i=new lt(a,[i]))}if(!(i instanceof at)&&function t(e){if(e instanceof yt)return t(e.boundExpression);if(e instanceof gt&&"error"===e.name)return!1;if(e instanceof rt)return!1;var r=e instanceof ft||e instanceof lt||e instanceof ut,n=!0;return e.eachChild(function(e){n=r?n&&t(e):n&&e instanceof at}),!!n&&(mt(e)&&vt(e,["zoom","heatmap-density","line-progress","is-supported-script"]))}(i)){var s=new dt;try{i=new at(i.type,i.evaluate(s))}catch(t){return this.error(t.message),null}}return i}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},xt.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new xt(this.registry,n,e||null,i,this.errors)},xt.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map(function(t){return"["+t+"]"}).join("");this.errors.push(new N(n,t))},xt.prototype.checkSubtype=function(t,e){var r=K(t,e);return r&&this.error(r),r};var _t=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',c);var h=e.parse(l,u,a);if(!h)return null;a=a||h.type,i.push([s,h])}return new _t(a,r,i)},_t.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[bt(e,n)].evaluate(t)},_t.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var kt=Object.freeze({number:wt,color:function(t,e,r){return new tt(wt(t.r,e.r,r),wt(t.g,e.g,r),wt(t.b,e.b,r),wt(t.a,e.a,r))},array:function(t,e,r){return t.map(function(t,n){return wt(t,e[n],r)})}}),Mt=function(t,e,r,n){this.type=t,this.interpolation=e,this.input=r,this.labels=[],this.outputs=[];for(var i=0,a=n;i1}))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:o}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(n=e.parse(n,2,U)))return null;var s=[],l=null;e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var c=0;c=u)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var d=e.parse(h,p,l);if(!d)return null;l=l||d.type,s.push([u,d])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new Mt(l,r,n,s):e.error("Type "+$(l)+" is not interpolatable.")},Mt.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var a=bt(e,n),o=e[a],s=e[a+1],l=Mt.interpolationFactor(this.interpolation,n,o,s),c=r[a].evaluate(t),u=r[a+1].evaluate(t);return kt[this.type.kind.toLowerCase()](c,u,l)},Mt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ot("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ot("Array index must be an integer, but found "+e+" instead.");return r[e]},Et.prototype.eachChild=function(t){t(this.index),t(this.input)},Et.prototype.possibleOutputs=function(){return[void 0]},Et.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Ct=function(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};Ct.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},a=[],o=2;oNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof f&&Math.floor(f)!==f)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,it(f)))return null}else r=it(f);if(void 0!==i[String(f)])return c.error("Branch labels must be unique.");i[String(f)]=a.length}var p=e.parse(l,o,n);if(!p)return null;n=n||p.type,a.push(p)}var d=e.parse(t[1],1,r);if(!d)return null;var g=e.parse(t[t.length-1],t.length-1,n);return g?new Ct(r,n,d,i,a,g):null},Ct.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Ct.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Ct.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()})).concat(this.otherwise.possibleOutputs());var t},Ct.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();in.evaluate(t)}function Ut(t,e){var r=e[0],n=e[1];return r.evaluate(t)<=n.evaluate(t)}function qt(t,e){var r=e[0],n=e[1];return r.evaluate(t)>=n.evaluate(t)}function Ht(t){return{type:t}}function Gt(t){return{result:"success",value:t}}function Wt(t){return{result:"error",value:t}}gt.register(Rt,{error:[{kind:"error"},[q],function(t,e){var r=e[0];throw new ot(r.evaluate(t))}],typeof:[q,[Y],function(t,e){return $(it(e[0].evaluate(t)))}],"to-string":[q,[Y],function(t,e){var r=e[0],n=typeof(r=r.evaluate(t));return null===r?"":"string"===n||"number"===n||"boolean"===n?String(r):r instanceof tt?r.toString():JSON.stringify(r)}],"to-boolean":[H,[Y],function(t,e){var r=e[0];return Boolean(r.evaluate(t))}],"to-rgba":[Z(U,4),[G],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[G,[U,U,U],Bt],rgba:[G,[U,U,U,U],Bt],has:{type:H,overloads:[[[q],function(t,e){return Ft(e[0].evaluate(t),t.properties())}],[[q,W],function(t,e){var r=e[0],n=e[1];return Ft(r.evaluate(t),n.evaluate(t))}]]},get:{type:Y,overloads:[[[q],function(t,e){return Nt(e[0].evaluate(t),t.properties())}],[[q,W],function(t,e){var r=e[0],n=e[1];return Nt(r.evaluate(t),n.evaluate(t))}]]},properties:[W,[],function(t){return t.properties()}],"geometry-type":[q,[],function(t){return t.geometryType()}],id:[Y,[],function(t){return t.id()}],zoom:[U,[],function(t){return t.globals.zoom}],"heatmap-density":[U,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[U,[],function(t){return t.globals.lineProgress||0}],"+":[U,Ht(U),function(t,e){for(var r=0,n=0,i=e;n":[H,[q,Y],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[H,[Y],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[H,[q,Y],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[H,[Y],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[H,[q,Y],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[H,[Y],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[H,[Y],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[H,[],function(t){return null!==t.id()}],"filter-type-in":[H,[Z(q)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[H,[Z(Y)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[H,[q,Z(Y)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[H,[q,Z(Y)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],">":{type:H,overloads:[[[U,U],Vt],[[q,q],Vt],[[q,q,X],function(t,e){var r=e[0],n=e[1];return e[2].evaluate(t).compare(r.evaluate(t),n.evaluate(t))>0}]]},"<":{type:H,overloads:[[[U,U],jt],[[q,q],jt],[[q,q,X],function(t,e){var r=e[0],n=e[1];return e[2].evaluate(t).compare(r.evaluate(t),n.evaluate(t))<0}]]},">=":{type:H,overloads:[[[U,U],qt],[[q,q],qt],[[q,q,X],function(t,e){var r=e[0],n=e[1];return e[2].evaluate(t).compare(r.evaluate(t),n.evaluate(t))>=0}]]},"<=":{type:H,overloads:[[[U,U],Ut],[[q,q],Ut],[[q,q,X],function(t,e){var r=e[0],n=e[1];return e[2].evaluate(t).compare(r.evaluate(t),n.evaluate(t))<=0}]]},all:{type:H,overloads:[[[H,H],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Ht(H),function(t,e){for(var r=0,n=e;rQt?Math.pow(t,1/3):t/Kt+$t}function ne(t){return t>Jt?t*t*t:Kt*(t-$t)}function ie(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ae(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function oe(t){var e=ae(t.r),r=ae(t.g),n=ae(t.b),i=re((.4124564*e+.3575761*r+.1804375*n)/Yt),a=re((.2126729*e+.7151522*r+.072175*n)/Xt);return{l:116*a-16,a:500*(i-a),b:200*(a-re((.0193339*e+.119192*r+.9503041*n)/Zt)),alpha:t.a}}function se(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=Xt*ne(e),r=Yt*ne(r),n=Zt*ne(n),new tt(ie(3.2404542*r-1.5371385*e-.4985314*n),ie(-.969266*r+1.8760108*e+.041556*n),ie(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}var le={forward:oe,reverse:se,interpolate:function(t,e,r){return{l:wt(t.l,e.l,r),a:wt(t.a,e.a,r),b:wt(t.b,e.b,r),alpha:wt(t.alpha,e.alpha,r)}}},ce={forward:function(t){var e=oe(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*ee;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*te,r=t.c;return se({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:function(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}(t.h,e.h,r),c:wt(t.c,e.c,r),l:wt(t.l,e.l,r),alpha:wt(t.alpha,e.alpha,r)}}},ue=Object.freeze({lab:le,hcl:ce});function he(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function fe(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function pe(t){return t}function de(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function ge(t,e,r,n,i){return de(typeof r===i?n[r]:void 0,t.default,e.default)}function me(t,e,r){if("number"!==he(r))return de(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=xe(t.stops,r);return t.stops[i][1]}function ve(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==he(r))return de(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var a=xe(t.stops,r),o=function(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],c=kt[e.type]||pe;if(t.colorSpace&&"rgb"!==t.colorSpace){var u=ue[t.colorSpace];c=function(t,e){return u.reverse(u.interpolate(u.forward(t),u.forward(e),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return c(r,n,o)}}:c(s,l,o)}function ye(t,e,r){return"color"===e.type?r=tt.parse(r):he(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),de(r,t.default,e.default)}function xe(t,e){for(var r,n,i=0,a=t.length-1,o=0;i<=a;){if(r=t[o=Math.floor((i+a)/2)][0],n=t[o+1][0],e===r||e>r&&ee&&(a=o-1)}return Math.max(o-1,0)}var be=function(t,e){var r;this.expression=t,this._warningHistory={},this._defaultValue="color"===(r=e).type&&fe(r.default)?new tt(0,0,0,0):"color"===r.type?tt.parse(r.default)||null:void 0===r.default?null:r.default,"enum"===e.type&&(this._enumValues=e.values)};function _e(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Rt}function we(t,e){var r=new xt(Rt,[],function(t){var e={color:G,string:q,number:U,enum:q,boolean:H};return"array"===t.type?Z(e[t.value]||Y,t.length):e[t.type]||null}(e)),n=r.parse(t);return n?Gt(new be(n,e)):Wt(r.errors)}be.prototype.evaluateWithoutErrorHandling=function(t,e){return this._evaluator||(this._evaluator=new dt),this._evaluator.globals=t,this._evaluator.feature=e,this.expression.evaluate(this._evaluator)},be.prototype.evaluate=function(t,e){this._evaluator||(this._evaluator=new dt),this._evaluator.globals=t,this._evaluator.feature=e;try{var r=this.expression.evaluate(this._evaluator);if(null==r)return this._defaultValue;if(this._enumValues&&!(r in this._enumValues))throw new ot("Expected value to be one of "+Object.keys(this._enumValues).map(function(t){return JSON.stringify(t)}).join(", ")+", but found "+JSON.stringify(r)+" instead.");return r}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var ke=function(t,e){this.kind=t,this._styleExpression=e};ke.prototype.evaluateWithoutErrorHandling=function(t,e){return this._styleExpression.evaluateWithoutErrorHandling(t,e)},ke.prototype.evaluate=function(t,e){return this._styleExpression.evaluate(t,e)};var Me=function(t,e,r){this.kind=t,this.zoomStops=r.labels,this._styleExpression=e,r instanceof Mt&&(this._interpolationType=r.interpolation)};function Ae(t,e){if("error"===(t=we(t,e)).result)return t;var r=t.value.expression,n=mt(r);if(!n&&!e["property-function"])return Wt([new N("","property expressions not supported")]);var i=vt(r,["zoom"]);if(!i&&!1===e["zoom-function"])return Wt([new N("","zoom expressions not supported")]);var a=function t(e){var r=null;if(e instanceof St)r=t(e.result);else if(e instanceof Tt)for(var n=0,i=e.args;nn.maximum?[new O(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function ze(t){var e,r,n,i=t.valueSpec,a=B(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,l=!s,c="array"===he(t.value.stops)&&"array"===he(t.value.stops[0])&&"object"===he(t.value.stops[0][0]),u=Ee({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return[new O(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Ce({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===he(r)&&0===r.length&&e.push(new O(t.key,r,"array must have at least one stop")),e},default:function(t){return Ke({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&u.push(new O(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||u.push(new O(t.key,t.value,'missing required property "stops"')),"exponential"===a&&"piecewise-constant"===t.valueSpec.function&&u.push(new O(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!t.valueSpec["property-function"]?u.push(new O(t.key,t.value,"property functions not supported")):s&&!t.valueSpec["zoom-function"]&&"heatmap-color"!==t.objectKey&&"line-gradient"!==t.objectKey&&u.push(new O(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!c||void 0!==t.value.property||u.push(new O(t.key,t.value,'"property" property is required')),u;function h(t){var e=[],a=t.value,s=t.key;if("array"!==he(a))return[new O(s,a,"array expected, "+he(a)+" found")];if(2!==a.length)return[new O(s,a,"array length 2 expected, length "+a.length+" found")];if(c){if("object"!==he(a[0]))return[new O(s,a,"object expected, "+he(a[0])+" found")];if(void 0===a[0].zoom)return[new O(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new O(s,a,"object stop key must have value")];if(n&&n>B(a[0].zoom))return[new O(s,a[0].zoom,"stop zoom values must appear in ascending order")];B(a[0].zoom)!==n&&(n=B(a[0].zoom),r=void 0,o={}),e=e.concat(Ee({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Le,value:f}}))}else e=e.concat(f({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return e.concat(Ke({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function f(t,n){var s=he(t.value),l=B(t.value),c=null!==t.value?t.value:n;if(e){if(s!==e)return[new O(t.key,c,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new O(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var u="number expected, "+s+" found";return i["property-function"]&&void 0===a&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new O(t.key,c,u)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3===t.length&&(Array.isArray(t[1])||Array.isArray(t[2]));case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function Fe(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?Ne(t[1],t[2],"=="):"!="===r?Ue(Ne(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?Ne(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(Fe))):"all"===r?["all"].concat(t.slice(1).map(Fe)):"none"===r?["all"].concat(t.slice(1).map(Fe).map(Ue)):"in"===r?je(t[1],t.slice(2)):"!in"===r?Ue(je(t[1],t.slice(2))):"has"===r?Ve(t[1]):"!has"!==r||Ue(Ve(t[1]))}function Ne(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function je(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(function(t){return typeof t!=typeof e[0]})?["filter-in-large",t,["literal",e.sort(Be)]]:["filter-in-small",t,["literal",e]]}}function Ve(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ue(t){return["!",t]}function qe(t){return Oe(F(t.value))?Pe(R({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==he(r))return[new O(n,r,"array expected, "+he(r)+" found")];var i,a=e.styleSpec,o=[];if(r.length<1)return[new O(n,r,"filter array must have at least 1 element")];switch(o=o.concat(Ie({key:n+"[0]",value:r[0],valueSpec:a.filter_operator,style:e.style,styleSpec:e.styleSpec})),B(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===B(r[1])&&o.push(new O(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new O(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=he(r[1]))&&o.push(new O(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s=c[f+0]&&n>=c[f+1]?(o[h]=!0,a.push(l[h])):o[h]=!1}}},ur.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(r),u=this._convertToCellCoord(n),h=s;h<=c;h++)for(var f=l;f<=u;f++){var p=this.d*f+h;if(i.call(this,t,e,r,n,p,a,o))return}},ur.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},ur.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=cr+this.cells.length+1+1,r=0,n=0;n=0)){var h=t[u];c[u]=fr[l].shallow.indexOf(u)>=0?h:gr(h,e)}t instanceof Error&&(c.message=t.message)}return{name:l,properties:c}}throw new Error("can't serialize object of type "+typeof t)}function mr(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||t instanceof hr)return t;if(Array.isArray(t))return t.map(function(t){return mr(t)});if("object"==typeof t){var e=t,r=e.name,n=e.properties;if(!r)throw new Error("can't deserialize object of anonymous class");var i=fr[r].klass;if(!i)throw new Error("can't deserialize unregistered class "+r);if(i.deserialize)return i.deserialize(n._serialized);for(var a=Object.create(i.prototype),o=0,s=Object.keys(n);o=0?n[l]:mr(n[l])}return a}throw new Error("can't deserialize object of type "+typeof t)}var vr=function(){this.first=!0};vr.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function xr(t){for(var e=0,r=t;e=65097&&t<=65103)||yr["CJK Compatibility Ideographs"](t)||yr["CJK Compatibility"](t)||yr["CJK Radicals Supplement"](t)||yr["CJK Strokes"](t)||!(!yr["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||yr["CJK Unified Ideographs Extension A"](t)||yr["CJK Unified Ideographs"](t)||yr["Enclosed CJK Letters and Months"](t)||yr["Hangul Compatibility Jamo"](t)||yr["Hangul Jamo Extended-A"](t)||yr["Hangul Jamo Extended-B"](t)||yr["Hangul Jamo"](t)||yr["Hangul Syllables"](t)||yr.Hiragana(t)||yr["Ideographic Description Characters"](t)||yr.Kanbun(t)||yr["Kangxi Radicals"](t)||yr["Katakana Phonetic Extensions"](t)||yr.Katakana(t)&&12540!==t||!(!yr["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!yr["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||yr["Unified Canadian Aboriginal Syllabics"](t)||yr["Unified Canadian Aboriginal Syllabics Extended"](t)||yr["Vertical Forms"](t)||yr["Yijing Hexagram Symbols"](t)||yr["Yi Syllables"](t)||yr["Yi Radicals"](t)))}function wr(t){return!(_r(t)||function(t){return!!(yr["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||yr["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||yr["Letterlike Symbols"](t)||yr["Number Forms"](t)||yr["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||yr["Control Pictures"](t)&&9251!==t||yr["Optical Character Recognition"](t)||yr["Enclosed Alphanumerics"](t)||yr["Geometric Shapes"](t)||yr["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||yr["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||yr["CJK Symbols and Punctuation"](t)||yr.Katakana(t)||yr["Private Use Area"](t)||yr["CJK Compatibility Forms"](t)||yr["Small Form Variants"](t)||yr["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function kr(t,e){return!(!e&&(t>=1424&&t<=2303||yr["Arabic Presentation Forms-A"](t)||yr["Arabic Presentation Forms-B"](t))||t>=2304&&t<=3583||t>=3840&&t<=4255||yr.Khmer(t))}var Mr,Ar=!1,Tr=null,Sr=!1,Er=new P,Cr={applyArabicShaping:null,processBidirectionalText:null,isLoaded:function(){return Sr||null!=Cr.applyArabicShaping}},Lr=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new vr,this.transition={})};Lr.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(e=1)return 1;var e=i*i,r=e*i;return 4*(i<.5?r:3*(i-e)+r-.75)}())}return r};var Dr=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Dr.prototype.possiblyEvaluate=function(t){for(var e=new Fr(this._properties),r=0,n=Object.keys(this._values);rn.zoomHistory.lastIntegerZoom?{from:t,to:e,fromScale:2,toScale:1,t:a+(1-a)*o}:{from:r,to:e,fromScale:.5,toScale:1,t:1-(1-o)*a}},Vr.prototype.interpolate=function(t){return t};var Ur=function(t){this.specification=t};Ur.prototype.possiblyEvaluate=function(t,e){return!!t.expression.evaluate(e)},Ur.prototype.interpolate=function(){return!1};var qr=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},t){var r=t[e],n=this.defaultPropertyValues[e]=new zr(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new Pr(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};pr("DataDrivenProperty",jr),pr("DataConstantProperty",Nr),pr("CrossFadedProperty",Vr),pr("ColorRampProperty",Ur);var Hr=function(t){function e(e,r){for(var n in t.call(this),this.id=e.id,this.metadata=e.metadata,this.type=e.type,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,this.visibility="visible","background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),this._featureFilter=function(){return!0},r.layout&&(this._unevaluatedLayout=new Rr(r.layout)),this._transitionablePaint=new Ir(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(or,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility="none"===e?e:"visible"},e.prototype.getPaintProperty=function(t){return m(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(ar,n,t,e,r))return}m(t,"-transition")?this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0):this._transitionablePaint.setValue(t,e)},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t)),this.paint=this._transitioningPaint.possiblyEvaluate(t)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return"none"===this.visibility&&(t.layout=t.layout||{},t.layout.visibility="none"),y(t,function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)})},e.prototype._validate=function(t,e,r,n,i){return(!i||!1!==i.validate)&&sr(this,t.call(nr,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:I,style:{glyphs:!0,sprite:!0}}))},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e}(P),Gr={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Wr=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Yr=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Xr(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map(function(t){var i,a=(i=t.type,Gr[i].BYTES_PER_ELEMENT),o=r=Zr(r,Math.max(e,a)),s=t.components||1;return n=Math.max(n,a),r+=a*s,{name:t.name,type:t.type,components:s,offset:o}}),size:Zr(r,Math.max(n,e)),alignment:e}}function Zr(t,e){return Math.ceil(t/e)*e}Yr.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Yr.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Yr.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Yr.prototype.clear=function(){this.length=0},Yr.prototype.resize=function(t){this.reserve(t),this.length=t},Yr.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Yr.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var $r=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var n=2*r;return this.int16[n+0]=t,this.int16[n+1]=e,r},e}(Yr);$r.prototype.bytesPerElement=4,pr("StructArrayLayout2i4",$r);var Jr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;this.resize(i+1);var a=4*i;return this.int16[a+0]=t,this.int16[a+1]=e,this.int16[a+2]=r,this.int16[a+3]=n,i},e}(Yr);Jr.prototype.bytesPerElement=8,pr("StructArrayLayout4i8",Jr);var Kr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;this.resize(o+1);var s=6*o;return this.int16[s+0]=t,this.int16[s+1]=e,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=i,this.int16[s+5]=a,o},e}(Yr);Kr.prototype.bytesPerElement=12,pr("StructArrayLayout2i4i12",Kr);var Qr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s){var l=this.length;this.resize(l+1);var c=6*l,u=12*l;return this.int16[c+0]=t,this.int16[c+1]=e,this.int16[c+2]=r,this.int16[c+3]=n,this.uint8[u+8]=i,this.uint8[u+9]=a,this.uint8[u+10]=o,this.uint8[u+11]=s,l},e}(Yr);Qr.prototype.bytesPerElement=12,pr("StructArrayLayout4i4ub12",Qr);var tn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s){var l=this.length;this.resize(l+1);var c=8*l;return this.int16[c+0]=t,this.int16[c+1]=e,this.int16[c+2]=r,this.int16[c+3]=n,this.uint16[c+4]=i,this.uint16[c+5]=a,this.uint16[c+6]=o,this.uint16[c+7]=s,l},e}(Yr);tn.prototype.bytesPerElement=16,pr("StructArrayLayout4i4ui16",tn);var en=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;this.resize(n+1);var i=3*n;return this.float32[i+0]=t,this.float32[i+1]=e,this.float32[i+2]=r,n},e}(Yr);en.prototype.bytesPerElement=12,pr("StructArrayLayout3f12",en);var rn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;this.resize(e+1);var r=1*e;return this.uint32[r+0]=t,e},e}(Yr);rn.prototype.bytesPerElement=4,pr("StructArrayLayout1ul4",rn);var nn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u){var h=this.length;this.resize(h+1);var f=12*h,p=6*h;return this.int16[f+0]=t,this.int16[f+1]=e,this.int16[f+2]=r,this.int16[f+3]=n,this.int16[f+4]=i,this.int16[f+5]=a,this.uint32[p+3]=o,this.uint16[f+8]=s,this.uint16[f+9]=l,this.int16[f+10]=c,this.int16[f+11]=u,h},e}(Yr);nn.prototype.bytesPerElement=24,pr("StructArrayLayout6i1ul2ui2i24",nn);var an=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;this.resize(o+1);var s=6*o;return this.int16[s+0]=t,this.int16[s+1]=e,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=i,this.int16[s+5]=a,o},e}(Yr);an.prototype.bytesPerElement=12,pr("StructArrayLayout2i2i2i12",an);var on=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var n=4*r;return this.uint8[n+0]=t,this.uint8[n+1]=e,r},e}(Yr);on.prototype.bytesPerElement=4,pr("StructArrayLayout2ub4",on);var sn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,h,f,p){var d=this.length;this.resize(d+1);var g=20*d,m=10*d,v=40*d;return this.int16[g+0]=t,this.int16[g+1]=e,this.uint16[g+2]=r,this.uint16[g+3]=n,this.uint32[m+2]=i,this.uint32[m+3]=a,this.uint32[m+4]=o,this.uint16[g+10]=s,this.uint16[g+11]=l,this.uint16[g+12]=c,this.float32[m+7]=u,this.float32[m+8]=h,this.uint8[v+36]=f,this.uint8[v+37]=p,d},e}(Yr);sn.prototype.bytesPerElement=40,pr("StructArrayLayout2i2ui3ul3ui2f2ub40",sn);var ln=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;this.resize(e+1);var r=1*e;return this.float32[r+0]=t,e},e}(Yr);ln.prototype.bytesPerElement=4,pr("StructArrayLayout1f4",ln);var cn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;this.resize(n+1);var i=3*n;return this.int16[i+0]=t,this.int16[i+1]=e,this.int16[i+2]=r,n},e}(Yr);cn.prototype.bytesPerElement=6,pr("StructArrayLayout3i6",cn);var un=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;this.resize(n+1);var i=2*n,a=4*n;return this.uint32[i+0]=t,this.uint16[a+2]=e,this.uint16[a+3]=r,n},e}(Yr);un.prototype.bytesPerElement=8,pr("StructArrayLayout1ul2ui8",un);var hn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;this.resize(n+1);var i=3*n;return this.uint16[i+0]=t,this.uint16[i+1]=e,this.uint16[i+2]=r,n},e}(Yr);hn.prototype.bytesPerElement=6,pr("StructArrayLayout3ui6",hn);var fn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var n=2*r;return this.uint16[n+0]=t,this.uint16[n+1]=e,r},e}(Yr);fn.prototype.bytesPerElement=4,pr("StructArrayLayout2ui4",fn);var pn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var n=2*r;return this.float32[n+0]=t,this.float32[n+1]=e,r},e}(Yr);pn.prototype.bytesPerElement=8,pr("StructArrayLayout2f8",pn);var dn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;this.resize(i+1);var a=4*i;return this.float32[a+0]=t,this.float32[a+1]=e,this.float32[a+2]=r,this.float32[a+3]=n,i},e}(Yr);dn.prototype.bytesPerElement=16,pr("StructArrayLayout4f16",dn);var gn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.x1.set=function(t){this._structArray.int16[this._pos2+2]=t},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.y1.set=function(t){this._structArray.int16[this._pos2+3]=t},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.x2.set=function(t){this._structArray.int16[this._pos2+4]=t},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.y2.set=function(t){this._structArray.int16[this._pos2+5]=t},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.radius.get=function(){return this._structArray.int16[this._pos2+10]},r.radius.set=function(t){this._structArray.int16[this._pos2+10]=t},r.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},r.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t},r.anchorPoint.get=function(){return new l(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Wr);gn.prototype.size=24;var mn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new gn(this,t)},e}(nn);pr("CollisionBoxArray",mn);var vn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},hidden:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+37]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+37]=t},Object.defineProperties(e.prototype,r),e}(Wr);vn.prototype.size=40;var yn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new vn(this,t)},e}(sn);pr("PlacedSymbolArray",yn);var xn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={offsetX:{configurable:!0}};return r.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},r.offsetX.set=function(t){this._structArray.float32[this._pos4+0]=t},Object.defineProperties(e.prototype,r),e}(Wr);xn.prototype.size=4;var bn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e.prototype.get=function(t){return new xn(this,t)},e}(ln);pr("GlyphOffsetArray",bn);var _n=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return r.x.get=function(){return this._structArray.int16[this._pos2+0]},r.x.set=function(t){this._structArray.int16[this._pos2+0]=t},r.y.get=function(){return this._structArray.int16[this._pos2+1]},r.y.set=function(t){this._structArray.int16[this._pos2+1]=t},r.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},r.tileUnitDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+2]=t},Object.defineProperties(e.prototype,r),e}(Wr);_n.prototype.size=6;var wn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e.prototype.get=function(t){return new _n(this,t)},e}(cn);pr("SymbolLineVertexArray",wn);var kn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t},Object.defineProperties(e.prototype,r),e}(Wr);kn.prototype.size=8;var Mn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new kn(this,t)},e}(un);pr("FeatureIndexArray",Mn);var An=Xr([{name:"a_pos",components:2,type:"Int16"}],4).members,Tn=function(t){void 0===t&&(t=[]),this.segments=t};Tn.prototype.prepareSegment=function(t,e,r){var n=this.segments[this.segments.length-1];return t>Tn.MAX_VERTEX_ARRAY_LENGTH&&_("Max vertices per segment is "+Tn.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!n||n.vertexLength+t>Tn.MAX_VERTEX_ARRAY_LENGTH)&&(n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},this.segments.push(n)),n},Tn.prototype.get=function(){return this.segments},Tn.prototype.destroy=function(){for(var t=0,e=this.segments;tRn.max||o.yRn.max)&&_("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Fn(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var Nn=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.layoutVertexArray=new $r,this.indexArray=new hn,this.segments=new Tn,this.programConfigurations=new In(An,t.layers,t.zoom)};function jn(t,e,r){for(var n=0;n=3)for(var s=0;s1){if(Hn(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function Xn(t,e){for(var r,n,i,a=!1,o=0;oe.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function Zn(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function $n(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).binders[t].statistics.max}function Jn(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Kn(t,e,r,n,i){if(!e[0]&&!e[1])return t;var a=l.convert(e);"viewport"===r&&a._rotate(-n);for(var o=[],s=0;s=Dn||l<0||l>=Dn)){var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),u=c.vertexLength;Fn(this.layoutVertexArray,s,l,-1,-1),Fn(this.layoutVertexArray,s,l,1,-1),Fn(this.layoutVertexArray,s,l,1,1),Fn(this.layoutVertexArray,s,l,-1,1),this.indexArray.emplaceBack(u,u+1,u+2),this.indexArray.emplaceBack(u,u+3,u+2),c.vertexLength+=4,c.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t)},pr("CircleBucket",Nn,{omit:["layers"]});var Qn={paint:new qr({"circle-radius":new jr(I.paint_circle["circle-radius"]),"circle-color":new jr(I.paint_circle["circle-color"]),"circle-blur":new jr(I.paint_circle["circle-blur"]),"circle-opacity":new jr(I.paint_circle["circle-opacity"]),"circle-translate":new Nr(I.paint_circle["circle-translate"]),"circle-translate-anchor":new Nr(I.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Nr(I.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Nr(I.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new jr(I.paint_circle["circle-stroke-width"]),"circle-stroke-color":new jr(I.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new jr(I.paint_circle["circle-stroke-opacity"])})},ti=i(function(t,e){var r;t.exports=((r=new Float32Array(3))[0]=0,r[1]=0,r[2]=0,function(){var t=new Float32Array(4);t[0]=0,t[1]=0,t[2]=0,t[3]=0}(),{vec3:{transformMat3:function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}},vec4:{transformMat4:function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},mat2:{create:function(){var t=new Float32Array(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},rotate:function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+a*s,t[1]=i*l+o*s,t[2]=n*-s+a*l,t[3]=i*-s+o*l,t},scale:function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1];return t[0]=n*s,t[1]=i*s,t[2]=a*l,t[3]=o*l,t}},mat3:{create:function(){var t=new Float32Array(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromRotation:function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}},mat4:{create:function(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},translate:function(t,e,r){var n,i,a,o,s,l,c,u,h,f,p,d,g=r[0],m=r[1],v=r[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*v+e[12],t[13]=e[1]*g+e[5]*m+e[9]*v+e[13],t[14]=e[2]*g+e[6]*m+e[10]*v+e[14],t[15]=e[3]*g+e[7]*m+e[11]*v+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],p=e[10],d=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=n*g+s*m+h*v+e[12],t[13]=i*g+l*m+f*v+e[13],t[14]=a*g+c*m+p*v+e[14],t[15]=o*g+u*m+d*v+e[15]),t},scale:function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},multiply:function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],p=e[10],d=e[11],g=e[12],m=e[13],v=e[14],y=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*s+_*h+w*g,t[1]=x*i+b*l+_*f+w*m,t[2]=x*a+b*c+_*p+w*v,t[3]=x*o+b*u+_*d+w*y,x=r[4],b=r[5],_=r[6],w=r[7],t[4]=x*n+b*s+_*h+w*g,t[5]=x*i+b*l+_*f+w*m,t[6]=x*a+b*c+_*p+w*v,t[7]=x*o+b*u+_*d+w*y,x=r[8],b=r[9],_=r[10],w=r[11],t[8]=x*n+b*s+_*h+w*g,t[9]=x*i+b*l+_*f+w*m,t[10]=x*a+b*c+_*p+w*v,t[11]=x*o+b*u+_*d+w*y,x=r[12],b=r[13],_=r[14],w=r[15],t[12]=x*n+b*s+_*h+w*g,t[13]=x*i+b*l+_*f+w*m,t[14]=x*a+b*c+_*p+w*v,t[15]=x*o+b*u+_*d+w*y,t},perspective:function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t},rotateX:function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+c*n,t[5]=o*i+u*n,t[6]=s*i+h*n,t[7]=l*i+f*n,t[8]=c*i-a*n,t[9]=u*i-o*n,t[10]=h*i-s*n,t[11]=f*i-l*n,t},rotateZ:function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+c*n,t[1]=o*i+u*n,t[2]=s*i+h*n,t[3]=l*i+f*n,t[4]=c*i-a*n,t[5]=u*i-o*n,t[6]=h*i-s*n,t[7]=f*i-l*n,t},invert:function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],p=e[11],d=e[12],g=e[13],m=e[14],v=e[15],y=r*s-n*o,x=r*l-i*o,b=r*c-a*o,_=n*l-i*s,w=n*c-a*s,k=i*c-a*l,M=u*g-h*d,A=u*m-f*d,T=u*v-p*d,S=h*m-f*g,E=h*v-p*g,C=f*v-p*m,L=y*C-x*E+b*S+_*T-w*A+k*M;return L?(L=1/L,t[0]=(s*C-l*E+c*S)*L,t[1]=(i*E-n*C-a*S)*L,t[2]=(g*k-m*w+v*_)*L,t[3]=(f*w-h*k-p*_)*L,t[4]=(l*T-o*C-c*A)*L,t[5]=(r*C-i*T+a*A)*L,t[6]=(m*b-d*k-v*x)*L,t[7]=(u*k-f*b+p*x)*L,t[8]=(o*E-s*T+c*M)*L,t[9]=(n*T-r*E-a*M)*L,t[10]=(d*w-g*b+v*y)*L,t[11]=(h*b-u*w-p*y)*L,t[12]=(s*A-o*S-l*M)*L,t[13]=(r*S-n*A+i*M)*L,t[14]=(g*x-d*_-m*y)*L,t[15]=(u*_-h*x+f*y)*L,t):null},ortho:function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t}}})}),ei=(ti.vec3,ti.vec4),ri=(ti.mat2,ti.mat3,ti.mat4),ni=function(t){function e(e){t.call(this,e,Qn)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Nn(t)},e.prototype.queryRadius=function(t){var e=t;return $n("circle-radius",this,e)+$n("circle-stroke-width",this,e)+Jn(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o){for(var s=Kn(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),i.angle,a),l=this.paint.get("circle-radius").evaluate(e)+this.paint.get("circle-stroke-width").evaluate(e),c="map"===this.paint.get("circle-pitch-alignment"),u=c?s:function(t,e,r){return s.map(function(t){return t.map(function(t){return ii(t,e,r)})})}(0,o,i),h=c?l*a:l,f=0,p=r;ft.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,l=0;l80*r){n=a=t[0],i=o=t[1];for(var d=r;da&&(a=s),l>o&&(o=l);c=0!==(c=Math.max(a-n,o-i))?1/c:0}return wi(f,p,r,n,i,c),p}function bi(t,e,r,n,i){var a,o;if(i===Vi(t,e,r,n)>0)for(a=e;a=e;a-=n)o=Fi(a,t[a],t[a+1],o);return o&&Oi(o,o.next)&&(Ni(o),o=o.next),o}function _i(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Oi(n,n.next)&&0!==Ii(n.prev,n,n.next))n=n.next;else{if(Ni(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function wi(t,e,r,n,i,a,o){if(t){!o&&a&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=Ci(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,a);for(var s,l,c=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?Mi(t,n,i,a):ki(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),Ni(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?wi(t=Ai(t,e,r),e,r,n,i,a,2):2===o&&Ti(t,e,r,n,i,a):wi(_i(t),e,r,n,i,a,1);break}}}function ki(t){var e=t.prev,r=t,n=t.next;if(Ii(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(zi(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Ii(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Mi(t,e,r,n){var i=t.prev,a=t,o=t.next;if(Ii(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=Ci(s,l,e,r,n),f=Ci(c,u,e,r,n),p=t.prevZ,d=t.nextZ;p&&p.z>=h&&d&&d.z<=f;){if(p!==t.prev&&p!==t.next&&zi(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ii(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,d!==t.prev&&d!==t.next&&zi(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Ii(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&zi(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ii(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&zi(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Ii(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function Ai(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!Oi(i,a)&&Di(i,n,n.next,a)&&Ri(i,a)&&Ri(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),Ni(n),Ni(n.next),n=t=a),n=n.next}while(n!==t);return n}function Ti(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Pi(o,s)){var l=Bi(o,s);return o=_i(o,o.next),l=_i(l,l.next),wi(o,e,r,n,i,a),void wi(l,e,r,n,i,a)}s=s.next}o=o.next}while(o!==t)}function Si(t,e){return t.x-e.x}function Ei(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=u&&i!==n.x&&zi(ar.x)&&Ri(n,t)&&(r=n,f=l),n=n.next;return r}(t,e)){var r=Bi(e,t);_i(r,r.next)}}function Ci(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Li(t){var e=t,r=t;do{e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function Pi(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Di(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&Ri(t,e)&&Ri(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)}function Ii(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Oi(t,e){return t.x===e.x&&t.y===e.y}function Di(t,e,r,n){return!!(Oi(t,e)&&Oi(r,n)||Oi(t,n)&&Oi(r,e))||Ii(t,e,r)>0!=Ii(t,e,n)>0&&Ii(r,n,t)>0!=Ii(r,n,e)>0}function Ri(t,e){return Ii(t.prev,t,t.next)<0?Ii(t,e,t.next)>=0&&Ii(t,t.prev,e)>=0:Ii(t,e,t.prev)<0||Ii(t,t.next,e)<0}function Bi(t,e){var r=new ji(t.i,t.x,t.y),n=new ji(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Fi(t,e,r,n){var i=new ji(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ni(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function ji(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Vi(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r},vi.default=yi;var Ui=Hi,qi=Hi;function Hi(t,e,r,n,i){!function t(e,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(i,Math.floor(r+(o-s)*c/o+u)),a)}var h=e[r],f=n,p=i;for(Gi(e,n,r),a(e[i],h)>0&&Gi(e,n,i);f0;)p--}0===a(e[n],h)?Gi(e,n,p):Gi(e,++p,i),p<=r&&(n=p+1),r<=p&&(i=p-1)}}(t,e,r||0,n||t.length-1,i||Wi)}function Gi(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Wi(t,e){return te?1:0}function Yi(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,a=[],o=0;o1)for(var l=0;lDn)||t.y===e.y&&(t.y<0||t.y>Dn)}function na(t){return t.every(function(t){return t.x<0})||t.every(function(t){return t.x>Dn})||t.every(function(t){return t.y<0})||t.every(function(t){return t.y>Dn})}ea.prototype.populate=function(t,e){for(var r=0,n=t;r=1){var g=h[p-1];if(!ra(d,g)){l.vertexLength+4>Tn.MAX_VERTEX_ARRAY_LENGTH&&(l=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var m=d.sub(g)._perp()._unit(),v=g.dist(d);f+v>32768&&(f=0),ta(this.layoutVertexArray,d.x,d.y,m.x,m.y,0,0,f),ta(this.layoutVertexArray,d.x,d.y,m.x,m.y,0,1,f),f+=v,ta(this.layoutVertexArray,g.x,g.y,m.x,m.y,0,0,f),ta(this.layoutVertexArray,g.x,g.y,m.x,m.y,0,1,f);var y=l.vertexLength;this.indexArray.emplaceBack(y,y+1,y+2),this.indexArray.emplaceBack(y+1,y+2,y+3),l.vertexLength+=4,l.primitiveLength+=2}}}}l.vertexLength+a>Tn.MAX_VERTEX_ARRAY_LENGTH&&(l=this.segments.prepareSegment(a,this.layoutVertexArray,this.indexArray));for(var x=[],b=[],_=l.vertexLength,w=0,k=i;w>3}if(i--,1===n||2===n)a+=t.readSVarint(),o+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new l(a,o));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},la.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(a+=t.readSVarint())c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},la.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),c=la.types[this.type];function u(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function da(t,e,r){if(3===t){var n=new ha(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}fa.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new sa(this._pbf,e,this.extent,this._keys,this._values)};var ga={VectorTile:function(t,e){this.layers=t.readFields(da,{},e)},VectorTileFeature:sa,VectorTileLayer:ha},ma=ga.VectorTileFeature.types,va=63,ya=Math.cos(Math.PI/180*37.5),xa=.5,ba=Math.pow(2,14)/xa;function _a(t,e,r,n,i,a,o){t.emplaceBack(e.x,e.y,n?1:0,i?1:-1,Math.round(va*r.x)+128,Math.round(va*r.y)+128,1+(0===a?0:a<0?-1:1)|(o*xa&63)<<2,o*xa>>6)}var wa=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.layoutVertexArray=new Qr,this.indexArray=new hn,this.programConfigurations=new In(oa,t.layers,t.zoom),this.segments=new Tn};function ka(t,e){return(t/e.tileTotal*(e.end-e.start)+e.start)*(ba-1)}wa.prototype.populate=function(t,e){for(var r=0,n=t;r=2&&t[l-1].equals(t[l-2]);)l--;for(var c=0;cc){var E=p.dist(x);if(E>2*u){var C=p.sub(p.sub(x)._mult(u/E)._round());this.distance+=C.dist(x),this.addCurrentVertex(C,this.distance,_.mult(1),0,0,!1,f,o),x=C}}var L=x&&b,z=L?r:b?m:v;if(L&&"round"===z&&(Ti&&(z="bevel"),"bevel"===z&&(T>2&&(z="flipbevel"),T100)M=w.clone().mult(-1);else{var P=_.x*w.y-_.y*w.x>0?-1:1,I=T*_.add(w).mag()/_.sub(w).mag();M._perp()._mult(I*P)}this.addCurrentVertex(p,this.distance,M,0,0,!1,f,o),this.addCurrentVertex(p,this.distance,M.mult(-1),0,0,!1,f,o)}else if("bevel"===z||"fakeround"===z){var O=_.x*w.y-_.y*w.x>0,D=-Math.sqrt(T*T-1);if(O?(g=0,d=D):(d=0,g=D),y||this.addCurrentVertex(p,this.distance,_,d,g,!1,f,o),"fakeround"===z){for(var R=Math.floor(8*(.5-(A-.5))),B=void 0,F=0;F=0;N--)B=_.mult((N+1)/(R+1))._add(w)._unit(),this.addPieSliceVertex(p,this.distance,B,O,f,o)}b&&this.addCurrentVertex(p,this.distance,w,-d,-g,!1,f,o)}else"butt"===z?(y||this.addCurrentVertex(p,this.distance,_,0,0,!1,f,o),b&&this.addCurrentVertex(p,this.distance,w,0,0,!1,f,o)):"square"===z?(y||(this.addCurrentVertex(p,this.distance,_,1,1,!1,f,o),this.e1=this.e2=-1),b&&this.addCurrentVertex(p,this.distance,w,-1,-1,!1,f,o)):"round"===z&&(y||(this.addCurrentVertex(p,this.distance,_,0,0,!1,f,o),this.addCurrentVertex(p,this.distance,_,1,1,!0,f,o),this.e1=this.e2=-1),b&&(this.addCurrentVertex(p,this.distance,w,-1,-1,!0,f,o),this.addCurrentVertex(p,this.distance,w,0,0,!1,f,o)));if(S&&k2*u){var V=p.add(b.sub(p)._mult(u/j)._round());this.distance+=V.dist(p),this.addCurrentVertex(V,this.distance,w.mult(1),0,0,!1,f,o),p=V}}y=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e)}},wa.prototype.addCurrentVertex=function(t,e,r,n,i,a,o,s){var l,c=this.layoutVertexArray,u=this.indexArray;s&&(e=ka(e,s)),l=r.clone(),n&&l._sub(r.perp()._mult(n)),_a(c,t,l,a,!1,n,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(u.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),this.e1=this.e2,this.e2=this.e3,l=r.mult(-1),i&&l._sub(r.perp()._mult(i)),_a(c,t,l,a,!0,-i,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(u.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),this.e1=this.e2,this.e2=this.e3,e>ba/2&&!s&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a,o))},wa.prototype.addPieSliceVertex=function(t,e,r,n,i,a){r=r.mult(n?-1:1);var o=this.layoutVertexArray,s=this.indexArray;a&&(e=ka(e,a)),_a(o,t,r,!1,n,0,e),this.e3=i.vertexLength++,this.e1>=0&&this.e2>=0&&(s.emplaceBack(this.e1,this.e2,this.e3),i.primitiveLength++),n?this.e2=this.e3:this.e1=this.e3},pr("LineBucket",wa,{omit:["layers"]});var Ma=new qr({"line-cap":new Nr(I.layout_line["line-cap"]),"line-join":new jr(I.layout_line["line-join"]),"line-miter-limit":new Nr(I.layout_line["line-miter-limit"]),"line-round-limit":new Nr(I.layout_line["line-round-limit"])}),Aa={paint:new qr({"line-opacity":new jr(I.paint_line["line-opacity"]),"line-color":new jr(I.paint_line["line-color"]),"line-translate":new Nr(I.paint_line["line-translate"]),"line-translate-anchor":new Nr(I.paint_line["line-translate-anchor"]),"line-width":new jr(I.paint_line["line-width"]),"line-gap-width":new jr(I.paint_line["line-gap-width"]),"line-offset":new jr(I.paint_line["line-offset"]),"line-blur":new jr(I.paint_line["line-blur"]),"line-dasharray":new Vr(I.paint_line["line-dasharray"]),"line-pattern":new Vr(I.paint_line["line-pattern"]),"line-gradient":new Ur(I.paint_line["line-gradient"])}),layout:Ma},Ta=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new Lr(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n){return r=p({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n)},e}(jr))(Aa.paint.properties["line-width"].specification);Ta.useIntegerZoom=!0;var Sa=function(t){function e(e){t.call(this,e,Aa)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setPaintProperty=function(e,r,n){t.prototype.setPaintProperty.call(this,e,r,n),"line-gradient"===e&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=fi(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),this.paint._values["line-floorwidth"]=Ta.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new wa(t)},e.prototype.queryRadius=function(t){var e=t,r=Ea($n("line-width",this,e),$n("line-gap-width",this,e)),n=$n("line-offset",this,e);return r/2+Math.abs(n)+Jn(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a){var o=Kn(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),i.angle,a),s=a/2*Ea(this.paint.get("line-width").evaluate(e),this.paint.get("line-gap-width").evaluate(e)),c=this.paint.get("line-offset").evaluate(e);return c&&(r=function(t,e){for(var r=[],n=new l(0,0),i=0;i0?e+2*t:t}var Ca=Xr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),La=Xr([{name:"a_projected_pos",components:3,type:"Float32"}],4),za=(Xr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Xr([{name:"a_placed",components:2,type:"Uint8"}],4)),Pa=(Xr([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),Xr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Ia=Xr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function Oa(t,e,r){var n=e.layout.get("text-transform").evaluate(r);return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),Cr.applyArabicShaping&&(t=Cr.applyArabicShaping(t)),t}Xr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"hidden"}]),Xr([{type:"Float32",name:"offsetX"}]),Xr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Da={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ra=function(t){function e(e,r,n,i){t.call(this,e,r),this.angle=n,void 0!==i&&(this.segment=i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(l);function Ba(t,e){var r=e.expression;if("constant"===r.kind)return{functionType:"constant",layoutSize:r.evaluate(new Lr(t+1))};if("source"===r.kind)return{functionType:"source"};for(var n=r.zoomStops,i=0;i0)&&("constant"!==i.value.kind||i.value.value.length>0),l="constant"!==o.value.kind||o.value.value&&o.value.value.length>0;if(this.features=[],s||l){for(var c=e.iconDependencies,u=e.glyphDependencies,h=new Lr(this.zoom),f=0,p=t;f=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var l=0;l0;this.addCollisionDebugVertices(s,l,c,u,h?this.collisionCircle:this.collisionBox,o.anchorPoint,r,h)}}}},Ha.prototype.deserializeCollisionBoxes=function(t,e,r,n,i){for(var a={},o=e;o0},Ha.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Ha.prototype.hasCollisionBoxData=function(){return this.collisionBox.segments.get().length>0},Ha.prototype.hasCollisionCircleData=function(){return this.collisionCircle.segments.get().length>0},Ha.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&(this.sortedAngle=t,!(this.text.segments.get().length>1||this.icon.segments.get().length>1))){for(var r=[],n=0;ni.maxh||t>i.maxw||r<=i.maxh&&t<=i.maxw&&(o=i.maxw*i.maxh-t*r)a.free)){if(r===a.h)return this.allocShelf(s,t,r,n);r>a.h||ru)&&(h=2*Math.max(t,u)),(ll)&&(c=2*Math.max(r,l)),this.resize(h,c),this.packOne(t,r,n)):null},t.prototype.allocFreebin=function(t,e,r,n){var i=this.freebins.splice(t,1)[0];return i.id=n,i.w=e,i.h=r,i.refcount=0,this.bins[n]=i,this.ref(i),i},t.prototype.allocShelf=function(t,e,r,n){var i=this.shelves[t].alloc(e,r,n);return this.bins[n]=i,this.ref(i),i},t.prototype.shrink=function(){if(this.shelves.length>0){for(var t=0,e=0,r=0;rthis.free||e>this.h)return null;var n=this.x;return this.x+=t,this.free-=t,new function(t,e,r,n,i,a,o){this.id=t,this.x=e,this.y=r,this.w=n,this.h=i,this.maxw=a||n,this.maxh=o||i,this.refcount=0}(r,n,this.y,t,e,t,this.h)},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t}()}),Qa=function(t,e){var r=e.pixelRatio;this.paddedRect=t,this.pixelRatio=r},to={tl:{configurable:!0},br:{configurable:!0},displaySize:{configurable:!0}};to.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},to.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},to.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Qa.prototype,to);var eo=function(t){var e=new ui({width:0,height:0}),r={},n=new Ka(0,0,{autoResize:!0});for(var i in t){var a=t[i],o=n.packOne(a.data.width+2,a.data.height+2);e.resize({width:n.w,height:n.h}),ui.copy(a.data,e,{x:0,y:0},{x:o.x+1,y:o.y+1},a.data),r[i]=new Qa(o,a)}n.shrink(),e.resize({width:n.w,height:n.h}),this.image=e,this.positions=r};pr("ImagePosition",Qa),pr("ImageAtlas",eo);var ro=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},no=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*g},io=ao;function ao(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}function oo(t){return t.type===ao.Bytes?t.readVarint()+t.pos:t.pos+1}function so(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function lo(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function co(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function _o(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}ao.Varint=0,ao.Fixed64=1,ao.Bytes=2,ao.Fixed32=5,ao.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=xo(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=_o(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=xo(this.buf,this.pos)+4294967296*xo(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=xo(this.buf,this.pos)+4294967296*_o(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=ro(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ro(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128)return so(t,n,e);if(n|=(127&(i=a[r.pos++]))<<3,i<128)return so(t,n,e);if(n|=(127&(i=a[r.pos++]))<<10,i<128)return so(t,n,e);if(n|=(127&(i=a[r.pos++]))<<17,i<128)return so(t,n,e);if(n|=(127&(i=a[r.pos++]))<<24,i<128)return so(t,n,e);if(n|=(1&(i=a[r.pos++]))<<31,i<128)return so(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=function(t,e,r){for(var n="",i=e;i239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(a=t[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){var r=oo(this);for(t=t||[];this.pos127;);else if(e===ao.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ao.Fixed32)this.pos+=4;else{if(e!==ao.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&lo(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),no(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),no(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&lo(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,ao.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,co,e)},writePackedSVarint:function(t,e){this.writeMessage(t,uo,e)},writePackedBoolean:function(t,e){this.writeMessage(t,po,e)},writePackedFloat:function(t,e){this.writeMessage(t,ho,e)},writePackedDouble:function(t,e){this.writeMessage(t,fo,e)},writePackedFixed32:function(t,e){this.writeMessage(t,go,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,mo,e)},writePackedFixed64:function(t,e){this.writeMessage(t,vo,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,yo,e)},writeBytesField:function(t,e){this.writeTag(t,ao.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,ao.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,ao.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,ao.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,ao.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,ao.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,ao.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,ao.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,ao.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,ao.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var wo=3;function ko(t,e,r){1===t&&r.readMessage(Mo,e)}function Mo(t,e,r){if(3===t){var n=r.readMessage(Ao,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,c=n.top,u=n.advance;e.push({id:i,bitmap:new ci({width:o+2*wo,height:s+2*wo},a),metrics:{width:o,height:s,left:l,top:c,advance:u}})}}function Ao(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}var To=wo,So=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.callbackID=0,g(["receive"],this),this.target.addEventListener("message",this.receive,!1)};So.prototype.send=function(t,e,r,n){var i=r?this.mapId+":"+this.callbackID++:null;r&&(this.callbacks[i]=r);var a=[];this.target.postMessage({targetMapId:n,sourceMapId:this.mapId,type:t,id:String(i),data:gr(e,a)},a)},So.prototype.receive=function(t){var e,r=this,n=t.data,i=n.id;if(!n.targetMapId||this.mapId===n.targetMapId){var a=function(t,e){var n=[];r.target.postMessage({sourceMapId:r.mapId,type:"",id:String(i),error:t?gr(t):null,data:gr(e,n)},n)};if(""===n.type)e=this.callbacks[n.id],delete this.callbacks[n.id],e&&n.error?e(mr(n.error)):e&&e(null,mr(n.data));else if(void 0!==n.id&&this.parent[n.type])this.parent[n.type](n.sourceMapId,mr(n.data),a);else if(void 0!==n.id&&this.parent.getWorkerSource){var o=n.type.split(".");this.parent.getWorkerSource(n.sourceMapId,o[0],o[1])[o[2]](mr(n.data),a)}else this.parent[n.type](mr(n.data))}},So.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)};var Eo=n(i(function(t,e){!function(t){function e(t,e,n){var i=r(256*t,256*(e=Math.pow(2,n)-e-1),n),a=r(256*(t+1),256*(e+1),n);return i[0]+","+i[1]+","+a[0]+","+a[1]}function r(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}t.getURL=function(t,r,n,i,a,o){return o=o||{},t+"?"+["bbox="+e(n,i,a),"format="+(o.format||"image/png"),"service="+(o.service||"WMS"),"version="+(o.version||"1.1.1"),"request="+(o.request||"GetMap"),"srs="+(o.srs||"EPSG:3857"),"width="+(o.width||256),"height="+(o.height||256),"layers="+r].join("&")},t.getTileBBox=e,t.getMercCoords=r,Object.defineProperty(t,"__esModule",{value:!0})}(e)})),Co=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Po(0,t,e,r)};Co.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Co.prototype.url=function(t,e){var r=Eo.getTileBBox(this.x,this.y,this.z),n=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<this.canonical.z?new zo(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new zo(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},zo.prototype.isChildOf=function(t){var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},zo.prototype.children=function(t){if(this.overscaledZ>=t)return[new zo(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new zo(e,this.wrap,e,r,n),new zo(e,this.wrap,e,r+1,n),new zo(e,this.wrap,e,r,n+1),new zo(e,this.wrap,e,r+1,n+1)]},zo.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+this.border||e<-this.border||e>=this.dim+this.border)throw new RangeError("out of range source coordinates for DEM data");return(e+this.border)*this.stride+(t+this.border)},pr("Level",Io);var Oo=function(t,e,r){this.uid=t,this.scale=e||1,this.level=r||new Io(256,512),this.loaded=!!r};Oo.prototype.loadFromImage=function(t,e){if(t.height!==t.width)throw new RangeError("DEM tiles must be square");if(e&&"mapbox"!==e&&"terrarium"!==e)return _('"'+e+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');var r=this.level=new Io(t.width,t.width/2),n=t.data;this._unpackData(r,n,e||"mapbox");for(var i=0;i=0&&l[3]>=0&&this.grid.insert(a,l[0],l[1],l[2],l[3])}},Fo.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new ga.VectorTile(new io(this.rawTileData)).layers,this.sourceLayerCoder=new Do(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Fo.prototype.query=function(t,e){var r=this;this.loadVTLayers();for(var n=t.params||{},i=Dn/t.tileSize/t.scale,a=Re(n.filter),o=t.queryGeometry,s=t.queryPadding*i,l=1/0,c=1/0,u=-1/0,h=-1/0,f=0;f=0)return!0;return!1}(a,l)){var c=this.sourceLayerCoder.decode(r),u=this.vtLayers[c].feature(n);if(i(new Lr(this.tileID.overscaledZ),u))for(var h=0;h=200&&r.status<300&&r.response){var n;try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n)}else 401===r.status&&t.url.match(/mapbox.com/)?e(new A(r.statusText+": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens",r.status,t.url)):e(new A(r.statusText,r.status,t.url))},r.send(),r},e.getImage=function(t,e){return S(t,function(t,r){if(t)e(t);else if(r){var n=new self.Image,i=self.URL||self.webkitURL;n.onload=function(){e(null,n),i.revokeObjectURL(n.src)};var a=new self.Blob([new Uint8Array(r.data)],{type:"image/png"});n.cacheControl=r.cacheControl,n.expires=r.expires,n.src=r.data.byteLength?i.createObjectURL(a):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}})},e.ResourceType=M,e.RGBAImage=ui,e.default$2=Ka,e.ImagePosition=Qa,e.getArrayBuffer=S,e.default$3=function(t){return new io(t).readFields(ko,[])},e.default$4=yr,e.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),a=null;t.forEach(function(t,o){e(t,function(t,e){t&&(a=t),i[o]=e,0==--n&&r(a,i)})})},e.AlphaImage=ci,e.default$5=I,e.endsWith=m,e.extend=p,e.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(n),y:e*Math.sin(r)*Math.sin(n),z:e*Math.cos(n)}},e.Evented=P,e.validateStyle=nr,e.validateLight=ir,e.emitValidationErrors=sr,e.default$6=tt,e.number=wt,e.Properties=qr,e.Transitionable=Ir,e.Transitioning=Dr,e.PossiblyEvaluated=Fr,e.DataConstantProperty=Nr,e.warnOnce=_,e.uniqueId=function(){return d++},e.default$7=So,e.pick=function(t,e){for(var r={},n=0;n@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(t,r,n,i){var a=n||i;return e[r]=!a||a.toLowerCase(),""}),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e},e.default$11=Fo,e.default$12=Ro,e.default$13=Re,e.default$14=Ha,e.CollisionBoxArray=mn,e.default$15=Tn,e.TriangleIndexArray=hn,e.default$16=Lr,e.default$17=s,e.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},e.default$18=["type","source","source-layer","minzoom","maxzoom","filter","layout"],e.mat4=ri,e.vec4=ei,e.getSizeData=Ba,e.evaluateSizeForFeature=function(t,e,r){var n=e;return"source"===t.functionType?r.lowerSize/10:"composite"===t.functionType?wt(r.lowerSize/10,r.upperSize/10,n.uSizeT):n.uSize},e.evaluateSizeForZoom=function(t,e,r){if("constant"===t.functionType)return{uSizeT:0,uSize:t.layoutSize};if("source"===t.functionType)return{uSizeT:0,uSize:0};if("camera"===t.functionType){var n=t.propertyValue,i=t.zoomRange,a=t.sizeRange,o=f(Se(n,r.specification).interpolationFactor(e,i.min,i.max),0,1);return{uSizeT:0,uSize:a.min+o*(a.max-a.min)}}var s=t.propertyValue,l=t.zoomRange;return{uSizeT:f(Se(s,r.specification).interpolationFactor(e,l.min,l.max),0,1),uSize:0}},e.addDynamicAttributes=Va,e.default$19=Wa,e.WritingMode=jo,e.multiPolygonIntersectsBufferedPoint=jn,e.multiPolygonIntersectsMultiPolygon=Vn,e.multiPolygonIntersectsBufferedMultiLine=Un,e.polygonIntersectsPolygon=function(t,e){for(var r=0;r-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],c=0;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=h.dist(f)}return!0}function a(e,r,n,a,o,s,l,c,u){var h=a?.6*s*l:0,f=Math.max(a?a.right-a.left:0,o?o.right-o.left:0),p=0===e[0].x||e[0].x===u||0===e[0].y||e[0].y===u;return r-f*l=0&&M=0&&A=0&&m+f<=p){var T=new t.default$25(M,A,w,y);T._round(),o&&!i(r,T,l,o,s)||v.push(T)}}g+=_}return u||v.length||c||(v=e(r,g/2,a,o,s,l,c,!0,h)),v}(e,p?r/2*c%r:(f/2+2*s)*l*c%r,r,h,n,f*l,p,!1,u)}n.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},n.prototype.update=function(e,n){for(var i=this,a=0,o=e;a0&&(g=Math.max(10*s,g),this._addLineCollisionCircles(t,e,r,r.segment,m,g,n,i,a,u))}else t.emplaceBack(r.x,r.y,p,h,d,f,n,i,a,0,0);this.boxEndIndex=t.length};s.prototype._addLineCollisionCircles=function(t,e,r,n,i,a,o,s,l,c){var u=a/2,h=Math.floor(i/u),f=1+.4*Math.log(c)/Math.LN2,p=Math.floor(h*f/2),d=-a/2,g=r,m=n+1,v=d,y=-i/2,x=y-i/4;do{if(--m<0){if(v>y)return;m=0;break}v-=e[m].dist(g),g=e[m]}while(v>x);for(var b=e[m].dist(e[m+1]),_=-p;_i&&(k+=w-i),!(k=e.length)return;b=e[m].dist(e[m+1])}var M=k-v,A=e[m],T=e[m+1].sub(A)._unit()._mult(M)._add(A)._round(),S=Math.abs(k-d)0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)}function h(t,e){return te?1:0}function f(e,r,n){void 0===r&&(r=1),void 0===n&&(n=!1);for(var i=1/0,a=1/0,o=-1/0,s=-1/0,c=e[0],u=0;uo)&&(o=h.x),(!u||h.y>s)&&(s=h.y)}var f=o-i,g=s-a,m=Math.min(f,g),v=m/2,y=new l(null,p);if(0===m)return new t.default$1(i,a);for(var x=i;x_.d||!_.d)&&(_=k,n&&console.log("found best %d after %d probes",Math.round(1e4*k.d)/1e4,w)),k.max-_.d<=r||(v=k.h/2,y.push(new d(k.p.x-v,k.p.y-v,v,e)),y.push(new d(k.p.x+v,k.p.y-v,v,e)),y.push(new d(k.p.x-v,k.p.y+v,v,e)),y.push(new d(k.p.x+v,k.p.y+v,v,e)),w+=4)}return n&&(console.log("num probes: "+w),console.log("best distance: "+_.d)),_.p}function p(t,e){return e.max-t.max}function d(e,r,n,i){this.p=new t.default$1(e,r),this.h=n,this.d=function(e,r){for(var n=!1,i=1/0,a=0;ae.y!=h.y>e.y&&e.x<(h.x-u.x)*(e.y-u.y)/(h.y-u.y)+u.x&&(n=!n),i=Math.min(i,t.distToSegmentSquared(e,u,h))}return(n?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}function g(e,r,n,i,a,o){e.createArrays(),e.symbolInstances=[];var s=512*e.overscaling;e.tilePixelRatio=t.default$8/s,e.compareText={},e.iconsNeedLinear=!1;var l=e.layers[0].layout,c=e.layers[0]._unevaluatedLayout._values,u={};if("composite"===e.textSizeData.functionType){var h=e.textSizeData.zoomRange,f=h.min,p=h.max;u.compositeTextSizes=[c["text-size"].possiblyEvaluate(new t.default$16(f)),c["text-size"].possiblyEvaluate(new t.default$16(p))]}if("composite"===e.iconSizeData.functionType){var d=e.iconSizeData.zoomRange,g=d.min,v=d.max;u.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new t.default$16(g)),c["icon-size"].possiblyEvaluate(new t.default$16(v))]}u.layoutTextSize=c["text-size"].possiblyEvaluate(new t.default$16(e.zoom+1)),u.layoutIconSize=c["icon-size"].possiblyEvaluate(new t.default$16(e.zoom+1)),u.textMaxSize=c["text-size"].possiblyEvaluate(new t.default$16(18));for(var y=24*l.get("text-line-height"),x="map"===l.get("text-rotation-alignment")&&"line"===l.get("symbol-placement"),b=l.get("text-keep-upright"),_=0,w=e.features;_=t.default$8||u.y<0||u.y>=t.default$8||e.symbolInstances.push(function(e,r,n,i,a,l,c,u,h,f,p,d,g,m,y,x,b,_,w,k,M){var A,T,S=e.addToLineVertexArray(r,n),E=0,C=0,L=0,z=i.horizontal?i.horizontal.text:"",P=[];i.horizontal&&(A=new s(c,n,r,u,h,f,i.horizontal,p,d,g,e.overscaling),C+=v(e,r,i.horizontal,l,g,w,m,S,i.vertical?t.WritingMode.horizontal:t.WritingMode.horizontalOnly,P,k,M),i.vertical&&(L+=v(e,r,i.vertical,l,g,w,m,S,t.WritingMode.vertical,P,k,M)));var I=A?A.boxStartIndex:e.collisionBoxArray.length,O=A?A.boxEndIndex:e.collisionBoxArray.length;if(a){var D=function(e,r,n,i,a,o){var s,l,c,u,h=r.image,f=n.layout,p=r.top-1/h.pixelRatio,d=r.left-1/h.pixelRatio,g=r.bottom+1/h.pixelRatio,m=r.right+1/h.pixelRatio;if("none"!==f.get("icon-text-fit")&&a){var v=m-d,y=g-p,x=f.get("text-size").evaluate(o)/24,b=a.left*x,_=a.right*x,w=a.top*x,k=_-b,M=a.bottom*x-w,A=f.get("icon-text-fit-padding")[0],T=f.get("icon-text-fit-padding")[1],S=f.get("icon-text-fit-padding")[2],E=f.get("icon-text-fit-padding")[3],C="width"===f.get("icon-text-fit")?.5*(M-y):0,L="height"===f.get("icon-text-fit")?.5*(k-v):0,z="width"===f.get("icon-text-fit")||"both"===f.get("icon-text-fit")?k:v,P="height"===f.get("icon-text-fit")||"both"===f.get("icon-text-fit")?M:y;s=new t.default$1(b+L-E,w+C-A),l=new t.default$1(b+L+T+z,w+C-A),c=new t.default$1(b+L+T+z,w+C+S+P),u=new t.default$1(b+L-E,w+C+S+P)}else s=new t.default$1(d,p),l=new t.default$1(m,p),c=new t.default$1(m,g),u=new t.default$1(d,g);var I=n.layout.get("icon-rotate").evaluate(o)*Math.PI/180;if(I){var O=Math.sin(I),D=Math.cos(I),R=[D,-O,O,D];s._matMult(R),l._matMult(R),u._matMult(R),c._matMult(R)}return[{tl:s,tr:l,bl:u,br:c,tex:h.paddedRect,writingMode:void 0,glyphOffset:[0,0]}]}(0,a,l,0,i.horizontal,w);T=new s(c,n,r,u,h,f,a,y,x,!1,e.overscaling),E=4*D.length;var R=e.iconSizeData,B=null;"source"===R.functionType?B=[10*l.layout.get("icon-size").evaluate(w)]:"composite"===R.functionType&&(B=[10*M.compositeIconSizes[0].evaluate(w),10*M.compositeIconSizes[1].evaluate(w)]),e.addSymbols(e.icon,D,B,_,b,w,!1,r,S.lineStartIndex,S.lineLength)}var F=T?T.boxStartIndex:e.collisionBoxArray.length,N=T?T.boxEndIndex:e.collisionBoxArray.length;return e.glyphOffsetArray.length>=t.default$14.MAX_GLYPHS&&t.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),{key:z,textBoxStartIndex:I,textBoxEndIndex:O,iconBoxStartIndex:F,iconBoxEndIndex:N,textOffset:m,iconOffset:_,anchor:r,line:n,featureIndex:u,feature:w,numGlyphVertices:C,numVerticalGlyphVertices:L,numIconVertices:E,textOpacityState:new o,iconOpacityState:new o,isDuplicate:!1,placedTextSymbolIndices:P,crossTileID:0}}(e,u,a,n,i,e.layers[0],e.collisionBoxArray,r.index,r.sourceLayerIndex,e.index,b,M,S,g,w,A,E,m,r,l,c))};if("line"===d.get("symbol-placement"))for(var z=0,P=function(e,r,n,i,a){for(var o=[],s=0;s=i&&f.x>=i||(h.x>=i?h=new t.default$1(i,h.y+(f.y-h.y)*((i-h.x)/(f.x-h.x)))._round():f.x>=i&&(f=new t.default$1(i,h.y+(f.y-h.y)*((i-h.x)/(f.x-h.x)))._round()),h.y>=a&&f.y>=a||(h.y>=a?h=new t.default$1(h.x+(f.x-h.x)*((a-h.y)/(f.y-h.y)),a)._round():f.y>=a&&(f=new t.default$1(h.x+(f.x-h.x)*((a-h.y)/(f.y-h.y)),a)._round()),c&&h.equals(c[c.length-1])||(c=[h],o.push(c)),c.push(f)))))}return o}(r.geometry,0,0,t.default$8,t.default$8);z=0;o--)if(n.dist(a[o])0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n},_down:function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=s,t=a}e[t]=i}},l.default=c;var x=function(e){var r=new t.AlphaImage({width:0,height:0}),n={},i=new t.default$2(0,0,{autoResize:!0});for(var a in e){var o=e[a],s=n[a]={};for(var l in o){var c=o[+l];if(c&&0!==c.bitmap.width&&0!==c.bitmap.height){var u=i.packOne(c.bitmap.width+2,c.bitmap.height+2);r.resize({width:i.w,height:i.h}),t.AlphaImage.copy(c.bitmap,r,{x:0,y:0},{x:u.x+1,y:u.y+1},c.bitmap),s[l]={rect:u,metrics:c.metrics}}}}i.shrink(),r.resize({width:i.w,height:i.h}),this.image=r,this.positions=n};t.register("GlyphAtlas",x);var b=function(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming};function _(e,r){for(var n=new t.default$16(r),i=0,a=e;i=T.maxzoom||"none"!==T.visibility&&(_(A,a.zoom),(h[T.id]=T.createBucket({index:s.bucketLayerIDs.length,layers:A,zoom:a.zoom,pixelRatio:a.pixelRatio,overscaling:a.overscaling,collisionBoxArray:a.collisionBoxArray,sourceLayerIndex:v})).populate(y,f),s.bucketLayerIDs.push(A.map(function(t){return t.id})))}}}var S=t.mapObject(f.glyphDependencies,function(t){return Object.keys(t).map(Number)});Object.keys(S).length?n.send("getGlyphs",{uid:this.uid,stacks:S},function(t,e){l||(l=t,c=e,C.call(a))}):c={};var E=Object.keys(f.iconDependencies);function C(){if(l)return i(l);if(c&&u){var e=new x(c),r=new t.default$28(u);for(var n in h){var a=h[n];a instanceof t.default$14&&(_(a.layers,this.zoom),g(a,c,e.positions,u,r.positions,this.showCollisionBoxes))}this.status="done",i(null,{buckets:t.values(h).filter(function(t){return!t.isEmpty()}),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,iconAtlasImage:r.image})}}E.length?n.send("getImages",{icons:E},function(t,e){l||(l=t,u=e,C.call(a))}):u={},C.call(this)};var w=function(t){return!(!performance||!performance.getEntriesByName)&&performance.getEntriesByName(t)};function k(e,r){var n=t.getArrayBuffer(e.request,function(e,n){e?r(e):n&&r(null,{vectorTile:new t.default$29.VectorTile(new t.default$30(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires})});return function(){n.abort(),r()}}var M=function(t,e,r){this.actor=t,this.layerIndex=e,this.loadVectorData=r||k,this.loading={},this.loaded={}};M.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var a=this.loading[i]=new b(e);a.abort=this.loadVectorData(e,function(o,s){if(delete n.loading[i],o||!s)return r(o);var l=s.rawData,c={};s.expires&&(c.expires=s.expires),s.cacheControl&&(c.cacheControl=s.cacheControl);var u={};if(e.request&&e.request.collectResourceTiming){var h=w(e.request.url);h&&(u.resourceTiming=JSON.parse(JSON.stringify(h)))}a.vectorTile=s.vectorTile,a.parse(s.vectorTile,n.layerIndex,n.actor,function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:l.slice(0)},n,c,u))}),n.loaded=n.loaded||{},n.loaded[i]=a})},M.prototype.reloadTile=function(t,e){var r=this.loaded,n=t.uid,i=this;if(r&&r[n]){var a=r[n];a.showCollisionBoxes=t.showCollisionBoxes;var o=function(t,r){var n=a.reloadCallback;n&&(delete a.reloadCallback,a.parse(a.vectorTile,i.layerIndex,i.actor,n)),e(t,r)};"parsing"===a.status?a.reloadCallback=o:"done"===a.status&&a.parse(a.vectorTile,this.layerIndex,this.actor,o)}},M.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},M.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var A=function(){this.loading={},this.loaded={}};A.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,a=new t.default$31(n);this.loading[n]=a,a.loadFromImage(e.rawImageData,i),delete this.loading[n],this.loaded=this.loaded||{},this.loaded[n]=a,r(null,a)},A.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var T={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:6356752.3142};function S(t){var e=0;if(t&&t.length>0){e+=Math.abs(E(t[0]));for(var r=1;r2){for(o=0;o=0}(t)===e?t:t.reverse()}var O=t.default$29.VectorTileFeature.prototype.toGeoJSON,D=function(e){this._feature=e,this.extent=t.default$8,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};D.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function $(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;si;){if(a-i>600){var s=a-i+1,l=n-i+1,c=Math.log(s),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);t(e,r,n,Math.max(i,Math.floor(n-l*u/s+h)),Math.min(a,Math.floor(n+(s-l)*u/s+h)),o)}var f=r[2*n+o],p=i,d=a;for(Q(e,r,i,n),r[2*a+o]>f&&Q(e,r,i,a);pf;)d--}r[2*i+o]===f?Q(e,r,i,d):Q(e,r,++d,a),d<=n&&(i=d+1),n<=d&&(a=d-1)}}(e,r,s,i,a,o%2),t(e,r,n,i,s-1,o+1),t(e,r,n,s+1,a,o+1)}};function Q(t,e,r,n){tt(t,r,n),tt(e,2*r,2*n),tt(e,2*r+1,2*n+1)}function tt(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function et(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}var rt=function(t,e,r,n,i){return new nt(t,e,r,n,i)};function nt(t,e,r,n,i){e=e||it,r=r||at,i=i||Array,this.nodeSize=n||64,this.points=t,this.ids=new i(t.length),this.coords=new i(2*t.length);for(var a=0;a=r&&s<=i&&l>=n&&l<=a&&u.push(t[d]);else{var g=Math.floor((p+f)/2);s=e[2*g],l=e[2*g+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[g]);var m=(h+1)%2;(0===h?r<=s:n<=l)&&(c.push(p),c.push(g-1),c.push(m)),(0===h?i>=s:a>=l)&&(c.push(g+1),c.push(f),c.push(m))}}return u}(this.ids,this.coords,t,e,r,n,this.nodeSize)},within:function(t,e,r){return function(t,e,r,n,i,a){for(var o=[0,t.length-1,0],s=[],l=i*i;o.length;){var c=o.pop(),u=o.pop(),h=o.pop();if(u-h<=a)for(var f=h;f<=u;f++)et(e[2*f],e[2*f+1],r,n)<=l&&s.push(t[f]);else{var p=Math.floor((h+u)/2),d=e[2*p],g=e[2*p+1];et(d,g,r,n)<=l&&s.push(t[p]);var m=(c+1)%2;(0===c?r-i<=d:n-i<=g)&&(o.push(h),o.push(p-1),o.push(m)),(0===c?r+i>=d:n+i>=g)&&(o.push(p+1),o.push(u),o.push(m))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)}};function ot(t){this.options=pt(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function st(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:n,properties:i,parentId:-1,numPoints:r}}function lt(t,e){var r=t.geometry.coordinates;return{x:ht(r[0]),y:ft(r[1]),zoom:1/0,id:e,parentId:-1}}function ct(t){return{type:"Feature",properties:ut(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function ut(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return pt(pt({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function ht(t){return t/360+.5}function ft(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function pt(t,e){for(var r in e)t[r]=e[r];return t}function dt(t){return t.x}function gt(t){return t.y}function mt(t,e,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=t-r)*o+(s=e-n)*s}function vt(t,e,r,n){var i={id:t||null,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)yt(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(o+=n?(i*c-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(c-a,2))),i=l,a=c}var u=e.length-3;e[2]=1,function t(e,r,n,i){for(var a,o=i,s=e[r],l=e[r+1],c=e[n],u=e[n+1],h=r+3;ho&&(a=h,o=f)}o>i&&(a-r>3&&t(e,r,a,i),e[a+2]=o,n-a>3&&t(e,a,n,i))}(e,0,u,r),e[u+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function wt(t,e,r,n){for(var i=0;i1?1:r}function At(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o<=n)return t;if(a>n||o=r&&d<=n)l.push(u);else if(!(p>n||d=r&&o<=n&&(e.push(t[a]),e.push(t[a+1]),e.push(t[a+2]))}}function St(t,e,r,n,i,a,o){for(var s,l,c=Et(t),u=0===i?zt:Pt,h=t.start,f=0;f=r&&(l=u(c,p,d,m,v,r),o&&(c.start=h+s*l)):y>n?x<=n&&(l=u(c,p,d,m,v,n),o&&(c.start=h+s*l)):Lt(c,p,d,g),x=r&&(l=u(c,p,d,m,v,r),b=!0),x>n&&y<=n&&(l=u(c,p,d,m,v,n),b=!0),!a&&b&&(o&&(c.end=h+s*l),e.push(c),c=Et(t)),o&&(h+=s)}var _=t.length-3;p=t[_],d=t[_+1],g=t[_+2],(y=0===i?p:d)>=r&&y<=n&&Lt(c,p,d,g),_=c.length-3,a&&_>=3&&(c[_]!==c[0]||c[_+1]!==c[1])&&Lt(c,c[0],c[1],c[2]),c.length&&e.push(c)}function Et(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function Ct(t,e,r,n,i,a){for(var o=0;oo.maxX&&(o.maxX=u),h>o.maxY&&(o.maxY=h)}return o}function Ft(t,e,r,n){var i=e.geometry,a=e.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s0&&e.size<(i?o:n))r.numPoints+=e.length/3;else{for(var s=[],l=0;lo)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,a=i-2;n0===e)for(n=0,i=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=this.options.minZoom;i--){var a=+Date.now();this.trees[i+1]=rt(n,dt,gt,this.options.nodeSize,Float32Array),n=this._cluster(n,i),e&&console.log("z%d: %d clusters in %dms",i,n.length,+Date.now()-a)}return this.trees[this.options.minZoom]=rt(n,dt,gt,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(ht(t[0]),ft(t[3]),ht(t[2]),ft(t[1])),i=[],a=0;a1&&console.time("creation"),f=this.tiles[h]=Bt(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));var p="z"+e;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(f.source=t,i){if(e===l.maxZoom||e===i)continue;var d=1<1&&console.time("clipping");var g,m,v,y,x,b,_=.5*l.buffer/l.extent,w=.5-_,k=.5+_,M=1+_;g=m=v=y=null,x=At(t,u,r-_,r+k,0,f.minX,f.maxX,l),b=At(t,u,r+w,r+M,0,f.minX,f.maxX,l),t=null,x&&(g=At(x,u,n-_,n+k,1,f.minY,f.maxY,l),m=At(x,u,n+w,n+M,1,f.minY,f.maxY,l),x=null),b&&(v=At(b,u,n-_,n+k,1,f.minY,f.maxY,l),y=At(b,u,n+w,n+M,1,f.minY,f.maxY,l),b=null),c>1&&console.timeEnd("clipping"),s.push(g||[],e+1,2*r,2*n),s.push(m||[],e+1,2*r,2*n+1),s.push(v||[],e+1,2*r+1,2*n),s.push(y||[],e+1,2*r+1,2*n+1)}}},jt.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug;if(t<0||t>24)return null;var o=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,c=t,u=e,h=r;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[Vt(c,u,h)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",c,u,h),a>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?Dt(this.tiles[s],i):null):null};var qt=function(e){function r(t,r,n){e.call(this,t,r,Ut),n&&(this.loadGeoJSON=n)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var e=this._pendingCallback,r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams,this.loadGeoJSON(r,function(n,i){if(n||!i)return e(n);if("object"!=typeof i)return e(new Error("Input data is not a valid GeoJSON object."));!function t(e,r){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.map(z(t,r)),e;case"Feature":return e.geometry=t(e.geometry,r),e;case"Polygon":case"MultiPolygon":return function(t,e){return"Polygon"===t.type?t.coordinates=P(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(z(P,e))),t}(e,r);default:return e}}(i,!0);try{t._geoJSONIndex=r.cluster?function(t){return new ot(t)}(r.superclusterOptions).load(i.features):new jt(i,r.geojsonVtOptions)}catch(n){return e(n)}t.loaded={};var a={};if(r.request&&r.request.collectResourceTiming){var o=w(r.request.url);o&&(a.resourceTiming={},a.resourceTiming[r.source]=JSON.parse(JSON.stringify(o)))}e(null,a)})}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(t,r){var n=this.loaded,i=t.uid;return n&&n[i]?e.prototype.reloadTile.call(this,t,r):this.loadTile(t,r)},r.prototype.loadGeoJSON=function(e,r){if(e.request)t.getJSON(e.request,r);else{if("string"!=typeof e.data)return r(new Error("Input data is not a valid GeoJSON object."));try{return r(null,JSON.parse(e.data))}catch(t){return r(new Error("Input data is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},r}(M),Ht=function(e){var r=this;this.self=e,this.actor=new t.default$7(e,this),this.layerIndexes={},this.workerSourceTypes={vector:M,geojson:qt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(r.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');r.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isLoaded())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText}};return Ht.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},Ht.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},Ht.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},Ht.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},Ht.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},Ht.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},Ht.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},Ht.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},Ht.prototype.removeSource=function(t,e,r){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var n=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,r):r()}},Ht.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},Ht.prototype.loadRTLTextPlugin=function(e,r,n){try{t.plugin.isLoaded()||(this.self.importScripts(r),n(t.plugin.isLoaded()?null:new Error("RTL Text Plugin failed to import scripts from "+r)))}catch(t){n(t.toString())}},Ht.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new n),e},Ht.prototype.getWorkerSource=function(t,e,r){var n=this;if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][r]){var i={send:function(e,r,i){n.actor.send(e,r,i,t)}};this.workerSources[t][e][r]=new this.workerSourceTypes[e](i,this.getLayerIndex(t))}return this.workerSources[t][e][r]},Ht.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new A),this.demWorkerSources[t][e]},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&new Ht(self),Ht}),i(0,function(t){var e=t.createCommonjsModule(function(t){function e(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,r=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(r);try{e=new Worker(n),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(n),t}()&&"Uint8ClampedArray"in window&&function(t){return void 0===r[t]&&(r[t]=function(t){var r=document.createElement("canvas"),n=Object.create(e.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,r.probablySupportsContext?r.probablySupportsContext("webgl",n)||r.probablySupportsContext("experimental-webgl",n):r.supportsContext?r.supportsContext("webgl",n)||r.supportsContext("experimental-webgl",n):r.getContext("webgl",n)||r.getContext("experimental-webgl",n)}(t)),r[t]}(t&&t.failIfMajorPerformanceCaveat))}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e);var r={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),r=t.default.performance&&t.default.performance.now?t.default.performance.now.bind(t.default.performance):Date.now.bind(Date),n=t.default.requestAnimationFrame||t.default.mozRequestAnimationFrame||t.default.webkitRequestAnimationFrame||t.default.msRequestAnimationFrame,i=t.default.cancelAnimationFrame||t.default.mozCancelAnimationFrame||t.default.webkitCancelAnimationFrame||t.default.msCancelAnimationFrame,a={now:r,frame:function(t){return n(t)},cancelFrame:function(t){return i(t)},getImageData:function(e){var r=t.default.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,n.drawImage(e,0,0,e.width,e.height),n.getImageData(0,0,e.width,e.height)},hardwareConcurrency:t.default.navigator.hardwareConcurrency||4,get devicePixelRatio(){return t.default.devicePixelRatio},supportsWebp:!1};if(t.default.document){var o=t.default.document.createElement("img");o.onload=function(){a.supportsWebp=!0},o.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="}var s={create:function(e,r,n){var i=t.default.document.createElement(e);return r&&(i.className=r),n&&n.appendChild(i),i},createNS:function(e,r){return t.default.document.createElementNS(e,r)}},l=t.default.document?t.default.document.documentElement.style:null;function c(t){if(!l)return null;for(var e=0;e=0?0:e.button},s.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var m={API_URL:"https://api.mapbox.com",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null},v="See https://www.mapbox.com/api-documentation/#access-tokens";function y(t,e){var r=A(m.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,"/"!==r.path&&(t.path=""+r.path+t.path),!m.REQUIRE_ACCESS_TOKEN)return T(t);if(!(e=e||m.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+v);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+v);return t.params.push("access_token="+e),T(t)}function x(t){return 0===t.indexOf("mapbox:")}var b=function(t,e){if(!x(t))return t;var r=A(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),y(r,e)},_=function(t,e,r,n){var i=A(t);return x(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,y(i,n)):(i.path+=""+e+r,T(i))},w=/(\.(png|jpg)\d*)(?=$)/,k=function(t,e,r){if(!e||!x(e))return t;var n=A(t),i=a.devicePixelRatio>=2||512===r?"@2x":"",o=a.supportsWebp?".webp":"$1";return n.path=n.path.replace(w,""+i+o),function(t){for(var e=0;e=0?1.2:1))}function R(t,e,r,n,i,a,o){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else{var l=a.requests[s];l||(l=a.requests[s]=[],F.loadGlyphRange(r,s,n.url,n.requestTransform,function(t,e){if(e)for(var r in e)a.glyphs[+r]=e[+r];for(var n=0,i=l;nthis.height)return t.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};G.prototype.wrap=function(){return new G(t.wrap(this.lng,-180,180),this.lat)},G.prototype.toArray=function(){return[this.lng,this.lat]},G.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},G.prototype.toBounds=function(t){var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new W(new G(this.lng-r,this.lat-e),new G(this.lng+r,this.lat+e))},G.convert=function(t){if(t instanceof G)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new G(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new G(Number(t.lng),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, or an array of [, ]")};var W=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};W.prototype.setNorthEast=function(t){return this._ne=t instanceof G?new G(t.lng,t.lat):G.convert(t),this},W.prototype.setSouthWest=function(t){return this._sw=t instanceof G?new G(t.lng,t.lat):G.convert(t),this},W.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof G)e=t,r=t;else{if(!(t instanceof W))return Array.isArray(t)?t.every(Array.isArray)?this.extend(W.convert(t)):this.extend(G.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new G(e.lng,e.lat),this._ne=new G(r.lng,r.lat)),this},W.prototype.getCenter=function(){return new G((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},W.prototype.getSouthWest=function(){return this._sw},W.prototype.getNorthEast=function(){return this._ne},W.prototype.getNorthWest=function(){return new G(this.getWest(),this.getNorth())},W.prototype.getSouthEast=function(){return new G(this.getEast(),this.getSouth())},W.prototype.getWest=function(){return this._sw.lng},W.prototype.getSouth=function(){return this._sw.lat},W.prototype.getEast=function(){return this._ne.lng},W.prototype.getNorth=function(){return this._ne.lat},W.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},W.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},W.prototype.isEmpty=function(){return!(this._sw&&this._ne)},W.convert=function(t){return!t||t instanceof W?t:new W(t)};var Y=function(t,e,r){this.bounds=W.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=r||24};Y.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},Y.prototype.contains=function(t){var e=Math.floor(this.lngX(this.bounds.getWest(),t.z)),r=Math.floor(this.latY(this.bounds.getNorth(),t.z)),n=Math.ceil(this.lngX(this.bounds.getEast(),t.z)),i=Math.ceil(this.latY(this.bounds.getSouth(),t.z));return t.x>=e&&t.x=r&&t.y0&&(l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}})},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(e){if(e)return r.fire(new t.ErrorEvent(e));var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}),this},r.prototype._updateWorkerData=function(e){var r,n,i=this,a=t.extend({},this.workerOptions),o=this._data;"string"==typeof o?(a.request=this.map._transformRequest((r=o,(n=t.default.document.createElement("a")).href=r,n.href),t.ResourceType.Source),a.request.collectResourceTiming=this._collectResourceTiming):a.data=JSON.stringify(o),this.workerID=this.dispatcher.send(this.type+"."+a.source+".loadData",a,function(t,r){i._removed||r&&r.abandoned||(i._loaded=!0,r&&r.resourceTiming&&r.resourceTiming[i.id]&&(i._resourceTiming=r.resourceTiming[i.id].slice(0)),i.dispatcher.send(i.type+"."+a.source+".coalesce",null,null,i.workerID),e(t))},this.workerID)},r.prototype.loadTile=function(t,e){var r=this,n=void 0===t.workerID?"loadTile":"reloadTile",i={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:a.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send(n,i,function(i,a){return t.unloadVectorData(),t.aborted?e(null):i?e(i):(t.loadVectorData(a,r.map.painter,"reloadTile"===n),e(null))},this.workerID)},r.prototype.abortTile=function(t){t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID)},r.prototype.onRemove=function(){this._removed=!0,this.dispatcher.send("removeSource",{type:this.type,source:this.id},null,this.workerID)},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),K=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Q=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};Q.prototype.bind=function(t,e,r,n,i,a,o,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,c=0;!l&&c>s.z,c=new t.default$1(s.x*l,s.y*l),u=new t.default$1(c.x+l,c.y+l),h=this.segments.prepareSegment(4,n,i);n.emplaceBack(c.x,c.y,c.x,c.y),n.emplaceBack(u.x,c.y,u.x,c.y),n.emplaceBack(c.x,u.y,c.x,u.y),n.emplaceBack(u.x,u.y,u.x,u.y);var f=h.vertexLength;i.emplaceBack(f,f+1,f+2),i.emplaceBack(f+1,f+2,f+3),h.vertexLength+=4,h.primitiveLength+=2}this.maskedBoundsBuffer=r.createVertexBuffer(n,K.members),this.maskedIndexBuffer=r.createIndexBuffer(i)}},st.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},st.prototype.setExpiryData=function(e){var r=this.expirationTime;if(e.cacheControl){var n=t.parseCacheControl(e.cacheControl);n["max-age"]&&(this.expirationTime=Date.now()+1e3*n["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var i=Date.now(),a=!1;if(this.expirationTime>i)a=!1;else if(r)if(this.expirationTimethis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},lt.prototype.has=function(t){return t.wrapped().key in this.data},lt.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},lt.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},lt.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},lt.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},lt.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this};var ct=function(t,e,r){this.context=t;var n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};ct.prototype.unbindVAO=function(){this.context.extVertexArrayObject&&this.context.bindVertexArrayOES.set(null)},ct.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},ct.prototype.updateData=function(t){var e=this.context.gl;this.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},ct.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var ut={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},ht=function(t,e,r,n){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;var i=t.gl;this.buffer=i.createBuffer(),t.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};ht.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},ht.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},ht.prototype.enableAttributes=function(t,e){for(var r=0;r1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype.getZoom=function(t){return t.zoom+t.scaleZoom(t.tileSize/this._source.tileSize)},r.prototype._findLoadedChildren=function(t,e,r){var n=!1;for(var i in this._tiles){var a=this._tiles[i];if(!(r[i]||!a.hasData()||a.tileID.overscaledZ<=t.overscaledZ||a.tileID.overscaledZ>e)){var o=Math.pow(2,a.tileID.canonical.z-t.canonical.z);if(Math.floor(a.tileID.canonical.x/o)===t.canonical.x&&Math.floor(a.tileID.canonical.y/o)===t.canonical.y)for(r[i]=a.tileID,n=!0;a&&a.tileID.overscaledZ-1>t.overscaledZ;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);if(!s)break;(a=this._tiles[s.key])&&a.hasData()&&(delete r[i],r[s.key]=s)}}}return n},r.prototype.findLoadedParent=function(t,e,r){for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n);if(!i)return;var a=String(i.key),o=this._tiles[a];if(o&&o.hasData())return r[a]=i,o;if(this._cache.has(i))return r[a]=i,this._cache.get(i)}},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)}):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter(function(t){return n._source.hasTile(t)}))):i=[];var o,s=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(e)),l=Math.max(s-r.maxOverzooming,this._source.minzoom),c=Math.max(s+r.maxUnderzooming,this._source.minzoom),u=this._updateRetainedTiles(i,s),h={};if(Zt(this._source.type))for(var f=Object.keys(u),p=0;p=a.now())){n._findLoadedChildren(g,c,u)&&(u[d]=g);var v=n.findLoadedParent(g,l,h);v&&n._addTile(v.tileID)}}for(o in h)u[o]||(n._coveredTiles[o]=!0);for(o in h)u[o]=h[o];for(var y=t.keysDifference(this._tiles,u),x=0;xthis._source.maxzoom){var f=l.children(this._source.maxzoom)[0],p=this.getTile(f);p&&p.hasData()?n[f.key]=f:h=!1}else{this._findLoadedChildren(l,o,n);for(var d=l.children(this._source.maxzoom),g=0;g=a;--m){var v=l.scaledTo(m);if(i[v.key])break;if(i[v.key]=!0,!(c=this.getTile(v))&&u&&(c=this._addTile(v)),c&&(n[v.key]=v,u=c.wasRequested(),c.hasData()))break}}}return n},r.prototype._addTile=function(e){var r=this._tiles[e.key];if(r)return r;(r=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,r),r.tileID=e);var n=Boolean(r);return n||(r=new st(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,e.key,r.state))),r?(r.uses++,this._tiles[e.key]=r,n||this._source.fire(new t.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},r.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var n=e.getExpiryTimeout();n&&(this._timers[t]=setTimeout(function(){r._reloadTile(t,"expired"),delete r._timers[t]},n))},r.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r){for(var n=[],i=this.getIds(),a=1/0,o=1/0,s=-1/0,l=-1/0,c=e[0].zoom,u=0;u=0&&v[1].y+m>=0){for(var y=[],x=0;x=a.now())return!0}return!1},r}(t.Evented);function Xt(e,r){var n=r.zoomTo(e.canonical.z);return new t.default$1((n.column-(e.canonical.x+e.wrap*Math.pow(2,e.canonical.z)))*t.default$8,(n.row-e.canonical.y)*t.default$8)}function Zt(t){return"raster"===t||"image"===t||"video"===t}function $t(){return new t.default.Worker(En.workerUrl)}Yt.maxOverzooming=10,Yt.maxUnderzooming=3;var Jt,Kt=function(){this.active={}};function Qt(e,r){var n={};for(var i in e)"ref"!==i&&(n[i]=e[i]);return t.default$18.forEach(function(t){t in r&&(n[t]=r[t])}),n}function te(t){t=t.slice();for(var e=Object.create(null),r=0;rthis.width||n<0||e>this.height)return!i&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var o=0;o0:a},ce.prototype._queryCircle=function(t,e,r,n){var i=t-r,a=t+r,o=e-r,s=e+r;if(a<0||i>this.width||s<0||o>this.height)return!n&&[];var l=[],c={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(i,o,a,s,this._queryCellCircle,l,c),n?l.length>0:l},ce.prototype.query=function(t,e,r,n){return this._query(t,e,r,n,!1)},ce.prototype.hitTest=function(t,e,r,n){return this._query(t,e,r,n,!0)},ce.prototype.hitTestCircle=function(t,e,r){return this._queryCircle(t,e,r,!0)},ce.prototype._queryCell=function(t,e,r,n,i,a,o){var s=o.seenUids,l=this.boxCells[i];if(null!==l)for(var c=this.bboxes,u=0,h=l;u=c[p+0]&&n>=c[p+1]){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[f],x1:c[p],y1:c[p+1],x2:c[p+2],y2:c[p+3]})}}}var d=this.circleCells[i];if(null!==d)for(var g=this.circles,m=0,v=d;mo*o+s*s},ce.prototype._circleAndRectCollide=function(t,e,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;var c=(o-i)/2,u=Math.abs(e-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;var h=l-s,f=u-c;return h*h+f*f<=r*r};var ue=t.default$19.layout;function he(e,r,n,i,a){var o=t.mat4.identity(new Float32Array(16));return r?(t.mat4.identity(o),t.mat4.scale(o,o,[1/a,1/a,1]),n||t.mat4.rotateZ(o,o,i.angle)):(t.mat4.scale(o,o,[i.width/2,-i.height/2,1]),t.mat4.translate(o,o,[1,-1,0]),t.mat4.multiply(o,o,e)),o}function fe(e,r,n,i,a){var o=t.mat4.identity(new Float32Array(16));return r?(t.mat4.multiply(o,o,e),t.mat4.scale(o,o,[a,a,1]),n||t.mat4.rotateZ(o,o,-i.angle)):(t.mat4.scale(o,o,[1,-1,1]),t.mat4.translate(o,o,[-1,-1,0]),t.mat4.scale(o,o,[2/i.width,2/i.height,1])),o}function pe(e,r){var n=[e.x,e.y,0,1];ke(n,n,r);var i=n[3];return{point:new t.default$1(n[0]/i,n[1]/i),signedDistanceFromCamera:i}}function de(t,e){var r=t[0]/t[3],n=t[1]/t[3];return r>=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function ge(e,r,n,i,a,o,s,l){var c=i?e.textSizeData:e.iconSizeData,u=t.evaluateSizeForZoom(c,n.transform.zoom,ue.properties[i?"text-size":"icon-size"]),h=[256/n.width*2+1,256/n.height*2+1],f=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;f.clear();for(var p=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,g=n.transform.width/n.transform.height,m=!1,v=0;vMath.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function ye(e,r,n,i,a,o,s,l,c,u,h,f,p,d){var g,m=r/24,v=e.lineOffsetX*r,y=e.lineOffsetY*r;if(e.numGlyphs>1){var x=e.glyphStartIndex+e.numGlyphs,b=e.lineStartIndex,_=e.lineStartIndex+e.lineLength,w=me(m,l,v,y,n,h,f,e,c,o,p,!1);if(!w)return{notEnoughRoom:!0};var k=pe(w.first.point,s).point,M=pe(w.last.point,s).point;if(i&&!n){var A=ve(e.writingMode,k,M,d);if(A)return A}g=[w.first];for(var T=e.glyphStartIndex+1;T0?L.point:xe(f,C,S,1,a),P=ve(e.writingMode,S,z,d);if(P)return P}var I=be(m*l.getoffsetX(e.glyphStartIndex),v,y,n,h,f,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,o,p,!1);if(!I)return{notEnoughRoom:!0};g=[I]}for(var O=0,D=g;O0?1:-1,m=0;i&&(g*=-1,m=Math.PI),g<0&&(m+=Math.PI);for(var v=g>0?l+s:l+s+1,y=v,x=a,b=a,_=0,w=0,k=Math.abs(d);_+w<=k;){if((v+=g)=c)return null;if(b=x,void 0===(x=f[v])){var M=new t.default$1(u.getx(v),u.gety(v)),A=pe(M,h);if(A.signedDistanceFromCamera>0)x=f[v]=A.point;else{var T=v-g;x=xe(0===_?o:new t.default$1(u.getx(T),u.gety(T)),M,b,k-_+1,h)}}_+=w,w=b.dist(x)}var S=(k-_)/w,E=x.sub(b),C=E.mult(S)._add(b);return C._add(E._unit()._perp()._mult(n*g)),{point:C,angle:m+Math.atan2(x.y-b.y,x.x-b.x),tileDistance:p?{prevTileDistance:v-g===y?0:u.gettileUnitDistanceFromAnchor(v-g),lastSegmentViewportDistance:k-_}:null}}var _e=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function we(t,e){for(var r=0;rT)Ae(e,S,!1);else{var P=this.projectPoint(u,E,C),I=L*k;if(d.length>0){var O=P.x-d[d.length-4],D=P.y-d[d.length-3];if(I*I*2>O*O+D*D&&S+8-A&&R=this.screenRightBoundary||n<100||e>this.screenBottomBoundary};var Se=t.default$19.layout,Ee=function(t,e,r,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&r?1:0,this.placed=r};Ee.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var Ce=function(t,e,r,n,i){this.text=new Ee(t?t.text:null,e,r,i),this.icon=new Ee(t?t.icon:null,e,n,i)};Ce.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Le=function(t,e,r){this.text=t,this.icon=e,this.skipFade=r},ze=function(t,e){this.transform=t.clone(),this.collisionIndex=new Me(this.transform),this.placements={},this.opacities={},this.stale=!1,this.fadeDuration=e,this.retainedQueryData={}};function Pe(t,e,r){t.emplaceBack(e?1:0,r?1:0),t.emplaceBack(e?1:0,r?1:0),t.emplaceBack(e?1:0,r?1:0),t.emplaceBack(e?1:0,r?1:0)}ze.prototype.placeLayerTile=function(e,r,n,i){var a=r.getBucket(e),o=r.latestFeatureIndex;if(a&&o&&e.id===a.layerIds[0]){var s=r.collisionBoxArray,l=a.layers[0].layout,c=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),u=r.tileSize/t.default$8,h=this.transform.calculatePosMatrix(r.tileID.toUnwrapped()),f=he(h,"map"===l.get("text-pitch-alignment"),"map"===l.get("text-rotation-alignment"),this.transform,Te(r,1,this.transform.zoom)),p=he(h,"map"===l.get("icon-pitch-alignment"),"map"===l.get("icon-rotation-alignment"),this.transform,Te(r,1,this.transform.zoom));this.retainedQueryData[a.bucketInstanceId]=new function(t,e,r,n,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i}(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,r.tileID),this.placeLayerBucket(a,h,f,p,c,u,n,i,s)}},ze.prototype.placeLayerBucket=function(e,r,n,i,a,o,s,l,c){for(var u=e.layers[0].layout,h=t.evaluateSizeForZoom(e.textSizeData,this.transform.zoom,Se.properties["text-size"]),f=!e.hasTextData()||u.get("text-optional"),p=!e.hasIconData()||u.get("icon-optional"),d=0,g=e.symbolInstances;d0,x=x&&b.offscreen);var A=m.collisionArrays.textCircles;if(A){var T=e.text.placedSymbolArray.get(m.placedTextSymbolIndices[0]),S=t.evaluateSizeForFeature(e.textSizeData,h,T);_=this.collisionIndex.placeCollisionCircles(A,u.get("text-allow-overlap"),a,o,m.key,T,e.lineVertexArray,e.glyphOffsetArray,S,r,n,s,"map"===u.get("text-pitch-alignment")),v=u.get("text-allow-overlap")||_.circles.length>0,x=x&&_.offscreen}m.collisionArrays.iconFeatureIndex&&(M=m.collisionArrays.iconFeatureIndex),m.collisionArrays.iconBox&&(y=(w=this.collisionIndex.placeCollisionBox(m.collisionArrays.iconBox,u.get("icon-allow-overlap"),o,r)).box.length>0,x=x&&w.offscreen),f||p?p?f||(y=y&&v):v=y&&v:y=v=y&&v,v&&b&&this.collisionIndex.insertCollisionBox(b.box,u.get("text-ignore-placement"),e.bucketInstanceId,k),y&&w&&this.collisionIndex.insertCollisionBox(w.box,u.get("icon-ignore-placement"),e.bucketInstanceId,M),v&&_&&this.collisionIndex.insertCollisionCircles(_.circles,u.get("text-ignore-placement"),e.bucketInstanceId,k),this.placements[m.crossTileID]=new Le(v,y,x||e.justReloaded),l[m.crossTileID]=!0}}e.justReloaded=!1},ze.prototype.commit=function(t,e){this.commitTime=e;var r=!1,n=t&&0!==this.fadeDuration?(this.commitTime-t.commitTime)/this.fadeDuration:1,i=t?t.opacities:{};for(var a in this.placements){var o=this.placements[a],s=i[a];s?(this.opacities[a]=new Ce(s,n,o.text,o.icon),r=r||o.text!==s.text.placed||o.icon!==s.icon.placed):(this.opacities[a]=new Ce(null,n,o.text,o.icon,o.skipFade),r=r||o.text||o.icon)}for(var l in i){var c=i[l];if(!this.opacities[l]){var u=new Ce(c,n,!1,!1);u.isHidden()||(this.opacities[l]=u,r=r||c.text.placed||c.icon.placed)}}r?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)},ze.prototype.updateLayerOpacities=function(t,e){for(var r={},n=0,i=e;n0||s.numVerticalGlyphVertices>0,h=s.numIconVertices>0;if(u){for(var f=je(c.text),p=(s.numGlyphVertices+s.numVerticalGlyphVertices)/4,d=0;dt},ze.prototype.setStale=function(){this.stale=!0};var Ie=Math.pow(2,25),Oe=Math.pow(2,24),De=Math.pow(2,17),Re=Math.pow(2,16),Be=Math.pow(2,9),Fe=Math.pow(2,8),Ne=Math.pow(2,1);function je(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*Ie+e*Oe+r*De+e*Re+r*Be+e*Fe+r*Ne+e}var Ve=function(){this._currentTileIndex=0,this._seenCrossTileIDs={}};Ve.prototype.continuePlacement=function(t,e,r,n,i){for(;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=e[t[n._currentPlacementIndex]],l=n.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(n._inProgressLayer||(n._inProgressLayer=new Ve),n._inProgressLayer.continuePlacement(r[s.source],n.placement,n._showCollisionBoxes,s,o))return;delete n._inProgressLayer}n._currentPlacementIndex--}this._done=!0},Ue.prototype.commit=function(t,e){return this.placement.commit(t,e),this.placement};var qe=512/t.default$8/2,He=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0,i=e;nt.overscaledZ)for(var l in s){var c=s[l];c.tileID.isChildOf(t)&&c.findMatches(e.symbolInstances,t,a)}else{var u=s[t.scaledTo(Number(o)).key];u&&u.findMatches(e.symbolInstances,t,a)}}for(var h=0,f=e.symbolInstances;h1?"@2x":"";function c(){if(s)n(s);else if(i&&o){var e=a.getImageData(o),r={};for(var l in i){var c=i[l],u=c.width,h=c.height,f=c.x,p=c.y,d=c.sdf,g=c.pixelRatio,m=new t.RGBAImage({width:u,height:h});t.RGBAImage.copy(e,m,{x:f,y:p},{x:0,y:0},{width:u,height:h}),r[l]={data:m,pixelRatio:g,sdf:d}}n(null,r)}}t.getJSON(r(_(e,l,".json"),t.ResourceType.SpriteJSON),function(t,e){s||(s=t,i=e,c())}),t.getImage(r(_(e,l,".png"),t.ResourceType.SpriteImage),function(t,e){s||(s=t,o=e,c())})}(e.sprite,this.map._transformRequest,function(e,r){if(e)n.fire(new t.ErrorEvent(e));else if(r)for(var i in r)n.imageManager.addImage(i,r[i]);n.imageManager.setLoaded(!0),n.fire(new t.Event("data",{dataType:"style"}))}):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var o=te(this.stylesheet.layers);this._order=o.map(function(t){return t.id}),this._layers={};for(var s=0,l=o;s0)throw new Error("Unimplemented: "+i.map(function(t){return t.command}).join(", ")+".");return n.forEach(function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)}),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.addSource=function(e,r,n){var i=this;if(this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[e]=new Yt(e,r,this.dispatcher);a.style=this,a.setEventedParent(this,function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:e}}),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone(e),e=t.extend(e,{source:i})),!this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n)){var a=t.default$22(e);this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}});var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e]}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r){this._checkLoaded();var n=this.getLayer(e);if(n){if(!t.default$10(n.filter,r))return null==r?(n.filter=void 0,void this._updateLayer(n)):void(this._validate(t.validateStyle.filter,"layers."+n.id+".filter",r)||(n.filter=t.clone(r),this._updateLayer(n)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?t.default$10(i.getLayoutProperty(r),n)||(i.setLayoutProperty(r,n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(t,e){return this.getLayer(t).getLayoutProperty(e)},r.prototype.setPaintProperty=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.default$10(i.getPaintProperty(r),n)){var a=i._transitionablePaint._values[r].value.isDataDriven();i.setPaintProperty(r,n),(i._transitionablePaint._values[r].value.isDataDriven()||a)&&this._updateLayer(i),this._changed=!0,this._updatedPaintProps[e]=!0}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){var e=this;return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,function(t){return t.serialize()}),layers:this._order.map(function(t){return e._layers[t].serialize()})},function(t){return void 0!==t})},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenRenderedFeatures=function(t){for(var e=[],r=this._order.length-1;r>=0;r--)for(var n=this._order[r],i=0,a=t;i 0.5) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n }\n\n if (v_notUsed > 0.5) {\n // This box not used, fade it out\n gl_FragColor *= .1;\n }\n}",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = clamp(\n 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance),\n 0.0, // Prevents oversized near-field boxes in pitched/overzoomed tiles\n 4.0);\n\n gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n gl_Position.xy += a_extrude * u_extrude_scale * gl_Position.w * collision_perspective_ratio;\n\n v_placed = a_placed.x;\n v_notUsed = a_placed.y;\n}\n"},collisionCircle:{fragmentSource:"uniform float u_overscale_factor;\n\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n float alpha = 0.5;\n\n // Red = collision, hide label\n vec4 color = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n\n // Blue = no collision, label is showing\n if (v_placed > 0.5) {\n color = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n }\n\n if (v_notUsed > 0.5) {\n // This box not used, fade it out\n color *= .2;\n }\n\n float extrude_scale_length = length(v_extrude_scale);\n float extrude_length = length(v_extrude) * extrude_scale_length;\n float stroke_width = 15.0 * extrude_scale_length / u_overscale_factor;\n float radius = v_radius * extrude_scale_length;\n\n float distance_to_edge = abs(extrude_length - radius);\n float opacity_t = smoothstep(-stroke_width, 0.0, -distance_to_edge);\n\n gl_FragColor = opacity_t * color;\n}\n",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\n\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = clamp(\n 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance),\n 0.0, // Prevents oversized near-field circles in pitched/overzoomed tiles\n 4.0);\n\n gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n\n highp float padding_factor = 1.2; // Pad the vertices slightly to make room for anti-alias blur\n gl_Position.xy += a_extrude * u_extrude_scale * padding_factor * gl_Position.w * collision_perspective_ratio;\n\n v_placed = a_placed.x;\n v_notUsed = a_placed.y;\n v_radius = abs(a_extrude.y); // We don't pitch the circles, so both units of the extrusion vector are equal in magnitude to the radius\n\n v_extrude = a_extrude * padding_factor;\n v_extrude_scale = u_extrude_scale * u_camera_to_center_distance * collision_perspective_ratio;\n}\n"},debug:{fragmentSource:"uniform highp vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fill:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fillOutline:{fragmentSource:"#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillOutlinePattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n\n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n}\n"},fillExtrusion:{fragmentSource:"varying vec4 v_color;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize highp vec4 color\n\n gl_FragColor = v_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec4 a_normal_ed;\n\nvarying vec4 v_color;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize highp vec4 color\n\n vec3 normal = a_normal_ed.xyz;\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(normal.x, 2.0);\n\n gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1);\n\n // Relative luminance (how dark/bright is the surface color?)\n float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;\n\n v_color = vec4(0.0, 0.0, 0.0, 1.0);\n\n // Add slight ambient lighting so no extrusions are totally black\n vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0);\n color += ambientlight;\n\n // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray\n float directional = clamp(dot(normal / 16384.0, u_lightpos), 0.0, 1.0);\n\n // Adjust directional so that\n // the range of values for highlight/shading is narrower\n // with lower light intensity\n // and with lighter/brighter surface colors\n directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional);\n\n // Add gradient along z axis of side surfaces\n if (normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n // Assign final color based on surface + ambient light color, diffuse light directional, and light color\n // with lower bounds adjusted to hue of light\n // so that shading is tinted with the complementary (opposite) color to the light color\n v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0);\n v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0);\n v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);\n}\n"},fillExtrusionPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n vec4 mixedColor = mix(color1, color2, u_mix);\n\n gl_FragColor = mixedColor * v_lighting;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\nuniform float u_height_factor;\n\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec4 a_normal_ed;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\nvarying float v_directional;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n vec3 normal = a_normal_ed.xyz;\n float edgedistance = a_normal_ed.w;\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(normal.x, 2.0);\n float z = t > 0.0 ? height : base;\n\n gl_Position = u_matrix * vec4(a_pos, z, 1);\n\n vec2 pos = normal.x == 1.0 && normal.y == 0.0 && normal.z == 16384.0\n ? a_pos // extrusion top\n : vec2(edgedistance, z * u_height_factor); // extrusion side\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, pos);\n\n v_lighting = vec4(0.0, 0.0, 0.0, 1.0);\n float directional = clamp(dot(normal / 16383.0, u_lightpos), 0.0, 1.0);\n directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional);\n\n if (normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));\n}\n"},extrusionTexture:{fragmentSource:"uniform sampler2D u_image;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_FragColor = texture2D(u_image, v_pos) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(0.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n v_pos.x = a_pos.x;\n v_pos.y = 1.0 - a_pos.y;\n}\n"},hillshadePrepare:{fragmentSource:"#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D u_image;\nvarying vec2 v_pos;\nuniform vec2 u_dimension;\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nfloat getElevation(vec2 coord, float bias) {\n // Convert encoded elevation value to meters\n vec4 data = texture2D(u_image, coord) * 255.0;\n return (data.r + data.g * 256.0 + data.b * 256.0 * 256.0) / 4.0;\n}\n\nvoid main() {\n vec2 epsilon = 1.0 / u_dimension;\n\n // queried pixels:\n // +-----------+\n // | | | |\n // | a | b | c |\n // | | | |\n // +-----------+\n // | | | |\n // | d | e | f |\n // | | | |\n // +-----------+\n // | | | |\n // | g | h | i |\n // | | | |\n // +-----------+\n\n float a = getElevation(v_pos + vec2(-epsilon.x, -epsilon.y), 0.0);\n float b = getElevation(v_pos + vec2(0, -epsilon.y), 0.0);\n float c = getElevation(v_pos + vec2(epsilon.x, -epsilon.y), 0.0);\n float d = getElevation(v_pos + vec2(-epsilon.x, 0), 0.0);\n float e = getElevation(v_pos, 0.0);\n float f = getElevation(v_pos + vec2(epsilon.x, 0), 0.0);\n float g = getElevation(v_pos + vec2(-epsilon.x, epsilon.y), 0.0);\n float h = getElevation(v_pos + vec2(0, epsilon.y), 0.0);\n float i = getElevation(v_pos + vec2(epsilon.x, epsilon.y), 0.0);\n\n // here we divide the x and y slopes by 8 * pixel size\n // where pixel size (aka meters/pixel) is:\n // circumference of the world / (pixels per tile * number of tiles)\n // which is equivalent to: 8 * 40075016.6855785 / (512 * pow(2, u_zoom))\n // which can be reduced to: pow(2, 19.25619978527 - u_zoom)\n // we want to vertically exaggerate the hillshading though, because otherwise\n // it is barely noticeable at low zooms. to do this, we multiply this by some\n // scale factor pow(2, (u_zoom - u_maxzoom) * a) where a is an arbitrary value\n // Here we use a=0.3 which works out to the expression below. see \n // nickidlugash's awesome breakdown for more info\n // https://github.com/mapbox/mapbox-gl-js/pull/5286#discussion_r148419556\n float exaggeration = u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;\n\n vec2 deriv = vec2(\n (c + f + f + i) - (a + d + d + g),\n (g + h + h + i) - (a + b + b + c)\n ) / pow(2.0, (u_zoom - u_maxzoom) * exaggeration + 19.2562 - u_zoom);\n\n gl_FragColor = clamp(vec4(\n deriv.x / 2.0 + 0.5,\n deriv.y / 2.0 + 0.5,\n 1.0,\n 1.0), 0.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (a_texture_pos / 8192.0) / 2.0 + 0.25;\n}\n"},hillshade:{fragmentSource:"uniform sampler2D u_image;\nvarying vec2 v_pos;\n\nuniform vec2 u_latrange;\nuniform vec2 u_light;\nuniform vec4 u_shadow;\nuniform vec4 u_highlight;\nuniform vec4 u_accent;\n\n#define PI 3.141592653589793\n\nvoid main() {\n vec4 pixel = texture2D(u_image, v_pos);\n\n vec2 deriv = ((pixel.rg * 2.0) - 1.0);\n\n // We divide the slope by a scale factor based on the cosin of the pixel's approximate latitude\n // to account for mercator projection distortion. see #4807 for details\n float scaleFactor = cos(radians((u_latrange[0] - u_latrange[1]) * (1.0 - v_pos.y) + u_latrange[1]));\n // We also multiply the slope by an arbitrary z-factor of 1.25\n float slope = atan(1.25 * length(deriv) / scaleFactor);\n float aspect = deriv.x != 0.0 ? atan(deriv.y, -deriv.x) : PI / 2.0 * (deriv.y > 0.0 ? 1.0 : -1.0);\n\n float intensity = u_light.x;\n // We add PI to make this property match the global light object, which adds PI/2 to the light's azimuthal\n // position property to account for 0deg corresponding to north/the top of the viewport in the style spec\n // and the original shader was written to accept (-illuminationDirection - 90) as the azimuthal.\n float azimuth = u_light.y + PI;\n\n // We scale the slope exponentially based on intensity, using a calculation similar to\n // the exponential interpolation function in the style spec:\n // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/expression/definitions/interpolate.js#L217-L228\n // so that higher intensity values create more opaque hillshading.\n float base = 1.875 - intensity * 1.75;\n float maxValue = 0.5 * PI;\n float scaledSlope = intensity != 0.5 ? ((pow(base, slope) - 1.0) / (pow(base, maxValue) - 1.0)) * maxValue : slope;\n\n // The accent color is calculated with the cosine of the slope while the shade color is calculated with the sine\n // so that the accent color's rate of change eases in while the shade color's eases out.\n float accent = cos(scaledSlope);\n // We multiply both the accent and shade color by a clamped intensity value\n // so that intensities >= 0.5 do not additionally affect the color values\n // while intensity values < 0.5 make the overall color more transparent.\n vec4 accent_color = (1.0 - accent) * u_accent * clamp(intensity * 2.0, 0.0, 1.0);\n float shade = abs(mod((aspect + azimuth) / PI + 0.5, 2.0) - 1.0);\n vec4 shade_color = mix(u_shadow, u_highlight, shade) * sin(scaledSlope) * clamp(intensity * 2.0, 0.0, 1.0);\n gl_FragColor = accent_color * (1.0 - shade_color.a) + shade_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = a_texture_pos / 8192.0;\n}\n"},line:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\nvarying highp float v_linesofar;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n v_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * 2.0;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},lineGradient:{fragmentSource:"\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nuniform sampler2D u_image;\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\nvarying highp float v_lineprogress;\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n // For gradient lines, v_lineprogress is the ratio along the entire line,\n // scaled to [0, 2^15), and the gradient ramp is stored in a texture.\n vec4 color = texture2D(u_image, vec2(v_lineprogress, 0.5));\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n// the attribute conveying progress along a line is scaled to [0, 2^15)\n#define MAX_LINE_DISTANCE 32767.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\nvarying highp float v_lineprogress;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n v_lineprogress = (floor(a_data.z / 4.0) + a_data.w * 64.0) * 2.0 / MAX_LINE_DISTANCE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},linePattern:{fragmentSource:"uniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_fade;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n\n // v_normal.y is 0 at the midpoint of the line, -1 at the lower edge, 1 at the upper edge\n // we clamp the line width outset to be between 0 and half the pattern height plus padding (2.0)\n // to ensure we don't sample outside the designated symbol on the sprite sheet.\n // 0.5 is added to shift the component to be bounded between 0 and 1 for interpolation of\n // the texture coordinate\n float y_a = 0.5 + (v_normal.y * clamp(v_width2.s, 0.0, (u_pattern_size_a.y + 2.0) / 2.0) / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * clamp(v_width2.s, 0.0, (u_pattern_size_b.y + 2.0) / 2.0) / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize mediump float width\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_linesofar = a_linesofar;\n v_width2 = vec2(outset, inset);\n}\n"},lineSDF:{fragmentSource:"\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float width\n #pragma mapbox: initialize lowp float floorwidth\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma / floorwidth, 0.5 + u_sdfgamma / floorwidth, sdfdist);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n #pragma mapbox: initialize lowp float floorwidth\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist =outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x / floorwidth, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x / floorwidth, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n v_width2 = vec2(outset, inset);\n}\n"},raster:{fragmentSource:"uniform float u_fade_t;\nuniform float u_opacity;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n if (color0.a > 0.0) {\n color0.rgb = color0.rgb / color0.a;\n }\n if (color1.a > 0.0) {\n color1.rgb = color1.rgb / color1.a;\n }\n vec4 color = mix(color0, color1, u_fade_t);\n color.a *= u_opacity;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb) * color.a, color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n // We are using Int16 for texture position coordinates to give us enough precision for\n // fractional coordinates. We use 8192 to scale the texture coordinates in the buffer\n // as an arbitrarily high number to preserve adequate precision when rendering.\n // This is also the same value as the EXTENT we are using for our tile buffer pos coordinates,\n // so math for modifying either is consistent.\n v_pos0 = (((a_texture_pos / 8192.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},symbolIcon:{fragmentSource:"uniform sampler2D u_texture;\n\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_tex;\nvarying float v_fade_opacity;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n lowp float alpha = opacity * v_fade_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\nattribute float a_fade_opacity;\n\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\nuniform highp float u_camera_to_center_distance;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform float u_fade_change;\n\n#pragma mapbox: define lowp float opacity\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying float v_fade_opacity;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp float segment_angle = -a_projected_pos[2];\n\n float size;\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 10.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // See comments in symbol_sdf.vertex\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = clamp(\n 0.5 + 0.5 * distance_ratio,\n 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles\n 4.0);\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // See comments in symbol_sdf.vertex\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0);\n\n v_tex = a_tex / u_texsize;\n vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n v_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n}\n"},symbolSDF:{fragmentSource:"#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO\n\nuniform bool u_is_halo;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nuniform sampler2D u_texture;\nuniform highp float u_gamma_scale;\nuniform bool u_is_text;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 fill_color\n #pragma mapbox: initialize highp vec4 halo_color\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float halo_width\n #pragma mapbox: initialize lowp float halo_blur\n\n vec2 tex = v_data0.xy;\n float gamma_scale = v_data1.x;\n float size = v_data1.y;\n float fade_opacity = v_data1[2];\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n lowp vec4 color = fill_color;\n highp float gamma = EDGE_GAMMA / (fontScale * u_gamma_scale);\n lowp float buff = (256.0 - 64.0) / 256.0;\n if (u_is_halo) {\n color = halo_color;\n gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * u_gamma_scale);\n buff = (6.0 - halo_width / fontScale) / SDF_PX;\n }\n\n lowp float dist = texture2D(u_texture, tex).a;\n highp float gamma_scaled = gamma * gamma_scale;\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n\n gl_FragColor = color * (alpha * opacity * fade_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\nattribute float a_fade_opacity;\n\n// contents of a_size vary based on the type of property value\n// used for {text,icon}-size.\n// For constants, a_size is disabled.\n// For source functions, we bind only one value per vertex: the value of {text,icon}-size evaluated for the current feature.\n// For composite functions:\n// [ text-size(lowerZoomStop, feature),\n// text-size(upperZoomStop, feature) ]\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\n\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform highp float u_camera_to_center_distance;\nuniform float u_fade_change;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 fill_color\n #pragma mapbox: initialize highp vec4 halo_color\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float halo_width\n #pragma mapbox: initialize lowp float halo_blur\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp float segment_angle = -a_projected_pos[2];\n float size;\n\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 10.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // If the label is pitched with the map, layout is done in pitched space,\n // which makes labels in the distance smaller relative to viewport space.\n // We counteract part of that effect by multiplying by the perspective ratio.\n // If the label isn't pitched with the map, we do layout in viewport space,\n // which makes labels in the distance larger relative to the features around\n // them. We counteract part of that effect by dividing by the perspective ratio.\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = clamp(\n 0.5 + 0.5 * distance_ratio,\n 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles\n 4.0);\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // Point labels with 'rotation-alignment: map' are horizontal with respect to tile units\n // To figure out that angle in projected space, we draw a short horizontal line in tile\n // space, project it, and measure its angle in projected space.\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0);\n float gamma_scale = gl_Position.w;\n\n vec2 tex = a_tex / u_texsize;\n vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n float interpolated_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n\n v_data0 = vec2(tex.x, tex.y);\n v_data1 = vec3(gamma_scale, size, interpolated_fade_opacity);\n}\n"}},tr=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,er=function(t){var e=Qe[t],r={};e.fragmentSource=e.fragmentSource.replace(tr,function(t,e,n,i,a){return r[a]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nvarying "+n+" "+i+" "+a+";\n#else\nuniform "+n+" "+i+" u_"+a+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+a+"\n "+n+" "+i+" "+a+" = u_"+a+";\n#endif\n"}),e.vertexSource=e.vertexSource.replace(tr,function(t,e,n,i,a){var o="float"===i?"vec2":"vec4";return r[a]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float a_"+a+"_t;\nattribute "+n+" "+o+" a_"+a+";\nvarying "+n+" "+i+" "+a+";\n#else\nuniform "+n+" "+i+" u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = unpack_mix_"+o+"(a_"+a+", a_"+a+"_t);\n#else\n "+n+" "+i+" "+a+" = u_"+a+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float a_"+a+"_t;\nattribute "+n+" "+o+" a_"+a+";\n#else\nuniform "+n+" "+i+" u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+n+" "+i+" "+a+" = unpack_mix_"+o+"(a_"+a+", a_"+a+"_t);\n#else\n "+n+" "+i+" "+a+" = u_"+a+";\n#endif\n"})};for(var rr in Qe)er(rr);var nr=Qe,ir=function(t,e,r,n){var i=t.gl;this.program=i.createProgram();var o=r.defines().concat("#define DEVICE_PIXEL_RATIO "+a.devicePixelRatio.toFixed(1));n&&o.push("#define OVERDRAW_INSPECTOR;");var s=o.concat(nr.prelude.fragmentSource,e.fragmentSource).join("\n"),l=o.concat(nr.prelude.vertexSource,e.vertexSource).join("\n"),c=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(c,s),i.compileShader(c),i.attachShader(this.program,c);var u=i.createShader(i.VERTEX_SHADER);i.shaderSource(u,l),i.compileShader(u),i.attachShader(this.program,u);for(var h=r.layoutAttributes||[],f=0;f>16,s>>16),n.uniform2f(r.uniforms.u_pixel_coord_lower,65535&o,65535&s)};function vr(t,e,r,n,i){if(!dr(r.paint.get("fill-pattern"),t))for(var a=!0,o=0,s=n;o0){var l=a.now(),c=(l-e.timeAdded)/s,u=r?(l-r.timeAdded)/s:-1,h=n.getSource(),f=o.coveringZoomLevel({tileSize:h.tileSize,roundZoom:h.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-f)>Math.abs(e.tileID.overscaledZ-f),d=p&&e.refreshedUponExpiration?1:t.clamp(p?c:1-u,0,1);return e.refreshedUponExpiration&&c>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}function Er(e,r,n){var i=e.context,o=i.gl;i.lineWidth.set(1*a.devicePixelRatio);var s=n.posMatrix,l=e.useProgram("debug");i.setDepthMode(qt.disabled),i.setStencilMode(Ht.disabled),i.setColorMode(e.colorModeForRenderPass()),o.uniformMatrix4fv(l.uniforms.u_matrix,!1,s),o.uniform4f(l.uniforms.u_color,1,0,0,1),e.debugVAO.bind(i,l,e.debugBuffer,[]),o.drawArrays(o.LINE_STRIP,0,e.debugBuffer.length);for(var c=function(t,e,r,n){n=n||1;var i,a,o,s,l,c,u,h,f=[];for(i=0,a=t.length;i":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]},Lr={symbol:function(t,e,r,n){if("translucent"===t.renderPass){var i=t.context;i.setStencilMode(Ht.disabled),i.setColorMode(t.colorModeForRenderPass()),0!==r.paint.get("icon-opacity").constantOr(1)&&cr(t,e,r,n,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright")),0!==r.paint.get("text-opacity").constantOr(1)&&cr(t,e,r,n,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright")),e.map.showCollisionBoxes&&function(t,e,r,n){or(t,e,r,n,!1),or(t,e,r,n,!0)}(t,e,r,n)}},circle:function(t,e,r,n){if("translucent"===t.renderPass){var i=r.paint.get("circle-opacity"),a=r.paint.get("circle-stroke-width"),o=r.paint.get("circle-stroke-opacity");if(0!==i.constantOr(1)||0!==a.constantOr(1)&&0!==o.constantOr(1)){var s=t.context,l=s.gl;s.setDepthMode(t.depthModeForSublayer(0,qt.ReadOnly)),s.setStencilMode(Ht.disabled),s.setColorMode(t.colorModeForRenderPass());for(var c=!0,u=0;u0?1-1/(1.001-i):-i),s.uniform1f(c.uniforms.u_contrast_factor,(a=r.paint.get("raster-contrast"))>0?1/(1-a):1+a),s.uniform3fv(c.uniforms.u_spin_weights,function(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}(r.paint.get("raster-hue-rotate"))),s.uniform1f(c.uniforms.u_buffer_scale,1),s.uniform1i(c.uniforms.u_image0,0),s.uniform1i(c.uniforms.u_image1,1);for(var u=n.length&&n[0].overscaledZ,h=0,f=n;he.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function Ir(t,e,r,n,i){var a=Math.max(r,Math.floor(e.y0)),o=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,h=e.dx<0,f=a;fl.dy&&(o=s,s=l,l=o),s.dy>c.dy&&(o=s,s=c,c=o),l.dy>c.dy&&(o=l,l=c,c=o),s.dy&&Ir(c,s,n,i,a),l.dy&&Ir(c,l,n,i,a)}zr.prototype.resize=function(t,e){var r=this.context.gl;if(this.width=t*a.devicePixelRatio,this.height=e*a.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,i=this.style._order;n=0;this.currentLayer--){var v=n.style._layers[s[n.currentLayer]];v.source!==(g&&g.id)&&(m=[],(g=n.style.sourceCaches[v.source])&&(n.clearStencil(),m=g.getVisibleCoordinates(),g.getSource().isTileClipped&&n._renderTileClippingMasks(m))),n.renderLayer(n,g,v,m)}this.renderPass="translucent";var y,x=[];for(this.currentLayer=0,this.currentLayer;this.currentLayer0?e.pop():null},zr.prototype._createProgramCached=function(t,e){this.cache=this.cache||{};var r=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new ir(this.context,nr[t],e,this._showOverdrawInspector)),this.cache[r]},zr.prototype.useProgram=function(t,e){var r=this._createProgramCached(t,e||this.emptyProgramConfiguration);return this.context.program.set(r.program),r};var Dr=t.default$20.vec4,Rr=t.default$20.mat4,Br=t.default$20.mat2,Fr=function(t,e,r){this.tileSize=512,this._renderWorldCopies=void 0===r||r,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new G(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={},this._alignedPosMatrixCache={}},Nr={minZoom:{configurable:!0},maxZoom:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerPoint:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},unmodified:{configurable:!0},x:{configurable:!0},y:{configurable:!0},point:{configurable:!0}};Fr.prototype.clone=function(){var t=new Fr(this._minZoom,this._maxZoom,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._calcMatrices(),t},Nr.minZoom.get=function(){return this._minZoom},Nr.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Nr.maxZoom.get=function(){return this._maxZoom},Nr.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Nr.renderWorldCopies.get=function(){return this._renderWorldCopies},Nr.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Nr.worldSize.get=function(){return this.tileSize*this.scale},Nr.centerPoint.get=function(){return this.size._div(2)},Nr.size.get=function(){return new t.default$1(this.width,this.height)},Nr.bearing.get=function(){return-this.angle/Math.PI*180},Nr.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=Br.create(),Br.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Nr.pitch.get=function(){return this._pitch/Math.PI*180},Nr.pitch.set=function(e){var r=t.clamp(e,0,60)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},Nr.fov.get=function(){return this._fov/Math.PI*180},Nr.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},Nr.zoom.get=function(){return this._zoom},Nr.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},Nr.center.get=function(){return this._center},Nr.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Fr.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},Fr.prototype.getVisibleUnwrappedCoordinates=function(e){var r=this.pointCoordinate(new t.default$1(0,0),0),n=this.pointCoordinate(new t.default$1(this.width,0),0),i=Math.floor(r.column),a=Math.floor(n.column),o=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var s=i;s<=a;s++)0!==s&&o.push(new t.UnwrappedTileID(s,e));return o},Fr.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var i=this.pointCoordinate(this.centerPoint,r),a=new t.default$1(i.column-.5,i.row-.5);return function(e,r,n,i){void 0===i&&(i=!0);var a=1<=0&&l<=a)for(c=r;co&&(i=o-g)}if(this.lngRange){var m=this.x,v=c.x/2;m-vl&&(n=l-v)}void 0===n&&void 0===i||(this.center=this.unproject(new t.default$1(void 0!==n?n:this.x,void 0!==i?i:this.y))),this._unmodified=u,this._constraining=!1}},Fr.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var t=this._fov/2,e=Math.PI/2+this._pitch,r=Math.sin(t)*this.cameraToCenterDistance/Math.sin(Math.PI-e-t),n=this.x,i=this.y,a=1.01*(Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance),o=new Float64Array(16);Rr.perspective(o,this._fov,this.width/this.height,1,a),Rr.scale(o,o,[1,-1,1]),Rr.translate(o,o,[0,0,-this.cameraToCenterDistance]),Rr.rotateX(o,o,this._pitch),Rr.rotateZ(o,o,this.angle),Rr.translate(o,o,[-n,-i,0]);var s=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));Rr.scale(o,o,[1,1,s,1]),this.projMatrix=o;var l=this.width%2/2,c=this.height%2/2,u=Math.cos(this.angle),h=Math.sin(this.angle),f=n-Math.round(n)+u*l+h*c,p=i-Math.round(i)+u*c+h*l,d=new Float64Array(o);if(Rr.translate(d,d,[f>.5?f-1:f,p>.5?p-1:p,0]),this.alignedProjMatrix=d,o=Rr.create(),Rr.scale(o,o,[this.width/2,-this.height/2,1]),Rr.translate(o,o,[1,-1,0]),this.pixelMatrix=Rr.multiply(new Float64Array(16),o,this.projMatrix),!(o=Rr.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=o,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Fr.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.default$1(0,0)).zoomTo(this.zoom),r=[e.column*this.tileSize,e.row*this.tileSize,0,1];return Dr.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Object.defineProperties(Fr.prototype,Nr);var jr=function(){var e,r,n,i;t.bindAll(["_onHashChange","_updateHash"],this),this._updateHash=(e=this._updateHashUnthrottled.bind(this),300,r=!1,n=0,i=function(){n=0,r&&(e(),n=setTimeout(i,300),r=!1)},function(){return r=!0,n||i(),n})};jr.prototype.addTo=function(e){return this._map=e,t.default.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},jr.prototype.remove=function(){return t.default.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},jr.prototype.getHashString=function(t){var e=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,n=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,n),a=Math.round(e.lng*i)/i,o=Math.round(e.lat*i)/i,s=this._map.getBearing(),l=this._map.getPitch(),c="";return c+=t?"#/"+a+"/"+o+"/"+r:"#"+r+"/"+o+"/"+a,(s||l)&&(c+="/"+Math.round(10*s)/10),l&&(c+="/"+Math.round(l)),c},jr.prototype._onHashChange=function(){var e=t.default.location.hash.replace("#","").split("/");return e.length>=3&&(this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:+(e[3]||0),pitch:+(e[4]||0)}),!0)},jr.prototype._updateHashUnthrottled=function(){var e=this.getHashString();t.default.history.replaceState(t.default.history.state,"",e)};var Vr=function(e){function r(r,n,i,a){void 0===a&&(a={});var o=s.mousePos(n.getCanvasContainer(),i),l=n.unproject(o);e.call(this,r,t.extend({point:o,lngLat:l,originalEvent:i},a)),this._defaultPrevented=!1,this.target=n}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r;var n={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,n),r}(t.Event),Ur=function(e){function r(r,n,i){var a=s.touchPos(n.getCanvasContainer(),i),o=a.map(function(t){return n.unproject(t)}),l=a.reduce(function(t,e,r,n){return t.add(e.div(n.length))},new t.default$1(0,0)),c=n.unproject(l);e.call(this,r,{points:a,point:l,lngLats:o,lngLat:c,originalEvent:i}),this._defaultPrevented=!1}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r;var n={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,n),r}(t.Event),qr=function(t){function e(e,r,n){t.call(this,e,{originalEvent:n}),this._defaultPrevented=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(t.Event),Hr=function(e){this._map=e,this._el=e.getCanvasContainer(),this._delta=0,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};Hr.prototype.isEnabled=function(){return!!this._enabled},Hr.prototype.isActive=function(){return!!this._active},Hr.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},Hr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Hr.prototype.onWheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.default.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=a.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this.isActive()||this._start(e)),e.preventDefault()}},Hr.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t)},Hr.prototype._start=function(e){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this._map.fire(new t.Event("movestart",{originalEvent:e})),this._map.fire(new t.Event("zoomstart",{originalEvent:e})),this._finishTimeout&&clearTimeout(this._finishTimeout);var r=s.mousePos(this._el,e);this._around=G.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(r)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame))}},Hr.prototype._onScrollFrame=function(){var e=this;if(this._frameId=null,this.isActive()){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?1/450:.01,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var o="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(o*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var s=!1;if("wheel"===this._type){var l=Math.min((a.now()-this._lastWheelEventTime)/200,1),c=this._easing(l);r.zoom=t.number(this._startZoom,this._targetZoom,c),l<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):s=!0}else r.zoom=this._targetZoom,s=!0;r.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire(new t.Event("move",{originalEvent:this._lastWheelEvent})),this._map.fire(new t.Event("zoom",{originalEvent:this._lastWheelEvent})),s&&(this._active=!1,this._finishTimeout=setTimeout(function(){e._map.fire(new t.Event("zoomend",{originalEvent:e._lastWheelEvent})),e._map.fire(new t.Event("moveend",{originalEvent:e._lastWheelEvent})),delete e._targetZoom},200))}},Hr.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(a.now()-n.start)/n.duration,o=n.easing(i+.01)-n.easing(i),s=.27/Math.sqrt(o*o+1e-4)*.01,l=Math.sqrt(.0729-s*s);r=t.bezier(s,l,.25,1)}return this._prevEase={start:a.now(),duration:e,easing:r},r};var Gr=function(e){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),t.bindAll(["_onMouseMove","_onMouseUp","_onKeyDown"],this)};Gr.prototype.isEnabled=function(){return!!this._enabled},Gr.prototype.isActive=function(){return!!this._active},Gr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Gr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Gr.prototype.onMouseDown=function(e){this.isEnabled()&&e.shiftKey&&0===e.button&&(t.default.document.addEventListener("mousemove",this._onMouseMove,!1),t.default.document.addEventListener("keydown",this._onKeyDown,!1),t.default.document.addEventListener("mouseup",this._onMouseUp,!1),s.disableDrag(),this._startPos=s.mousePos(this._el,e),this._active=!0)},Gr.prototype._onMouseMove=function(t){var e=this._startPos,r=s.mousePos(this._el,t);this._box||(this._box=s.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,r.x),i=Math.max(e.x,r.x),a=Math.min(e.y,r.y),o=Math.max(e.y,r.y);s.setTransform(this._box,"translate("+n+"px,"+a+"px)"),this._box.style.width=i-n+"px",this._box.style.height=o-a+"px"},Gr.prototype._onMouseUp=function(e){if(0===e.button){var r=this._startPos,n=s.mousePos(this._el,e),i=(new W).extend(this._map.unproject(r)).extend(this._map.unproject(n));this._finish(),s.suppressClick(),r.x===n.x&&r.y===n.y?this._fireEvent("boxzoomcancel",e):this._map.fitBounds(i,{linear:!0}).fire(new t.Event("boxzoomend",{originalEvent:e,boxZoomBounds:i}))}},Gr.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},Gr.prototype._finish=function(){this._active=!1,t.default.document.removeEventListener("mousemove",this._onMouseMove,!1),t.default.document.removeEventListener("keydown",this._onKeyDown,!1),t.default.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(s.remove(this._box),this._box=null),s.enableDrag()},Gr.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,{originalEvent:r}))};var Wr=t.bezier(0,0,.25,1),Yr=function(e,r){this._map=e,this._el=r.element||e.getCanvasContainer(),this._state="disabled",this._button=r.button||"right",this._bearingSnap=r.bearingSnap||0,this._pitchWithRotate=!1!==r.pitchWithRotate,t.bindAll(["_onMouseMove","_onMouseUp","_onBlur","_onDragFrame"],this)};Yr.prototype.isEnabled=function(){return"disabled"!==this._state},Yr.prototype.isActive=function(){return"active"===this._state},Yr.prototype.enable=function(){this.isEnabled()||(this._state="enabled")},Yr.prototype.disable=function(){if(this.isEnabled())switch(this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend"),this._pitchWithRotate&&this._fireEvent("pitchend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},Yr.prototype.onMouseDown=function(e){if("enabled"===this._state){if("right"===this._button){if(this._eventButton=s.mouseButton(e),this._eventButton!==(e.ctrlKey?0:2))return}else{if(e.ctrlKey||0!==s.mouseButton(e))return;this._eventButton=0}s.disableDrag(),t.default.document.addEventListener("mousemove",this._onMouseMove,{capture:!0}),t.default.document.addEventListener("mouseup",this._onMouseUp),t.default.addEventListener("blur",this._onBlur),this._state="pending",this._inertia=[[a.now(),this._map.getBearing()]],this._previousPos=s.mousePos(this._el,e),this._center=this._map.transform.centerPoint,e.preventDefault()}},Yr.prototype._onMouseMove=function(t){this._lastMoveEvent=t,this._pos=s.mousePos(this._el,t),"pending"===this._state&&(this._state="active",this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame))},Yr.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t){var e=this._map.transform,r=this._previousPos,n=this._pos,i=.8*(r.x-n.x),o=-.5*(r.y-n.y),s=e.bearing-i,l=e.pitch-o,c=this._inertia,u=c[c.length-1];this._drainInertiaBuffer(),c.push([a.now(),this._map._normalizeBearing(s,u[1])]),e.bearing=s,this._pitchWithRotate&&(this._fireEvent("pitch",t),e.pitch=l),this._fireEvent("rotate",t),this._fireEvent("move",t),delete this._lastMoveEvent,this._previousPos=this._pos}},Yr.prototype._onMouseUp=function(t){if(s.mouseButton(t)===this._eventButton)switch(this._state){case"active":this._state="enabled",s.suppressClick(),this._unbind(),this._deactivate(),this._inertialRotate(t);break;case"pending":this._state="enabled",this._unbind()}},Yr.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend",t),this._pitchWithRotate&&this._fireEvent("pitchend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},Yr.prototype._unbind=function(){t.default.document.removeEventListener("mousemove",this._onMouseMove,{capture:!0}),t.default.document.removeEventListener("mouseup",this._onMouseUp),t.default.removeEventListener("blur",this._onBlur),s.enableDrag()},Yr.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._previousPos},Yr.prototype._inertialRotate=function(t){var e=this;this._fireEvent("rotateend",t),this._drainInertiaBuffer();var r=this._map,n=r.getBearing(),i=this._inertia,a=function(){Math.abs(n)180&&(p=180);var d=p/180;c+=h*p*(d/2),Math.abs(r._normalizeBearing(c,0))0&&e-t[0][0]>160;)t.shift()};var Xr=t.bezier(0,0,.3,1),Zr=function(e){this._map=e,this._el=e.getCanvasContainer(),this._state="disabled",t.bindAll(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this)};Zr.prototype.isEnabled=function(){return"disabled"!==this._state},Zr.prototype.isActive=function(){return"active"===this._state},Zr.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled")},Zr.prototype.disable=function(){if(this.isEnabled())switch(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("dragend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},Zr.prototype.onMouseDown=function(e){"enabled"===this._state&&(e.ctrlKey||0!==s.mouseButton(e)||(s.addEventListener(t.default.document,"mousemove",this._onMove,{capture:!0}),s.addEventListener(t.default.document,"mouseup",this._onMouseUp),this._start(e)))},Zr.prototype.onTouchStart=function(e){"enabled"===this._state&&(e.touches.length>1||(s.addEventListener(t.default.document,"touchmove",this._onMove,{capture:!0,passive:!1}),s.addEventListener(t.default.document,"touchend",this._onTouchEnd),this._start(e)))},Zr.prototype._start=function(e){t.default.addEventListener("blur",this._onBlur),this._state="pending",this._previousPos=s.mousePos(this._el,e),this._inertia=[[a.now(),this._previousPos]]},Zr.prototype._onMove=function(t){this._lastMoveEvent=t,t.preventDefault(),this._pos=s.mousePos(this._el,t),this._drainInertiaBuffer(),this._inertia.push([a.now(),this._pos]),"pending"===this._state&&(this._state="active",this._fireEvent("dragstart",t),this._fireEvent("movestart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame))},Zr.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t){var e=this._map.transform;e.setLocationAtPoint(e.pointLocation(this._previousPos),this._pos),this._fireEvent("drag",t),this._fireEvent("move",t),this._previousPos=this._pos,delete this._lastMoveEvent}},Zr.prototype._onMouseUp=function(t){if(0===s.mouseButton(t))switch(this._state){case"active":this._state="enabled",s.suppressClick(),this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},Zr.prototype._onTouchEnd=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},Zr.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("dragend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},Zr.prototype._unbind=function(){s.removeEventListener(t.default.document,"touchmove",this._onMove,{capture:!0,passive:!1}),s.removeEventListener(t.default.document,"touchend",this._onTouchEnd),s.removeEventListener(t.default.document,"mousemove",this._onMove,{capture:!0}),s.removeEventListener(t.default.document,"mouseup",this._onMouseUp),s.removeEventListener(t.default,"blur",this._onBlur)},Zr.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._previousPos,delete this._pos},Zr.prototype._inertialPan=function(t){this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=this._inertia;if(e.length<2)this._fireEvent("moveend",t);else{var r=e[e.length-1],n=e[0],i=r[1].sub(n[1]),a=(r[0]-n[0])/1e3;if(0===a||r[1].equals(n[1]))this._fireEvent("moveend",t);else{var o=i.mult(.3/a),s=o.mag();s>1400&&(s=1400,o._unit()._mult(s));var l=s/750,c=o.mult(-l/2);this._map.panBy(c,{duration:1e3*l,easing:Xr,noMoveStart:!0},{originalEvent:t})}}},Zr.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},Zr.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=a.now();t.length>0&&e-t[0][0]>160;)t.shift()};var $r=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onKeyDown"],this)};function Jr(t){return t*(2-t)}$r.prototype.isEnabled=function(){return!!this._enabled},$r.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},$r.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},$r.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,n=0,i=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),i=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),i=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(a=1,t.preventDefault());break;default:return}var o=this._map,s=o.getZoom(),l={duration:300,delayEndEvents:500,easing:Jr,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:o.getBearing()+15*r,pitch:o.getPitch()+10*n,offset:[100*-i,100*-a],center:o.getCenter()};o.easeTo(l,{originalEvent:t})}};var Kr=function(e){this._map=e,t.bindAll(["_onDblClick","_onZoomEnd"],this)};Kr.prototype.isEnabled=function(){return!!this._enabled},Kr.prototype.isActive=function(){return!!this._active},Kr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Kr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Kr.prototype.onTouchStart=function(t){var e=this;this.isEnabled()&&(t.points.length>1||(this._tapped?(clearTimeout(this._tapped),this._tapped=null,this._zoom(t)):this._tapped=setTimeout(function(){e._tapped=null},300)))},Kr.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t))},Kr.prototype._zoom=function(t){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},Kr.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)};var Qr=t.bezier(0,0,.15,1),tn=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onMove","_onEnd","_onTouchFrame"],this)};tn.prototype.isEnabled=function(){return!!this._enabled},tn.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)},tn.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1)},tn.prototype.disableRotation=function(){this._rotationDisabled=!0},tn.prototype.enableRotation=function(){this._rotationDisabled=!1},tn.prototype.onStart=function(e){if(this.isEnabled()&&2===e.touches.length){var r=s.mousePos(this._el,e.touches[0]),n=s.mousePos(this._el,e.touches[1]);this._startVec=r.sub(n),this._gestureIntent=void 0,this._inertia=[],s.addEventListener(t.default.document,"touchmove",this._onMove,{passive:!1}),s.addEventListener(t.default.document,"touchend",this._onEnd)}},tn.prototype._getTouchEventData=function(t){var e=s.mousePos(this._el,t.touches[0]),r=s.mousePos(this._el,t.touches[1]),n=e.sub(r);return{vec:n,center:e.add(r).div(2),scale:n.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*n.angleWith(this._startVec)/Math.PI}},tn.prototype._onMove=function(e){if(2===e.touches.length){var r=this._getTouchEventData(e),n=r.vec,i=r.scale,a=r.bearing;if(!this._gestureIntent){var o=Math.abs(1-i)>.15;Math.abs(a)>10?this._gestureIntent="rotate":o&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._map.fire(new t.Event(this._gestureIntent+"start",{originalEvent:e})),this._map.fire(new t.Event("movestart",{originalEvent:e})),this._startVec=n)}this._lastTouchEvent=e,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),e.preventDefault()}},tn.prototype._onTouchFrame=function(){this._frameId=null;var e=this._gestureIntent;if(e){var r=this._map.transform;this._startScale||(this._startScale=r.scale,this._startBearing=r.bearing);var n=this._getTouchEventData(this._lastTouchEvent),i=n.center,o=n.bearing,s=n.scale,l=r.pointLocation(i),c=r.locationPoint(l);"rotate"===e&&(r.bearing=this._startBearing+o),r.zoom=r.scaleZoom(this._startScale*s),r.setLocationAtPoint(l,c),this._map.fire(new t.Event(e,{originalEvent:this._lastTouchEvent})),this._map.fire(new t.Event("move",{originalEvent:this._lastTouchEvent})),this._drainInertiaBuffer(),this._inertia.push([a.now(),s,i])}},tn.prototype._onEnd=function(e){s.removeEventListener(t.default.document,"touchmove",this._onMove,{passive:!1}),s.removeEventListener(t.default.document,"touchend",this._onEnd);var r=this._gestureIntent,n=this._startScale;if(this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._gestureIntent,delete this._startScale,delete this._startBearing,delete this._lastTouchEvent,r){this._map.fire(new t.Event(r+"end",{originalEvent:e})),this._drainInertiaBuffer();var i=this._inertia,a=this._map;if(i.length<2)a.snapToNorth({},{originalEvent:e});else{var o=i[i.length-1],l=i[0],c=a.transform.scaleZoom(n*o[1]),u=a.transform.scaleZoom(n*l[1]),h=c-u,f=(o[0]-l[0])/1e3,p=o[2];if(0!==f&&c!==u){var d=.15*h/f;Math.abs(d)>2.5&&(d=d>0?2.5:-2.5);var g=1e3*Math.abs(d/(12*.15)),m=c+d*g/2e3;m<0&&(m=0),a.easeTo({zoom:m,duration:g,easing:Qr,around:this._aroundCenter?a.getCenter():a.unproject(p),noMoveStart:!0},{originalEvent:e})}else a.snapToNorth({},{originalEvent:e})}}},tn.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=a.now();t.length>2&&e-t[0][0]>160;)t.shift()};var en={scrollZoom:Hr,boxZoom:Gr,dragRotate:Yr,dragPan:Zr,keyboard:$r,doubleClickZoom:Kr,touchZoomRotate:tn},rn=function(e){function r(r,n){e.call(this),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=n.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getCenter=function(){return this.transform.center},r.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},r.prototype.panBy=function(e,r,n){return e=t.default$1.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},r),n)},r.prototype.panTo=function(e,r,n){return this.easeTo(t.extend({center:e},r),n)},r.prototype.getZoom=function(){return this.transform.zoom},r.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},r.prototype.zoomTo=function(e,r,n){return this.easeTo(t.extend({zoom:e},r),n)},r.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},r.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},r.prototype.getBearing=function(){return this.transform.bearing},r.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},r.prototype.rotateTo=function(e,r,n){return this.easeTo(t.extend({bearing:e},r),n)},r.prototype.resetNorth=function(e,r){return this.rotateTo(0,t.extend({duration:1e3},e),r),this},r.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())e?1:0}),["bottom","left","right","top"]))return t.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'"),this;e=W.convert(e);var a=[(r.padding.left-r.padding.right)/2,(r.padding.top-r.padding.bottom)/2],o=Math.min(r.padding.right,r.padding.left),s=Math.min(r.padding.top,r.padding.bottom);r.offset=[r.offset[0]+a[0],r.offset[1]+a[1]];var l=t.default$1.convert(r.offset),c=this.transform,u=c.project(e.getNorthWest()),h=c.project(e.getSouthEast()),f=h.sub(u),p=(c.width-2*o-2*Math.abs(l.x))/f.x,d=(c.height-2*s-2*Math.abs(l.y))/f.y;return d<0||p<0?(t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset."),this):(r.center=c.unproject(u.add(h).div(2)),r.zoom=Math.min(c.scaleZoom(c.scale*Math.min(p,d)),r.maxZoom),r.bearing=0,r.linear?this.easeTo(r,n):this.flyTo(r,n))},r.prototype.jumpTo=function(e,r){this.stop();var n=this.transform,i=!1,a=!1,o=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(i=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=G.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(a=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(o=!0,n.pitch=+e.pitch),this.fire(new t.Event("movestart",r)).fire(new t.Event("move",r)),i&&this.fire(new t.Event("zoomstart",r)).fire(new t.Event("zoom",r)).fire(new t.Event("zoomend",r)),a&&this.fire(new t.Event("rotatestart",r)).fire(new t.Event("rotate",r)).fire(new t.Event("rotateend",r)),o&&this.fire(new t.Event("pitchstart",r)).fire(new t.Event("pitch",r)).fire(new t.Event("pitchend",r)),this.fire(new t.Event("moveend",r))},r.prototype.easeTo=function(e,r){var n=this;this.stop(),!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate&&(e.duration=0);var i=this.transform,a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l="zoom"in e?+e.zoom:a,c="bearing"in e?this._normalizeBearing(e.bearing,o):o,u="pitch"in e?+e.pitch:s,h=i.centerPoint.add(t.default$1.convert(e.offset)),f=i.pointLocation(h),p=G.convert(e.center||f);this._normalizeCenter(p);var d,g,m=i.project(f),v=i.project(p).sub(m),y=i.zoomScale(l-a);return e.around&&(d=G.convert(e.around),g=i.locationPoint(d)),this._zooming=l!==a,this._rotating=o!==c,this._pitching=u!==s,this._prepareEase(r,e.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease(function(e){if(n._zooming&&(i.zoom=t.number(a,l,e)),n._rotating&&(i.bearing=t.number(o,c,e)),n._pitching&&(i.pitch=t.number(s,u,e)),d)i.setLocationAtPoint(d,g);else{var f=i.zoomScale(i.zoom-a),p=l>a?Math.min(2,y):Math.max(.5,y),x=Math.pow(p,1-e),b=i.unproject(m.add(v.mult(e*x)).mult(f));i.setLocationAtPoint(i.renderWorldCopies?b.wrap():b,h)}n._fireMoveEvents(r)},function(){e.delayEndEvents?n._easeEndTimeoutID=setTimeout(function(){return n._afterEase(r)},e.delayEndEvents):n._afterEase(r)},e),this},r.prototype._prepareEase=function(e,r){this._moving=!0,r||this.fire(new t.Event("movestart",e)),this._zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e){var r=this._zooming,n=this._rotating,i=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,r&&this.fire(new t.Event("zoomend",e)),n&&this.fire(new t.Event("rotateend",e)),i&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))},r.prototype.flyTo=function(e,r){var n=this;this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var i=this.transform,a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l="zoom"in e?t.clamp(+e.zoom,i.minZoom,i.maxZoom):a,c="bearing"in e?this._normalizeBearing(e.bearing,o):o,u="pitch"in e?+e.pitch:s,h=i.zoomScale(l-a),f=i.centerPoint.add(t.default$1.convert(e.offset)),p=i.pointLocation(f),d=G.convert(e.center||p);this._normalizeCenter(d);var g=i.project(p),m=i.project(d).sub(g),v=e.curve,y=Math.max(i.width,i.height),x=y/h,b=m.mag();if("minZoom"in e){var _=t.clamp(Math.min(e.minZoom,a,l),i.minZoom,i.maxZoom),w=y/i.zoomScale(_-a);v=Math.sqrt(w/b*2)}var k=v*v;function M(t){var e=(x*x-y*y+(t?-1:1)*k*k*b*b)/(2*(t?x:y)*k*b);return Math.log(Math.sqrt(e*e+1)-e)}function A(t){return(Math.exp(t)-Math.exp(-t))/2}function T(t){return(Math.exp(t)+Math.exp(-t))/2}var S=M(0),E=function(t){return T(S)/T(S+v*t)},C=function(t){return y*((T(S)*(A(e=S+v*t)/T(e))-A(S))/k)/b;var e},L=(M(1)-S)/v;if(Math.abs(b)<1e-6||!isFinite(L)){if(Math.abs(y-x)<1e-6)return this.easeTo(e,r);var z=xe.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=o!==c,this._pitching=u!==s,this._prepareEase(r,!1),this._ease(function(e){var l=e*L,h=1/E(l);i.zoom=a+i.scaleZoom(h),n._rotating&&(i.bearing=t.number(o,c,e)),n._pitching&&(i.pitch=t.number(s,u,e));var p=i.unproject(g.add(m.mult(C(l))).mult(h));i.setLocationAtPoint(i.renderWorldCopies?p.wrap():p,f),n._fireMoveEvents(r)},function(){return n._afterEase(r)},e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var t=this._onEaseEnd;delete this._onEaseEnd,t.call(this)}return this},r.prototype._ease=function(t,e,r){!1===r.animate||0===r.duration?(t(1),e()):(this._easeStart=a.now(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var t=Math.min((a.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),nn=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};nn.prototype.getDefaultPosition=function(){return"bottom-right"},nn.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=s.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},nn.prototype.onRemove=function(){s.remove(this._container),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0},nn.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var e=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:m.ACCESS_TOKEN}];if(t){var r=e.reduce(function(t,r,n){return r.value&&(t+=r.key+"="+r.value+(n=0)return!1;return!0})).length?(this._container.innerHTML=t.join(" | "),this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null}},nn.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var an=function(){t.bindAll(["_updateLogo"],this)};an.prototype.onAdd=function(t){this._map=t,this._container=s.create("div","mapboxgl-ctrl");var e=s.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.href="https://www.mapbox.com/",e.setAttribute("aria-label","Mapbox logo"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._container},an.prototype.onRemove=function(){s.remove(this._container),this._map.off("sourcedata",this._updateLogo)},an.prototype.getDefaultPosition=function(){return"bottom-left"},an.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},an.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}};var on=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};on.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},on.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.maxZoom)throw new Error("maxZoom must be greater than minZoom");var n=new Fr(e.minZoom,e.maxZoom,e.renderWorldCopies);r.call(this,n,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new on;var i=e.transformRequest;if(this._transformRequest=i?function(t,e){return i(t,e)||{url:t}}:function(t){return{url:t}},"string"==typeof e.container){var a=t.default.document.getElementById(e.container);if(!a)throw new Error("Container '"+e.container+"' not found.");this._container=a}else{if(!(e.container instanceof ln))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored","_update","_render","_onData","_onDataLoading"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),void 0!==t.default&&(t.default.addEventListener("online",this._onWindowOnline,!1),t.default.addEventListener("resize",this._onWindowResize,!1)),function(t,e){var r=t.getCanvasContainer(),n=null,i=!1;for(var a in en)t[a]=new en[a](t,e),e.interactive&&e[a]&&t[a].enable(e[a]);s.addEventListener(r,"mouseout",function(e){t.fire(new Vr("mouseout",t,e))}),s.addEventListener(r,"mousedown",function(r){i=!0;var n=new Vr("mousedown",t,r);t.fire(n),n.defaultPrevented||(e.interactive&&!t.doubleClickZoom.isActive()&&t.stop(),t.boxZoom.onMouseDown(r),t.boxZoom.isActive()||t.dragPan.isActive()||t.dragRotate.onMouseDown(r),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onMouseDown(r))}),s.addEventListener(r,"mouseup",function(e){var r=t.dragRotate.isActive();n&&!r&&t.fire(new Vr("contextmenu",t,n)),n=null,i=!1,t.fire(new Vr("mouseup",t,e))}),s.addEventListener(r,"mousemove",function(e){if(!t.dragPan.isActive()&&!t.dragRotate.isActive()){for(var n=e.toElement||e.target;n&&n!==r;)n=n.parentNode;n===r&&t.fire(new Vr("mousemove",t,e))}}),s.addEventListener(r,"mouseover",function(e){for(var n=e.toElement||e.target;n&&n!==r;)n=n.parentNode;n===r&&t.fire(new Vr("mouseover",t,e))}),s.addEventListener(r,"touchstart",function(r){var n=new Ur("touchstart",t,r);t.fire(n),n.defaultPrevented||(e.interactive&&t.stop(),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(r),t.touchZoomRotate.onStart(r),t.doubleClickZoom.onTouchStart(n))},{passive:!1}),s.addEventListener(r,"touchmove",function(e){t.fire(new Ur("touchmove",t,e))},{passive:!1}),s.addEventListener(r,"touchend",function(e){t.fire(new Ur("touchend",t,e))}),s.addEventListener(r,"touchcancel",function(e){t.fire(new Ur("touchcancel",t,e))}),s.addEventListener(r,"click",function(e){t.fire(new Vr("click",t,e))}),s.addEventListener(r,"dblclick",function(e){var r=new Vr("dblclick",t,e);t.fire(r),r.defaultPrevented||t.doubleClickZoom.onDblClick(r)}),s.addEventListener(r,"contextmenu",function(e){var r=t.dragRotate.isActive();i||r?i&&(n=e):t.fire(new Vr("contextmenu",t,e)),e.preventDefault()}),s.addEventListener(r,"wheel",function(e){var r=new qr("wheel",t,e);t.fire(r),r.defaultPrevented||t.scrollZoom.onWheel(e)},{passive:!1})}(this,e),this._hash=e.hash&&(new jr).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),this.resize(),e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new nn),this.addControl(new an,e.logoPosition),this.on("style.load",function(){this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",this._onData),this.on("dataloading",this._onDataLoading)}r&&(n.__proto__=r),n.prototype=Object.create(r&&r.prototype),n.prototype.constructor=n;var i={showTileBoundaries:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0}};return n.prototype.addControl=function(t,e){void 0===e&&t.getDefaultPosition&&(e=t.getDefaultPosition()),void 0===e&&(e="top-right");var r=t.onAdd(this),n=this._controlPositions[e];return-1!==e.indexOf("bottom")?n.insertBefore(r,n.firstChild):n.appendChild(r),this},n.prototype.removeControl=function(t){return t.onRemove(this),this},n.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];return this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)).fire(new t.Event("resize",e)).fire(new t.Event("moveend",e))},n.prototype.getBounds=function(){var e=new W(this.transform.pointLocation(new t.default$1(0,this.transform.height)),this.transform.pointLocation(new t.default$1(this.transform.width,0)));return(this.transform.angle||this.transform.pitch)&&(e.extend(this.transform.pointLocation(new t.default$1(this.transform.size.x,0))),e.extend(this.transform.pointLocation(new t.default$1(0,this.transform.size.y)))),e},n.prototype.getMaxBounds=function(){return this.transform.latRange&&2===this.transform.latRange.length&&this.transform.lngRange&&2===this.transform.lngRange.length?new W([this.transform.lngRange[0],this.transform.latRange[0]],[this.transform.lngRange[1],this.transform.latRange[1]]):null},n.prototype.setMaxBounds=function(t){if(t){var e=W.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null==t&&(this.transform.lngRange=null,this.transform.latRange=null,this._update());return this},n.prototype.setMinZoom=function(t){if((t=null==t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},n.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},n.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update(),this},n.prototype.getMaxZoom=function(){return this.transform.maxZoom},n.prototype.project=function(t){return this.transform.locationPoint(G.convert(t))},n.prototype.unproject=function(e){return this.transform.pointLocation(t.default$1.convert(e))},n.prototype.isMoving=function(){return this._moving||this.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},n.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isActive()},n.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},n.prototype.on=function(t,e,n){var i,a=this;if(void 0===n)return r.prototype.on.call(this,t,e);var o=function(){if("mouseenter"===t||"mouseover"===t){var r=!1;return{layer:e,listener:n,delegates:{mousemove:function(i){var o=a.getLayer(e)?a.queryRenderedFeatures(i.point,{layers:[e]}):[];o.length?r||(r=!0,n.call(a,new Vr(t,a,i.originalEvent,{features:o}))):r=!1},mouseout:function(){r=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:n,delegates:{mousemove:function(r){(a.getLayer(e)?a.queryRenderedFeatures(r.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,n.call(a,new Vr(t,a,r.originalEvent)))},mouseout:function(e){o&&(o=!1,n.call(a,new Vr(t,a,e.originalEvent)))}}}}return{layer:e,listener:n,delegates:(i={},i[t]=function(t){var r=a.getLayer(e)?a.queryRenderedFeatures(t.point,{layers:[e]}):[];r.length&&(t.features=r,n.call(a,t),delete t.features)},i)}}();for(var s in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(o),o.delegates)a.on(s,o.delegates[s]);return this},n.prototype.off=function(t,e,n){if(void 0===n)return r.prototype.off.call(this,t,e);if(this._delegatedListeners&&this._delegatedListeners[t])for(var i=this._delegatedListeners[t],a=0;a180;){var o=r.locationPoint(t);if(o.x>=0&&o.y>=0&&o.x<=r.width&&o.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t}pn.prototype._rotateCompassArrow=function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t},pn.prototype.onAdd=function(t){return this._map=t,this.options.showCompass&&(this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Yr(t,{button:"left",element:this._compass}),this._handler.enable()),this._container},pn.prototype.onRemove=function(){s.remove(this._container),this.options.showCompass&&(this._map.off("rotate",this._rotateCompassArrow),this._handler.disable(),delete this._handler),delete this._map},pn.prototype._createButton=function(t,e,r){var n=s.create("button",t,this._container);return n.type="button",n.setAttribute("aria-label",e),n.addEventListener("click",r),n};var gn={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function mn(t,e,r){var n=t.classList;for(var i in gn)n.remove("mapboxgl-"+r+"-anchor-"+i);n.add("mapboxgl-"+r+"-anchor-"+e)}var vn=function(e){if((arguments[0]instanceof t.default.HTMLElement||2===arguments.length)&&(e=t.extend({element:e},arguments[1])),t.bindAll(["_update","_onMapClick"],this),this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",e&&e.element)this._element=e.element,this._offset=t.default$1.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=s.create("div");var r=s.createNS("http://www.w3.org/2000/svg","svg");r.setAttributeNS(null,"height","41px"),r.setAttributeNS(null,"width","27px"),r.setAttributeNS(null,"viewBox","0 0 27 41");var n=s.createNS("http://www.w3.org/2000/svg","g");n.setAttributeNS(null,"stroke","none"),n.setAttributeNS(null,"stroke-width","1"),n.setAttributeNS(null,"fill","none"),n.setAttributeNS(null,"fill-rule","evenodd");var i=s.createNS("http://www.w3.org/2000/svg","g");i.setAttributeNS(null,"fill-rule","nonzero");var a=s.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"transform","translate(3.0, 29.0)"),a.setAttributeNS(null,"fill","#000000");for(var o=0,l=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];o5280?Mn(e,c,f/5280,"mi"):Mn(e,c,f,"ft")}else r&&"nautical"===r.unit?Mn(e,c,h/1852,"nm"):Mn(e,c,h,"m")}function Mn(t,e,r,n){var i,a,o,s=(i=r,(a=Math.pow(10,(""+Math.floor(i)).length-1))*(o=(o=i/a)>=10?10:o>=5?5:o>=3?3:o>=2?2:1)),l=s/r;"m"===n&&s>=1e3&&(s/=1e3,n="km"),t.style.width=e*l+"px",t.innerHTML=s+n}wn.prototype.getDefaultPosition=function(){return"bottom-left"},wn.prototype._onMove=function(){kn(this._map,this._container,this.options)},wn.prototype.onAdd=function(t){return this._map=t,this._container=s.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},wn.prototype.onRemove=function(){s.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},wn.prototype.setUnit=function(t){this.options.unit=t,kn(this._map,this._container,this.options)};var An=function(){this._fullscreen=!1,t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.default.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.default.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.default.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.default.document&&(this._fullscreenchange="MSFullscreenChange"),this._className="mapboxgl-ctrl"};An.prototype.onAdd=function(e){return this._map=e,this._mapContainer=this._map.getContainer(),this._container=s.create("div",this._className+" mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._container.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._container},An.prototype.onRemove=function(){s.remove(this._container),this._map=null,t.default.document.removeEventListener(this._fullscreenchange,this._changeIcon)},An.prototype._checkFullscreenSupport=function(){return!!(t.default.document.fullscreenEnabled||t.default.document.mozFullScreenEnabled||t.default.document.msFullscreenEnabled||t.default.document.webkitFullscreenEnabled)},An.prototype._setupUI=function(){var e=this._fullscreenButton=s.create("button",this._className+"-icon "+this._className+"-fullscreen",this._container);e.setAttribute("aria-label","Toggle fullscreen"),e.type="button",this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.default.document.addEventListener(this._fullscreenchange,this._changeIcon)},An.prototype._isFullscreen=function(){return this._fullscreen},An.prototype._changeIcon=function(){(t.default.document.fullscreenElement||t.default.document.mozFullScreenElement||t.default.document.webkitFullscreenElement||t.default.document.msFullscreenElement)===this._mapContainer!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(this._className+"-shrink"),this._fullscreenButton.classList.toggle(this._className+"-fullscreen"))},An.prototype._onClickFullscreen=function(){this._isFullscreen()?t.default.document.exitFullscreen?t.default.document.exitFullscreen():t.default.document.mozCancelFullScreen?t.default.document.mozCancelFullScreen():t.default.document.msExitFullscreen?t.default.document.msExitFullscreen():t.default.document.webkitCancelFullScreen&&t.default.document.webkitCancelFullScreen():this._mapContainer.requestFullscreen?this._mapContainer.requestFullscreen():this._mapContainer.mozRequestFullScreen?this._mapContainer.mozRequestFullScreen():this._mapContainer.msRequestFullscreen?this._mapContainer.msRequestFullscreen():this._mapContainer.webkitRequestFullscreen&&this._mapContainer.webkitRequestFullscreen()};var Tn={closeButton:!0,closeOnClick:!0},Sn=function(e){function r(r){e.call(this),this.options=t.extend(Object.create(Tn),r),t.bindAll(["_update","_onClickClose"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.addTo=function(e){return this._map=e,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this.fire(new t.Event("open")),this},r.prototype.isOpen=function(){return!!this._map},r.prototype.remove=function(){return this._content&&s.remove(this._content),this._container&&(s.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire(new t.Event("close")),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(t){return this._lngLat=G.convert(t),this._pos=null,this._update(),this},r.prototype.setText=function(e){return this.setDOMContent(t.default.document.createTextNode(e))},r.prototype.setHTML=function(e){var r,n=t.default.document.createDocumentFragment(),i=t.default.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},r.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},r.prototype._createContent=function(){this._content&&s.remove(this._content),this._content=s.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=s.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},r.prototype._update=function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=s.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=s.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content)),this._map.transform.renderWorldCopies&&(this._lngLat=dn(this._lngLat,this._pos,this._map.transform));var e=this._pos=this._map.project(this._lngLat),r=this.options.anchor,n=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.default$1(0,0),top:new t.default$1(0,r),"top-left":new t.default$1(n,n),"top-right":new t.default$1(-n,n),bottom:new t.default$1(0,-r),"bottom-left":new t.default$1(n,-n),"bottom-right":new t.default$1(-n,-n),left:new t.default$1(r,0),right:new t.default$1(-r,0)}}if(r instanceof t.default$1||Array.isArray(r)){var i=t.default$1.convert(r);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.default$1.convert(r.center||[0,0]),top:t.default$1.convert(r.top||[0,0]),"top-left":t.default$1.convert(r["top-left"]||[0,0]),"top-right":t.default$1.convert(r["top-right"]||[0,0]),bottom:t.default$1.convert(r.bottom||[0,0]),"bottom-left":t.default$1.convert(r["bottom-left"]||[0,0]),"bottom-right":t.default$1.convert(r["bottom-right"]||[0,0]),left:t.default$1.convert(r.left||[0,0]),right:t.default$1.convert(r.right||[0,0])}}return e(new t.default$1(0,0))}(this.options.offset);if(!r){var i,a=this._container.offsetWidth,o=this._container.offsetHeight;i=e.y+n.bottom.ythis._map.transform.height-o?["bottom"]:[],e.xthis._map.transform.width-a/2&&i.push("right"),r=0===i.length?"bottom":i.join("-")}var l=e.add(n[r]).round();s.setTransform(this._container,gn[r]+" translate("+l.x+"px,"+l.y+"px)"),mn(this._container,r,"popup")}},r.prototype._onClickClose=function(){this.remove()},r}(t.Evented),En={version:"0.45.0",supported:e,workerCount:Math.max(Math.floor(a.hardwareConcurrency/2),1),setRTLTextPlugin:t.setRTLTextPlugin,Map:un,NavigationControl:pn,GeolocateControl:bn,AttributionControl:nn,ScaleControl:wn,FullscreenControl:An,Popup:Sn,Marker:vn,Style:Je,LngLat:G,LngLatBounds:W,Point:t.default$1,Evented:t.Evented,config:m,get accessToken(){return m.ACCESS_TOKEN},set accessToken(t){m.ACCESS_TOKEN=t},workerUrl:""};return En}),n})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],394:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1<p[1][2]&&(v[0]=-v[0]),p[0][2]>p[2][0]&&(v[1]=-v[1]),p[1][0]>p[0][1]&&(v[2]=-v[2]),!0}},{"./normalize":396,"gl-mat4/clone":248,"gl-mat4/create":249,"gl-mat4/determinant":250,"gl-mat4/invert":254,"gl-mat4/transpose":264,"gl-vec3/cross":314,"gl-vec3/dot":317,"gl-vec3/length":322,"gl-vec3/normalize":328}],396:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},{}],397:[function(t,e,r){var n=t("gl-vec3/lerp"),i=t("mat4-recompose"),a=t("mat4-decompose"),o=t("gl-mat4/determinant"),s=t("quat-slerp"),l=h(),c=h(),u=h();function h(){return{translate:f(),scale:f(1),skew:f(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function f(t){return[t||0,t||0,t||0]}e.exports=function(t,e,r,h){if(0===o(e)||0===o(r))return!1;var f=a(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),p=a(r,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!(!f||!p||(n(u.translate,l.translate,c.translate,h),n(u.skew,l.skew,c.skew,h),n(u.scale,l.scale,c.scale,h),n(u.perspective,l.perspective,c.perspective,h),s(u.quaternion,l.quaternion,c.quaternion,h),i(t,u.translate,u.scale,u.skew,u.perspective,u.quaternion),0))}},{"gl-mat4/determinant":250,"gl-vec3/lerp":323,"mat4-decompose":395,"mat4-recompose":398,"quat-slerp":450}],398:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},{"gl-mat4/create":249,"gl-mat4/fromRotationTranslation":252,"gl-mat4/identity":253,"gl-mat4/multiply":256,"gl-mat4/scale":262,"gl-mat4/translate":263}],399:[function(t,e,r){"use strict";e.exports=Math.log2||function(t){return Math.log(t)*Math.LOG2E}},{}],400:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),i=t("mat4-interpolate"),a=t("gl-mat4/invert"),o=t("gl-mat4/rotateX"),s=t("gl-mat4/rotateY"),l=t("gl-mat4/rotateZ"),c=t("gl-mat4/lookAt"),u=t("gl-mat4/translate"),h=(t("gl-mat4/scale"),t("gl-vec3/normalize")),f=[0,0,0];function p(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}e.exports=function(t){return new p((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var d=p.prototype;d.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,c=0;c<16;++c)o[c]=s[l++];else{var u=e[r+1]-e[r],f=(l=16*r,this.prevMatrix),p=!0;for(c=0;c<16;++c)f[c]=s[l++];var d=this.nextMatrix;for(c=0;c<16;++c)d[c]=s[l++],p=p&&f[c]===d[c];if(u<1e-6||p)for(c=0;c<16;++c)o[c]=f[c];else i(o,f,d,(t-e[r])/u)}var g=this.computedUp;g[0]=o[1],g[1]=o[5],g[2]=o[9],h(g,g);var m=this.computedInverse;a(m,o);var v=this.computedEye,y=m[15];v[0]=m[12]/y,v[1]=m[13]/y,v[2]=m[14]/y;var x=this.computedCenter,b=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)x[c]=v[c]-o[2+4*c]*b}},d.idle=function(t){if(!(t1&&n(t[o[u-2]],t[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(t[s[u-2]],t[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}for(var r=new Array(s.length+o.length-2),h=0,i=0,f=o.length;i0;--p)r[h++]=s[p];return r};var n=t("robust-orientation")[3]},{"robust-orientation":471}],402:[function(t,e,r){"use strict";e.exports=function(t,e){e||(e=t,t=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function c(t,s){var c=n.x(s),u=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||c!==i||u!==a||l(s))&&(r=0|t,i=c||0,a=u||0,e&&e(r,i,a,o))}function u(t){c(0,t)}function h(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function f(t){l(t)&&e&&e(r,i,a,o)}function p(t){0===n.buttons(t)?c(0,t):c(r,t)}function d(t){c(r|n.buttons(t),t)}function g(t){c(r&~n.buttons(t),t)}function m(){s||(s=!0,t.addEventListener("mousemove",p),t.addEventListener("mousedown",d),t.addEventListener("mouseup",g),t.addEventListener("mouseleave",u),t.addEventListener("mouseenter",u),t.addEventListener("mouseout",u),t.addEventListener("mouseover",u),t.addEventListener("blur",h),t.addEventListener("keyup",f),t.addEventListener("keydown",f),t.addEventListener("keypress",f),t!==window&&(window.addEventListener("blur",h),window.addEventListener("keyup",f),window.addEventListener("keydown",f),window.addEventListener("keypress",f)))}m();var v={element:t};return Object.defineProperties(v,{enabled:{get:function(){return s},set:function(e){e?m():s&&(s=!1,t.removeEventListener("mousemove",p),t.removeEventListener("mousedown",d),t.removeEventListener("mouseup",g),t.removeEventListener("mouseleave",u),t.removeEventListener("mouseenter",u),t.removeEventListener("mouseout",u),t.removeEventListener("mouseover",u),t.removeEventListener("blur",h),t.removeEventListener("keyup",f),t.removeEventListener("keydown",f),t.removeEventListener("keypress",f),t!==window&&(window.removeEventListener("blur",h),window.removeEventListener("keyup",f),window.removeEventListener("keydown",f),window.removeEventListener("keypress",f)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),v};var n=t("mouse-event")},{"mouse-event":404}],403:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=(s=e,s===window||s===document||s===document.body?n:s.getBoundingClientRect());var s;return r[0]=i-o.left,r[1]=a-o.top,r}},{}],404:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1< 0");"function"!=typeof t.vertex&&e("Must specify vertex creation function");"function"!=typeof t.cell&&e("Must specify cell creation function");"function"!=typeof t.phase&&e("Must specify phase function");for(var E=t.getters||[],C=new Array(T),L=0;L=0?C[L]=!0:C[L]=!1;return function(t,e,r,T,S,E){var C=E.length,L=S.length;if(L<2)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var z="extractContour"+S.join("_"),P=[],I=[],O=[],D=0;D0&&N.push(l(D,S[R-1])+"*"+s(S[R-1])),I.push(d(D,S[R])+"=("+N.join("-")+")|0")}for(var D=0;D=0;--D)j.push(s(S[D]));I.push(w+"=("+j.join("*")+")|0",b+"=mallocUint32("+w+")",x+"=mallocUint32("+w+")",k+"=0"),I.push(g(0)+"=0");for(var R=1;R<1<0;M=M-1&d)w.push(x+"["+k+"+"+v(M)+"]");w.push(y(0));for(var M=0;M=0;--e)G(e,0);for(var r=[],e=0;e0){",p(S[e]),"=1;");t(e-1,r|1<=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),a.push("1"),o.push("s["+l+"]-2"));var c=".lo("+a.join()+").hi("+o.join()+")";if(0===a.length&&(c=""),i>0){n.push("if(1");for(var l=0;l=0||e.indexOf(-(l+1))>=0||n.push("&&s[",l,"]>2");n.push("){grad",i,"(src.pick(",s.join(),")",c);for(var l=0;l=0||e.indexOf(-(l+1))>=0||n.push(",dst.pick(",s.join(),",",l,")",c);n.push(");")}for(var l=0;l1){dst.set(",s.join(),",",u,",0.5*(src.get(",f.join(),")-src.get(",p.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):n.push("if(s[",u,"]>1){diff(",h,",src.pick(",f.join(),")",c,",src.pick(",p.join(),")",c,");}else{zero(",h,");};");break;case"mirror":0===i?n.push("dst.set(",s.join(),",",u,",0);"):n.push("zero(",h,");");break;case"wrap":var d=s.slice(),g=s.slice();e[l]<0?(d[u]="s["+u+"]-2",g[u]="0"):(d[u]="s["+u+"]-1",g[u]="1"),0===i?n.push("if(s[",u,"]>2){dst.set(",s.join(),",",u,",0.5*(src.get(",d.join(),")-src.get(",g.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):n.push("if(s[",u,"]>2){diff(",h,",src.pick(",d.join(),")",c,",src.pick(",g.join(),")",c,");}else{zero(",h,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}i>0&&n.push("};")}for(var s=0;s<1<>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var e=l[t];r[t]=o({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var u=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=n({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=n({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=o({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=n({args:["array","array"],pre:i,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":133}],412:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":413,ndarray:417}],413:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":133}],414:[function(t,e,r){"use strict";var n=t("typedarray-pool"),i=32;function a(t){switch(t){case"uint8":return[n.mallocUint8,n.freeUint8];case"uint16":return[n.mallocUint16,n.freeUint16];case"uint32":return[n.mallocUint32,n.freeUint32];case"int8":return[n.mallocInt8,n.freeInt8];case"int16":return[n.mallocInt16,n.freeInt16];case"int32":return[n.mallocInt32,n.freeInt32];case"float32":return[n.mallocFloat,n.freeFloat];case"float64":return[n.mallocDouble,n.freeDouble];default:return null}}function o(t){for(var e=[],r=0;r0?s.push(["d",d,"=s",d,"-d",h,"*n",h].join("")):s.push(["d",d,"=s",d].join("")),h=d),0!=(p=t.length-1-l)&&(f>0?s.push(["e",p,"=s",p,"-e",f,"*n",f,",f",p,"=",c[p],"-f",f,"*n",f].join("")):s.push(["e",p,"=s",p,",f",p,"=",c[p]].join("")),f=p)}r.push("var "+s.join(","));var g=["0","n0-1","data","offset"].concat(o(t.length));r.push(["if(n0<=",i,"){","insertionSort(",g.join(","),")}else{","quickSort(",g.join(","),")}"].join("")),r.push("}return "+n);var m=new Function("insertionSort","quickSort",r.join("\n")),v=function(t,e){var r=["'use strict'"],n=["ndarrayInsertionSort",t.join("d"),e].join(""),i=["left","right","data","offset"].concat(o(t.length)),s=a(e),l=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var c=[],u=1;u1){for(r.push("dptr=0;sptr=ptr"),u=t.length-1;u>=0;--u)0!==(p=t[u])&&r.push(["for(i",p,"=0;i",p,"b){break __l}"].join("")),u=t.length-1;u>=1;--u)r.push("sptr+=e"+u,"dptr+=f"+u,"}");for(r.push("dptr=cptr;sptr=cptr-s0"),u=t.length-1;u>=0;--u)0!==(p=t[u])&&r.push(["for(i",p,"=0;i",p,"=0;--u)0!==(p=t[u])&&r.push(["for(i",p,"=0;i",p,"scratch)){",f("cptr",h("cptr-s0")),"cptr-=s0","}",f("cptr","scratch"));return r.push("}"),t.length>1&&s&&r.push("free(scratch)"),r.push("} return "+n),s?new Function("malloc","free",r.join("\n"))(s[0],s[1]):new Function(r.join("\n"))()}(t,e),y=function(t,e,r){var n=["'use strict'"],s=["ndarrayQuickSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(o(t.length)),c=a(e),u=0;n.push(["function ",s,"(",l.join(","),"){"].join(""));var h=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var f=[],p=1;p=0;--a)0!==(o=t[a])&&n.push(["for(i",o,"=0;i",o,"1)for(a=0;a1?n.push("ptr_shift+=d"+o):n.push("ptr0+=d"+o),n.push("}"))}}function y(e,r,i,a){if(1===r.length)n.push("ptr0="+d(r[0]));else{for(var o=0;o1)for(o=0;o=1;--o)i&&n.push("pivot_ptr+=f"+o),r.length>1?n.push("ptr_shift+=e"+o):n.push("ptr0+=e"+o),n.push("}")}function x(){t.length>1&&c&&n.push("free(pivot1)","free(pivot2)")}function b(e,r){var i="el"+e,a="el"+r;if(t.length>1){var o="__l"+ ++u;y(o,[i,a],!1,["comp=",g("ptr0"),"-",g("ptr1"),"\n","if(comp>0){tmp0=",i,";",i,"=",a,";",a,"=tmp0;break ",o,"}\n","if(comp<0){break ",o,"}"].join(""))}else n.push(["if(",g(d(i)),">",g(d(a)),"){tmp0=",i,";",i,"=",a,";",a,"=tmp0}"].join(""))}function _(e,r){t.length>1?v([e,r],!1,m("ptr0",g("ptr1"))):n.push(m(d(e),g(d(r))))}function w(e,r,i){if(t.length>1){var a="__l"+ ++u;y(a,[r],!0,[e,"=",g("ptr0"),"-pivot",i,"[pivot_ptr]\n","if(",e,"!==0){break ",a,"}"].join(""))}else n.push([e,"=",g(d(r)),"-pivot",i].join(""))}function k(e,r){t.length>1?v([e,r],!1,["tmp=",g("ptr0"),"\n",m("ptr0",g("ptr1")),"\n",m("ptr1","tmp")].join("")):n.push(["ptr0=",d(e),"\n","ptr1=",d(r),"\n","tmp=",g("ptr0"),"\n",m("ptr0",g("ptr1")),"\n",m("ptr1","tmp")].join(""))}function M(e,r,i){t.length>1?(v([e,r,i],!1,["tmp=",g("ptr0"),"\n",m("ptr0",g("ptr1")),"\n",m("ptr1",g("ptr2")),"\n",m("ptr2","tmp")].join("")),n.push("++"+r,"--"+i)):n.push(["ptr0=",d(e),"\n","ptr1=",d(r),"\n","ptr2=",d(i),"\n","++",r,"\n","--",i,"\n","tmp=",g("ptr0"),"\n",m("ptr0",g("ptr1")),"\n",m("ptr1",g("ptr2")),"\n",m("ptr2","tmp")].join(""))}function A(t,e){k(t,e),n.push("--"+e)}function T(e,r,i){t.length>1?v([e,r],!0,[m("ptr0",g("ptr1")),"\n",m("ptr1",["pivot",i,"[pivot_ptr]"].join(""))].join("")):n.push(m(d(e),g(d(r))),m(d(r),"pivot"+i))}function S(e,r){n.push(["if((",r,"-",e,")<=",i,"){\n","insertionSort(",e,",",r,",data,offset,",o(t.length).join(","),")\n","}else{\n",s,"(",e,",",r,",data,offset,",o(t.length).join(","),")\n","}"].join(""))}function E(e,r,i){t.length>1?(n.push(["__l",++u,":while(true){"].join("")),v([e],!0,["if(",g("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",u,"}"].join("")),n.push(i,"}")):n.push(["while(",g(d(e)),"===pivot",r,"){",i,"}"].join(""))}return n.push("var "+h.join(",")),b(1,2),b(4,5),b(1,3),b(2,3),b(1,4),b(3,4),b(2,5),b(2,3),b(4,5),t.length>1?v(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",g("ptr1"),"\n","pivot2[pivot_ptr]=",g("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",g("ptr0"),"\n","y=",g("ptr2"),"\n","z=",g("ptr4"),"\n",m("ptr5","x"),"\n",m("ptr6","y"),"\n",m("ptr7","z")].join("")):n.push(["pivot1=",g(d("el2")),"\n","pivot2=",g(d("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",g(d("el1")),"\n","y=",g(d("el3")),"\n","z=",g(d("el5")),"\n",m(d("index1"),"x"),"\n",m(d("index3"),"y"),"\n",m(d("index5"),"z")].join("")),_("index2","left"),_("index4","right"),n.push("if(pivots_are_equal){"),n.push("for(k=less;k<=great;++k){"),w("comp","k",1),n.push("if(comp===0){continue}"),n.push("if(comp<0){"),n.push("if(k!==less){"),k("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),n.push("while(true){"),w("comp","great",1),n.push("if(comp>0){"),n.push("great--"),n.push("}else if(comp<0){"),M("k","less","great"),n.push("break"),n.push("}else{"),A("k","great"),n.push("break"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),n.push("}else{"),n.push("for(k=less;k<=great;++k){"),w("comp_pivot1","k",1),n.push("if(comp_pivot1<0){"),n.push("if(k!==less){"),k("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),w("comp_pivot2","k",2),n.push("if(comp_pivot2>0){"),n.push("while(true){"),w("comp","great",2),n.push("if(comp>0){"),n.push("if(--greatindex5){"),E("less",1,"++less"),E("great",2,"--great"),n.push("for(k=less;k<=great;++k){"),w("comp_pivot1","k",1),n.push("if(comp_pivot1===0){"),n.push("if(k!==less){"),k("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),w("comp_pivot2","k",2),n.push("if(comp_pivot2===0){"),n.push("while(true){"),w("comp","great",2),n.push("if(comp===0){"),n.push("if(--great1&&c?new Function("insertionSort","malloc","free",n.join("\n"))(r,c[0],c[1]):new Function("insertionSort",n.join("\n"))(r)}(t,e,v);return m(v,y)}},{"typedarray-pool":507}],415:[function(t,e,r){"use strict";var n=t("./lib/compile_sort.js"),i={};e.exports=function(t){var e=t.order,r=t.dtype,a=[e,r].join(":"),o=i[a];return o||(i[a]=o=n(e,r)),o(t),t}},{"./lib/compile_sort.js":414}],416:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_3_arg4_)}",args:[{name:"_inline_3_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_3_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_4_arg2_(this_warped,_inline_4_arg0_),_inline_4_arg1_=_inline_4_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_4_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_4_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_4_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_7_arg2_(this_warped,_inline_7_arg0_),_inline_7_arg1_=_inline_7_arg3_(_inline_7_arg4_,this_warped[0])}",args:[{name:"_inline_7_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_7_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_(_inline_10_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":136,"ndarray-linear-interpolate":410}],417:[function(t,e,r){var n=t("iota-array"),i=t("is-buffer"),a="undefined"!=typeof Float64Array;function o(t,e){return t[0]-e[0]}function s(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+l.join(",")+",v){"),i?a.push("return this.data.set("+u+",v)}"):a.push("return this.data["+u+"]=v}"),a.push("proto.get=function "+r+"_get("+l.join(",")+"){"),i?a.push("return this.data.get("+u+")}"):a.push("return this.data["+u+"]}"),a.push("proto.index=function "+r+"_index(",l.join(),"){return "+u+"}"),a.push("proto.hi=function "+r+"_hi("+l.join(",")+"){return new "+r+"(this.data,"+o.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+o.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var p=o.map(function(t){return"a"+t+"=this.shape["+t+"]"}),d=o.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+d.join(","));for(var g=0;g=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");a.push("return new "+r+"(this.data,"+o.map(function(t){return"a"+t}).join(",")+","+o.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+l.join(",")+"){var "+o.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+o.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(g=0;g=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");return a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+o.map(function(t){return"shape["+t+"]"}).join(",")+","+o.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",a.join("\n"))(c[t],s)}var c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,u=1;s>=0;--s)r[s]=u,u*=e[s]}if(void 0===n)for(n=0,s=0;s>>0;e.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-i:i;var r=n.hi(t),o=n.lo(t);e>t==t>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1;return n.pack(o,r)}},{"double-bits":151}],419:[function(t,e,r){var n=Math.PI,i=c(120);function a(t,e,r,n){return["C",t,e,r,n,r,n]}function o(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}function s(t,e,r,a,o,c,u,h,f,p){if(p)k=p[0],M=p[1],_=p[2],w=p[3];else{var d=l(t,e,-o);t=d.x,e=d.y;var g=(t-(h=(d=l(h,f,-o)).x))/2,m=(e-(f=d.y))/2,v=g*g/(r*r)+m*m/(a*a);v>1&&(r*=v=Math.sqrt(v),a*=v);var y=r*r,x=a*a,b=(c==u?-1:1)*Math.sqrt(Math.abs((y*x-y*m*m-x*g*g)/(y*m*m+x*g*g)));b==1/0&&(b=1);var _=b*r*m/a+(t+h)/2,w=b*-a*g/r+(e+f)/2,k=Math.asin(((e-w)/a).toFixed(9)),M=Math.asin(((f-w)/a).toFixed(9));(k=t<_?n-k:k)<0&&(k=2*n+k),(M=h<_?n-M:M)<0&&(M=2*n+M),u&&k>M&&(k-=2*n),!u&&M>k&&(M-=2*n)}if(Math.abs(M-k)>i){var A=M,T=h,S=f;M=k+i*(u&&M>k?1:-1);var E=s(h=_+r*Math.cos(M),f=w+a*Math.sin(M),r,a,o,0,u,T,S,[M,A,_,w])}var C=Math.tan((M-k)/4),L=4/3*r*C,z=4/3*a*C,P=[2*t-(t+L*Math.sin(k)),2*e-(e-z*Math.cos(k)),h+L*Math.sin(M),f-z*Math.cos(M),h,f];if(p)return P;E&&(P=P.concat(E));for(var I=0;I7&&(r.push(v.splice(0,7)),v.unshift("C"));break;case"S":var x=p,b=d;"C"!=e&&"S"!=e||(x+=x-n,b+=b-i),v=["C",x,b,v[1],v[2],v[3],v[4]];break;case"T":"Q"==e||"T"==e?(h=2*p-h,f=2*d-f):(h=p,f=d),v=o(p,d,h,f,v[1],v[2]);break;case"Q":h=v[1],f=v[2],v=o(p,d,v[1],v[2],v[3],v[4]);break;case"L":v=a(p,d,v[1],v[2]);break;case"H":v=a(p,d,v[1],d);break;case"V":v=a(p,d,p,v[1]);break;case"Z":v=a(p,d,l,u)}e=y,p=v[v.length-2],d=v[v.length-1],v.length>4?(n=v[v.length-4],i=v[v.length-3]):(n=p,i=d),r.push(v)}return r}},{}],420:[function(t,e,r){r.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa){var b=i[c],_=1/Math.sqrt(m*y);for(x=0;x<3;++x){var w=(x+1)%3,k=(x+2)%3;b[x]+=_*(v[w]*g[k]-v[k]*g[w])}}}for(o=0;oa)for(_=1/Math.sqrt(M),x=0;x<3;++x)b[x]*=_;else for(x=0;x<3;++x)b[x]=0}return i},r.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(p):0;for(c=0;c<3;++c)f[c]*=p;i[o]=f}return i}},{}],421:[function(t,e,r){"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,o,s=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;l0){var h=Math.sqrt(u+1);t[0]=.5*(o-l)/h,t[1]=.5*(s-n)/h,t[2]=.5*(r-a)/h,t[3]=.5*h}else{var f=Math.max(e,a,c),h=Math.sqrt(2*f-u+1);e>=f?(t[0]=.5*h,t[1]=.5*(i+r)/h,t[2]=.5*(s+n)/h,t[3]=.5*(o-l)/h):a>=f?(t[0]=.5*(r+i)/h,t[1]=.5*h,t[2]=.5*(l+o)/h,t[3]=.5*(s-n)/h):(t[0]=.5*(n+s)/h,t[1]=.5*(o+l)/h,t[2]=.5*h,t[3]=.5*(r-i)/h)}return t}},{}],423:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),u(r=[].slice.call(r,0,4),r);var i=new h(r,e,Math.log(n));i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up);return i};var n=t("filtered-vector"),i=t("gl-mat4/lookAt"),a=t("gl-mat4/fromQuat"),o=t("gl-mat4/invert"),s=t("./lib/quatFromFrame");function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function c(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function u(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=c(r,n,i,a);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=i/o,t[3]=a/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function h(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var f=h.prototype;f.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},f.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;u(e,e);var r=this.computedMatrix;a(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var c=0,h=0;h<3;++h)c+=r[l+4*h]*i[h];r[12+l]=-c}},f.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},f.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},f.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},f.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],c=l(a,o,s);a/=c,o/=c,s/=c;var u=i[0],h=i[4],f=i[8],p=u*a+h*o+f*s,d=l(u-=a*p,h-=o*p,f-=s*p);u/=d,h/=d,f/=d;var g=i[2],m=i[6],v=i[10],y=g*a+m*o+v*s,x=g*u+m*h+v*f,b=l(g-=y*a+x*u,m-=y*o+x*h,v-=y*s+x*f);g/=b,m/=b,v/=b;var _=u*e+a*r,w=h*e+o*r,k=f*e+s*r;this.center.move(t,_,w,k);var M=Math.exp(this.computedRadius[0]);M=Math.max(1e-4,M+n),this.radius.set(t,Math.log(M))},f.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],u=i[1],h=i[5],f=i[9],p=i[2],d=i[6],g=i[10],m=e*a+r*u,v=e*o+r*h,y=e*s+r*f,x=-(d*y-g*v),b=-(g*m-p*y),_=-(p*v-d*m),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),k=c(x,b,_,w);k>1e-6?(x/=k,b/=k,_/=k,w/=k):(x=b=_=0,w=1);var M=this.computedRotation,A=M[0],T=M[1],S=M[2],E=M[3],C=A*w+E*x+T*_-S*b,L=T*w+E*b+S*x-A*_,z=S*w+E*_+A*b-T*x,P=E*w-A*x-T*b-S*_;if(n){x=p,b=d,_=g;var I=Math.sin(n)/l(x,b,_);x*=I,b*=I,_*=I,P=P*(w=Math.cos(e))-(C=C*w+P*x+L*_-z*b)*x-(L=L*w+P*b+z*x-C*_)*b-(z=z*w+P*_+C*b-L*x)*_}var O=c(C,L,z,P);O>1e-6?(C/=O,L/=O,z/=O,P/=O):(C=L=z=0,P=1),this.rotation.set(t,C,L,z,P)},f.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,e,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),u(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,c=0;c<3;++c)l+=Math.pow(r[c]-e[c],2);this.radius.set(t,.5*Math.log(Math.max(l,1e-6))),this.center.set(t,r[0],r[1],r[2])},f.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},f.setMatrix=function(t,e){var r=this.computedRotation;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),u(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,e);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,c=n[14]/i;this.recalcMatrix(t);var h=Math.exp(this.computedRadius[0]);this.center.set(t,a-n[2]*h,l-n[6]*h,c-n[10]*h),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},f.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},f.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},f.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},f.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},f.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":422,"filtered-vector":215,"gl-mat4/fromQuat":251,"gl-mat4/invert":254,"gl-mat4/lookAt":255}],424:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return n(r=void 0!==r?r+"":" ",e)+t}},{"repeat-string":464}],425:[function(t,e,r){"use strict";function n(t,e){if("string"!=typeof t)return[t];var r=[t];"string"==typeof e||Array.isArray(e)?e={brackets:e}:e||(e={});var n=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],i=e.escape||"___",a=!!e.flat;n.forEach(function(t){var e=new RegExp(["\\",t[0],"[^\\",t[0],"\\",t[1],"]*\\",t[1]].join("")),n=[];function a(e,a,o){var s=r.push(e.slice(t[0].length,-t[1].length))-1;return n.push(s),i+s}r.forEach(function(t,n){for(var i,o=0;t!=i;)if(i=t,t=t.replace(e,a),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=t}),n=n.reverse(),r=r.map(function(e){return n.forEach(function(r){e=e.replace(new RegExp("(\\"+i+r+"(?![0-9]))","g"),t[0]+"$1"+t[1])}),e})});var o=new RegExp("\\"+i+"([0-9]+)");return a?r:function t(e,r,n){for(var i,a=[],s=0;i=o.exec(e);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(e.slice(0,i.index)),a.push(t(r[i[1]],r)),e=e.slice(i.index+i[0].length)}return a.push(e),a}(r[0],r)}function i(t,e){if(e&&e.flat){var r,n=e&&e.escape||"___",i=t[0];if(!i)return"";for(var a=new RegExp("\\"+n+"([0-9]+)"),o=0;i!=r;){if(o++>1e4)throw Error("Circular references in "+t);r=i,i=i.replace(a,s)}return i}return t.reduce(function t(e,r){return Array.isArray(r)&&(r=r.reduce(t,"")),e+r},"");function s(e,r){if(null==t[r])throw Error("Reference "+r+"is undefined");return t[r]}}function a(t,e){return Array.isArray(t)?i(t,e):n(t,e)}a.parse=n,a.stringify=i,e.exports=a},{}],426:[function(t,e,r){"use strict";var n=t("pick-by-alias");e.exports=function(t){var e;arguments.length>1&&(t=arguments);"string"==typeof t?t=t.split(/\s/).map(parseFloat):"number"==typeof t&&(t=[t]);t.length&&"number"==typeof t[0]?e=1===t.length?{width:t[0],height:t[0],x:0,y:0}:2===t.length?{width:t[0],height:t[1],x:0,y:0}:{x:t[0],y:t[1],width:t[2]-t[0]||0,height:t[3]-t[1]||0}:t&&(t=n(t,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),e={x:t.left||0,y:t.top||0},null==t.width?t.right?e.width=t.right-e.x:e.width=0:e.width=t.width,null==t.height?t.bottom?e.height=t.bottom-e.y:e.height=0:e.height=t.height);return e}},{"pick-by-alias":432}],427:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(i,function(t,r,i){var o=r.toLowerCase();for(i=function(t){var e=t.match(a);return e?e.map(Number):[]}(i),"m"==o&&i.length>2&&(e.push([r].concat(i.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(i.length==n[o])return i.unshift(r),e.push(i);if(i.length0;--o)a=l[o],r=s[o],s[o]=s[a],s[a]=r,l[o]=l[r],l[r]=a,c=(c+r)*o;return n.freeUint32(l),n.freeUint32(s),c},r.unrank=function(t,e,r){switch(t){case 0:return r||[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}var n,i,a,o=1;for((r=r||new Array(t))[0]=0,a=1;a0;--a)e=e-(n=e/o|0)*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}},{"invert-permutation":383,"typedarray-pool":507}],432:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n,a,o={};if("string"==typeof e&&(e=i(e)),Array.isArray(e)){var s={};for(a=0;a0){o=a[u][r][0],l=u;break}s=o[1^l];for(var h=0;h<2;++h)for(var f=a[h][r],p=0;p0&&(o=d,s=g,l=h)}return i?s:(o&&c(o,l),s)}function h(t,r){var i=a[r][t][0],o=[t];c(i,r);for(var s=i[1^r];;){for(;s!==t;)o.push(s),s=u(o[o.length-2],s,!1);if(a[0][t].length+a[1][t].length===0)break;var l=o[o.length-1],h=t,f=o[1],p=u(l,h,!0);if(n(e[l],e[h],e[f],e[p])<0)break;o.push(t),s=u(l,h)}return o}function f(t,e){return e[1]===e[e.length-1]}for(var o=0;o0;){a[0][o].length;var g=h(o,p);f(d,g)?d.push.apply(d,g):(d.length>0&&l.push(d),d=g)}d.length>0&&l.push(d)}return l};var n=t("compare-angle")},{"compare-angle":114}],434:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=n(t,e.length),i=new Array(e.length),a=new Array(e.length),o=[],s=0;s0;){var c=o.pop();i[c]=!1;for(var u=r[c],s=0;s0})).length,m=new Array(g),v=new Array(g),p=0;p0;){var N=B.pop(),j=C[N];l(j,function(t,e){return t-e});var V,U=j.length,q=F[N];if(0===q){var k=d[N];V=[k]}for(var p=0;p=0)&&(F[H]=1^q,B.push(H),0===q)){var k=d[H];R(k)||(k.reverse(),V.push(k))}}0===q&&r.push(V)}return r};var n=t("edges-to-adjacency-list"),i=t("planar-dual"),a=t("point-in-big-polygon"),o=t("two-product"),s=t("robust-sum"),l=t("uniq"),c=t("./lib/trim-leaves");function u(t,e){for(var r=new Array(t),n=0;n>>1;e.dtype||(e.dtype="array"),"string"==typeof e.dtype?d=new(h(e.dtype))(m):e.dtype&&(d=e.dtype,Array.isArray(d)&&(d.length=m));for(var v=0;vr){for(var f=0;fl||A>c||T=C||o===s)){var u=y[a];void 0===s&&(s=u.length);for(var h=o;h=g&&p<=v&&d>=m&&d<=w&&z.push(f)}var b=x[a],_=b[4*o+0],k=b[4*o+1],E=b[4*o+2],L=b[4*o+3],P=function(t,e){for(var r=null,n=0;null===r;)if(r=t[4*e+n],++n>t.length)return null;return r}(b,o+1),I=.5*i,O=a+1;e(r,n,I,O,_,k||E||L||P),e(r,n+I,I,O,k,E||L||P),e(r+I,n,I,O,E,L||P),e(r+I,n+I,I,O,L,P)}}}(0,0,1,0,0,1),z},d;function E(t,e,r){for(var n=1,i=.5,a=.5,o=.5,s=0;s0&&e[i]===r[0]))return 1;a=t[i-1]}for(var s=1;a;){var l=a.key,c=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,a=a.right}else if(c>0)a=a.left;else{if(!(c<0))return 0;s=1,a=a.right}}return s}}(v.slabs,v.coordinates);return 0===a.length?y:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(a),y)};var n=t("robust-orientation")[3],i=t("slab-decomposition"),a=t("interval-tree-1d"),o=t("binary-search-bounds");function s(){return!0}function l(t){for(var e={},r=0;r=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],443:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),i=1;i0})}function u(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var h=e.linesIntersect(o,s,c,u);if(!1===h){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var f=e.pointsSame(o,c),p=e.pointsSame(s,u);if(f&&p)return n;var d=!f&&e.pointBetween(o,c,u),g=!p&&e.pointBetween(s,c,u);if(f)return g?l(n,s):l(t,u),n;d&&(p||(g?l(n,s):l(t,u)),l(n,o))}else 0===h.alongA&&(-1===h.alongB?l(t,c):0===h.alongB?l(t,h.pt):1===h.alongB&&l(t,u)),0===h.alongB&&(-1===h.alongA?l(n,o):0===h.alongA?l(n,h.pt):1===h.alongA&&l(n,s));return!1}for(var h=[];!a.isEmpty();){var f=a.getHead();if(r&&r.vert(f.pt[0]),f.isStart){r&&r.segmentNew(f.seg,f.primary);var p=c(f),d=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function m(){if(d){var t=u(f,d);if(t)return t}return!!g&&u(f,g)}r&&r.tempStatus(f.seg,!!d&&d.seg,!!g&&g.seg);var v,y,x=m();if(x)t?(y=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below)&&(x.seg.myFill.above=!x.seg.myFill.above):x.seg.otherFill=f.seg.myFill,r&&r.segmentUpdate(x.seg),f.other.remove(),f.remove();if(a.getHead()!==f){r&&r.rewind(f.seg);continue}t?(y=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below,f.seg.myFill.below=g?g.seg.myFill.above:i,f.seg.myFill.above=y?!f.seg.myFill.below:f.seg.myFill.below):null===f.seg.otherFill&&(v=g?f.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:f.primary?o:i,f.seg.otherFill={above:v,below:v}),r&&r.status(f.seg,!!d&&d.seg,!!g&&g.seg),f.other.status=p.insert(n.node({ev:f}))}else{var b=f.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(b.prev)&&s.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!f.primary){var _=f.seg.myFill;f.seg.myFill=f.seg.otherFill,f.seg.otherFill=_}h.push(f.seg)}a.getHead().remove()}return r&&r.done(),h}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l=c?(M=1,y=c+2*f+d):y=f*(M=-f/c)+d):(M=0,p>=0?(A=0,y=d):-p>=h?(A=1,y=h+2*p+d):y=p*(A=-p/h)+d);else if(A<0)A=0,f>=0?(M=0,y=d):-f>=c?(M=1,y=c+2*f+d):y=f*(M=-f/c)+d;else{var T=1/k;y=(M*=T)*(c*M+u*(A*=T)+2*f)+A*(u*M+h*A+2*p)+d}else M<0?(b=h+p)>(x=u+f)?(_=b-x)>=(w=c-2*u+h)?(M=1,A=0,y=c+2*f+d):y=(M=_/w)*(c*M+u*(A=1-M)+2*f)+A*(u*M+h*A+2*p)+d:(M=0,b<=0?(A=1,y=h+2*p+d):p>=0?(A=0,y=d):y=p*(A=-p/h)+d):A<0?(b=c+f)>(x=u+p)?(_=b-x)>=(w=c-2*u+h)?(A=1,M=0,y=h+2*p+d):y=(M=1-(A=_/w))*(c*M+u*A+2*f)+A*(u*M+h*A+2*p)+d:(A=0,b<=0?(M=1,y=c+2*f+d):f>=0?(M=0,y=d):y=f*(M=-f/c)+d):(_=h+p-u-f)<=0?(M=0,A=1,y=h+2*p+d):_>=(w=c-2*u+h)?(M=1,A=0,y=c+2*f+d):y=(M=_/w)*(c*M+u*(A=1-M)+2*f)+A*(u*M+h*A+2*p)+d;var S=1-M-A;for(l=0;l1)for(var r=1;r0){var c=t[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":99,"compare-cell":115,"compare-oriented-cell":116}],457:[function(t,e,r){"use strict";var n=t("array-bounds"),i=t("color-normalize"),a=t("update-diff"),o=t("pick-by-alias"),s=t("object-assign"),l=t("flatten-vertex-data"),c=t("to-float32"),u=c.float32,h=c.fract32;e.exports=function(t,e){"function"==typeof t?(e||(e={}),e.regl=t):e=t;e.length&&(e.positions=e);if(!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");var r,c,p,d,g,m,v=t._gl,y={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},x=[];return d=t.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),c=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),p=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),m=t.buffer({usage:"static",type:"float",data:f}),k(e),r=t({vert:"\n\t\tprecision highp float;\n\n\t\tattribute vec2 position, positionFract;\n\t\tattribute vec4 error;\n\t\tattribute vec4 color;\n\n\t\tattribute vec2 direction, lineOffset, capOffset;\n\n\t\tuniform vec4 viewport;\n\t\tuniform float lineWidth, capSize;\n\t\tuniform vec2 scale, scaleFract, translate, translateFract;\n\n\t\tvarying vec4 fragColor;\n\n\t\tvoid main() {\n\t\t\tfragColor = color / 255.;\n\n\t\t\tvec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;\n\n\t\t\tvec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;\n\n\t\t\tvec2 position = position + dxy;\n\n\t\t\tvec2 pos = (position + translate) * scale\n\t\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t\t+ (position + translate) * scaleFract\n\t\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n\t\t\tpos += pixelOffset / viewport.zw;\n\n\t\t\tgl_Position = vec4(pos * 2. - 1., 0, 1);\n\t\t}\n\t\t",frag:"\n\t\tprecision mediump float;\n\n\t\tvarying vec4 fragColor;\n\n\t\tuniform float opacity;\n\n\t\tvoid main() {\n\t\t\tgl_FragColor = fragColor;\n\t\t\tgl_FragColor.a *= opacity;\n\t\t}\n\t\t",uniforms:{range:t.prop("range"),lineWidth:t.prop("lineWidth"),capSize:t.prop("capSize"),opacity:t.prop("opacity"),scale:t.prop("scale"),translate:t.prop("translate"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{color:{buffer:d,offset:function(t,e){return 4*e.offset},divisor:1},position:{buffer:c,offset:function(t,e){return 8*e.offset},divisor:1},positionFract:{buffer:p,offset:function(t,e){return 8*e.offset},divisor:1},error:{buffer:g,offset:function(t,e){return 16*e.offset},divisor:1},direction:{buffer:m,stride:24,offset:0},lineOffset:{buffer:m,stride:24,offset:8},capOffset:{buffer:m,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:!1,instances:t.prop("count"),count:f.length}),s(b,{update:k,draw:_,destroy:M,regl:t,gl:v,canvas:v.canvas,groups:x}),b;function b(t){t?k(t):null===t&&M(),_()}function _(e){if("number"==typeof e)return w(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),x.forEach(function(t,r){t&&(e&&(e[r]?t.draw=!0:t.draw=!1),t.draw?w(r):t.draw=!0)})}function w(t){"number"==typeof t&&(t=x[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],r(t),t.after&&t.after(t))}function k(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(b.groups=x=t.map(function(t,c){var u=x[c];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),u||(x[c]=u={id:c,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},y,t)),a(u,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var a=0;a 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * scale + translate;\n\tvec2 aBotPosition = (aBotCoord) * scale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * scale + translate;\n\tvec2 bBotPosition = (bBotCoord) * scale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform float dashSize, pixelRatio, thickness, opacity, id, miterMode;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashSize) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=i}return{fill:t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:i,miter:e}},m.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},m.prototype.render=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];e.length&&(t=this).update.apply(t,e),this.draw()},m.prototype.draw=function(){for(var t=this,e=[],r=arguments.length;r--;)e[r]=arguments[r];return(e.length?e:this.passes).forEach(function(e,r){if(e&&Array.isArray(e))return(n=t).draw.apply(n,e);var n;("number"==typeof e&&(e=t.passes[e]),e&&e.count>1&&e.opacity)&&(t.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&t.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>m.precisionThreshold||e.scale[1]*e.viewport.height>m.precisionThreshold?t.shaders.rect(e):"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=m.maxPoints)?t.shaders.rect(e):t.shaders.miter(e)))}),this},m.prototype.update=function(t){var e=this;if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var r=this.regl,o=this.gl;if(t.forEach(function(t,h){var d=e.passes[h];if(void 0!==t)if(null!==t){if("number"==typeof t[0]&&(t={positions:t}),t=s(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow"}),d||(e.passes[h]=d={id:h,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=a({},m.defaults,t)),null!=t.thickness&&(d.thickness=parseFloat(t.thickness)),null!=t.opacity&&(d.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(d.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(d.overlay=!!t.overlay,h 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),u.vert=l(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\nuniform vec2 paletteSize;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nvec2 paletteCoord(float id) {\n return vec2(\n (mod(id, paletteSize.x) + .5) / paletteSize.x,\n (floor(id / paletteSize.x) + .5) / paletteSize.y\n );\n}\nvec2 paletteCoord(vec2 id) {\n return vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n );\n}\n\nvec4 getColor(vec4 id) {\n // zero-palette means we deal with direct buffer\n if (paletteSize.x == 0.) return id / 255.;\n return texture2D(palette, paletteCoord(id.xy));\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),f&&(u.frag=u.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(u)}e.exports=v,v.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},v.prototype.render=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];return e.length&&(t=this).update.apply(t,e),this.draw(),this},v.prototype.draw=function(){for(var t=this,e=[],r=arguments.length;r--;)e[r]=arguments[r];var n=this.groups;if(1===e.length&&Array.isArray(e[0])&&(null===e[0][0]||Array.isArray(e[0][0]))&&(e=e[0]),this.regl._refresh(),e.length)for(var i=0;in)?e.tree=o(t,{bounds:f}):n&&n.length&&(e.tree=n),e.tree){var p={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(p):e.elements=l.elements(p)}return a({data:d(t),usage:"dynamic"}),s({data:g(t),usage:"dynamic"}),c({data:new Uint8Array(u),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var i=r.activation;if(i.forEach(function(t){return t&&t.destroy&&t.destroy()}),i.length=0,e&&"number"!=typeof e[0]){for(var a=[],o=0,s=Math.min(e.length,r.count);o=0)return a;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;oi*i*4&&(this.tooManyColors=!0),this.updatePalette(r),1===o.length?o[0]:o},v.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var i=.25*(t=t.slice()).length%e;i2?(s[0],s[2],n=s[1],i=s[3]):s.length?(n=s[0],i=s[1]):(s.x,n=s.y,s.x+s.width,i=s.y+s.height),l.length>2?(a=l[0],o=l[2],l[1],l[3]):l.length?(a=l[0],o=l[1]):(a=l.x,l.y,o=l.x+l.width,l.y+l.height),[a,n,o,i]}function p(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];var e=l(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}e.exports=u,u.prototype.render=function(){for(var t,e=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(t=this).update.apply(t,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o(function(){e.draw(),e.dirty=!0,e.planned=null})):(this.draw(),this.dirty=!0,o(function(){e.dirty=!1})),this)},u.prototype.update=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];if(t.length){for(var r=0;rM))&&(s.lower||!(k>>=e))<<3,(e|=r=(15<(t>>>=r))<<2)|(r=(3<(t>>>=r))<<1)|t>>>r>>1}function s(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=r[o(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){r[o(t.byteLength)>>2].push(t)}var r=a(8,function(){return[]});return{alloc:t,free:e,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){e(t.buffer)}}}function l(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||Y(t.data))}function c(t,e,r,n,i,a){for(var o=0;o(i=s)&&(i=n.buffer.byteLength,5123===h?i>>=1:5125===h&&(i>>=2)),n.vertCount=i,i=o,0>o&&(i=4,1===(o=n.buffer.dimension)&&(i=0),2===o&&(i=1),3===o&&(i=4)),n.primType=i}function o(t){n.elementsCount--,delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},c=0,u={uint8:5121,uint16:5123};e.oes_element_index_uint&&(u.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var h=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)c(t),h.primType=4,h.vertCount=0|t,h.type=5121;else{var e=null,r=35044,n=-1,i=-1,o=0,f=0;Array.isArray(t)||Y(t)||l(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=K[t.usage]),"primitive"in t&&(n=rt[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(f=u[t.type]),"length"in t?o=0|t.length:(o=i,5123===f||5122===f?o*=2:5125!==f&&5124!==f||(o*=4))),a(h,e,r,n,i,o,f)}else c(),h.primType=4,h.vertCount=0,h.type=5121;return s}var c=r.create(null,34963,!0),h=new i(c._buffer);return n.elementsCount++,s(t),s._reglType="elements",s._elements=h,s.subdata=function(t,e){return c.subdata(t,e),s},s.destroy=function(){o(h)},s},createStream:function(t){var e=h.pop();return e||(e=new i(r.create(null,34963,!0,!1)._buffer)),a(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){h.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){X(s).forEach(o)}}}function g(t){for(var e=G.allocType(5123,t.length),r=0;r>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;e[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15>=i,r.height>>=i,p(r,n[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function L(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&B(this)}}),o.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(vt).forEach(function(e){t+=vt[e].stats.size}),t}),{create2D:function(e,r){function n(t,e){var r=i.texInfo;z.call(r);var a=C();return"number"==typeof t?T(a,0|t,"number"==typeof e?0|e:0|t):t?(P(r,t),S(a,t)):T(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,c(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,D(i),E(a,3553),I(r,3553),R(),L(a),o.profile&&(i.stats.size=k(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=tt[i.internalformat],n.type=et[i.type],n.mag=rt[r.magFilter],n.min=nt[r.minFilter],n.wrapS=it[r.wrapS],n.wrapT=it[r.wrapT],n}var i=new O(3553);return vt[i.id]=i,a.textureCount++,n(e,r),n.subimage=function(t,e,r,a){e|=0,r|=0,a|=0;var o=v();return c(o,i),o.width=0,o.height=0,p(o,t),o.width=o.width||(i.width>>a)-e,o.height=o.height||(i.height>>a)-r,D(i),d(o,3553,e,r,a),R(),M(o),n},n.resize=function(e,r){var a=0|e,s=0|r||a;if(a===i.width&&s===i.height)return n;n.width=i.width=a,n.height=i.height=s,D(i);for(var l,c=i.channels,u=i.type,h=0;i.mipmask>>h;++h){var f=a>>h,p=s>>h;if(!f||!p)break;l=G.zero.allocType(u,f*p*c),t.texImage2D(3553,h,i.format,f,p,0,i.format,i.type,l),l&&G.zero.freeType(l)}return R(),o.profile&&(i.stats.size=k(i.internalformat,i.type,a,s,!1,!1)),n},n._reglType="texture2d",n._texture=i,o.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,n,i,s,l){function h(t,e,r,n,i,a){var s,l=f.texInfo;for(z.call(l),s=0;6>s;++s)g[s]=C();if("number"!=typeof t&&t){if("object"==typeof t)if(e)S(g[0],t),S(g[1],e),S(g[2],r),S(g[3],n),S(g[4],i),S(g[5],a);else if(P(l,t),u(f,t),"faces"in t)for(t=t.faces,s=0;6>s;++s)c(g[s],f),S(g[s],t[s]);else for(s=0;6>s;++s)S(g[s],t)}else for(t=0|t||1,s=0;6>s;++s)T(g[s],t,t);for(c(f,g[0]),f.mipmask=l.genMipmaps?(g[0].width<<1)-1:g[0].mipmask,f.internalformat=g[0].internalformat,h.width=g[0].width,h.height=g[0].height,D(f),s=0;6>s;++s)E(g[s],34069+s);for(I(l,34067),R(),o.profile&&(f.stats.size=k(f.internalformat,f.type,h.width,h.height,l.genMipmaps,!0)),h.format=tt[f.internalformat],h.type=et[f.type],h.mag=rt[l.magFilter],h.min=nt[l.minFilter],h.wrapS=it[l.wrapS],h.wrapT=it[l.wrapT],s=0;6>s;++s)L(g[s]);return h}var f=new O(34067);vt[f.id]=f,a.cubeCount++;var g=Array(6);return h(e,r,n,i,s,l),h.subimage=function(t,e,r,n,i){r|=0,n|=0,i|=0;var a=v();return c(a,f),a.width=0,a.height=0,p(a,e),a.width=a.width||(f.width>>i)-r,a.height=a.height||(f.height>>i)-n,D(f),d(a,34069+t,r,n,i),R(),M(a),h},h.resize=function(e){if((e|=0)!==f.width){h.width=f.width=e,h.height=f.height=e,D(f);for(var r=0;6>r;++r)for(var n=0;f.mipmask>>n;++n)t.texImage2D(34069+r,n,f.format,e>>n,e>>n,0,f.format,f.type,null);return R(),o.profile&&(f.stats.size=k(f.internalformat,f.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=f,o.profile&&(h.stats=f.stats),h.destroy=function(){f.decRef()},h},clear:function(){for(var e=0;er;++r)if(0!=(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);I(e.texInfo,e.target)})}}}function A(t,e,r,n,i,a){function o(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=t=0;e?(t=e.width,n=e.height):r&&(t=r.width,n=r.height),this.width=t,this.height=n}function s(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function l(t,e,r){t&&(t.texture?t.texture._texture.refCount+=1:t.renderbuffer._renderbuffer.refCount+=1)}function c(e,r){r&&(r.texture?t.framebufferTexture2D(36160,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,r.renderbuffer._renderbuffer.renderbuffer))}function u(t){var e=3553,r=null,n=null,i=t;return"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),"texture2d"===(t=i._reglType)?r=i:"textureCube"===t?r=i:"renderbuffer"===t&&(n=i,e=36161),new o(e,r,n)}function h(t,e,r,a,s){return r?((t=n.create2D({width:t,height:e,format:a,type:s}))._texture.refCount=0,new o(3553,t,null)):((t=i.create({width:t,height:e,format:a}))._renderbuffer.refCount=0,new o(36161,null,t))}function f(t){return t&&(t.texture||t.renderbuffer)}function p(t,e,r){t&&(t.texture?t.texture.resize(e,r):t.renderbuffer&&t.renderbuffer.resize(e,r))}function d(){this.id=k++,M[this.id]=this,this.framebuffer=t.createFramebuffer(),this.height=this.width=0,this.colorAttachments=[],this.depthStencilAttachment=this.stencilAttachment=this.depthAttachment=null}function g(t){t.colorAttachments.forEach(s),s(t.depthAttachment),s(t.stencilAttachment),s(t.depthStencilAttachment)}function m(e){t.deleteFramebuffer(e.framebuffer),e.framebuffer=null,a.framebufferCount--,delete M[e.id]}function v(e){var n;t.bindFramebuffer(36160,e.framebuffer);var i=e.colorAttachments;for(n=0;ni;++i){for(c=0;ct;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach(function(t){t.destroy()})}})},clear:function(){X(M).forEach(m)},restore:function(){X(M).forEach(function(e){e.framebuffer=t.createFramebuffer(),v(e)})}})}function T(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function S(t,e,r,n){function i(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function a(t,e){for(var r=0;rt&&(t=e.stats.uniformsCount)}),t},r.getMaxAttributesCount=function(){var t=0;return f.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);X(c).forEach(e),c={},X(u).forEach(e),u={},f.forEach(function(e){t.deleteProgram(e.program)}),f.length=0,h={},r.shaderCount=0},program:function(t,e,n){var i=h[e];i||(i=h[e]={});var a=i[t];return a||(a=new s(e,t),r.shaderCount++,l(a),i[t]=a,f.push(a)),a},restore:function(){c={},u={};for(var t=0;t"+e+"?"+i+".constant["+e+"]:0;"}).join(""),"}}else{","if(",o,"(",i,".buffer)){",u,"=",s,".createStream(",34962,",",i,".buffer);","}else{",u,"=",s,".getBuffer(",i,".buffer);","}",h,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",u,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",u,");","}"),l})}),o}function A(t,e,r,n,i){var o=_(t),s=function(t,e,r){function n(t){if(t in i){var r=i[t];t=!0;var n,o,s=0|r.x,l=0|r.y;return"width"in r?n=0|r.width:t=!1,"height"in r?o=0|r.height:t=!1,new O(!t&&e&&e.thisDep,!t&&e&&e.contextDep,!t&&e&&e.propDep,function(t,e){var i=t.shared.context,a=n;"width"in r||(a=e.def(i,".","framebufferWidth","-",s));var c=o;return"height"in r||(c=e.def(i,".","framebufferHeight","-",l)),[s,l,a,c]})}if(t in a){var c=a[t];return t=B(c,function(t,e){var r=t.invoke(e,c),n=t.shared.context,i=e.def(r,".x|0"),a=e.def(r,".y|0");return[i,a,e.def('"width" in ',r,"?",r,".width|0:","(",n,".","framebufferWidth","-",i,")"),r=e.def('"height" in ',r,"?",r,".height|0:","(",n,".","framebufferHeight","-",a,")")]}),e&&(t.thisDep=t.thisDep||e.thisDep,t.contextDep=t.contextDep||e.contextDep,t.propDep=t.propDep||e.propDep),t}return e?new O(e.thisDep,e.contextDep,e.propDep,function(t,e){var r=t.shared.context;return[0,0,e.def(r,".","framebufferWidth"),e.def(r,".","framebufferHeight")]}):null}var i=t.static,a=t.dynamic;if(t=n("viewport")){var o=t;t=new O(t.thisDep,t.contextDep,t.propDep,function(t,e){var r=o.append(t,e),n=t.shared.context;return e.set(n,".viewportWidth",r[2]),e.set(n,".viewportHeight",r[3]),r})}return{viewport:t,scissor_box:n("scissor.box")}}(t,o),l=k(t),c=function(t,e){var r=t.static,n=t.dynamic,i={};return nt.forEach(function(t){function e(e,a){if(t in r){var s=e(r[t]);i[o]=R(function(){return s})}else if(t in n){var l=n[t];i[o]=B(l,function(t,e){return a(t,e,t.invoke(e,l))})}}var o=v(t);switch(t){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":return e(function(t){return t},function(t,e,r){return r});case"depth.func":return e(function(t){return kt[t]},function(t,e,r){return e.def(t.constants.compareFuncs,"[",r,"]")});case"depth.range":return e(function(t){return t},function(t,e,r){return[e.def("+",r,"[0]"),e=e.def("+",r,"[1]")]});case"blend.func":return e(function(t){return[wt["srcRGB"in t?t.srcRGB:t.src],wt["dstRGB"in t?t.dstRGB:t.dst],wt["srcAlpha"in t?t.srcAlpha:t.src],wt["dstAlpha"in t?t.dstAlpha:t.dst]]},function(t,e,r){function n(t,n){return e.def('"',t,n,'" in ',r,"?",r,".",t,n,":",r,".",t)}t=t.constants.blendFuncs;var i=n("src","RGB"),a=n("dst","RGB"),o=(i=e.def(t,"[",i,"]"),e.def(t,"[",n("src","Alpha"),"]"));return[i,a=e.def(t,"[",a,"]"),o,t=e.def(t,"[",n("dst","Alpha"),"]")]});case"blend.equation":return e(function(t){return"string"==typeof t?[$[t],$[t]]:"object"==typeof t?[$[t.rgb],$[t.alpha]]:void 0},function(t,e,r){var n=t.constants.blendEquations,i=e.def(),a=e.def();return(t=t.cond("typeof ",r,'==="string"')).then(i,"=",a,"=",n,"[",r,"];"),t.else(i,"=",n,"[",r,".rgb];",a,"=",n,"[",r,".alpha];"),e(t),[i,a]});case"blend.color":return e(function(t){return a(4,function(e){return+t[e]})},function(t,e,r){return a(4,function(t){return e.def("+",r,"[",t,"]")})});case"stencil.mask":return e(function(t){return 0|t},function(t,e,r){return e.def(r,"|0")});case"stencil.func":return e(function(t){return[kt[t.cmp||"keep"],t.ref||0,"mask"in t?t.mask:-1]},function(t,e,r){return[t=e.def('"cmp" in ',r,"?",t.constants.compareFuncs,"[",r,".cmp]",":",7680),e.def(r,".ref|0"),e=e.def('"mask" in ',r,"?",r,".mask|0:-1")]});case"stencil.opFront":case"stencil.opBack":return e(function(e){return["stencil.opBack"===t?1029:1028,Mt[e.fail||"keep"],Mt[e.zfail||"keep"],Mt[e.zpass||"keep"]]},function(e,r,n){function i(t){return r.def('"',t,'" in ',n,"?",a,"[",n,".",t,"]:",7680)}var a=e.constants.stencilOps;return["stencil.opBack"===t?1029:1028,i("fail"),i("zfail"),i("zpass")]});case"polygonOffset.offset":return e(function(t){return[0|t.factor,0|t.units]},function(t,e,r){return[e.def(r,".factor|0"),e=e.def(r,".units|0")]});case"cull.face":return e(function(t){var e=0;return"front"===t?e=1028:"back"===t&&(e=1029),e},function(t,e,r){return e.def(r,'==="front"?',1028,":",1029)});case"lineWidth":return e(function(t){return t},function(t,e,r){return r});case"frontFace":return e(function(t){return At[t]},function(t,e,r){return e.def(r+'==="cw"?2304:2305')});case"colorMask":return e(function(t){return t.map(function(t){return!!t})},function(t,e,r){return a(4,function(t){return"!!"+r+"["+t+"]"})});case"sample.coverage":return e(function(t){return["value"in t?t.value:1,!!t.invert]},function(t,e,r){return[e.def('"value" in ',r,"?+",r,".value:1"),e=e.def("!!",r,".invert")]})}}),i}(t),u=w(t),h=s.viewport;return h&&(c.viewport=h),(s=s[h=v("scissor.box")])&&(c[h]=s),(o={framebuffer:o,draw:l,shader:u,state:c,dirty:s=0>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[d,g,m,s],");")}p?y?t():(r("if(",p,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(u+".drawElements("+[d,m,v,g+"<<(("+v+"-5121)>>1)"]+");")}function e(){r(u+".drawArrays("+[d,g,m]+");")}p?y?t():(r("if(",p,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,c=t.shared,u=c.gl,h=c.draw,f=n.draw,p=function(){var i=f.elements,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(h,".","elements"),i&&a("if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);"),i}(),d=i("primitive"),g=i("offset"),m=function(){var i=f.count,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(h,".","count"),i}();if("number"==typeof m){if(0===m)return}else r("if(",m,"){"),r.exit("}");K&&(s=i("instances"),l=t.instancing);var v=p+".type",y=f.elements&&D(f.elements);K&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),a(),r("}else if(",s,"<0){"),o(),r("}")):a():o()}function q(t,e,r,n,i){return i=(e=b()).proc("body",i),K&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function H(t,e,r,n){L(t,e),N(t,e,r,n.attributes,function(){return!0}),j(t,e,r,n.uniforms,function(){return!0}),V(t,e,e,r)}function G(t,e,r,n){function i(){return!0}t.batchId="a1",L(t,e),N(t,e,r,n.attributes,i),j(t,e,r,n.uniforms,i),V(t,e,e,r)}function W(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}L(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var c=t.scope(),u=t.scope();e(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&T(t,u,r.context),r.needsFramebuffer&&S(t,u,r.framebuffer),C(t,u,r.state,i),r.profile&&i(r.profile)&&F(t,u,r,!1,!0),n?(N(t,c,r,n.attributes,a),N(t,u,r,n.attributes,i),j(t,c,r,n.uniforms,a),j(t,u,r,n.uniforms,i),V(t,c,u,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,u),l=u.def(n,".id"),c=u.def(e,"[",l,"]"),u(t.shared.gl,".useProgram(",n,".program);","if(!",c,"){",c,"=",e,"[",l,"]=",t.link(function(e){return q(G,t,r,e,2)}),"(",n,");}",c,".call(this,a0[",s,"],",s,");"))}function Y(t,r){function n(e){var n=r.shader[e];n&&i.set(a.shader,"."+e,n.append(t,i))}var i=t.proc("scope",3);t.batchId="a2";var a=t.shared,o=a.current;T(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),I(Object.keys(r.state)).forEach(function(e){var n=r.state[e].append(t,i);m(n)?n.forEach(function(r,n){i.set(t.next[e],"["+n+"]",r)}):i.set(a.next,"."+e,n)}),F(t,i,r,!0,!0),["elements","offset","count","instances","primitive"].forEach(function(e){var n=r.draw[e];n&&i.set(a.draw,"."+e,""+n.append(t,i))}),Object.keys(r.uniforms).forEach(function(n){i.set(a.uniforms,"["+e.id(n)+"]",r.uniforms[n].append(t,i))}),Object.keys(r.attributes).forEach(function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new Z).forEach(function(t){i.set(a,"."+t,n[t])})}),n("vert"),n("frag"),0=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(u).forEach(function(e){t+=u[e].stats.size}),t}),{create:function(e,r){function o(e,r){var n=0,a=0,u=32854;if("object"==typeof e&&e?("shape"in e?(n=0|(a=e.shape)[0],a=0|a[1]):("radius"in e&&(n=a=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(a=0|e.height)),"format"in e&&(u=s[e.format])):"number"==typeof e?(n=0|e,a="number"==typeof r?0|r:n):e||(n=a=1),n!==c.width||a!==c.height||u!==c.format)return o.width=c.width=n,o.height=c.height=a,c.format=u,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,u,n,a),i.profile&&(c.stats.size=mt[c.format]*c.width*c.height),o.format=l[c.format],o}var c=new a(t.createRenderbuffer());return u[c.id]=c,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,a=0|r||n;return n===c.width&&a===c.height?o:(o.width=c.width=n,o.height=c.height=a,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,c.format,n,a),i.profile&&(c.stats.size=mt[c.format]*c.width*c.height),o)},o._reglType="renderbuffer",o._renderbuffer=c,i.profile&&(o.stats=c.stats),o.destroy=function(){c.decRef()},o},clear:function(){X(u).forEach(o)},restore:function(){X(u).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)}),t.bindRenderbuffer(36161,null)}}},yt=[];yt[6408]=4,yt[6407]=3;var xt=[];xt[5121]=1,xt[5126]=4,xt[36193]=2;var bt=["x","y","z","w"],_t="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),wt={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},kt={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Mt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},At={cw:2304,ccw:2305},Tt=new O(!1,!1,!1,function(){});return function(t){function e(){if(0===Z.length)w&&w.update(),Q=null;else{Q=q.next(e),h();for(var t=Z.length-1;0<=t;--t){var r=Z[t];r&&r(z,null,0)}m.flush(),w&&w.update()}}function r(){!Q&&0=Z.length&&n()}}}}function u(){var t=Y.viewport,e=Y.scissor_box;t[0]=t[1]=e[0]=e[1]=0,z.viewportWidth=z.framebufferWidth=z.drawingBufferWidth=t[2]=e[2]=m.drawingBufferWidth,z.viewportHeight=z.framebufferHeight=z.drawingBufferHeight=t[3]=e[3]=m.drawingBufferHeight}function h(){z.tick+=1,z.time=g(),u(),G.procs.poll()}function f(){u(),G.procs.refresh(),w&&w.update()}function g(){return(H()-k)/1e3}if(!(t=i(t)))return null;var m=t.gl,v=m.getContextAttributes();m.isContextLost();var y=function(t,e){function r(e){var r;e=e.toLowerCase();try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},i=0;ie;++e)tt(j({framebuffer:t.framebuffer.faces[e]},t),l);else tt(t,l);else l(0,t)},prop:U.define.bind(null,1),context:U.define.bind(null,2),this:U.define.bind(null,3),draw:s({}),buffer:function(t){return I.create(t,34962,!1,!1)},elements:function(t){return O.create(t,!1)},texture:R.create2D,cube:R.createCube,renderbuffer:B.create,framebuffer:V.create,framebufferCube:V.createCube,attributes:v,frame:c,on:function(t,e){var r;switch(t){case"frame":return c(e);case"lost":r=$;break;case"restore":r=J;break;case"destroy":r=K}return r.push(e),{cancel:function(){for(var t=0;t=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i=(i+=t).substr(0,r)}},{}],465:[function(t,e,r){(function(t){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],466:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r,o=t[i],s=(r=a+o)-a,l=o-s;l&&(t[--n]=r,r=l)}for(var c=0,i=n;i>1;return["sum(",t(e.slice(0,r)),",",t(e.slice(r)),")"].join("")}(e);var n}function h(t){return new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",u(c(t)),")};return robustDeterminant",t].join(""))(i,a,n,o)}var f=[function(){return[0]},function(t){return[t[0][0]]}];!function(){for(;f.length>1;return["sum(",c(t.slice(0,e)),",",c(t.slice(e)),")"].join("")}function u(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return u(e,t)}function h(t){if(2===t.length)return[["diff(",u(t[0][0],t[1][1]),",",u(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var o=0;o0&&r.push(","),o===i?r.push("+b[",a,"]"):r.push("+A[",a,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?n[t]:n)}var o=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;o.length>1;return["sum(",c(t.slice(0,e)),",",c(t.slice(e)),")"].join("")}function u(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=3.3306690738754716e-16*n;return o>=s||o<=-s?o:f(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],c=r[1]-n[1],u=t[2]-n[2],h=e[2]-n[2],f=r[2]-n[2],d=a*c,g=o*l,m=o*s,v=i*c,y=i*l,x=a*s,b=u*(d-g)+h*(m-v)+f*(y-x),_=7.771561172376103e-16*((Math.abs(d)+Math.abs(g))*Math.abs(u)+(Math.abs(m)+Math.abs(v))*Math.abs(h)+(Math.abs(y)+Math.abs(x))*Math.abs(f));return b>_||-b>_?b:p(t,e,r,n)}];function g(t){var e=d[t.length];return e||(e=d[t.length]=h(t.length)),e.apply(void 0,t)}!function(){for(;d.length<=s;)d.push(h(d.length));for(var t=[],r=["slow"],n=0;n<=s;++n)t.push("a"+n),r.push("o"+n);var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=s;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===a&&0===o&&0===s&&0===l)return function(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),c=r[i],u=n[i],h=Math.min(c,u),f=Math.max(c,u);if(f=n?(i=h,(l+=1)=n?(i=h,(l+=1)0?1:0}},{}],478:[function(t,e,r){"use strict";e.exports=function(t){return i(n(t))};var n=t("boundary-cells"),i=t("reduce-simplicial-complex")},{"boundary-cells":83,"reduce-simplicial-complex":456}],479:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){r=r||0,void 0===s&&(s=function(t){for(var e=t.length,r=0,n=0;n>1,v=E[2*m+1];","if(v===b){return m}","if(b0&&l.push(","),l.push("[");for(var n=0;n0&&l.push(","),l.push("B(C,E,c[",i[0],"],c[",i[1],"])")}l.push("]")}l.push(");")}}for(var a=t+1;a>1;--a){a>1,s=a(t[o],e);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function u(t,e){for(var r=new Array(t.length),i=0,o=r.length;i=t.length||0!==a(t[m],s)););}return r}function h(t,e){if(e<0)return[];for(var r=[],i=(1<>>u&1&&c.push(i[u]);e.push(c)}return s(e)},r.skeleton=h,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function x(t){for(var e=v(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=y(t);if(r>=0){var n=v(r);if(e0){var t=M[0];return m(0,S-1),S-=1,x(0),t}return-1}function w(t,e){var r=M[t];return c[r]===e?t:(c[r]=-1/0,b(t),_(),c[r]=e,b((S+=1)-1))}function k(t){if(!u[t]){u[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),A[e]>=0&&w(A[e],g(e)),A[r]>=0&&w(A[r],g(r))}}for(var M=[],A=new Array(a),h=0;h>1;h>=0;--h)x(h);for(;;){var E=_();if(E<0||c[E]>r)break;k(E)}for(var C=[],h=0;h=0&&r>=0&&e!==r){var n=A[e],i=A[r];n!==i&&z.push([n,i])}}),i.unique(i.normalize(z)),{positions:C,edges:z}};var n=t("robust-orientation"),i=t("simplicial-complex")},{"robust-orientation":471,"simplicial-complex":483}],486:[function(t,e,r){"use strict";e.exports=function(t,e){var r,a,o,s;if(e[0][0]e[1][0]))return i(e,t);r=e[1],a=e[0]}if(t[0][0]t[1][0]))return-i(t,e);o=t[1],s=t[0]}var l=n(r,a,s),c=n(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=n(s,o,a),c=n(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var n=t("robust-orientation");function i(t,e){var r,i,a,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),c=Math.min(e[0][1],e[1][1]),u=Math.max(e[0][1],e[1][1]);return lu?s-u:l-u}r=e[1],i=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=c(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=c(t.right,e))return l;t=t.left}}return r}function u(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function h(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=c(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var u=c(this.slabs[e-1],t);u&&(s?o(u.key,s)>0&&(s=u.key,i=u.value):(i=u.value,s=u.key))}var h=this.horizontal[e];if(h.length>0){var f=n.ge(h,t[1],l);if(f=h.length)return i;p=h[f]}}if(p.start)if(s){var d=a(s[0],s[1],[t[0],p.y]);s[0][0]>s[1][0]&&(d=-d),d>0&&(i=p.index)}else i=p.index;else p.y!==t[1]&&(i=p.index)}}}return i}},{"./lib/order-segments":486,"binary-search-bounds":79,"functional-red-black-tree":219,"robust-orientation":471}],488:[function(t,e,r){"use strict";var n=t("robust-dot-product"),i=t("robust-sum");function a(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l0||i>0&&u<0){var h=o(s,u,l,i);r.push(h),n.push(h.slice())}u<0?n.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=u}return{positive:r,negative:n}},e.exports.positive=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(i,c,s,n)),c>=0&&r.push(s.slice()),n=c}return r},e.exports.negative=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(i,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},{"robust-dot-product":468,"robust-sum":476}],489:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};function e(r){return function(r,n){var i,a,o,s,l,c,u,h,f,p=1,d=r.length,g="";for(a=0;a=0),s[8]){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,s[6]?parseInt(s[6]):0);break;case"e":i=s[7]?parseFloat(i).toExponential(s[7]):parseFloat(i).toExponential();break;case"f":i=s[7]?parseFloat(i).toFixed(s[7]):parseFloat(i);break;case"g":i=s[7]?String(Number(i.toPrecision(s[7]))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=s[7]?i.substring(0,s[7]):i;break;case"t":i=String(!!i),i=s[7]?i.substring(0,s[7]):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=s[7]?i.substring(0,s[7]):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=s[7]?i.substring(0,s[7]):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}t.json.test(s[8])?g+=i:(!t.number.test(s[8])||h&&!s[3]?f="":(f=h?"+":"-",i=i.toString().replace(t.sign,"")),c=s[4]?"0"===s[4]?"0":s[4].charAt(1):" ",u=s[6]-(f+i).length,l=s[6]&&u>0?c.repeat(u):"",g+=s[5]?f+i+l:"0"===c?f+l+i:l+f+i)}return g}(function(e){if(i[e])return i[e];var r,n=e,a=[],o=0;for(;n;){if(null!==(r=t.text.exec(n)))a.push(r[0]);else if(null!==(r=t.modulo.exec(n)))a.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],c=[];if(null===(c=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=t.key_access.exec(l)))s.push(c[1]);else{if(null===(c=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(c[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push(r)}n=n.substring(r[0].length)}return i[e]=a}(r),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}var i=Object.create(null);void 0!==r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],490:[function(t,e,r){"use strict";var n=t("parenthesis");e.exports=function(t,e,r){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map(function(t){return 1===t.length&&(t+=t),t}));var i=n.parse(t,{flat:!0,brackets:r.ignore}),a=i[0].split(e);if(r.escape){for(var o=[],s=0;s0;){e=c[c.length-1];var p=t[e];if(a[e]=0&&s[e].push(o[g])}a[e]=d}else{if(n[e]===r[e]){for(var m=[],v=[],y=0,d=l.length-1;d>=0;--d){var x=l[d];if(i[x]=!1,m.push(x),v.push(s[x]),y+=s[x].length,o[x]=h.length,x===e){l.length=d;break}}h.push(m);for(var b=new Array(y),d=0;d c)|0 },"),"generic"===e&&a.push("getters:[0],");for(var s=[],l=[],c=0;c>>7){");for(var c=0;c<1<<(1<128&&c%128==0){h.length>0&&f.push("}}");var p="vExtra"+h.length;a.push("case ",c>>>7,":",p,"(m&0x7f,",l.join(),");break;"),f=["function ",p,"(m,",l.join(),"){switch(m){"],h.push(f)}f.push("case ",127&c,":");for(var d=new Array(r),g=new Array(r),m=new Array(r),v=new Array(r),y=0,x=0;xx)&&!(c&1<<_)!=!(c&1<0&&(A="+"+m[b]+"*c");var T=d[b].length/y*.5,S=.5+v[b]/y*.5;M.push("d"+b+"-"+S+"-"+T+"*("+d[b].join("+")+A+")/("+g[b].join("+")+")")}f.push("a.push([",M.join(),"]);","break;")}a.push("}},"),h.length>0&&f.push("}}");for(var E=[],c=0;c<1<1&&(a=1),a<-1&&(a=-1),i*Math.acos(a)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,c=t.cy,u=t.rx,h=t.ry,f=t.xAxisRotation,p=void 0===f?0:f,d=t.largeArcFlag,g=void 0===d?0:d,m=t.sweepFlag,v=void 0===m?0:m,y=[];if(0===u||0===h)return[];var x=Math.sin(p*i/360),b=Math.cos(p*i/360),_=b*(e-l)/2+x*(r-c)/2,w=-x*(e-l)/2+b*(r-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),h=Math.abs(h);var k=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(h,2);k>1&&(u*=Math.sqrt(k),h*=Math.sqrt(k));var M=function(t,e,r,n,a,o,l,c,u,h,f,p){var d=Math.pow(a,2),g=Math.pow(o,2),m=Math.pow(f,2),v=Math.pow(p,2),y=d*g-d*v-g*m;y<0&&(y=0),y/=d*v+g*m;var x=(y=Math.sqrt(y)*(l===c?-1:1))*a/o*p,b=y*-o/a*f,_=h*x-u*b+(t+r)/2,w=u*x+h*b+(e+n)/2,k=(f-x)/a,M=(p-b)/o,A=(-f-x)/a,T=(-p-b)/o,S=s(1,0,k,M),E=s(k,M,A,T);return 0===c&&E>0&&(E-=i),1===c&&E<0&&(E+=i),[_,w,S,E]}(e,r,l,c,u,h,g,v,x,b,_,w),A=n(M,4),T=A[0],S=A[1],E=A[2],C=A[3],L=Math.max(Math.ceil(Math.abs(C)/(i/4)),1);C/=L;for(var z=0;ze[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}},{"abs-svg-path":51,assert:59,"is-svg-path":391,"normalize-svg-path":496,"parse-svg-path":427}],496:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,c=0,u=null,h=null,f=0,p=0,d=0,g=t.length;d4?(o=m[m.length-4],s=m[m.length-3]):(o=f,s=p),r.push(m)}return r};var n=t("svg-arc-to-cubic-bezier");function i(t,e,r,n){return["C",t,e,r,n,r,n]}function a(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}},{"svg-arc-to-cubic-bezier":494}],497:[function(t,e,r){(function(r){"use strict";var n=t("svg-path-bounds"),i=t("parse-svg-path"),a=t("draw-svg-path"),o=t("is-svg-path"),s=t("bitmap-sdf"),l=document.createElement("canvas"),c=l.getContext("2d");e.exports=function(t,e){if(!o(t))throw Error("Argument should be valid svg path string");e||(e={});var u,h;e.shape?(u=e.shape[0],h=e.shape[1]):(u=l.width=e.w||e.width||200,h=l.height=e.h||e.height||200);var f=Math.min(u,h),p=e.stroke||0,d=e.viewbox||e.viewBox||n(t),g=[u/(d[2]-d[0]),h/(d[3]-d[1])],m=Math.min(g[0]||0,g[1]||0)/2;c.fillStyle="black",c.fillRect(0,0,u,h),c.fillStyle="white",p&&("number"!=typeof p&&(p=1),c.strokeStyle=p>0?"white":"black",c.lineWidth=Math.abs(p));if(c.translate(.5*u,.5*h),c.scale(m,m),r.Path2D){var v=new Path2D(t);c.fill(v),p&&c.stroke(v)}else{var y=i(t);a(c,y),c.fill(),p&&c.stroke()}return c.setTransform(1,0,0,1,0,0),s(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*f})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bitmap-sdf":81,"draw-svg-path":152,"is-svg-path":391,"parse-svg-path":427,"svg-path-bounds":495}],498:[function(t,e,r){(function(r){"use strict";e.exports=function t(e,r,i){var i=i||{};var o=a[e];o||(o=a[e]={" ":{data:new Float32Array(0),shape:.2}});var s=o[r];if(!s)if(r.length<=1||!/\d/.test(r))s=o[r]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o0&&(h+=.02);for(var p=new Float32Array(u),d=0,g=-.5*h,f=0;f1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=L(t,360),e=L(e,100),r=L(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,u),h=!0,f="hsl"),e.hasOwnProperty("a")&&(a=e.a));var p,d,g;return a=C(a),{ok:h,format:e.format||f,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=i++}function u(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(c(n));return a}function T(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=C(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=h(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=h(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return f(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[I(a(t).toString(16)),I(a(e).toString(16)),I(a(r).toString(16)),I(D(n))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*L(this._r,255))+"%",g:a(100*L(this._g,255))+"%",b:a(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*L(this._r,255))+"%, "+a(100*L(this._g,255))+"%, "+a(100*L(this._b,255))+"%)":"rgba("+a(100*L(this._r,255))+"%, "+a(100*L(this._g,255))+"%, "+a(100*L(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+p(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=c(t);r="#"+p(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(v,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(T,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:O(t[n]));t=r}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),i=c(e).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(e,r){var n=c(e),i=c(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,i,a=c.readability(t,e);switch(i=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var S=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},E=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function L(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function z(t){return o(1,s(0,t))}function P(t){return parseInt(t,16)}function I(t){return 1==t.length?"0"+t:""+t}function O(t){return t<=1&&(t=100*t+"%"),t}function D(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return P(t)/255}var B,F,N,j=(F="[\\s|\\(]+("+(B="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+B+")[,|\\s]+("+B+")\\s*\\)?",N="[\\s|\\(]+("+B+")[,|\\s]+("+B+")[,|\\s]+("+B+")[,|\\s]+("+B+")\\s*\\)?",{CSS_UNIT:new RegExp(B),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+N),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function V(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],500:[function(t,e,r){"use strict";function n(t){if(t instanceof Float32Array)return t;if("number"==typeof t)return new Float32Array([t])[0];var e=new Float32Array(t);return e.set(t),e}e.exports=n,e.exports.float32=e.exports.float=n,e.exports.fract32=e.exports.fract=function(t){if("number"==typeof t)return n(t-n(t));for(var e=n(t),r=0,i=e.length;rh&&(h=l[0]),l[1]f&&(f=l[1])}function i(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(i);break;case"Point":n(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(n)}}if(!e){var a,o,s=r(t),l=new Array(2),c=1/0,u=c,h=-c,f=-c;for(o in t.arcs.forEach(function(t){for(var e=-1,r=t.length;++eh&&(h=l[0]),l[1]f&&(f=l[1])}),t.objects)i(t.objects[o]);e=t.bbox=[c,u,h,f]}return e},i=function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r};function a(t,e){var r=e.id,n=e.bbox,i=null==e.properties?{}:e.properties,a=o(t,e);return null==r&&null==n?{type:"Feature",properties:i,geometry:a}:null==n?{type:"Feature",id:r,properties:i,geometry:a}:{type:"Feature",id:r,bbox:n,properties:i,geometry:a}}function o(t,e){var n=r(t),a=t.arcs;function o(t,e){e.length&&e.pop();for(var r=a[t<0?~t:t],o=0,s=r.length;o1)n=function(t,e,r){var n,i=[],a=[];function o(t){var e=t<0?~t:t;(a[e]||(a[e]=[])).push({i:t,g:n})}function s(t){t.forEach(o)}function l(t){t.forEach(s)}return function t(e){switch(n=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":s(e.arcs);break;case"MultiLineString":case"Polygon":l(e.arcs);break;case"MultiPolygon":e.arcs.forEach(l)}}(e),a.forEach(null==r?function(t){i.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}(0,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var a,o,c=1,u=l(i[0]);cu&&(o=i[0],i[0]=i[c],i[c]=o,u=a);return i})}}var u=function(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be ≥2");if(t.transform)throw new Error("already quantized");var r,i=n(t),a=i[0],o=(i[2]-a)/(e-1)||1,s=i[1],l=(i[3]-s)/(e-1)||1;function c(t){t[0]=Math.round((t[0]-a)/o),t[1]=Math.round((t[1]-s)/l)}function u(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(u);break;case"Point":c(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(c)}}for(r in t.arcs.forEach(function(t){for(var e,r,n,i=1,c=1,u=t.length,h=t[0],f=h[0]=Math.round((h[0]-a)/o),p=h[1]=Math.round((h[1]-s)/l);iMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=t[l]*t[l],o+=i[l]*t[l];for(l=0;l<3;++l)i[l]-=o/a*t[l];return s(i,i),i}function f(t,e,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}var p=f.prototype;p.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},p.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},p.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=e[a]*r[a],n+=e[a]*e[a];var l=Math.sqrt(n),u=0;for(a=0;a<3;++a)r[a]-=e[a]*i/n,u+=r[a]*r[a],e[a]/=l;var h=Math.sqrt(u);for(a=0;a<3;++a)r[a]/=h;var f=this.computedToward;o(f,e,r),s(f,f);var p=Math.exp(this.computedRadius[0]),d=this.computedAngle[0],g=this.computedAngle[1],m=Math.cos(d),v=Math.sin(d),y=Math.cos(g),x=Math.sin(g),b=this.computedCenter,_=m*y,w=v*y,k=x,M=-m*x,A=-v*x,T=y,S=this.computedEye,E=this.computedMatrix;for(a=0;a<3;++a){var C=_*r[a]+w*f[a]+k*e[a];E[4*a+1]=M*r[a]+A*f[a]+T*e[a],E[4*a+2]=C,E[4*a+3]=0}var L=E[1],z=E[5],P=E[9],I=E[2],O=E[6],D=E[10],R=z*D-P*O,B=P*I-L*D,F=L*O-z*I,N=c(R,B,F);R/=N,B/=N,F/=N,E[0]=R,E[4]=B,E[8]=F;for(a=0;a<3;++a)S[a]=b[a]+E[2+4*a]*p;for(a=0;a<3;++a){u=0;for(var j=0;j<3;++j)u+=E[a+4*j]*S[j];E[12+a]=-u}E[15]=1},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var d=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;d[0]=i[2],d[1]=i[6],d[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,c=0;c<3;++c)i[4*c]=o[c],i[4*c+1]=s[c],i[4*c+2]=l[c];a(i,i,n,d);for(c=0;c<3;++c)o[c]=i[4*c],s[c]=i[4*c+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},p.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=c(a,o,s);a/=l,o/=l,s/=l;var u=i[0],h=i[4],f=i[8],p=u*a+h*o+f*s,d=c(u-=a*p,h-=o*p,f-=s*p),g=(u/=d)*e+a*r,m=(h/=d)*e+o*r,v=(f/=d)*e+s*r;this.center.move(t,g,m,v);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+n),this.radius.set(t,Math.log(y))},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e,r,n){var a=1;"number"==typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[a],l=e[a+4],h=e[a+8];if(n){var f=Math.abs(s),p=Math.abs(l),d=Math.abs(h),g=Math.max(f,p,d);f===g?(s=s<0?-1:1,l=h=0):d===g?(h=h<0?-1:1,s=l=0):(l=l<0?-1:1,s=h=0)}else{var m=c(s,l,h);s/=m,l/=m,h/=m}var v,y,x=e[o],b=e[o+4],_=e[o+8],w=x*s+b*l+_*h,k=c(x-=s*w,b-=l*w,_-=h*w),M=l*(_/=k)-h*(b/=k),A=h*(x/=k)-s*_,T=s*b-l*x,S=c(M,A,T);if(M/=S,A/=S,T/=S,this.center.jump(t,H,G,W),this.radius.idle(t),this.up.jump(t,s,l,h),this.right.jump(t,x,b,_),2===a){var E=e[1],C=e[5],L=e[9],z=E*x+C*b+L*_,P=E*M+C*A+L*T;v=R<0?-Math.PI/2:Math.PI/2,y=Math.atan2(P,z)}else{var I=e[2],O=e[6],D=e[10],R=I*s+O*l+D*h,B=I*x+O*b+D*_,F=I*M+O*A+D*T;v=Math.asin(u(R)),y=Math.atan2(F,B)}this.angle.jump(t,y,v),this.recalcMatrix(t);var N=e[2],j=e[6],V=e[10],U=this.computedMatrix;i(U,e);var q=U[15],H=U[12]/q,G=U[13]/q,W=U[14]/q,Y=Math.exp(this.computedRadius[0]);this.center.jump(t,H-N*Y,G-j*Y,W-V*Y)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},p.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=c(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=e[0]-r[0],h=e[1]-r[1],f=e[2]-r[2],p=c(l,h,f);if(!(p<1e-6)){l/=p,h/=p,f/=p;var d=this.computedRight,g=d[0],m=d[1],v=d[2],y=i*g+a*m+o*v,x=c(g-=y*i,m-=y*a,v-=y*o);if(!(x<.01&&(x=c(g=a*f-o*h,m=o*l-i*f,v=i*h-a*l))<1e-6)){g/=x,m/=x,v/=x,this.up.set(t,i,a,o),this.right.set(t,g,m,v),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(p));var b=a*v-o*m,_=o*g-i*v,w=i*m-a*g,k=c(b,_,w),M=i*l+a*h+o*f,A=g*l+m*h+v*f,T=(b/=k)*l+(_/=k)*h+(w/=k)*f,S=Math.asin(u(M)),E=Math.atan2(T,A),C=this.angle._state,L=C[C.length-1],z=C[C.length-2];L%=2*Math.PI;var P=Math.abs(L+2*Math.PI-E),I=Math.abs(L-E),O=Math.abs(L-2*Math.PI-E);P0?r.pop():new ArrayBuffer(t)}function f(t){return new Uint8Array(h(t),0,t)}function p(t){return new Uint16Array(h(2*t),0,t)}function d(t){return new Uint32Array(h(4*t),0,t)}function g(t){return new Int8Array(h(t),0,t)}function m(t){return new Int16Array(h(2*t),0,t)}function v(t){return new Int32Array(h(4*t),0,t)}function y(t){return new Float32Array(h(4*t),0,t)}function x(t){return new Float64Array(h(8*t),0,t)}function b(t){return o?new Uint8ClampedArray(h(t),0,t):f(t)}function _(t){return new DataView(h(t),0,t)}function w(t){t=i.nextPow2(t);var e=i.log2(t),r=c[e];return r.length>0?r.pop():new n(t)}r.free=function(t){if(n.isBuffer(t))c[i.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|i.log2(e);l[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){u(t.buffer)},r.freeArrayBuffer=u,r.freeBuffer=function(t){c[i.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return h(t);switch(e){case"uint8":return f(t);case"uint16":return p(t);case"uint32":return d(t);case"int8":return g(t);case"int16":return m(t);case"int32":return v(t);case"float":case"float32":return y(t);case"double":case"float64":return x(t);case"uint8_clamped":return b(t);case"buffer":return w(t);case"data":case"dataview":return _(t);default:return null}return null},r.mallocArrayBuffer=h,r.mallocUint8=f,r.mallocUint16=p,r.mallocUint32=d,r.mallocInt8=g,r.mallocInt16=m,r.mallocInt32=v,r.mallocFloat32=r.mallocFloat=y,r.mallocFloat64=r.mallocDouble=x,r.mallocUint8Clamped=b,r.mallocDataView=_,r.mallocBuffer=w,r.clearCache=function(){for(var t=0;t<32;++t)s.UINT8[t].length=0,s.UINT16[t].length=0,s.UINT32[t].length=0,s.INT8[t].length=0,s.INT16[t].length=0,s.INT32[t].length=0,s.FLOAT[t].length=0,s.DOUBLE[t].length=0,s.UINT8C[t].length=0,l[t].length=0,c[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":80,buffer:92,dup:154}],508:[function(t,e,r){"use strict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e=a)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),l=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(e)?n.showHidden=e:e&&r._extend(n,e),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),u(n,t,n.depth)}function l(t,e){var r=s.styles[e];return r?"["+s.colors[r][0]+"m"+t+"["+s.colors[r][1]+"m":t}function c(t,e){return t}function u(t,e,n){if(t.customInspect&&e&&k(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return v(i)||(i=u(t,i,n)),i}var a=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(m(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,e);if(a)return a;var o=Object.keys(e),s=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),w(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(e);if(0===o.length){if(k(e)){var l=e.name?": "+e.name:"";return t.stylize("[Function"+l+"]","special")}if(x(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(_(e))return t.stylize(Date.prototype.toString.call(e),"date");if(w(e))return h(e)}var c,b="",M=!1,A=["{","}"];(p(e)&&(M=!0,A=["[","]"]),k(e))&&(b=" [Function"+(e.name?": "+e.name:"")+"]");return x(e)&&(b=" "+RegExp.prototype.toString.call(e)),_(e)&&(b=" "+Date.prototype.toUTCString.call(e)),w(e)&&(b=" "+h(e)),0!==o.length||M&&0!=e.length?n<0?x(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),c=M?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(c,b,A)):A[0]+b+A[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),S(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=g(r)?u(t,l.value,null):u(t,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function g(t){return null===t}function m(t){return"number"==typeof t}function v(t){return"string"==typeof t}function y(t){return void 0===t}function x(t){return b(t)&&"[object RegExp]"===M(t)}function b(t){return"object"==typeof t&&null!==t}function _(t){return b(t)&&"[object Date]"===M(t)}function w(t){return b(t)&&("[object Error]"===M(t)||t instanceof Error)}function k(t){return"function"==typeof t}function M(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(y(a)&&(a=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(a)){var n=e.pid;o[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else o[t]=function(){};return o[t]},r.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=p,r.isBoolean=d,r.isNull=g,r.isNullOrUndefined=function(t){return null==t},r.isNumber=m,r.isString=v,r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=y,r.isRegExp=x,r.isObject=b,r.isDate=_,r.isError=w,r.isFunction=k,r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t("./support/isBuffer");var T=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){var t,e;console.log("%s - %s",(t=new Date,e=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":"),[t.getDate(),T[t.getMonth()],e].join(" ")),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!b(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":513,_process:449,inherits:512}],515:[function(t,e,r){"use strict";e.exports=function(t,e){"object"==typeof e&&null!==e||(e={});return n(t,e.canvas||i,e.context||a,e)};var n=t("./lib/vtext"),i=null,a=null;"undefined"!=typeof document&&((i=document.createElement("canvas")).width=8192,i.height=1024,a=i.getContext("2d"))},{"./lib/vtext":516}],516:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=n.size||64,o=n.font||"normal";return r.font=a+"px "+o,r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",h(function(t,e,r,n){var a=0|Math.ceil(e.measureText(r).width+2*n);if(a>8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var o=3*n;t.height=0?e[a]:i})},has___:{value:x(function(e){var n=y(e);return n?r in n:t.indexOf(e)>=0})},set___:{value:x(function(n,i){var a,o=y(n);return o?o[r]=i:(a=t.indexOf(n))>=0?e[a]=i:(a=t.length,e[a]=i,t[a]=n),this})},delete___:{value:x(function(n){var i,a,o=y(n);return o?r in o&&delete o[r]:!((i=t.indexOf(n))<0||(a=t.length-1,t[i]=void 0,e[i]=e[a],t[i]=t[a],t.length=a,e.length=a,0))})}})};g.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof r?function(){function n(){this instanceof g||b();var e,n=new r,i=void 0,a=!1;return e=t?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new g),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch(r){i||(i=new g),i.set___(t,e)}else n.set(t,e);return this},Object.create(g.prototype,{get___:{value:x(function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)})},has___:{value:x(function(t){return n.has(t)||!!i&&i.has___(t)})},set___:{value:x(e)},delete___:{value:x(function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e})},permitHostObjects___:{value:x(function(t){if(t!==m)throw new Error("bogus call to permitHostObjects___");a=!0})}})}t&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=g.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=g)}function m(t){t.permitHostObjects___&&t.permitHostObjects___(m)}function v(t){return!(t.substr(0,l.length)==l&&"___"===t.substr(t.length-3))}function y(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[c];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,c,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function x(t){return t.prototype=null,Object.freeze(t)}function b(){p||"undefined"==typeof console||(p=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},{}],518:[function(t,e,r){var n=t("./hidden-store.js");e.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},{"./hidden-store.js":519}],519:[function(t,e,r){e.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},{}],520:[function(t,e,r){var n=t("./create-store.js");e.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},{"./create-store.js":518}],521:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":221}],522:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match(l);return r?r[0]:""}var n=this._validateYear(t),i=t.month(),a=""+this.toChineseMonth(n,i);return e&&a.length<2&&(a="0"+a),this.isIntercalaryMonth(n,i)&&(a+="i"),a},monthNames:function(t){if("string"==typeof t){var e=t.match(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="闰"+i),i},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["一","二","三","四","五","六","七","八","九","十","十一","十二"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="闰"+i),i},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"闰"===e[0]&&(r=!0,e=e.substring(1)),"月"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(e);else{var i=e[e.length-1];r="i"===i||"I"===i}return this.toMonthIndex(t,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var i=this.intercalaryMonth(t);if(r&&e!==i||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&e<=i?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var i,o=this._validateYear(t,n.local.invalidyear),s=f[o-f[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(i=a.newDate(l,c,u)).add(4-(i.dayOfWeek()||7),"d");var h=this.toJD(t,e,r)-i.toJD();return 1+Math.floor(h/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=h[t-h[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(i.year()),e=i.month(),r=i.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o,s;if("object"==typeof t)o=t,a=e||{};else{var l="number"==typeof t&&t>=1888&&t<=2111;if(!l)throw new Error("Lunar year outside range 1888-2111");var c="number"==typeof e&&e>=1&&e<=12;if(!c)throw new Error("Lunar month outside range 1 - 12");var u,p="number"==typeof r&&r>=1&&r<=30;if(!p)throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(u=!1,a=n):(u=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:u}}s=o.day-1;var d,g=h[o.year-h[0]],m=g>>13;d=m?o.month>m?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var v=0;v>9&4095,(x>>5&15)-1,(31&x)+s);return a.year=b.getFullYear(),a.month=1+b.getMonth(),a.day=b.getDate(),a}(t,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=a.fromJD(t),r=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{var o="number"==typeof t&&t>=1888&&t<=2111;if(!o)throw new Error("Solar year outside range 1888-2111");var s="number"==typeof e&&e>=1&&e<=12;if(!s)throw new Error("Solar month outside range 1 - 12");var l="number"==typeof r&&r>=1&&r<=31;if(!l)throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var c=f[i.year-f[0]],u=i.year<<9|i.month<<5|i.day;a.year=u>=c?i.year:i.year-1,c=f[a.year-f[0]];var p,d=new Date(c>>9&4095,(c>>5&15)-1,31&c),g=new Date(i.year,i.month-1,i.day);p=Math.round((g-d)/864e5);var m,v=h[a.year-h[0]];for(m=0;m<13;m++){var y=v&1<<12-m?30:29;if(p>13;!x||m=2&&n<=6},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year()+(i.year()<0?1:0),e=i.month(),(r=i.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=a},{"../main":536,"object-assign":421}],525:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),n.calendars.ethiopian=a},{"../main":536,"object-assign":421}],526:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=a},{"../main":536,"object-assign":421}],527:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),t=t<=0?t+1:t,(r=i.day())+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.islamic=a},{"../main":536,"object-assign":421}],528:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),r=i.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),n.calendars.julian=a},{"../main":536,"object-assign":421}],529:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),n.calendars.mayan=a},{"../main":536,"object-assign":421}],530:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidMonth);(t=i.year())<0&&t++;for(var a=i.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),n.calendars.nanakshahi=a},{"../main":536,"object-assign":421}],531:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),i=e.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t-(t>=0?474:473),s=474+o(a,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),h=t-this.toJD(l,u,1)+1;return this.newDate(l,u,h)}}),n.calendars.persian=a,n.calendars.jalali=a},{"../main":536,"object-assign":421}],533:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":536,"object-assign":421}],534:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),n.calendars.thai=o},{"../main":536,"object-assign":421}],535:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;ar)return o[i]-o[i-1];i++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,c=e-o[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(t=null!=t.year?t.year:t)>=1276&&t<=1500),i},_validate:function(t,e,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":536,"object-assign":421}],536:[function(t,e,r){var n=t("object-assign");function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function a(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(i.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,function(e){return t[e]})}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(a.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new a(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);i=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var c=e.exports=new i;c.cdate=a,c.baseCalendar=s,c.calendars.gregorian=l},{"object-assign":421}],537:[function(t,e,r){var n=t("object-assign"),i=t("./main");n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,a,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,h=r.monthNamesShort||this.local.monthNamesShort,f=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),d=function(t,e,r,n){var i=""+e;if(p(t,n))for(;i.length1},x=function(t,r){var n=y(t,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=e.substring(A).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"==typeof l){y("m");var t=l.call(b,e.substring(A));return A+=t.length,t}return x("m")},w=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s-1){p=1,d=g;for(var E=this.daysInMonth(f,p);d>E;E=this.daysInMonth(f,p))p++,d-=E}return h>-1?this.fromJD(h):this.newDate(f,p,d)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":536,"object-assign":421}],538:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":133}],539:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":538}],540:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],541:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calcIfAutorange+arraydraw"},text:{valType:"string",editType:"calcIfAutorange+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calcIfAutorange+arraydraw"},font:i({editType:"calcIfAutorange+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calcIfAutorange+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calcIfAutorange+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calcIfAutorange+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calcIfAutorange+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calcIfAutorange+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calcIfAutorange+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange+arraydraw"},ax:{valType:"any",editType:"calcIfAutorange+arraydraw"},ay:{valType:"any",editType:"calcIfAutorange+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calcIfAutorange+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calcIfAutorange+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calcIfAutorange+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calcIfAutorange+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calcIfAutorange+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calcIfAutorange+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":722,"../../plots/cartesian/constants":737,"../../plots/font_attributes":758,"./arrow_paths":540}],542:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach(function(e){var r,n,a,o,s=i.getFromId(t,e.xref),l=i.getFromId(t,e.yref),c=3*e.arrowsize*e.arrowwidth||0,u=3*e.startarrowsize*e.arrowwidth||0;s&&s.autorange&&(r=c+e.xshift,n=c-e.xshift,a=u+e.xshift,o=u-e.xshift,e.axref===e.xref?(i.expand(s,[s.r2c(e.x)],{ppadplus:r,ppadminus:n}),i.expand(s,[s.r2c(e.ax)],{ppadplus:Math.max(e._xpadplus,a),ppadminus:Math.max(e._xpadminus,o)})):(a=e.ax?a+e.ax:a,o=e.ax?o-e.ax:o,i.expand(s,[s.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r,a),ppadminus:Math.max(e._xpadminus,n,o)}))),l&&l.autorange&&(r=c-e.yshift,n=c+e.yshift,a=u-e.yshift,o=u+e.yshift,e.ayref===e.yref?(i.expand(l,[l.r2c(e.y)],{ppadplus:r,ppadminus:n}),i.expand(l,[l.r2c(e.ay)],{ppadplus:Math.max(e._ypadplus,a),ppadminus:Math.max(e._ypadminus,o)})):(a=e.ay?a+e.ay:a,o=e.ay?o-e.ay:o,i.expand(l,[l.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r,a),ppadminus:Math.max(e._ypadminus,n,o)})))})}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.annotations);if(r.length&&t._fullData.length){var s={};for(var l in r.forEach(function(t){s[t.xref]=1,s[t.yref]=1}),s){var c=i.getFromId(t,l);if(c&&c.autorange)return n.syncOrAsync([a,o],t)}}}},{"../../lib":684,"../../plots/cartesian/axes":732,"./draw":547}],543:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,c,u=t._fullLayout.annotations,h=[],f=[],p=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),c=l.on,u=l.off.concat(l.explicitOff),h={},f=t._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}e._w=w,e._h=P;for(var q=!1,H=["x","y"],G=0;G1)&&(Q===K?((lt=tt.r2fraction(e["a"+J]))<0||lt>1)&&(q=!0):q=!0,q))continue;W=tt._offset+tt.r2p(e[J]),Z=.5}else"x"===J?(X=e[J],W=b.l+b.w*X):(X=1-e[J],W=b.t+b.h*X),Z=e.showarrow?.5:X;if(e.showarrow){st.head=W;var ct=e["a"+J];$=rt*U(.5,e.xanchor)-nt*U(.5,e.yanchor),Q===K?(st.tail=tt._offset+tt.r2p(ct),Y=$):(st.tail=W+ct,Y=$+ct),st.text=st.tail+$;var ut=x["x"===J?"width":"height"];if("paper"===K&&(st.head=o.constrain(st.head,1,ut-1)),"pixel"===Q){var ht=-Math.max(st.tail-3,st.text),ft=Math.min(st.tail+3,st.text)-ut;ht>0?(st.tail+=ht,st.text+=ht):ft>0&&(st.tail-=ft,st.text-=ft)}st.tail+=ot,st.head+=ot}else Y=$=it*U(Z,at),st.text=W+$;st.text+=ot,$+=ot,Y+=ot,e["_"+J+"padplus"]=it/2+Y,e["_"+J+"padminus"]=it/2-Y,e["_"+J+"size"]=it,e["_"+J+"shift"]=$}if(q)I.remove();else{var pt=0,dt=0;if("left"!==e.align&&(pt=(w-v)*("center"===e.align?.5:1)),"top"!==e.valign&&(dt=(P-y)*("middle"===e.valign?.5:1)),u)n.select("svg").attr({x:R+pt-1,y:R+dt}).call(c.setClipUrl,F?T:null);else{var gt=R+dt-d.top,mt=R+pt-d.left;V.call(h.positionText,mt,gt).call(c.setClipUrl,F?T:null)}N.select("rect").call(c.setRect,R,R,w,P),B.call(c.setRect,O/2,O/2,D-O,j-O),I.call(c.setTranslate,Math.round(S.x.text-D/2),Math.round(S.y.text-j/2)),L.attr({transform:"rotate("+E+","+S.x.text+","+S.y.text+")"});var vt,yt=function(r,n){C.selectAll(".annotation-arrow-g").remove();var u=S.x.head,h=S.y.head,f=S.x.tail+r,d=S.y.tail+n,v=S.x.text+r,y=S.y.text+n,x=o.rotationXYMatrix(E,v,y),w=o.apply2DTransform(x),T=o.apply2DTransform2(x),z=+B.attr("width"),P=+B.attr("height"),O=v-.5*z,D=O+z,R=y-.5*P,F=R+P,N=[[O,R,O,F],[O,F,D,F],[D,F,D,R],[D,R,O,R]].map(T);if(!N.reduce(function(t,e){return t^!!o.segmentsIntersect(u,h,u+1e6,h+1e6,e[0],e[1],e[2],e[3])},!1)){N.forEach(function(t){var e=o.segmentsIntersect(f,d,u,h,t[0],t[1],t[2],t[3]);e&&(f=e.x,d=e.y)});var j=e.arrowwidth,V=e.arrowcolor,U=e.arrowside,q=C.append("g").style({opacity:l.opacity(V)}).classed("annotation-arrow-g",!0),H=q.append("path").attr("d","M"+f+","+d+"L"+u+","+h).style("stroke-width",j+"px").call(l.stroke,l.rgb(V));if(g(H,U,e),_.annotationPosition&&H.node().parentNode&&!a){var G=u,W=h;if(e.standoff){var Y=Math.sqrt(Math.pow(u-f,2)+Math.pow(h-d,2));G+=e.standoff*(f-u)/Y,W+=e.standoff*(d-h)/Y}var X,Z,$=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(f-G)+","+(d-W),transform:"translate("+G+","+W+")"}).style("stroke-width",j+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");p.init({element:$.node(),gd:t,prepFn:function(){var t=c.getTranslate(I);X=t.x,Z=t.y,s&&s.autorange&&k(s._name+".autorange",!0),m&&m.autorange&&k(m._name+".autorange",!0)},moveFn:function(t,r){var n=w(X,Z),i=n[0]+t,a=n[1]+r;I.call(c.setTranslate,i,a),M("x",s?s.p2r(s.r2p(e.x)+t):e.x+t/b.w),M("y",m?m.p2r(m.r2p(e.y)+r):e.y-r/b.h),e.axref===e.xref&&M("ax",s.p2r(s.r2p(e.ax)+t)),e.ayref===e.yref&&M("ay",m.p2r(m.r2p(e.ay)+r)),q.attr("transform","translate("+t+","+r+")"),L.attr({transform:"rotate("+E+","+i+","+a+")"})},doneFn:function(){i.call("relayout",t,A());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&yt(0,0),z)p.init({element:I.node(),gd:t,prepFn:function(){vt=L.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?M("ax",s.p2r(s.r2p(e.ax)+t)):M("ax",e.ax+t),e.ayref===e.yref?M("ay",m.p2r(m.r2p(e.ay)+r)):M("ay",e.ay+r),yt(t,r);else{if(a)return;var i,o;if(s)i=s.p2r(s.r2p(e.x)+t);else{var l=e._xsize/b.w,c=e.x+(e._xshift-e.xshift)/b.w-l/2;i=p.align(c+t/b.w,l,0,1,e.xanchor)}if(m)o=m.p2r(m.r2p(e.y)+r);else{var u=e._ysize/b.h,h=e.y-(e._yshift+e.yshift)/b.h-u/2;o=p.align(h-r/b.h,u,0,1,e.yanchor)}M("x",i),M("y",o),s&&m||(n=p.getCursor(s?.5:i,m?.5:o,e.xanchor,e.yanchor))}L.attr({transform:"translate("+t+","+r+")"+vt}),f(I,n)},doneFn:function(){f(I),i.call("relayout",t,A());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,m=e.indexOf("end")>=0,v=h.backoff*p+r.standoff,y=f.backoff*d+r.startstandoff;if("line"===u.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},s={x:+t.attr("x2"),y:+t.attr("y2")};var x=o.x-s.x,b=o.y-s.y;if(c=(l=Math.atan2(b,x))+Math.PI,v&&y&&v+y>Math.sqrt(x*x+b*b))return void z();if(v){if(v*v>x*x+b*b)return void z();var _=v*Math.cos(l),w=v*Math.sin(l);s.x+=_,s.y+=w,t.attr({x2:s.x,y2:s.y})}if(y){if(y*y>x*x+b*b)return void z();var k=y*Math.cos(l),M=y*Math.sin(l);o.x-=k,o.y-=M,t.attr({x1:o.x,y1:o.y})}}else if("path"===u.nodeName){var A=u.getTotalLength(),T="";if(A1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":783,"../annotations/draw":547}],554:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var a=r.attrRegex,o=Object.keys(t),s=0;s=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(n(t))},a.opacity=function(t){return t?n(t).getAlpha():0},a.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},a.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||l).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},a.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(a.combine(t,l))),(i.isDark()?e?i.lighten(e):l:r?i.darken(r):s).toString()},a.stroke=function(t,e){var r=n(e);t.style({stroke:a.tinyRGB(r),"stroke-opacity":r.getAlpha()})},a.fill=function(t,e){var r=n(e);t.style({fill:a.tinyRGB(r),"fill-opacity":r.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,o=Object.keys(t);for(e=0;e0?S>=O:S<=O));E++)S>R&&S0?S>=O:S<=O));E++)S>C[0]&&S1){var at=Math.pow(10,Math.floor(Math.log(it)/Math.LN10));rt*=at*c.roundUp(it/at,[2,5,10]),(Math.abs(r.levels.start)/r.levels.size+1e-6)%1<2e-6&&(tt.tick0=0)}tt.dtick=rt}tt.domain=[$+Y,$+H-Y],tt.setScale();var ot=c.ensureSingle(k._infolayer,"g",e,function(t){t.classed(M.colorbar,!0).each(function(){var t=n.select(this);t.append("rect").classed(M.cbbg,!0),t.append("g").classed(M.cbfills,!0),t.append("g").classed(M.cblines,!0),t.append("g").classed(M.cbaxis,!0).classed(M.crisp,!0),t.append("g").classed(M.cbtitleunshift,!0).append("g").classed(M.cbtitle,!0),t.append("rect").classed(M.cboutline,!0),t.select(".cbtitle").datum(0)})});ot.attr("transform","translate("+Math.round(T.l)+","+Math.round(T.t)+")");var st=ot.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(T.l)+",-"+Math.round(T.t)+")");tt._axislayer=ot.select(".cbaxis");var lt=0;if(-1!==["top","bottom"].indexOf(r.titleside)){var ct,ut=T.l+(r.x+G)*T.w,ht=tt.titlefont.size;ct="top"===r.titleside?(1-($+H-Y))*T.h+T.t+3+.75*ht:(1-($+Y))*T.h+T.t-3-.25*ht,vt(tt._id+"title",{attributes:{x:ut,y:ct,"text-anchor":"start"}})}var ft,pt,dt,gt=c.syncOrAsync([a.previousPromises,function(){if(-1!==["top","bottom"].indexOf(r.titleside)){var e=ot.select(".cbtitle"),a=e.select("text"),o=[-r.outlinewidth/2,r.outlinewidth/2],l=e.select(".h"+tt._id+"title-math-group").node(),u=15.6;if(a.node()&&(u=parseInt(a.node().style.fontSize,10)*v),l?(lt=f.bBox(l).height)>u&&(o[1]-=(lt-u)/2):a.node()&&!a.classed(M.jsPlaceholder)&&(lt=f.bBox(a.node()).height),lt){if(lt+=5,"top"===r.titleside)tt.domain[1]-=lt/T.h,o[1]*=-1;else{tt.domain[0]+=lt/T.h;var h=g.lineCount(a);o[1]+=(1-h)*u}e.attr("transform","translate("+o+")"),tt.setScale()}}ot.selectAll(".cbfills,.cblines").attr("transform","translate(0,"+Math.round(T.h*(1-tt.domain[1]))+")"),tt._axislayer.attr("transform","translate(0,"+Math.round(-T.t)+")");var p=ot.select(".cbfills").selectAll("rect.cbfill").data(z);p.enter().append("rect").classed(M.cbfill,!0).style("stroke","none"),p.exit().remove(),p.each(function(t,e){var r=[0===e?C[0]:(z[e]+z[e-1])/2,e===z.length-1?C[1]:(z[e]+z[e+1])/2].map(tt.c2p).map(Math.round);e!==z.length-1&&(r[1]+=r[1]>r[0]?1:-1);var a=I(t).replace("e-",""),o=i(a).toHexString();n.select(this).attr({x:X,width:Math.max(V,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var d=ot.select(".cblines").selectAll("path.cbline").data(r.line.color&&r.line.width?L:[]);return d.enter().append("path").classed(M.cbline,!0),d.exit().remove(),d.each(function(t){n.select(this).attr("d","M"+X+","+(Math.round(tt.c2p(t))+r.line.width/2%1)+"h"+V).call(f.lineGroupStyle,r.line.width,P(t),r.line.dash)}),tt._axislayer.selectAll("g."+tt._id+"tick,path").remove(),tt._pos=X+V+(r.outlinewidth||0)/2-("outside"===r.ticks?1:0),tt.side="right",c.syncOrAsync([function(){return s.doTicksSingle(t,tt,!0)},function(){if(-1===["top","bottom"].indexOf(r.titleside)){var e=tt.titlefont.size,i=tt._offset+tt._length/2,a=T.l+(tt.position||0)*T.w+("right"===tt.side?10+e*(tt.showticklabels?1:.5):-10-e*(tt.showticklabels?.5:0));vt("h"+tt._id+"title",{avoid:{selection:n.select(t).selectAll("g."+tt._id+"tick"),side:r.titleside,offsetLeft:T.l,offsetTop:0,maxShift:k.width},attributes:{x:a,y:i,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])},a.previousPromises,function(){var n=V+r.outlinewidth/2+f.bBox(tt._axislayer.node()).width;if((F=st.select("text")).node()&&!F.classed(M.jsPlaceholder)){var i,o=st.select(".h"+tt._id+"title-math-group").node();i=o&&-1!==["top","bottom"].indexOf(r.titleside)?f.bBox(o).width:f.bBox(st.node()).right-X-T.l,n=Math.max(n,i)}var s=2*r.xpad+n+r.borderwidth+r.outlinewidth/2,l=J-K;ot.select(".cbbg").attr({x:X-r.xpad-(r.borderwidth+r.outlinewidth)/2,y:K-W,width:Math.max(s,2),height:Math.max(l+2*W,2)}).call(p.fill,r.bgcolor).call(p.stroke,r.bordercolor).style({"stroke-width":r.borderwidth}),ot.selectAll(".cboutline").attr({x:X,y:K+r.ypad+("top"===r.titleside?lt:0),width:Math.max(V,2),height:Math.max(l-2*r.ypad-lt,2)}).call(p.stroke,r.outlinecolor).style({fill:"None","stroke-width":r.outlinewidth});var c=({center:.5,right:1}[r.xanchor]||0)*s;ot.attr("transform","translate("+(T.l-c)+","+T.t+")");var u={},h=y[r.yanchor],d=x[r.yanchor];"pixels"===r.lenmode?(u.y=r.y,u.t=l*h,u.b=l*d):(u.t=u.b=0,u.yt=r.y+r.len*h,u.yb=r.y-r.len*d);var g=y[r.xanchor],m=x[r.xanchor];if("pixels"===r.thicknessmode)u.x=r.x,u.l=s*g,u.r=s*m;else{var v=s-V;u.l=v*g,u.r=v*m,u.xl=r.x-r.thickness*g,u.xr=r.x+r.thickness*m}a.autoMargin(t,e,u)}],t);if(gt&>.then&&(t._promises||[]).push(gt),t._context.edits.colorbarPosition)l.init({element:ot.node(),gd:t,prepFn:function(){ft=ot.attr("transform"),h(ot)},moveFn:function(t,e){ot.attr("transform",ft+" translate("+t+","+e+")"),pt=l.align(Z+t/T.w,U,0,1,r.xanchor),dt=l.align($-e/T.h,H,0,1,r.yanchor);var n=l.getCursor(pt,dt,r.xanchor,r.yanchor);h(ot,n)},doneFn:function(){h(ot),void 0!==pt&&void 0!==dt&&o.call("restyle",t,{"colorbar.x":pt,"colorbar.y":dt},A().index)}});return gt}function mt(t,e){return c.coerce(Q,tt,w,t,e)}function vt(e,r){var n=A(),i="colorbar.title",a=n._module.colorbar.container;a&&(i=a+"."+i);var o={propContainer:tt,propName:i,traceIndex:n.index,placeholder:k._dfltTitle.colorbar,containerGroup:ot.select(".cbtitle")},s="h"===e.charAt(0)?e.substr(1):"h"+e;ot.selectAll("."+s+",."+s+"-math-group").remove(),d.draw(t,e,u(o,r||{}))}k._infolayer.selectAll("g."+e).remove()}function A(){var r,n,i=e.substr(2);for(r=0;r=0?i.Reds:i.Blues,s.reversescale?a(y):y),l.autocolorscale||h("autocolorscale",!1))}},{"../../lib":684,"./flip_scale":570,"./scales":577}],567:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":577}],568:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,c,u){var h,f=u.prefix,p=u.cLetter,d=f.slice(0,f.length-1),g=f?i.nestedProperty(t,d).get()||{}:t,m=f?i.nestedProperty(e,d).get()||{}:e,v=g[p+"min"],y=g[p+"max"],x=g.colorscale;c(f+p+"auto",!(n(v)&&n(y)&&v=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n}},{}],571:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),a=t("./is_valid_scale_array");e.exports=function(t,e){if(e||(e=i),!t)return e;function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return"string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e}},{"./default_scale":567,"./is_valid_scale_array":575,"./scales":577}],572:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,o=r.color,s=!1;if(i.isArrayOrTypedArray(o))for(var l=0;l4/3-s?o:s}},{}],579:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":684}],580:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../registry"),s=t("../../lib"),l=t("../../plots/cartesian/constants"),c=t("../../constants/interactions"),u=e.exports={};u.align=t("./align"),u.getCursor=t("./cursor");var h=t("./unhover");function f(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function p(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}u.unhover=h.wrapped,u.unhoverRaw=h.raw,u.init=function(t){var e,r,n,h,d,g,m,v,y=t.gd,x=1,b=c.DBLCLICKDELAY,_=t.element;y._mouseDownTime||(y._mouseDownTime=0),_.style.pointerEvents="all",_.onmousedown=k,a?(_._ontouchstart&&_.removeEventListener("touchstart",_._ontouchstart),_._ontouchstart=k,_.addEventListener("touchstart",k,{passive:!1})):_.ontouchstart=k;var w=t.clampFn||function(t,e,r){return Math.abs(t)b&&(x=Math.max(x-1,1)),y._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(x,g),!v){var r;try{r=new MouseEvent("click",e)}catch(t){var n=p(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}m.dispatchEvent(r)}!function(t){t._dragging=!1,t._replotPending&&o.call("plot",t)}(y),y._dragged=!1}else y._dragged=!1}},u.coverSlip=f},{"../../constants/interactions":660,"../../lib":684,"../../plots/cartesian/constants":737,"../../registry":817,"./align":578,"./cursor":579,"./unhover":581,"has-hover":378,"has-passive-events":379,"mouse-event-offset":403}],581:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/get_graph_div"),o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/events":672,"../../lib/get_graph_div":679,"../../lib/throttle":709,"../fx/constants":595}],582:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],583:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),c=t("../../lib"),u=t("../../lib/svg_text_utils"),h=t("../../constants/xmlns_namespaces"),f=t("../../constants/alignment").LINE_SPACING,p=t("../../constants/interactions").DESELECTDIM,d=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),m=e.exports={};m.font=function(t,e,r,n){c.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},m.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},m.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},m.setRect=function(t,e,r,n,i){t.call(m.setPosition,e,r).call(m.setSize,n,i)},m.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),o=n.c2p(t.y);return!!(i(a)&&i(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",o):e.attr("transform","translate("+a+","+o+")"),!0)},m.translatePoints=function(t,e,r){t.each(function(t){var i=n.select(this);m.translatePoint(t,i,e,r)})},m.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},m.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each(function(e){var a=e[0].trace,o=a.xcalendar,s=a.ycalendar,l="bar"===a.type?".bartext":".point,.textpoint";t.selectAll(l).each(function(t){m.hideOutsideRangePoint(t,n.select(this),r,i,o,s)})})}},m.crispRound=function(t,e,r){return e&&i(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},m.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,l=i||a.dash||"";s.stroke(e,n||a.color),m.dashLine(e,l,o)},m.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each(function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,l=i||a.dash||"";n.select(this).call(s.stroke,r||a.color).call(m.dashLine,l,o)})},m.dashLine=function(t,e,r){r=+r||0,e=m.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},m.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},m.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(s.fill,e)},m.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=n.select(this);try{r.call(s.fill,e[0].trace.fillcolor)}catch(e){c.error(e,t),r.remove()}})};var v=t("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(v).forEach(function(t){var e=v[t];m.symbolList=m.symbolList.concat([e.n,t,e.n+100,t+"-open"]),m.symbolNames[e.n]=t,m.symbolFuncs[e.n]=e.f,e.needLine&&(m.symbolNeedLines[e.n]=!0),e.noDot?m.symbolNoDot[e.n]=!0:m.symbolList=m.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"]),e.noFill&&(m.symbolNoFill[e.n]=!0)});var y=m.symbolNames.length,x="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";function b(t,e){var r=t%100;return m.symbolFuncs[r](e)+(t>=200?x:"")}m.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=m.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=y||t>=400?0:Math.floor(Math.max(t,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0};m.gradient=function(t,e,r,i,o,l){var u=e._fullLayout._defs.select(".gradients").selectAll("#"+r).data([i+o+l],c.identity);u.exit().remove(),u.enter().append("radial"===i?"radialGradient":"linearGradient").each(function(){var t=n.select(this);"horizontal"===i?t.attr(_):"vertical"===i&&t.attr(w),t.attr("id",r);var e=a(o),c=a(l);t.append("stop").attr({offset:"0%","stop-color":s.tinyRGB(c),"stop-opacity":c.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":s.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+r+")","fill-opacity":null})},m.initGradients=function(t){c.ensureSingle(t._fullLayout._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove()},m.pointStyle=function(t,e,r){if(t.size()){var i=m.makePointStyleFns(e);t.each(function(t){m.singlePointStyle(t,n.select(this),e,i,r)})}},m.singlePointStyle=function(t,e,r,n,i){var a=r.marker,o=a.line;if(e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?a.opacity:t.mo),n.ms2mrc){var l;l="various"===t.ms||"various"===a.size?3:n.ms2mrc(t.ms),t.mrc=l,n.selectedSizeFn&&(l=t.mrc=n.selectedSizeFn(t));var u=m.symbolNumber(t.mx||a.symbol)||0;t.om=u%200>=100,e.attr("d",b(u,l))}var h,f,p,d=!1;if(t.so)p=o.outlierwidth,f=o.outliercolor,h=a.outliercolor;else{var g=(o||{}).width;p=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,f="mlc"in t?t.mlcc=n.lineScale(t.mlc):c.isArrayOrTypedArray(o.color)?s.defaultLine:o.color,c.isArrayOrTypedArray(a.color)&&(h=s.defaultLine,d=!0),h="mc"in t?t.mcc=n.markerScale(t.mc):a.color||"rgba(0,0,0,0)",n.selectedColorFn&&(h=n.selectedColorFn(t))}if(t.om)e.call(s.stroke,h).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",p+"px");var v=a.gradient,y=t.mgt;if(y?d=!0:y=v&&v.type,y&&"none"!==y){var x=t.mgc;x?d=!0:x=v.color;var _="g"+i._fullLayout._uid+"-"+r.uid;d&&(_+="-"+t.i),e.call(m.gradient,i,_,y,h,x)}else e.call(s.fill,h);p&&e.call(s.stroke,f)}},m.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=m.tryColorscale(r,""),e.lineScale=m.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=d.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&c.extendFlat(e,m.makeSelectedPointStyleFns(t)),e},m.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},a=r.marker||{},s=n.marker||{},l=i.opacity,u=a.opacity,h=s.opacity,f=void 0!==u,d=void 0!==h;(c.isArrayOrTypedArray(l)||f||d)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?f?u:e:d?h:p*e});var g=i.color,m=a.color,v=s.color;(m||v)&&(e.selectedColorFn=function(t){var e=t.mcc||g;return t.selected?m||e:v||e});var y=i.size,x=a.size,b=s.size,_=void 0!==x,w=void 0!==b;return o.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?x/2:e:w?b/2:e}),e},m.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},l=i.color,c=a.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||l;return t.selected?c||e:u||(c?e:s.addOpacity(e,p))},e},m.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=m.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push(function(t,e){t.style("opacity",r.selectedOpacityFn(e))}),r.selectedColorFn&&a.push(function(t,e){s.fill(t,r.selectedColorFn(e))}),r.selectedSizeFn&&a.push(function(t,e){var n=e.mx||i.symbol||0,a=r.selectedSizeFn(e);t.attr("d",b(m.symbolNumber(n),a)),e.mrc2=a}),a.length&&t.each(function(t){for(var e=n.select(this),r=0;r0?r:0}m.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var a=m.makeSelectedTextStyleFns(e);i=a.selectedTextColorFn}t.each(function(t){var a=n.select(this),o=c.extractOption(t,e,"tx","text");if(o||0===o){var s=t.tp||e.textposition,l=A(t,e),h=i?i(t):t.tc||e.textfont.color;a.call(m.font,t.tf||e.textfont.family,l,h).text(o).call(u.convertToTspans,r).call(M,s,l,t.mrc)}else a.remove()})}},m.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=m.makeSelectedTextStyleFns(e);t.each(function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,l=A(t,e);s.fill(i,a),M(i,o,l,t.mrc2||t.mrc)})}};var T=.5;function S(t,e,r,i){var a=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],c=Math.pow(a*a+o*o,T/2),u=Math.pow(s*s+l*l,T/2),h=(u*u*a-c*c*s)*i,f=(u*u*o-c*c*l)*i,p=3*u*(c+u),d=3*c*(c+u);return[[n.round(e[0]+(p&&h/p),2),n.round(e[1]+(p&&f/p),2)],[n.round(e[0]-(d&&h/d),2),n.round(e[1]-(d&&f/d),2)]]}m.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(m.savedBBoxes={},L=0),r&&(m.savedBBoxes[r]=v),L++,c.extendFlat({},v)},m.setClipUrl=function(t,e){if(e){if(void 0===m.baseUrl){var r=n.select("base");r.size()&&r.attr("href")?m.baseUrl=window.location.href.split("#")[0]:m.baseUrl=""}t.attr("clip-path","url("+m.baseUrl+"#"+e+")")}else t.attr("clip-path",null)},m.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||0,y:+e[1]||0}},m.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=" translate("+e+", "+r+")").trim(),t[i]("transform",a),a},m.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||1,y:+e[1]||1}},m.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+=" scale("+e+", "+r+")").trim(),t[i]("transform",a),a};var P=/\s*sc.*/;m.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":" scale("+e+","+r+")";t.each(function(){var t=(this.getAttribute("transform")||"").replace(P,"");t=(t+=n).trim(),this.setAttribute("transform",t)})}};var I=/translate\([^)]*\)\s*$/;m.setTextPointsScale=function(t,e,r){t&&t.each(function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(I);t=1===e&&1===r?[]:["translate("+o+","+s+")","scale("+e+","+r+")","translate("+-o+","+-s+")"],l&&t.push(l),i.attr("transform",t.join(" "))}})}},{"../../constants/alignment":656,"../../constants/interactions":660,"../../constants/xmlns_namespaces":663,"../../lib":684,"../../lib/svg_text_utils":708,"../../registry":817,"../../traces/scatter/make_bubble_size_func":1031,"../../traces/scatter/subtypes":1037,"../color":558,"../colorscale":573,"./symbol_defs":584,d3:147,"fast-isnumeric":214,tinycolor2:499}],584:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+a+","+c+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0,noFill:!0}}},{d3:147}],585:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],586:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../plots/cartesian/axes"),o=t("./compute_error");function s(t,e,r,i){var s=e["error_"+i]||{},l=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=o(s),u=0;u0;t.each(function(t){var u,h=t[0].trace,f=h.error_x||{},p=h.error_y||{};h.ids&&(u=function(t){return t.id});var d=o.hasMarkers(h)&&h.marker.maxdisplayed>0;p.visible||f.visible||(t=[]);var g=n.select(this).selectAll("g.errorbar").data(t,u);if(g.exit().remove(),t.length){f.visible||g.selectAll("path.xerror").remove(),p.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var m=g.enter().append("g").classed("errorbar",!0);c&&m.style("opacity",0).transition().duration(r.duration).style("opacity",1),a.setClipUrl(g,e.layerClipId),g.each(function(t){var e=n.select(this),a=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0)));void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,s,l);if(!d||t.vis){var o,u=e.select("path.yerror");if(p.visible&&i(a.x)&&i(a.yh)&&i(a.ys)){var h=p.width;o="M"+(a.x-h)+","+a.yh+"h"+2*h+"m-"+h+",0V"+a.ys,a.noYS||(o+="m-"+h+",0h"+2*h),!u.size()?u=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(u=u.transition().duration(r.duration).ease(r.easing)),u.attr("d",o)}else u.remove();var g=e.select("path.xerror");if(f.visible&&i(a.y)&&i(a.xh)&&i(a.xs)){var m=(f.copy_ystyle?p:f).width;o="M"+a.xh+","+(a.y-m)+"v"+2*m+"m0,-"+m+"H"+a.xs,a.noXS||(o+="m0,-"+m+"v"+2*m),!g.size()?g=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(g=g.transition().duration(r.duration).ease(r.easing)),g.attr("d",o)}else g.remove()}})}})}},{"../../traces/scatter/subtypes":1037,"../drawing":583,d3:147,"fast-isnumeric":214}],591:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)})}},{"../color":558,d3:147}],592:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:n({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":758}],593:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.index-1&&o.length>y&&(o=y>3?o.substr(0,y-3)+"...":o.substr(0,y))}void 0!==t.zLabel?(void 0!==t.xLabel&&(c+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(c+="y: "+t.yLabel+"
"),c+=(c?"z: ":"")+t.zLabel):L&&t[i+"Label"]===M?c=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(c=t.yLabel):c=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(c+=(c?"
":"")+t.text),void 0!==t.extraText&&(c+=(c?"
":"")+t.extraText),""===c&&(""===o&&e.remove(),c=o);var x=e.select("text.nums").call(u.font,t.fontFamily||d,t.fontSize||g,t.fontColor||m).text(c).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),b=e.select("text.name"),_=0;o&&o!==c?(b.call(u.font,t.fontFamily||d,t.fontSize||g,p).text(o).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),_=b.node().getBoundingClientRect().width+2*k):(b.remove(),e.select("rect").remove()),e.select("path").style({fill:p,stroke:m});var A,T,z=x.node().getBoundingClientRect(),P=t.xa._offset+(t.x0+t.x1)/2,I=t.ya._offset+(t.y0+t.y1)/2,O=Math.abs(t.x1-t.x0),D=Math.abs(t.y1-t.y0),R=z.width+w+k+_;t.ty0=S-z.top,t.bx=z.width+2*k,t.by=z.height+2*k,t.anchor="start",t.txwidth=z.width,t.tx2width=_,t.offset=0,a?(t.pos=P,A=I+D/2+R<=C,T=I-D/2-R>=0,"top"!==t.idealAlign&&A||!T?A?(I+=D/2,t.anchor="start"):t.anchor="middle":(I-=D/2,t.anchor="end")):(t.pos=I,A=P+O/2+R<=E,T=P-O/2-R>=0,"left"!==t.idealAlign&&A||!T?A?(P+=O/2,t.anchor="start"):t.anchor="middle":(P-=O/2,t.anchor="end")),x.attr("text-anchor",t.anchor),_&&b.attr("text-anchor",t.anchor),e.attr("transform","translate("+P+","+I+")"+(a?"rotate("+v+")":""))}),R}function A(t,e){t.each(function(t){var r=n.select(this);if(t.del)r.remove();else{var i="end"===t.anchor?-1:1,a=r.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],s=o*(w+k),c=s+o*(t.txwidth+k),h=0,f=t.offset;"middle"===t.anchor&&(s-=t.tx2width/2,c+=t.txwidth/2+k),e&&(f*=-_,h=t.offset*b),r.select("path").attr("d","middle"===t.anchor?"M-"+(t.bx/2+t.tx2width/2)+","+(f-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(i*w+h)+","+(w+f)+"v"+(t.by/2-w)+"h"+i*t.bx+"v-"+t.by+"H"+(i*w+h)+"V"+(f-w)+"Z"),a.call(l.positionText,s+h,f+t.ty0-t.by/2+k),t.tx2width&&(r.select("text.name").call(l.positionText,c+o*k+h,f+t.ty0-t.by/2+k),r.select("rect").call(u.setRect,c+(o-1)*t.tx2width/2+h,f-t.by/2-1,t.tx2width,t.by+2))}})}function T(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],a=t.cd[r]||{},s=Array.isArray(r)?function(t,e){return o.castOption(i,r,t)||o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(a,n,t,e)};function l(e,r,n){var i=s(r,n);i&&(t[e]=i)}if(l("hoverinfo","hi","hoverinfo"),l("color","hbg","hoverlabel.bgcolor"),l("borderColor","hbc","hoverlabel.bordercolor"),l("fontFamily","htf","hoverlabel.font.family"),l("fontSize","hts","hoverlabel.font.size"),l("fontColor","htc","hoverlabel.font.color"),l("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:p.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:p.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var c=p.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+c+" / -"+p.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" ± "+c,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var u=p.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+u+" / -"+p.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" ± "+u,"y"===e&&(t.distance+=1)}var h=t.hoverinfo||t.trace.hoverinfo;return"all"!==h&&(-1===(h=Array.isArray(h)?h:h.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===h.indexOf("y")&&(t.yLabel=void 0),-1===h.indexOf("z")&&(t.zLabel=void 0),-1===h.indexOf("text")&&(t.text=void 0),-1===h.indexOf("name")&&(t.name=void 0)),t}function S(t,e){var r,n,i=e.container,o=e.fullLayout,s=e.event,l=!!t.hLinePoint,c=!!t.vLinePoint;if(i.selectAll(".spikeline").remove(),c||l){var f=h.combine(o.plot_bgcolor,o.paper_bgcolor);if(l){var p,d,g=t.hLinePoint;r=g&&g.xa,"cursor"===(n=g&&g.ya).spikesnap?(p=s.pointerX,d=s.pointerY):(p=r._offset+g.x,d=n._offset+g.y);var m,v,y=a.readability(g.color,f)<1.5?h.contrast(f):g.color,x=n.spikemode,b=n.spikethickness,_=n.spikecolor||y,w=n._boundingBox,k=(w.left+w.right)/2w[0]._length||tt<0||tt>k[0]._length)return f.unhoverRaw(t,e)}if(e.pointerX=Q+w[0]._offset,e.pointerY=tt+k[0]._offset,D="xval"in e?g.flat(l,e.xval):g.p2c(w,Q),R="yval"in e?g.flat(l,e.yval):g.p2c(k,tt),!i(D[0])||!i(R[0]))return o.warn("Fx.hover failed",e,t),f.unhoverRaw(t,e)}var nt=1/0;for(F=0;FY&&($.splice(0,Y),nt=$[0].distance),y&&0!==Z&&0===$.length){W.distance=Z,W.index=!1;var lt=j._module.hoverPoints(W,H,G,"closest",u._hoverlayer);if(lt&&(lt=lt.filter(function(t){return t.spikeDistance<=Z})),lt&<.length){var ct,ut=lt.filter(function(t){return t.xa.showspikes});if(ut.length){var ht=ut[0];i(ht.x0)&&i(ht.y0)&&(ct=gt(ht),(!K.vLinePoint||K.vLinePoint.spikeDistance>ct.spikeDistance)&&(K.vLinePoint=ct))}var ft=lt.filter(function(t){return t.ya.showspikes});if(ft.length){var pt=ft[0];i(pt.x0)&&i(pt.y0)&&(ct=gt(pt),(!K.hLinePoint||K.hLinePoint.spikeDistance>ct.spikeDistance)&&(K.hLinePoint=ct))}}}}function dt(t,e){for(var r,n=null,i=1/0,a=0;a1,Et=h.combine(u.plot_bgcolor||h.background,u.paper_bgcolor),Ct={hovermode:O,rotateLabels:St,bgColor:Et,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},Lt=M($,Ct,t);if(function(t,e,r){var n,i,a,o,s,l,c,u=0,h=t.map(function(t,n){var i=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===i._id.charAt(0)?x:1)/2,pmin:0,pmax:"x"===i._id.charAt(0)?r.width:r.height}]}).sort(function(t,e){return t[0].posref-e[0].posref});function f(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}for(;!n&&u<=t.length;){for(u++,n=!0,o=0;o.01&&g.pmin===m.pmin&&g.pmax===m.pmax){for(s=d.length-1;s>=0;s--)d[s].dp+=i;for(p.push.apply(p,d),h.splice(o+1,1),c=0,s=p.length-1;s>=0;s--)c+=p[s].dp;for(a=c/p.length,s=p.length-1;s>=0;s--)p[s].dp-=a;n=!1}else o++}h.forEach(f)}for(o=h.length-1;o>=0;o--){var v=h[o];for(s=v.length-1;s>=0;s--){var y=v[s],b=t[y.i];b.offset=y.dp,b.del=y.del}}}($,St?"xa":"ya",u),A(Lt,St),e.target&&e.target.tagName){var zt=d.getComponentMethod("annotations","hasClickToShow")(t,At);c(n.select(e.target),zt?"pointer":"")}if(!e.target||a||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}(t,0,Mt))return;Mt&&t.emit("plotly_unhover",{event:e,points:Mt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:w,yaxes:k,xvals:D,yvals:R})}(t,e,r,a)})},r.loneHover=function(t,e){var r={color:t.color||h.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},i=n.select(e.container),a=e.outerContainer?n.select(e.outerContainer):i,o={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||h.background,container:i,outerContainer:a},s=M([r],o,e.gd);return A(s,o.rotateLabels),s.node()}},{"../../lib":684,"../../lib/events":672,"../../lib/override_cursor":695,"../../lib/svg_text_utils":708,"../../plots/cartesian/axes":732,"../../registry":817,"../color":558,"../dragelement":580,"../drawing":583,"./constants":595,"./helpers":597,d3:147,"fast-isnumeric":214,tinycolor2:499}],599:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i){r("hoverlabel.bgcolor",(i=i||{}).bgcolor),r("hoverlabel.bordercolor",i.bordercolor),r("hoverlabel.namelength",i.namelength),n.coerceFont(r,"hoverlabel.font",i.font)}},{"../../lib":684}],600:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,"hoverinfo",function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)})},hover:t("./hover").hover,unhover:a.unhover,loneHover:t("./hover").loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":684,"../dragelement":580,"./attributes":592,"./calc":593,"./click":594,"./constants":595,"./defaults":596,"./helpers":597,"./hover":598,"./layout_attributes":601,"./layout_defaults":602,"./layout_global_defaults":603,d3:147}],601:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes")({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:20,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":758,"./constants":595}],602:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}var o;"select"===a("dragmode")&&a("selectdirection"),e._has("cartesian")?(e._isHoriz=function(t){for(var e=!0,r=0;r1){f||p||d||"independent"===M("pattern")&&(f=!0),m._hasSubplotGrid=f;var x,b,_="top to bottom"===M("roworder"),w=f?.2:.1,k=f?.3:.1;g&&e._splomGridDflt&&(x=e._splomGridDflt.xside,b=e._splomGridDflt.yside),m._domains={x:u("x",M,w,x,y),y:u("y",M,k,b,v,_)}}else delete e.grid}function M(t,e){return n.coerce(r,m,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,u,f=t.grid||{},p=e._subplots,d=r._hasSubplotGrid,g=r.rows,m=r.columns,v="independent"===r.pattern,y=r._axisMap={};if(d){var x=f.subplots||[];l=r.subplots=new Array(g);var b=1;for(n=0;n=2/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],611:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":758,"../color/attributes":557}],612:[function(t,e,r){"use strict";e.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],613:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../plot_api/plot_template"),o=t("./attributes"),s=t("../../plots/layout_attributes"),l=t("./helpers");e.exports=function(t,e,r){for(var c,u,h,f,p=t.legend||{},d=0,g="normal",m=0;m1)){var y=a.newContainer(e,"legend");if(b("bgcolor",e.paper_bgcolor),b("bordercolor"),b("borderwidth"),i.coerceFont(b,"font",e.font),b("orientation"),"h"===y.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(c=0,h="left",u=1.1,f="bottom"):(c=0,h="left",u=-.1,f="top")}b("traceorder",g),l.isGrouped(e.legend)&&b("tracegroupgap"),b("x",c),b("xanchor",h),b("y",u),b("yanchor",f),i.noneOrAll(p,y,["x","y"])}function b(t,e){return i.coerce(p,y,o,t,e)}}},{"../../lib":684,"../../plot_api/plot_template":722,"../../plots/layout_attributes":786,"../../registry":817,"./attributes":611,"./helpers":617}],614:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),c=t("../drawing"),u=t("../color"),h=t("../../lib/svg_text_utils"),f=t("./handle_click"),p=t("./constants"),d=t("../../constants/interactions"),g=t("../../constants/alignment"),m=g.LINE_SPACING,v=g.FROM_TL,y=g.FROM_BR,x=t("./get_legend_data"),b=t("./style"),_=t("./helpers"),w=t("./anchor_utils"),k=d.DBLCLICKDELAY;function M(t,e,r,n,i){var a=r.data()[0][0].trace,o={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(o.group=a._group),"pie"===a.type&&(o.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",o))if(1===n)e._clickTimeout=setTimeout(function(){f(r,t,n)},k);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",o)&&f(r,t,n)}}function A(t,e,r){var n=t.data()[0][0],a=e._fullLayout,s=n.trace,l=o.traceIs(s,"pie"),u=s.index,f=l?n.label:s.name,p=e._context.edits.legendText&&!l,d=i.ensureSingle(t,"text","legendtext");function g(r){h.convertToTspans(r,e,function(){!function(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,i,a=t.select("g[class*=math-group]"),o=a.node(),s=e._fullLayout.legend.font.size*m;if(o){var l=c.bBox(o);n=l.height,i=l.width,c.setTranslate(a,0,n/4)}else{var u=t.select(".legendtext"),f=h.lineCount(u),p=u.node();n=s*f,i=p?c.bBox(p).width:0;var d=s*(.3+(1-f)/2);h.positionText(u,40,d)}n=Math.max(n,16)+3,r.height=n,r.width=i}(t,e)})}d.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,a.legend.font).text(p?T(f,r):f),p?d.call(h.makeEditable,{gd:e,text:f}).call(g).on("edit",function(t){this.text(T(t,r)).call(g);var a=n.trace._fullInput||{},s={};if(o.hasTransform(a,"groupby")){var l=o.getTransformIndices(a,"groupby"),c=l[l.length-1],h=i.keyedContainer(a,"transforms["+c+"].styles","target","value.name");h.set(n.trace._group,t),s=h.constructUpdate()}else s.name=t;return o.call("restyle",e,s,u)}):g(d)}function T(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function S(t,e){var r,a=1,o=i.ensureSingle(t,"rect","legendtoggle",function(t){t.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")});o.on("mousedown",function(){(r=(new Date).getTime())-e._legendMouseDownTimek&&(a=Math.max(a-1,1)),M(e,r,t,a,n.event)}})}function E(t,e,r){var i=t._fullLayout,a=i.legend,o=a.borderwidth,s=_.isGrouped(a),l=0;if(a._width=0,a._height=0,_.isVertical(a))s&&e.each(function(t,e){c.setTranslate(this,0,e*a.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;c.setTranslate(this,o,5+o+a._height+r/2),a._height+=r,a._width=Math.max(a._width,n)}),a._width+=45+2*o,a._height+=10+2*o,s&&(a._height+=(a._lgroupsLength-1)*a.tracegroupgap),l=40;else if(s){for(var u=[a._width],h=e.data(),f=0,p=h.length;fo+w-k,r.each(function(t){var e=t[0],r=m?40+t[0].width:x;o+b+k+r>i.width-(i.margin.r+i.margin.l)&&(b=0,v+=y,a._height=a._height+y,y=0),c.setTranslate(this,o+b,5+o+e.height/2+v),a._width+=k+r,a._height=Math.max(a._height,e.height),b+=k+r,y=Math.max(e.height,y)}),a._width+=2*o,a._height+=10+2*o}a._width=Math.ceil(a._width),a._height=Math.ceil(a._height);var M=t._context.edits.legendText||t._context.edits.legendPosition;r.each(function(t){var e=t[0],r=n.select(this).select(".legendtoggle");c.setRect(r,0,-e.height/2,(M?0:a._width)+l,e.height)})}function C(t){var e=t._fullLayout.legend,r="left";w.isRightAnchor(e)?r="right":w.isCenterAnchor(e)&&(r="center");var n="top";w.isBottomAnchor(e)?n="bottom":w.isMiddleAnchor(e)&&(n="middle"),a.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*v[r],r:e._width*y[r],b:e._height*y[n],t:e._height*v[n]})}e.exports=function(t){var e=t._fullLayout,r="legend"+e._uid;if(e._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var s=e.legend,h=e.showlegend&&x(t.calcdata,s),f=e.hiddenlabels||[];if(!e.showlegend||!h.length)return e._infolayer.selectAll(".legend").remove(),e._topdefs.select("#"+r).remove(),void a.autoMargin(t,"legend");for(var d=0,g=0;gN?function(t){var e=t._fullLayout.legend,r="left";w.isRightAnchor(e)?r="right":w.isCenterAnchor(e)&&(r="center");a.autoMargin(t,"legend",{x:e.x,y:.5,l:e._width*v[r],r:e._width*y[r],b:0,t:0})}(t):C(t);var j=e._size,V=j.l+j.w*s.x,U=j.t+j.h*(1-s.y);w.isRightAnchor(s)?V-=s._width:w.isCenterAnchor(s)&&(V-=s._width/2),w.isBottomAnchor(s)?U-=s._height:w.isMiddleAnchor(s)&&(U-=s._height/2);var q=s._width,H=j.w;q>H?(V=j.l,q=H):(V+q>F&&(V=F-q),V<0&&(V=0),q=Math.min(F-V,s._width));var G,W,Y,X,Z=s._height,$=j.h;if(Z>$?(U=j.t,Z=$):(U+Z>N&&(U=N-Z),U<0&&(U=0),Z=Math.min(N-U,s._height)),c.setTranslate(z,V,U),D.on(".drag",null),z.on("wheel",null),s._height<=Z||t._context.staticPlot)I.attr({width:q-s.borderwidth,height:Z-s.borderwidth,x:s.borderwidth/2,y:s.borderwidth/2}),c.setTranslate(O,0,0),P.select("rect").attr({width:q-2*s.borderwidth,height:Z-2*s.borderwidth,x:s.borderwidth,y:s.borderwidth}),c.setClipUrl(O,r),c.setRect(D,0,0,0,0),delete s._scrollY;else{var J,K,Q=Math.max(p.scrollBarMinHeight,Z*Z/s._height),tt=Z-Q-2*p.scrollBarMargin,et=s._height-Z,rt=tt/et,nt=Math.min(s._scrollY||0,et);I.attr({width:q-2*s.borderwidth+p.scrollBarWidth+p.scrollBarMargin,height:Z-s.borderwidth,x:s.borderwidth/2,y:s.borderwidth/2}),P.select("rect").attr({width:q-2*s.borderwidth+p.scrollBarWidth+p.scrollBarMargin,height:Z-2*s.borderwidth,x:s.borderwidth,y:s.borderwidth+nt}),c.setClipUrl(O,r),at(nt,Q,rt),z.on("wheel",function(){at(nt=i.constrain(s._scrollY+n.event.deltaY/tt*et,0,et),Q,rt),0!==nt&&nt!==et&&n.event.preventDefault()});var it=n.behavior.drag().on("dragstart",function(){J=n.event.sourceEvent.clientY,K=nt}).on("drag",function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||at(nt=i.constrain((t.clientY-J)/rt+K,0,et),Q,rt)});D.call(it)}if(t._context.edits.legendPosition)z.classed("cursor-move",!0),l.init({element:z.node(),gd:t,prepFn:function(){var t=c.getTranslate(z);Y=t.x,X=t.y},moveFn:function(t,e){var r=Y+t,n=X+e;c.setTranslate(z,r,n),G=l.align(r,0,j.l,j.l+j.w,s.xanchor),W=l.align(n,0,j.t+j.h,j.t,s.yanchor)},doneFn:function(){void 0!==G&&void 0!==W&&o.call("relayout",t,{"legend.x":G,"legend.y":W})},clickFn:function(r,n){var i=e._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom});i.size()>0&&M(t,z,i,r,n)}})}function at(e,r,n){s._scrollY=t._fullLayout.legend._scrollY=e,c.setTranslate(O,0,-e),c.setRect(D,q,p.scrollBarMargin+e*n,p.scrollBarWidth,r),P.select("rect").attr({y:s.borderwidth+e})}}},{"../../constants/alignment":656,"../../constants/interactions":660,"../../lib":684,"../../lib/events":672,"../../lib/svg_text_utils":708,"../../plots/plots":795,"../../registry":817,"../color":558,"../dragelement":580,"../drawing":583,"./anchor_utils":610,"./constants":612,"./get_legend_data":615,"./handle_click":616,"./helpers":617,"./style":619,d3:147}],615:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o={},s=[],l=!1,c={},u=0;function h(t,r){if(""!==t&&i.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+u;s.push(n),o[n]=[[r]],u++}}for(r=0;rr[1])return r[1]}return i}function d(t){return t[0]}if(u||h||f){var g={},m={};u&&(g.mc=p("marker.color",d),g.mx=p("marker.symbol",d),g.mo=p("marker.opacity",a.mean,[.2,1]),g.ms=p("marker.size",a.mean,[2,16]),g.mlc=p("marker.line.color",d),g.mlw=p("marker.line.width",a.mean,[0,5]),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),f&&(m.line={width:p("line.width",d,[0,10])}),h&&(g.tx="Aa",g.tp=p("textposition",d),g.ts=10,g.tc=p("textfont.color",d),g.tf=p("textfont.family",d)),r=[a.minExtend(s,g)],(i=a.minExtend(c,m)).selectedpoints=null}var v=n.select(this).select("g.legendpoints"),y=v.selectAll("path.scatterpts").data(u?r:[]);y.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),y.exit().remove(),y.call(o.pointStyle,i,e),u&&(r[0].mrc=3);var x=v.selectAll("g.pointtext").data(h?r:[]);x.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),x.exit().remove(),x.selectAll("text").call(o.textPointStyle,i,e)}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data("candlestick"===e.type&&e.visible?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var i=e[r?"increasing":"decreasing"],a=i.line.width,o=n.select(this);o.style("stroke-width",a+"px").call(s.fill,i.fillcolor),a&&s.stroke(o,i.line.color)})}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data("ohlc"===e.type&&e.visible?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var i=e[r?"increasing":"decreasing"],a=i.line.width,l=n.select(this);l.style("fill","none").call(o.dashLine,i.line.dash,a),a&&s.stroke(l,i.line.color)})})}},{"../../lib":684,"../../registry":817,"../../traces/pie/style_one":1001,"../../traces/scatter/subtypes":1037,"../color":558,"../drawing":583,d3:147}],620:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../lib"),s=t("../../../build/ploticon"),l=o._,c=e.exports={};function u(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},h=a.list(t,null,!0),f="on";if("zoom"===s){var p,d="in"===l?.5:2,g=(1+d)/2,m=(1-d)/2;for(i=0;i1?(_=["toggleHover"],w=["resetViews"]):h?(b=["zoomInGeo","zoomOutGeo"],_=["hoverClosestGeo"],w=["resetGeo"]):u?(_=["hoverClosest3d"],w=["resetCameraDefault3d","resetCameraLastSave3d"]):g?(_=["toggleHover"],w=["resetViewMapbox"]):_=p?["hoverClosestGl2d"]:f?["hoverClosestPie"]:["toggleHover"];c&&(_=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);!c&&!p||v||(b=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==w[0]&&(w=["resetScale2d"]));u?k=["zoom3d","pan3d","orbitRotation","tableRotation"]:(c||p)&&!v||d?k=["zoom2d","pan2d"]:g||h?k=["pan2d"]:m&&(k=["zoom2d"]);(function(t){for(var e=!1,r=0;r0)){var g=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;a0?f+c:c;return{ppad:c,ppadplus:u?d:g,ppadminus:u?g:d}}return{ppad:c}}function u(t,e,r,n,i){var s="category"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,c,u,h,f=1/0,p=-1/0,d=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lp&&(p=h)));return p>=f?[f,p]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;o10?t/2:10;return n.append("circle").attr({"data-line-point":"start-point",cx:D?q(r.xanchor)+r.x0:q(r.x0),cy:R?H(r.yanchor)-r.y0:H(r.y0),r:a}).style(i).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:D?q(r.xanchor)+r.x1:q(r.x1),cy:R?H(r.yanchor)-r.y1:H(r.y1),r:a}).style(i).classed("cursor-grab",!0),n}():e,X={element:Y.node(),gd:t,prepFn:function(n){D&&(_=q(r.xanchor));R&&(w=H(r.yanchor));"path"===r.type?z=r.path:(v=D?r.x0:q(r.x0),y=R?r.y0:H(r.y0),x=D?r.x1:q(r.x1),b=R?r.y1:H(r.y1));vb?(k=y,S="y0",M=b,E="y1"):(k=b,S="y1",M=y,E="y0");Z(n),K(p,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),l=a.getFromId(r,i),c="";"paper"===n||o.autorange||(c+=n);"paper"===i||l.autorange||(c+=i);t.call(s.setClipUrl,c?"clip"+r._fullLayout._uid+c:null)}(e,r,t),X.moveFn="move"===P?$:J},doneFn:function(){u(e),Q(p),d(e,t,r),n.call("relayout",t,N.getUpdateObj())},clickFn:function(){Q(p)}};function Z(t){if(B)P="path"===t.target.tagName?"move":"start-point"===t.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var r=X.element.getBoundingClientRect(),n=r.right-r.left,i=r.bottom-r.top,a=t.clientX-r.left,o=t.clientY-r.top,s=!F&&n>I&&i>O&&!t.shiftKey?c.getCursor(a/n,1-o/i):"move";u(e,s),P=s.split("-")[0]}}function $(n,i){if("path"===r.type){var a=function(t){return t},o=a,s=a;D?j("xanchor",r.xanchor=G(_+n)):(o=function(t){return G(q(t)+n)},V&&"date"===V.type&&(o=f.encodeDate(o))),R?j("yanchor",r.yanchor=W(w+i)):(s=function(t){return W(H(t)+i)},U&&"date"===U.type&&(s=f.encodeDate(s))),j("path",r.path=m(z,o,s))}else D?j("xanchor",r.xanchor=G(_+n)):(j("x0",r.x0=G(v+n)),j("x1",r.x1=G(x+n))),R?j("yanchor",r.yanchor=W(w+i)):(j("y0",r.y0=W(y+i)),j("y1",r.y1=W(b+i)));e.attr("d",g(t,r)),K(p,r)}function J(n,i){if(F){var a=function(t){return t},o=a,s=a;D?j("xanchor",r.xanchor=G(_+n)):(o=function(t){return G(q(t)+n)},V&&"date"===V.type&&(o=f.encodeDate(o))),R?j("yanchor",r.yanchor=W(w+i)):(s=function(t){return W(H(t)+i)},U&&"date"===U.type&&(s=f.encodeDate(s))),j("path",r.path=m(z,o,s))}else if(B){if("resize-over-start-point"===P){var l=v+n,c=R?y-i:y+i;j("x0",r.x0=D?l:G(l)),j("y0",r.y0=R?c:W(c))}else if("resize-over-end-point"===P){var u=x+n,h=R?b-i:b+i;j("x1",r.x1=D?u:G(u)),j("y1",r.y1=R?h:W(h))}}else{var d=~P.indexOf("n")?k+i:k,N=~P.indexOf("s")?M+i:M,Y=~P.indexOf("w")?A+n:A,X=~P.indexOf("e")?T+n:T;~P.indexOf("n")&&R&&(d=k-i),~P.indexOf("s")&&R&&(N=M-i),(!R&&N-d>O||R&&d-N>O)&&(j(S,r[S]=R?d:W(d)),j(E,r[E]=R?N:W(N))),X-Y>I&&(j(C,r[C]=D?Y:G(Y)),j(L,r[L]=D?X:G(X)))}e.attr("d",g(t,r)),K(p,r)}function K(t,e){(D||R)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var a=q(D?e.xanchor:i.midRange(r?[e.x0,e.x1]:f.extractPathCoords(e.path,h.paramIsX))),o=H(R?e.yanchor:i.midRange(r?[e.y0,e.y1]:f.extractPathCoords(e.path,h.paramIsY)));if(a=f.roundPositionForSharpStrokeRendering(a,1),o=f.roundPositionForSharpStrokeRendering(o,1),D&&R){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(D){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function Q(t){t.selectAll(".visual-cue").remove()}c.init(X),Y.node().onmousemove=Z}(t,x,r,e,p)}}function d(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");t.call(s.setClipUrl,n?"clip"+e._fullLayout._uid+n:null)}function g(t,e){var r,n,o,s,l,c,u,p,d=e.type,g=a.getFromId(t,e.xref),m=a.getFromId(t,e.yref),v=t._fullLayout._size;if(g?(r=f.shapePositionToRange(g),n=function(t){return g._offset+g.r2p(r(t,!0))}):n=function(t){return v.l+v.w*t},m?(o=f.shapePositionToRange(m),s=function(t){return m._offset+m.r2p(o(t,!0))}):s=function(t){return v.t+v.h*(1-t)},"path"===d)return g&&"date"===g.type&&(n=f.decodeDate(n)),m&&"date"===m.type&&(s=f.decodeDate(s)),function(t,e,r){var n=t.path,a=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(h.segmentRE,function(t){var n=0,c=t.charAt(0),u=h.paramIsX[c],f=h.paramIsY[c],p=h.numParams[c],d=t.substr(1).replace(h.paramRE,function(t){return u[n]?t="pixel"===a?e(s)+Number(t):e(t):f[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>p&&(t="X"),t});return n>p&&(d=d.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),c+d})}(e,n,s);if("pixel"===e.xsizemode){var y=n(e.xanchor);l=y+e.x0,c=y+e.x1}else l=n(e.x0),c=n(e.x1);if("pixel"===e.ysizemode){var x=s(e.yanchor);u=x-e.y0,p=x-e.y1}else u=s(e.y0),p=s(e.y1);if("line"===d)return"M"+l+","+u+"L"+c+","+p;if("rect"===d)return"M"+l+","+u+"H"+c+"V"+p+"H"+l+"Z";var b=(l+c)/2,_=(u+p)/2,w=Math.abs(b-l),k=Math.abs(_-u),M="A"+w+","+k,A=b+w+","+_;return"M"+A+M+" 0 1,1 "+(b+","+(_-k))+M+" 0 0,1 "+A+"Z"}function m(t,e,r){return t.replace(h.segmentRE,function(t){var n=0,i=t.charAt(0),a=h.paramIsX[i],o=h.paramIsY[i],s=h.numParams[i];return i+t.substr(1).replace(h.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}e.exports={draw:function(t){var e=t._fullLayout;for(var r in e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._plots){var n=e._plots[r].shapelayer;n&&n.selectAll("path").remove()}for(var i=0;i0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform","translate("+(o-.5*h.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function E(t,e){var r=t._dims;return r.inputAreaStart+h.stepInset+(r.inputAreaLength-2*h.stepInset)*Math.min(1,Math.max(0,e))}function C(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-h.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*h.stepInset-2*r.inputAreaStart)))}function L(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",h.railTouchRectClass,function(n){n.call(A,e,t,r).style("pointer-events","all")});i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,h.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function z(t,e){var r=e._dims,n=r.inputAreaLength-2*h.railInset,i=s.ensureSingle(t,"rect",h.railRectClass);i.attr({width:n,height:h.railWidth,rx:h.railRadius,ry:h.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,h.railInset,.5*(r.inputAreaWidth-h.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[h.name],n=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,m(e))}if(a.enter().append("g").classed(h.containerClassName,!0).style("cursor","ew-resize"),a.exit().each(function(){n.select(this).selectAll("g."+h.groupClassName).each(s)}).remove(),0!==r.length){var l=a.selectAll("g."+h.groupClassName).data(r,v);l.enter().append("g").classed(h.groupClassName,!0),l.exit().each(s).remove();for(var c=0;c0||f<0){var g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[y.side];e.attr("transform","translate("+g+")")}}}P.call(I),L&&(C?P.on(".opacity",null):(S=0,E=!0,P.text(m).on("mouseover.opacity",function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)})),P.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==v?o.call("restyle",t,g,e,v):o.call("relayout",t,g,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(I)}).on("input",function(t){this.text(t||" ").call(u.positionText,x.x,x.y)}));return P.classed("js-placeholder",E),_}};var f=/ [XY][0-9]* /},{"../../constants/interactions":660,"../../lib":684,"../../lib/svg_text_utils":708,"../../plots/plots":795,"../../registry":817,"../color":558,"../drawing":583,d3:147,"fast-isnumeric":214}],650:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a({},s,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":673,"../../plot_api/edit_types":715,"../../plot_api/plot_template":722,"../../plots/font_attributes":758,"../../plots/pad_attributes":794,"../color/attributes":557}],651:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}}},{}],652:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(t,e,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(t,e){function r(r,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":684,"../../plots/array_container_defaults":728,"./attributes":650,"./constants":651}],653:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../legend/anchor_utils"),u=t("../../plot_api/plot_template").arrayEditor,h=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),p=t("./scrollbox");function d(t){return t._index}function g(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function m(t,e,r,n,i,a,o,s){e.active=o,u(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?y(t,n,null,null,e):"dropdown"===e.type&&(i.attr(f.menuIndexAttrName,"-1"),v(t,n,i,a,e),s||y(t,n,i,a,e))}function v(t,e,r,n,i){var a=s.ensureSingle(e,"g",f.headerClassName,function(t){t.style("pointer-events","all")}),l=i._dims,c=i.active,u=i.buttons[c]||f.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},p={width:l.headerWidth,height:l.headerHeight};a.call(x,i,u,t).call(S,i,h,p),s.ensureSingle(e,"text",f.headerArrowClassName,function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])}).attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",function(){r.call(E,String(g(r,i)?-1:i._index)),y(t,e,r,n,i)}),a.on("mouseover",function(){a.call(k)}),a.on("mouseout",function(){a.call(M,i)}),o.setTranslate(e,l.lx,l.ly)}function y(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(s.filterVisible(l)),h=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var d=0,g=0,v=o._dims,y=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(y?g=v.headerHeight+f.gapButtonHeader:d=v.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(g=-f.gapButtonHeader+f.gapButton-v.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-f.gapButtonHeader+f.gapButton-v.openWidth);var b={x:v.lx+d+o.pad.l,y:v.ly+g+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},_={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each(function(s,l){var c=n.select(this);c.call(x,o,s,t).call(S,o,b),c.on("click",function(){n.event.defaultPrevented||(m(t,o,0,e,r,a,l),s.execute&&i.executeAPICommand(t,s.method,s.args),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))}),c.on("mouseover",function(){c.call(k)}),c.on("mouseout",function(){c.call(M,o),u.call(w,o)})}),u.call(w,o),y?(_.w=Math.max(v.openWidth,v.headerWidth),_.h=b.y-_.t):(_.w=b.x-_.l,_.h=Math.max(v.openHeight,v.headerHeight)),_.direction=o.direction,a&&(u.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,h=i._dims,p=i.active;if(u)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each(function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(a)}).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,d);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,function(t){t.style("pointer-events","all")}),u=0;uw,A=s.barLength+2*s.barPad,T=s.barWidth+2*s.barPad,S=d,E=m+v;E+T>c&&(E=c-T);var C=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),M?(this.hbar=C.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:E,width:A,height:T}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var L=v>k,z=s.barWidth+2*s.barPad,P=s.barLength+2*s.barPad,I=d+g,O=m;I+z>l&&(I=l-z);var D=this.container.selectAll("rect.scrollbar-vertical").data(L?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),L?(this.vbar=D.attr({rx:s.barRadius,ry:s.barRadius,x:I,y:O,width:z,height:P}),this._vbarYMin=O+P/2,this._vbarTranslateMax=k-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,B=u-.5,F=L?h+z+.5:h+.5,N=f-.5,j=M?p+T+.5:p+.5,V=o._topdefs.selectAll("#"+R).data(M||L?[0]:[]);if(V.exit().remove(),V.enter().append("clipPath").attr("id",R).append("rect"),M||L?(this._clipRect=V.select("rect").attr({x:Math.floor(B),y:Math.floor(N),width:Math.ceil(F)-Math.floor(B),height:Math.ceil(j)-Math.floor(N)}),this.container.call(a.setClipUrl,R),this.bg.attr({x:d,y:m,width:g,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),M||L){var U=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(U);var q=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(q),L&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":684,"../color":558,"../drawing":583,d3:147}],656:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],657:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],658:[function(t,e,r){"use strict";e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],659:[function(t,e,r){"use strict";e.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}},{}],660:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],661:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"−"}},{}],662:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"μ","#956":"μ",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:" ","#160":" ",times:"×","#215":"×",plusmn:"±","#177":"±",deg:"°","#176":"°"}}},{}],663:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],664:[function(t,e,r){"use strict";r.version="1.39.4",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config");for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;s180&&(t-=360*Math.round(t/360)),t}},{}],667:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},{"../constants/numerical":661,"fast-isnumeric":214}],668:[function(t,e,r){"use strict";e.exports=function(t){var e=t._fullLayout;e._glcanvas&&e._glcanvas.size()&&e._glcanvas.each(function(t){t.regl&&t.regl.clear({color:!0,depth:!0})})}},{}],669:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter,c=t("../constants/interactions").DESELECTDIM,u=t("./angles").wrap180,h=t("./is_array").isArrayOrTypedArray;function f(t,e){var n=r.valObjectMeta[e.valType];if(e.arrayOk&&h(t))return!0;if(n.validateFunction)return n.validateFunction(t,e);var i={},a=i,o={set:function(t){a=t}};return n.coerceFunction(t,o,i,e),a!==i}r.valObjectMeta={data_array:{coerceFunction:function(t,e,r){h(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;ni.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every(function(t){return i(t).isValid()})?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(u(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||l(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!l(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a=n&&t<=i?t:u}if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var c=_(e),v=t.charAt(0);!c||"G"!==v&&"g"!==v||(t=t.substr(1),e="");var w=c&&"chinese"===e.substr(0,7),k=t.match(w?x:y);if(!k)return u;var M=k[1],A=k[3]||"1",T=Number(k[5]||1),S=Number(k[7]||0),E=Number(k[9]||0),C=Number(k[11]||0);if(c){if(2===M.length)return u;var L;M=Number(M);try{var z=m.getComponentMethod("calendars","getCal")(e);if(w){var P="i"===A.charAt(A.length-1);A=parseInt(A,10),L=z.newDate(M,z.toMonthIndex(M,A,P),T)}else L=z.newDate(M,Number(A),T)}catch(t){return u}return L?(L.toJD()-g)*h+S*f+E*p+C*d:u}M=2===M.length?(Number(M)+2e3-b)%100+b:Number(M),A-=1;var I=new Date(Date.UTC(2e3,A,T,S,E));return I.setUTCFullYear(M),I.getUTCMonth()!==A?u:I.getUTCDate()!==T?u:I.getTime()+C*d},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var k=90*h,M=3*f,A=5*p;function T(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return u;e||(e=0);var a,o,s,c,y,x,b=Math.floor(10*l(t+.05,1)),w=Math.round(t-b/10);if(_(r)){var S=Math.floor(w/h)+g,E=Math.floor(l(t,h));try{a=m.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){a=v("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+h&&t<=i-h))return u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return T(a.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(r.isJSDate(t)||"number"==typeof t){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g;function E(t,e,r,n){t=t.replace(S,function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"});var i=new Date(Math.floor(e+.05));if(_(n))try{t=m.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,h),n=w(Math.floor(r/f),2)+":"+w(l(Math.floor(r/p),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/d,60),C[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+E(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return E(e,t,n,i)};var L=3*h;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,h);if(t=Math.round(t-n),r)try{var i=Math.round(t/h)+g,a=m.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-g)*h+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+L);return c.setUTCMonth(c.getUTCMonth()+e)+n-L},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,c=_(e)&&m.getComponentMethod("calendars","getCal")(e),u=0;u0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||g<0||g>1?null:{x:t+l*g,y:e+h*g}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,c){if(s(t,e,r,n,i,a,o,c))return 0;var u=r-t,h=n-e,f=o-i,p=c-a,d=u*u+h*h,g=f*f+p*p,m=Math.min(l(u,h,d,i-t,a-e),l(u,h,d,o-t,c-e),l(f,p,g,t-i,e-a),l(f,p,g,r-i,n-a));return Math.sqrt(m)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),c=t.getPointAtLength(o(r+s/2,e)),u=Math.atan((c.y-l.y)/(c.x-l.x)),h=t.getPointAtLength(o(r,e)),f={x:(4*h.x+l.x+c.x)/6,y:(4*h.y+l.y+c.y)/6,theta:u};return n[r]=f,f},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),h=u;function f(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.xo?r.x-o:0,h=r.yl?r.y-l:0;return Math.sqrt(c*c+h*h)}for(var p=f(c);p;){if((c+=p+r)>h)return;p=f(c)}for(p=f(h);p;){if(c>(h-=p+r))return;p=f(h)}return{min:c,max:h,len:h-c,total:u,isClosed:0===c&&h===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,h=0,f=0,p=s;h0?p=i:f=i,h++}return a}},{"./mod":691}],679:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null==t)throw new Error("DOM element provided is null or undefined");return t}},{}],680:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./is_array").isArrayOrTypedArray,c=a(s),u=1;function h(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return c;var e=a(t);return e.length?e:c}function p(t){return n(t)?t:u}e.exports={formatColor:function(t,e,r){var n,i,s,d,g,m=t.color,v=l(m),y=l(e),x=[];if(n=void 0!==t.colorscale?o.makeColorScaleFunc(o.extractScale(t.colorscale,t.cmin,t.cmax)):f,i=v?function(t,e){return void 0===t[e]?c:a(n(t[e]))}:f,s=y?function(t,e){return void 0===t[e]?u:p(t[e])}:p,v||y)for(var b=0;b=0;){var n=t.indexOf(";",r);if(n/g,"")}(function(t){for(var e=0;(e=t.indexOf("",e))>=0;){var r=t.indexOf("",e);if(r/g,"\n"))))}},{"../constants/string_mappings":662,"superscript-text":492}],683:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],684:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../constants/numerical"),o=a.FP_SAFE,s=a.BADNUM,l=e.exports={};l.nestedProperty=t("./nested_property"),l.keyedContainer=t("./keyed_container"),l.relativeAttr=t("./relative_attr"),l.isPlainObject=t("./is_plain_object"),l.mod=t("./mod"),l.toLogRange=t("./to_log_range"),l.relinkPrivateKeys=t("./relink_private"),l.ensureArray=t("./ensure_array");var c=t("./is_array");l.isTypedArray=c.isTypedArray,l.isArrayOrTypedArray=c.isArrayOrTypedArray,l.isArray1D=c.isArray1D;var u=t("./coerce");l.valObjectMeta=u.valObjectMeta,l.coerce=u.coerce,l.coerce2=u.coerce2,l.coerceFont=u.coerceFont,l.coerceHoverinfo=u.coerceHoverinfo,l.coerceSelectionMarkerOpacity=u.coerceSelectionMarkerOpacity,l.validate=u.validate;var h=t("./dates");l.dateTime2ms=h.dateTime2ms,l.isDateTime=h.isDateTime,l.ms2DateTime=h.ms2DateTime,l.ms2DateTimeLocal=h.ms2DateTimeLocal,l.cleanDate=h.cleanDate,l.isJSDate=h.isJSDate,l.formatDate=h.formatDate,l.incrementMonth=h.incrementMonth,l.dateTick0=h.dateTick0,l.dfltRange=h.dfltRange,l.findExactDates=h.findExactDates,l.MIN_MS=h.MIN_MS,l.MAX_MS=h.MAX_MS;var f=t("./search");l.findBin=f.findBin,l.sorterAsc=f.sorterAsc,l.sorterDes=f.sorterDes,l.distinctVals=f.distinctVals,l.roundUp=f.roundUp;var p=t("./stats");l.aggNums=p.aggNums,l.len=p.len,l.mean=p.mean,l.midRange=p.midRange,l.variance=p.variance,l.stdev=p.stdev,l.interp=p.interp;var d=t("./matrix");l.init2dArray=d.init2dArray,l.transposeRagged=d.transposeRagged,l.dot=d.dot,l.translationMatrix=d.translationMatrix,l.rotationMatrix=d.rotationMatrix,l.rotationXYMatrix=d.rotationXYMatrix,l.apply2DTransform=d.apply2DTransform,l.apply2DTransform2=d.apply2DTransform2;var g=t("./angles");l.deg2rad=g.deg2rad,l.rad2deg=g.rad2deg,l.wrap360=g.wrap360,l.wrap180=g.wrap180;var m=t("./geometry2d");l.segmentsIntersect=m.segmentsIntersect,l.segmentDistance=m.segmentDistance,l.getTextLocation=m.getTextLocation,l.clearLocationCache=m.clearLocationCache,l.getVisibleSegment=m.getVisibleSegment,l.findPointOnPath=m.findPointOnPath;var v=t("./extend");l.extendFlat=v.extendFlat,l.extendDeep=v.extendDeep,l.extendDeepAll=v.extendDeepAll,l.extendDeepNoArrays=v.extendDeepNoArrays;var y=t("./loggers");l.log=y.log,l.warn=y.warn,l.error=y.error;var x=t("./regex");l.counterRegex=x.counter;var b=t("./throttle");function _(t){var e={};for(var r in t)for(var n=t[r],i=0;io?s:i(t)?Number(t):s:s},l.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(i(t)&&t>=0&&t%1==0)},l.noop=t("./noop"),l.identity=t("./identity"),l.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;ir?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o=Math.pow(2,r)?i>10?(l.warn("randstr failed uniqueness"),c):t(e,r,n,(i||0)+1):c},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},l.syncOrAsync=function(t,e,r){var n;function i(){return l.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l};var M=/%{([^\s%{}]*)}/g,A=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(M,function(t,n){return A.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")})};l.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,i=0,a=0;a=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var T=2e9;l.seedPseudoRandom=function(){T=2e9},l.pseudoRandom=function(){var t=T;return T=(69069*T+1)%4294967296,Math.abs(T-t)<429496729?l.pseudoRandom():T/4294967296}},{"../constants/numerical":661,"./angles":666,"./clean_number":667,"./coerce":669,"./dates":670,"./ensure_array":671,"./extend":673,"./filter_unique":674,"./filter_visible":675,"./geometry2d":678,"./get_graph_div":679,"./identity":683,"./is_array":685,"./is_plain_object":686,"./keyed_container":687,"./localize":688,"./loggers":689,"./matrix":690,"./mod":691,"./nested_property":692,"./noop":693,"./notifier":694,"./push_unique":698,"./regex":700,"./relative_attr":701,"./relink_private":702,"./search":703,"./stats":706,"./throttle":709,"./to_log_range":710,d3:147,"fast-isnumeric":214}],685:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function a(t){return n.isView(t)&&!(t instanceof i)}function o(t){return Array.isArray(t)||a(t)}e.exports={isTypedArray:a,isArrayOrTypedArray:o,isArray1D:function(t){return!o(t[0])}}},{}],686:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],687:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var c={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var u={};if(s)for(o=0;o2)return c[e]=2|c[e],f.set(t,null);if(h){for(o=e;o1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e/g),o=0;oo||a===i||al||e&&c(t))}:function(t,e){var a=t[0],c=t[1];if(a===i||ao||c===i||cl)return!1;var u,h,f,p,d,g=r.length,m=r[0][0],v=r[0][1],y=0;for(u=1;uMath.max(h,m)||c>Math.max(f,v)))if(cu||Math.abs(n(o,f))>i)return!0;return!1};a.filter=function(t,e){var r=[t[0]],n=0,i=0;function a(a){t.push(a);var s=r.length,l=n;r.splice(i+1);for(var c=l+1;c1&&a(t.pop());return{addPt:a,raw:t,filtered:r}}},{"../constants/numerical":661,"./matrix":690}],697:[function(t,e,r){(function(r){"use strict";var n=t("./show_no_webgl_msg"),i=t("regl");e.exports=function(t,e){var a=t._fullLayout,o=!0;return a._glcanvas.each(function(n){if(!n.regl&&(!n.pick||a._has("parcoords")))try{n.regl=i({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio,extensions:e||[]})}catch(t){o=!1}}),o||n({container:a._glcontainer.node()}),o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":705,regl:463}],698:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;ri.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function l(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var c,u,h=0,f=e.length,p=0,d=f>1?(e[f-1]-e[0])/(f-1):1;for(u=d>=0?r?a:o:r?l:s,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);h90&&i.log("Long binary search..."),h-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;se[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./is_array":685,"fast-isnumeric":214}],707:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":107}],708:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib"),a=t("../constants/xmlns_namespaces"),o=t("../constants/string_mappings"),s=t("../constants/alignment").LINE_SPACING;function l(t,e){return t.node().getBoundingClientRect()[e]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,o){var v=t.text(),C=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&v.match(c),L=n.select(t.node().parentNode);if(!L.empty()){var z=t.attr("class")?t.attr("class").split(" ")[0]:"text";return z+="-math",L.selectAll("svg."+z).remove(),L.selectAll("g."+z+"-group").remove(),t.style("display",null).attr({"data-unformatted":v,"data-math":"N"}),C?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),a={fontSize:r};!function(t,e,r){var a="math-output-"+i.randstr({},64),o=n.select("body").append("div").attr({id:a}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text((s=t,s.replace(u,"\\lt ").replace(h,"\\gt ")));var s;MathJax.Hub.Queue(["Typeset",MathJax.Hub,o.node()],function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(o.select(".MathJax_SVG").empty()||!o.select("svg").node())i.log("There was an error in the tex syntax.",t),r();else{var a=o.select("svg").node().getBoundingClientRect();r(o.select(".MathJax_SVG"),e,a)}o.remove()})}(C[2],a,function(n,i,a){L.selectAll("svg."+z).remove(),L.selectAll("g."+z+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return P(),void e();var c=L.append("g").classed(z+"-group",!0).attr({"pointer-events":"none","data-unformatted":v,"data-math":"Y"});c.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild),s.attr({class:z,height:a.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black";s.select("g").attr({fill:u,stroke:u});var h=l(s,"width"),f=l(s,"height"),p=+t.attr("x")-h*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],d=-(r||l(t,"height"))/4;"y"===z[0]?(c.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-h/2,d-f/2]+")"}),s.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===z[0]?s.attr({x:t.attr("x"),y:d-f/2}):"a"===z[0]?s.attr({x:0,y:d}):s.attr({x:p,y:+t.attr("y")+d-f/2}),o&&o.call(t,c),e(c)})})):P(),t}function P(){L.empty()||(z=t.attr("class")+"-math",L.select("svg."+z).remove()),t.text("").style("white-space","pre"),function(t,e){e=(r=e,function(t,e){if(!t)return"";for(var r=0;r1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),o=c[c.length-1].node}else i.log("Ignoring unexpected end tag .",e)}w.test(e)?h():(o=t,c=[{node:t}]);for(var z=e.split(b),P=0;P|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},g="​",m=["http:","https:","mailto:","",void 0,":"],v=new RegExp("]*)?/?>","g"),y=Object.keys(o.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:o.entityToUnicode[t]}}),x=/(\r\n?|\n)/g,b=/(<[^<>]*>)/,_=/<(\/?)([^ >]*)(\s+(.*))?>/i,w=//i,k=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,M=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,A=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function S(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}var E=/(^|;)\s*color:/;function C(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-c.top+"px",left:a()-c.left+"px","z-index":1e3}),this}}r.plainText=function(t){return(t||"").replace(v," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){var t=n.select(this);function i(e,r){return void 0===r?null===(r=t.attr(e))&&(t.attr(e,0),r=0):t.attr(e,r),r}var a=i("x",e),o=i("y",r);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:a,y:o})})},r.makeEditable=function(t,e){var r=e.gd,i=e.delegate,a=n.dispatch("edit","input","cancel"),o=i||t;if(t.style({"pointer-events":i?"none":"all"}),1!==t.size())throw new Error("boo");function s(){!function(){var i=n.select(r).select(".svg-container"),o=i.append("div"),s=t.node().style,c=parseFloat(s.fontSize||12),u=e.text;void 0===u&&(u=t.attr("data-unformatted"));o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":s.fontFamily||"Arial","font-size":c,color:e.fill||s.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(u).call(C(t,i,e)).on("blur",function(){r._editing=!1,t.text(this.textContent).style({opacity:1});var e,i=n.select(this).attr("class");(e=i?"."+i.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(e).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),a.edit.call(t,o)}).on("focus",function(){var t=this;r._editing=!0,n.select(document).on("mouseup",function(){if(n.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===n.event.which?(r._editing=!1,t.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),a.cancel.call(t,this.textContent)):(a.input.call(t,this.textContent),n.select(this).call(C(t,i,e)))}).on("keydown",function(){13===n.event.which&&this.blur()}).call(l)}(),t.style({opacity:0});var i,s=o.attr("class");(i=s?"."+s.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(i).style({opacity:0})}function l(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}return e.immediate?s():o.on("click",s),n.rebind(t,a,"on")}},{"../constants/alignment":656,"../constants/string_mappings":662,"../constants/xmlns_namespaces":663,"../lib":684,d3:147}],709:[function(t,e,r){"use strict";var n={};function i(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}r.throttle=function(t,e,r){var a=n[t],o=Date.now();if(!a){for(var s in n)n[s].tsa.ts+e?l():a.timer=setTimeout(function(){l(),a.timer=null},e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],710:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":214}],711:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson-client").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../plots/geo/constants":760,"topojson-client":502}],712:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],713:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],714:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,r;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var n=(s.subplotsRegistry.cartesian||{}).attrRegex,a=(s.subplotsRegistry.gl3d||{}).attrRegex,l=Object.keys(t);for(e=0;e3?(T.x=1.02,T.xanchor="left"):T.x<-2&&(T.x=-.02,T.xanchor="right"),T.y>3?(T.y=1.02,T.yanchor="bottom"):T.y<-2&&(T.y=-.02,T.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),h.clean(t),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=y(e);r;){if(r in t)return!0;r=y(r)}return!1};var x=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&o.warn("Full array edits are incompatible with other edits",h);var y=r[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return o.warn("Unrecognized full array edit value",h,y),!0;e.set(y)}return!g&&(f(m,v),p(t),!0)}var x,b,_,w,k,M,A,T=Object.keys(r).map(Number).sort(s),S=e.get(),E=S||[],C=n(v,h).get(),L=[],z=-1,P=E.length;for(x=0;xE.length-(A?0:1))o.warn("index out of range",h,_);else if(void 0!==M)k.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",h,_),u(M)?L.push(_):A?("add"===M&&(M={}),E.splice(_,0,M),C&&C.splice(_,0,{})):o.warn("Unrecognized full object edit value",h,_,M),-1===z&&(z=_);else for(b=0;b=0;x--)E.splice(L[x],1),C&&C.splice(L[x],1);if(E.length?S||e.set(E):e.set(null),g)return!1;if(f(m,v),d!==a){var I;if(-1===z)I=T;else{for(P=Math.max(E.length,P),I=[],x=0;x=z);x++)I.push(_);for(x=z;x=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function I(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&P(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function O(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var a in P(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var s=function(t,e,r,n){var a,s,l,c,u,h=o.isPlainObject(n),f=[];for(var p in Array.isArray(r)||(r=[r]),r=z(r,t.data.length-1),e)for(var d=0;d=0&&r=0&&r0&&"string"!=typeof C.parts[z];)z--;var P=C.parts[z],I=C.parts[z-1]+"."+P,O=C.parts.slice(0,z).join("."),D=o.nestedProperty(t.layout,O).get(),B=o.nestedProperty(s,O).get(),F=C.get();if(void 0!==L){y[E]=L,x[E]="reverse"===P?L:R(F);var U=u.getLayoutValObject(s,C.parts);if(U&&U.impliedEdits&&null!==L)for(var G in U.impliedEdits)b(o.relativeAttr(E,G),U.impliedEdits[G]);if(-1!==["width","height"].indexOf(E)&&null===L)s[E]=t._initialAutoSize[E];else if(I.match(N))S(I),o.nestedProperty(s,O+"._inputRange").set(null);else if(I.match(j)){S(I),o.nestedProperty(s,O+"._inputRange").set(null);var W=o.nestedProperty(s,O).get();W._inputDomain&&(W._input.domain=W._inputDomain.slice())}else I.match(V)&&o.nestedProperty(s,O+"._inputDomain").set(null);if("type"===P){var Y=D,X="linear"===B.type&&"log"===L,Z="log"===B.type&&"linear"===L;if(X||Z){if(Y&&Y.range)if(B.autorange)X&&(Y.range=Y.range[1]>Y.range[0]?[1,2]:[2,1]);else{var $=Y.range[0],J=Y.range[1];X?($<=0&&J<=0&&b(O+".autorange",!0),$<=0?$=J/1e6:J<=0&&(J=$/1e6),b(O+".range[0]",Math.log($)/Math.LN10),b(O+".range[1]",Math.log(J)/Math.LN10)):(b(O+".range[0]",Math.pow(10,$)),b(O+".range[1]",Math.pow(10,J)))}else b(O+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[C.parts[0]]&&"radialaxis"===C.parts[1]&&delete s[C.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,B,L,b),c.getComponentMethod("images","convertCoords")(t,B,L,b)}else b(O+".autorange",!0),b(O+".range",null);o.nestedProperty(s,O+"._inputRange").set(null)}else if(P.match(A)){var K=o.nestedProperty(s,E).get(),Q=(L||{}).type;Q&&"-"!==Q||(Q="linear"),c.getComponentMethod("annotations","convertCoords")(t,K,Q,b),c.getComponentMethod("images","convertCoords")(t,K,Q,b)}var tt=_.containerArrayMatch(E);if(tt){r=tt.array,n=tt.index;var et=tt.property,rt=(o.nestedProperty(a,r)||[])[n]||{},nt=rt,it=U||{editType:"calc"},at=-1!==it.editType.indexOf("calcIfAutorange");""===n?(at?v.calc=!0:M.update(v,it),at=!1):""===et&&(nt=L,_.isAddVal(L)?x[E]=null:_.isRemoveVal(L)?(x[E]=rt,nt=rt):o.warn("unrecognized full object value",e)),at&&(H(t,nt,"x")||H(t,nt,"y"))?v.calc=!0:M.update(v,it),f[r]||(f[r]={});var ot=f[r][n];ot||(ot=f[r][n]={}),ot[et]=L,delete e[E]}else"reverse"===P?(D.range?D.range.reverse():(b(O+".autorange",!0),D.range=[1,0]),B.autorange?v.calc=!0:v.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===E&&("lasso"===L||"select"===L)&&"lasso"!==F&&"select"!==F?v.plot=!0:U?M.update(v,U):v.calc=!0,C.set(L))}}for(r in f){_.applyContainerArrayChanges(t,o.nestedProperty(a,r),f[r],v)||(v.plot=!0)}var st=s._axisConstraintGroups||[];for(k in T)for(n=0;n=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise(function(a,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,w.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var d,g,m=0;function v(t){return Array.isArray(i)?m>=i.length?t.transitionOpts=i[m]:t.transitionOpts=i[0]:t.transitionOpts=i,m++,t}var y=[],x=null==e,b=Array.isArray(e);if(!x&&!b&&o.isPlainObject(e))y.push({type:"object",data:v(o.extendFlat({},e))});else if(x||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&MM)&&A.push(g);y=A}}y.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,m=(u[g]||d[g]||{}).name,v=e[n].name,y=u[m]||d[m];m&&v&&"number"==typeof v&&y&&T<5&&(T++,o.warn('addFrames: overwriting frame "'+(u[m]||d[m]).name+'" with a frame whose name of type "number" also equates to "'+m+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===T&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[g]={name:g},p.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort(function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;u[i.name="frame "+t._transitionData._counter++];);if(u[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var c=h.modifyFrames,u=h.modifyFrames,f=[t,s],p=[t,a];return l&&l.add(t,c,f,u,p),h.modifyFrames(t,a)},r.purge=function(t){var e=(t=o.getGraphDiv(t))._fullLayout||{},r=t._fullData||[],n=t.calcdata||[];return h.cleanPlot([],{},r,e,n),h.purge(t),s.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":558,"../components/colorbar/connect":560,"../components/drawing":583,"../constants/xmlns_namespaces":663,"../lib":684,"../lib/events":672,"../lib/queue":699,"../lib/svg_text_utils":708,"../plots/cartesian/axes":732,"../plots/cartesian/constants":737,"../plots/cartesian/graph_interact":741,"../plots/plots":795,"../plots/polar/legacy":803,"../registry":817,"./edit_types":715,"./helpers":716,"./manage_arrays":718,"./plot_config":720,"./plot_schema":721,"./subroutines":723,d3:147,"fast-isnumeric":214,"has-hover":378}],720:[function(t,e,r){"use strict";e.exports={staticPlot:!1,plotlyServerURL:"https://plot.ly",editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,toImageButtonOptions:{},displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:1,globalTransforms:[],locale:"en-US",locales:{}}},{}],721:[function(t,e,r){"use strict";var n=t("../registry"),i=t("../lib"),a=t("../plots/attributes"),o=t("../plots/layout_attributes"),s=t("../plots/frame_attributes"),l=t("../plots/animation_attributes"),c=t("../plots/polar/legacy/area_attributes"),u=t("../plots/polar/legacy/axis_attributes"),h=t("./edit_types"),f=i.extendFlat,p=i.extendDeepAll,d=i.isPlainObject,g="_isSubplotObj",m="_isLinkedToArray",v=[g,m,"_arrayAttrRegexps","_deprecated"];function y(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(x(e[r]))r++;else if(r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!x(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function x(t){return t===Math.round(t)&&t>=0}function b(){var t,e,r={};for(t in p(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)i=c[o];else{var h=t._module;if(h||(h=(n.modules[t.type||a.type.dflt]||{})._module),!h)return!1;if(!(i=(r=h.attributes)&&r[o])){var f=h.basePlotModule;f&&f.attributes&&(i=f.attributes[o])}i||(i=a[o])}return y(i,e,s)},r.getLayoutValObject=function(t,e){return y(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var c;for(r=0;r=i&&(r._input||{})._templateitemname;s&&(o=i);var l,c=e+"["+o+"]";function u(){l={},s&&(l[c]={},l[c][a]=s)}function h(t,e){s?n.nestedProperty(l[c],t).set(e):l[c+"."+t]=e}function f(){var t=l;return u(),t}return u(),{modifyBase:function(t,e){l[t]=e},modifyItem:h,getUpdateObj:f,applyUpdate:function(e,r){e&&h(e,r);var i=f();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":684,"../plots/attributes":729}],723:[function(t,e,r){"use strict";var n=t("d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),h=t("../components/modebar"),f=t("../plots/cartesian/axes"),p=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),g=d.enforce,m=d.clean,v=t("../plots/cartesian/autorange").doAutoRange;function y(t){var e,i=t._fullLayout,a=i._size,s=a.p,u=f.list(t,"",!0),d=i._has("cartesian");function g(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-s-n:e._offset+e._length+s+n:a.t+a.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+s+n:e._offset-s-n:a.l+a.w*(t.position||0)+n%1}for(e=0;e=t[1]||i[1]<=t[0])&&a[0]e[0])return!0}return!1}(n,a,k)){var l=s.node(),c=r.bg=o.ensureSingle(s,"rect","bg");l.insertBefore(c.node(),l.childNodes[0])}else s.select("rect.bg").remove(),_.push(e),k.push([n,a])});var M=i._bgLayer.selectAll(".bg").data(_);return M.enter().append("rect").classed("bg",!0),M.exit().remove(),M.each(function(t){i._plots[t].bg=n.select(this)}),y.each(function(t){var e=t[0],r=i._plots[e],n=r.xaxis,a=r.yaxis;r.bg&&d&&r.bg.call(c.setRect,n._offset-s,a._offset-s,n._length+2*s,a._length+2*s).call(l.fill,i.plot_bgcolor).style("stroke-width",0);var h,f,p=r.clipId="clip"+i._uid+e+"plot",m=o.ensureSingleById(i._clips,"clipPath",p,function(t){t.classed("plotclip",!0).append("rect")});if(r.clipRect=m.select("rect").attr({width:n._length,height:a._length}),c.setTranslate(r.plot,n._offset,a._offset),r._hasClipOnAxisFalse?(h=null,f=p):(h=p,f=null),c.setClipUrl(r.plot,h),r.layerClipId=f,d){var v,y,x,_,k,M,A,T,S,E,C,L,z,P="M0,0";b(n,e)&&(k=w(n,"left",a,u),v=n._offset-(k?s+k:0),M=w(n,"right",a,u),y=n._offset+n._length+(M?s+M:0),x=g(n,a,"bottom"),_=g(n,a,"top"),(z=!n._anchorAxis||e!==n._mainSubplot)&&n.ticks&&"allticks"===n.mirror&&(n._linepositions[e]=[x,_]),P=R(n,O,function(t){return"M"+n._offset+","+t+"h"+n._length}),z&&n.showline&&("all"===n.mirror||"allticks"===n.mirror)&&(P+=O(x)+O(_)),r.xlines.style("stroke-width",n._lw+"px").call(l.stroke,n.showline?n.linecolor:"rgba(0,0,0,0)")),r.xlines.attr("d",P);var I="M0,0";b(a,e)&&(C=w(a,"bottom",n,u),A=a._offset+a._length+(C?s:0),L=w(a,"top",n,u),T=a._offset-(L?s:0),S=g(a,n,"left"),E=g(a,n,"right"),(z=!a._anchorAxis||e!==n._mainSubplot)&&a.ticks&&"allticks"===a.mirror&&(a._linepositions[e]=[S,E]),I=R(a,D,function(t){return"M"+t+","+a._offset+"v"+a._length}),z&&a.showline&&("all"===a.mirror||"allticks"===a.mirror)&&(I+=D(S)+D(E)),r.ylines.style("stroke-width",a._lw+"px").call(l.stroke,a.showline?a.linecolor:"rgba(0,0,0,0)")),r.ylines.attr("d",I)}function O(t){return"M"+v+","+t+"H"+y}function D(t){return"M"+t+","+T+"V"+A}function R(t,r,n){if(!t.showline||e!==t._mainSubplot)return"";if(!t._anchorAxis)return n(t._mainLinePosition);var i=r(t._mainLinePosition);return t.mirror&&(i+=r(t._mainMirrorPosition)),i}}),f.makeClipPaths(t),r.drawMainTitle(t),h.manage(t),t._promises.length&&Promise.all(t._promises)}function x(t,e){var r=e._subplots,n=r.cartesian.concat(r.gl2d||[]),i={_fullLayout:e},a="x"===t._id.charAt(0),o=t._mainAxis._anchorAxis,s="",l="",c="";if(o&&(c=o._mainAxis._id,s=a?t._id+c:c+t._id),!s||!e._plots[s]){s="";for(var u=0;uk?u.push({code:"unused",traceType:y,templateCount:w,dataCount:k}):k>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:k})}}else u.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=p(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&u.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&d(a)&&t(a,o)}}({data:m,layout:f},""),u.length)return u.map(g)}},{"../lib":684,"../plots/attributes":729,"../plots/plots":795,"./plot_config":720,"./plot_schema":721,"./plot_template":722}],725:[function(t,e,r){"use strict";var n=t("./plot_api"),i=t("../lib"),a=t("../snapshot/helpers"),o=t("../snapshot/tosvg"),s=t("../snapshot/svgtoimg"),l={format:{valType:"enumerated",values:["png","jpeg","webp","svg"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}},c=/^data:image\/\w+;base64,/;e.exports=function(t,e){var r,u,h;function f(t){return!(t in e)||i.validate(e[t],l[t])}if(e=e||{},i.isPlainObject(t)?(r=t.data||[],u=t.layout||{},h=t.config||{}):(t=i.getGraphDiv(t),r=i.extendDeep([],t.data),u=i.extendDeep({},t.layout),h=t._context),!f("width")||!f("height"))throw new Error("Height and width should be pixel values.");if(!f("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var p={};function d(t,r){return i.coerce(e,p,l,t,r)}var g=d("format"),m=d("width"),v=d("height"),y=d("scale"),x=d("setBackground"),b=d("imageDataOnly"),_=document.createElement("div");_.style.position="absolute",_.style.left="-5000px",document.body.appendChild(_);var w=i.extendFlat({},u);m&&(w.width=m),v&&(w.height=v);var k=i.extendFlat({},h,{staticPlot:!0,setBackground:x}),M=a.getRedrawFunc(_);function A(){return new Promise(function(t){setTimeout(t,a.getDelay(_._fullLayout))})}function T(){return new Promise(function(t,e){var r=o(_,g,y),a=_._fullLayout.width,l=_._fullLayout.height;if(n.purge(_),document.body.removeChild(_),"svg"===g)return t(b?r:"data:image/svg+xml,"+encodeURIComponent(r));var c=document.createElement("canvas");c.id=i.randstr(),s({format:g,width:a,height:l,scale:y,canvas:c,svg:r,promise:!0}).then(t).catch(e)})}return new Promise(function(t,e){n.plot(_,r,w,k).then(M).then(A).then(T).then(function(e){t(function(t){return b?t.replace(c,""):t}(e))}).catch(function(t){e(t)})})}},{"../lib":684,"../snapshot/helpers":821,"../snapshot/svgtoimg":823,"../snapshot/tosvg":825,"./plot_api":719}],726:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config"),s=n.isPlainObject,l=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,i,a,o){o=o||[];for(var h=Object.keys(t),f=0;fx.length&&i.push(p("unused",a,v.concat(x.length)));var M,A,T,S,E,C=x.length,L=Array.isArray(k);if(L&&(C=Math.min(C,k.length)),2===b.dimensions)for(A=0;Ax[A].length&&i.push(p("unused",a,v.concat(A,x[A].length)));var z=x[A].length;for(M=0;M<(L?Math.min(z,k[A].length):z);M++)T=L?k[A][M]:k,S=y[A][M],E=x[A][M],n.validate(S,T)?E!==S&&E!==+S&&i.push(p("dynamic",a,v.concat(A,M),S,E)):i.push(p("value",a,v.concat(A,M),S))}else i.push(p("array",a,v.concat(A),y[A]));else for(A=0;A1&&f.push(p("object","layout"))),i.supplyDefaults(d);for(var g=d._fullData,m=r.length,v=0;v0&&c>0&&u/c>d&&(o=n,l=a,d=u/c);if(f===p){var y=f-1,x=f+1;h="tozero"===t.rangemode?f<0?[y,0]:[0,x]:"nonnegative"===t.rangemode?[Math.max(0,y),Math.max(0,x)]:[y,x]}else d&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(o.val>=0&&(o={val:0,pad:0}),l.val<=0&&(l={val:0,pad:0})):"nonnegative"===t.rangemode&&(o.val-d*m(o)<0&&(o={val:0,pad:0}),l.val<0&&(l={val:1,pad:0})),d=(l.val-o.val)/(t._length-m(o)-m(l))),h=[o.val-d*m(o),l.val+d*m(l)]);return h[0]===h[1]&&("tozero"===t.rangemode?h=h[0]<0?[h[0],0]:h[0]>0?[0,h[0]]:[0,1]:(h=[h[0]-1,h[0]+1],"nonnegative"===t.rangemode&&(h[0]=Math.max(0,h[0])))),g&&h.reverse(),i.simpleMap(h,t.l2r||Number)}function s(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function l(t){return n(t)&&Math.abs(t)=e}e.exports={getAutoRange:o,makePadFn:s,doAutoRange:function(t){t._length||t.setScale();var e,r=t._min&&t._max&&t._min.length&&t._max.length;t.autorange&&r&&(t.range=o(t),t._r=t.range.slice(),t._rl=i.simpleMap(t._r,t.r2l),(e=t._input).range=t.range.slice(),e.autorange=t.autorange);if(t._anchorAxis&&t._anchorAxis.rangeslider){var n=t._anchorAxis.rangeslider[t._name];n&&"auto"===n.rangemode&&(n.range=r?o(t):t._rangeInitial?t._rangeInitial.slice():t.range.slice()),(e=t._anchorAxis._input).rangeslider[t._name]=i.extendFlat({},n)}},expand:function(t,e,r){if(!function(t){return t.autorange||t._rangesliderAutorange}(t)||!e)return;t._min||(t._min=[]);t._max||(t._max=[]);r||(r={});t._m||t.setScale();var i,o,s,h,f,p,d,g,m,v,y,x,b=e.length,_=r.padded||!1,w=r.tozero&&("linear"===t.type||"-"===t.type),k="log"===t.type,M=!1;function A(t){if(Array.isArray(t))return M=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var T=A((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),S=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=A(r.vpadplus||r.vpad),C=A(r.vpadminus||r.vpad);if(!M){if(y=1/0,x=-1/0,k)for(i=0;i0&&(y=h),h>x&&h-a&&(y=h),h>x&&h=b&&(h.extrapad||!_)){v=!1;break}M(i,h.val)&&h.pad<=b&&(_||!h.extrapad)&&(a.splice(o,1),o--)}if(v){var A=w&&0===i;a.push({val:i,pad:A?0:b,extrapad:!A&&_})}}}}var z=Math.min(6,b);for(i=0;i=z;i--)L(i)}}},{"../../constants/numerical":661,"../../lib":684,"fast-isnumeric":214}],732:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../../components/titles"),u=t("../../components/color"),h=t("../../components/drawing"),f=t("../../constants/numerical"),p=f.ONEAVGYEAR,d=f.ONEAVGMONTH,g=f.ONEDAY,m=f.ONEHOUR,v=f.ONEMIN,y=f.ONESEC,x=f.MINUS_SIGN,b=f.BADNUM,_=t("../../constants/alignment").MID_SHIFT,w=t("../../constants/alignment").LINE_SPACING,k=e.exports={};k.setConvert=t("./set_convert");var M=t("./axis_autotype"),A=t("./axis_ids");k.id2name=A.id2name,k.name2id=A.name2id,k.cleanId=A.cleanId,k.list=A.list,k.listIds=A.listIds,k.getFromId=A.getFromId,k.getFromTrace=A.getFromTrace;var T=t("./autorange");k.expand=T.expand,k.getAutoRange=T.getAutoRange,k.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return i||(i=l[0]||a),a||(a=i),u[c]={valType:"enumerated",values:l.concat(a?[a]:[]),dflt:i},s.coerce(t,e,u,c)},k.coercePosition=function(t,e,r,n,i,a){var o,l;if("paper"===n||"pixel"===n)o=s.ensureNumber,l=r(i,a);else{var c=k.getFromId(e,n);l=r(i,a=c.fraction2r(a)),o=c.cleanPos}t[i]=o(l)},k.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:k.getFromId(e,r).cleanPos)(t)};var S=k.getDataConversions=function(t,e,r,n){var i,a="x"===r||"y"===r||"z"===r?r:n;if(Array.isArray(a)){if(i={type:M(n),_categories:[]},k.setConvert(i),"category"===i.type)for(var o=0;o2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},k.saveRangeInitial=function(t,e){for(var r=k.list(t,"",!0),n=!1,i=0;i.3*f||u(n)||u(a))){var p=r.dtick/2;t+=t+p.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=k.tickIncrement(t,"M6","reverse")+1.5*g:a.exactMonths>.8?t=k.tickIncrement(t,"M1","reverse")+15.5*g:t-=g/2;var l=k.tickIncrement(t,r);if(l<=n)return l}return t}(m,t,l.dtick,c,a)),d=m,0;d<=u;)d=k.tickIncrement(d,l.dtick,!1,a),0;return{start:e.c2r(m,0,a),end:e.c2r(d,0,a),size:l.dtick,_dataSpan:u-c}},k.prepTicks=function(t){var e=s.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=s.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),k.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),F(t)},k.calcTicks=function(t){k.prepTicks(t);var e=s.simpleMap(t.range,t.r2l);if("array"===t.tickmode)return function(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=s.simpleMap(t.range,t.r2l),l=1.0001*o[0]-1e-4*o[1],c=1.0001*o[1]-1e-4*o[0],u=Math.min(l,c),h=Math.max(l,c),f=0;Array.isArray(i)||(i=[]);var p="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(r=0;ru&&e=n:c<=n)&&!(a.length>l||c===o);c=k.tickIncrement(c,t.dtick,i,t.calendar))o=c,a.push(c);"angular"===t._id&&360===Math.abs(e[1]-e[0])&&a.pop(),t._tmax=a[a.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var u=new Array(a.length),h=0;h10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=g&&a<=10||e>=15*g)t._tickround="d";else if(e>=v&&a<=16||e>=m)t._tickround="M";else if(e>=y&&a<=19||e>=v)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(c)>3&&(V(t.exponentformat)&&!U(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function N(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}k.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar);var a=2*e;a>p?(e/=p,r=n(10),t.dtick="M"+12*B(e,r,L)):a>d?(e/=d,t.dtick="M"+B(e,1,z)):a>g?(t.dtick=B(e,g,I),t.tick0=s.dateTick0(t.calendar,!0)):a>m?t.dtick=B(e,m,z):a>v?t.dtick=B(e,v,P):a>y?t.dtick=B(e,y,P):(r=n(10),t.dtick=B(e,r,L))}else if("log"===t.type){t.tick0=0;var o=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var l=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/l,r=n(10),t.dtick="L"+B(e,r,L)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):"angular"===t._id?(t.tick0=0,r=1,t.dtick=B(e,r,R)):(t.tick0=0,r=n(10),t.dtick=B(e,r,L));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var c=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(c)}},k.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return t+o*e;var l=e.charAt(0),c=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,c,a);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?D:O,h=t+.01*o,f=s.roundUp(s.mod(h,1),u,r);return Math.floor(h)+Math.log(n.round(Math.pow(10,f),1))/Math.LN10}throw"unrecognized dtick "+String(e)},k.tickFirst=function(t){var e=t.r2l||Number,r=s.simpleMap(t.range,e),a=r[1]"+l,t._prevDateHead=l));e.text=c}(t,o,r,c):"log"===t.type?function(t,e,r,n,a){var o=t.dtick,l=e.x,c=t.tickformat;"never"===a&&(a="");!n||"string"==typeof o&&"L"===o.charAt(0)||(o="L3");if(c||"string"==typeof o&&"L"===o.charAt(0))e.text=q(Math.pow(10,l),t,a,n);else if(i(o)||"D"===o.charAt(0)&&s.mod(l+.01,1)<.1){var u=Math.round(l);-1!==["e","E","power"].indexOf(t.exponentformat)||V(t.exponentformat)&&U(u)?(e.text=0===u?1:1===u?"10":u>1?"10"+u+"":"10"+x+-u+"",e.fontSize*=1.25):(e.text=q(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==o.charAt(0))throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var h=String(e.text).charAt(0);"0"!==h&&"1"!==h||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,c,n):"category"===t.type?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"angular"===t._id?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=q(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){var r=1;for(;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=q(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="π":e.text=o[0]+"π":e.text=["",o[0],"","⁄","",o[1],"","π"].join(""),l&&(e.text=x+e.text)}}}}(t,o,r,c,n):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=q(e.x,t,i,n)}(t,o,0,c,n),t.tickprefix&&!p(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!p(t.showticksuffix)&&(o.text+=t.ticksuffix),o},k.hoverLabelText=function(t,e,r){if(r!==b&&r!==e)return k.hoverLabelText(t,e)+" - "+k.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=k.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":x+i:i};var j=["f","p","n","μ","m","","k","M","G","T"];function V(t){return"SI"===t||"B"===t}function U(t){return t>14||t<-15}function q(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=k.getTickFormat(e),h=e.separatethousands;if(n){var f={exponentformat:l,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};F(f),o=(Number(f._tickround)||0)+4,c=f._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,x);var p,d=Math.pow(10,-o)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+p+"":"B"===l&&9===c?t+="B":V(l)&&(t+=j[c/3+5]));return a?x+t:t}function H(t,e){for(var r=0;r=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e1&&e1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,o=0,s=0;s2*n}(t)?"category":function(t){if(!t)return!1;for(var e=0;en?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)}},{"../../registry":817,"./constants":737}],736:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var i,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;no*y)||w)for(r=0;rP&&DL&&(L=D);f/=(L-C)/(2*z),C=c.l2r(C),L=c.l2r(L),c.range=c._input.range=T=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function P(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}function I(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function O(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),D(t,e,i,a)}function D(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function R(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function B(t){A&&t.data&&t._context.showTips&&(s.notifier(s._(t,"Double-click to zoom back out"),"long"),A=!1)}function F(t){return"lasso"===t||"select"===t}function N(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,M)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function j(t,e){if(a){var r=void 0!==t.onwheel?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(r,t._onwheel),t._onwheel=e,t.addEventListener(r,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel&&(t.onmousewheel=e)}function V(t){var e=[];for(var r in t)e.push(t[r]);return e}e.exports={makeDragBox:function(t,e,r,a,u,p,A,T){var D,U,q,H,G,W,Y,X,Z,$,J,K,Q,tt,et,rt,nt,it,at,ot,st,lt=t._fullLayout._zoomlayer,ct=A+T==="nsew",ut=1===(A+T).length;function ht(){if(D=e.xaxis,U=e.yaxis,Z=D._length,$=U._length,Y=D._offset,X=U._offset,(q={})[D._id]=D,(H={})[U._id]=U,A&&T)for(var r=e.overlays,n=0;nM||o>M?(bt="xy",a/Z>o/$?(o=a*$/Z,gt>i?mt.t=gt-o:mt.b=gt+o):(a=o*Z/$,dt>n?mt.l=dt-a:mt.r=dt+a),wt.attr("d",N(mt))):s():!Q||o10||r.scrollWidth-r.clientWidth>10)){clearTimeout(It);var n=-e.deltaY;if(isFinite(n)||(n=e.wheelDelta/10),isFinite(n)){var i,a=Math.exp(-Math.min(Math.max(n,-20),20)/200),o=Dt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-o.left)/o.width,c=(o.bottom-e.clientY)/o.height;if(rt){for(T||(l=.5),i=0;ig[1]-.01&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":684,"fast-isnumeric":214}],748:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)]}},{"../../constants/alignment":656}],749:[function(t,e,r){"use strict";var n=t("polybooljs"),i=t("../../registry"),a=t("../../components/color"),o=t("../../components/fx"),s=t("../../lib/polygon"),l=t("../../lib/throttle"),c=t("../../components/fx/helpers").makeEventData,u=t("./axis_ids").getFromId,h=t("../sort_modules").sortModules,f=t("./constants"),p=f.MINSELECT,d=s.filter,g=s.tester,m=s.multitester;function v(t){return t._id}function y(t,e,r){var n,a,o,s;if(r){var l=r.points||[];for(n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*u*Math.abs(n-i))}return f}function v(e,r,n){var o=l(e,n||t.calendar);if(o===f){if(!i(e))return f;e=+e;var s=Math.floor(10*a.mod(e+.05,1)),c=Math.round(e-s/10);o=l(new Date(c))+s/10}return o}function y(e,r,n){return s(e,r,n||t.calendar)}function x(e){return t._categories[Math.round(e)]}function b(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(i(e))return+e}function _(e){return i(e)?n.round(t._b+t._m*e,2):f}function w(e){return(e-t._b)/t._m}t.c2l="log"===t.type?m:c,t.l2c="log"===t.type?g:c,t.l2p=_,t.p2l=w,t.c2p="log"===t.type?function(t,e){return _(m(t,e))}:_,t.p2c="log"===t.type?function(t){return g(w(t))}:w,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=w,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return m(o(t),e)},t.r2d=t.r2c=function(t){return g(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=c,t.c2r=m,t.l2d=g,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return g(w(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=w,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=v,t.c2d=t.c2r=t.l2d=t.l2r=y,t.d2p=t.r2p=function(e,r,n){return t.l2p(v(e,0,n))},t.p2d=t.p2r=function(t,e,r){return y(w(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,f,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=function(e){if(null!=e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return f},t.r2d=t.c2d=t.l2d=x,t.d2r=t.d2l_noadd=b,t.r2c=function(e){var r=b(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=b,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return x(w(t))},t.r2p=t.d2p,t.p2r=w,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e,n){n||(n={}),e||(e="range");var o,s,l=a.nestedProperty(t,e).get();if(s=(s="date"===t.type?a.dfltRange(t.calendar):"y"===r?p.DFLTRANGEY:n.dfltRange||p.DFLTRANGEX).slice(),l&&2===l.length)for("date"===t.type&&(l[0]=a.cleanDate(l[0],f,t.calendar),l[1]=a.cleanDate(l[1],f,t.calendar)),o=0;o<2;o++)if("date"===t.type){if(!a.isDateTime(l[o],t.calendar)){t[e]=s;break}if(t.r2l(l[0])===t.r2l(l[1])){var c=a.constrain(t.r2l(l[0]),a.MIN_MS+1e3,a.MAX_MS-1e3);l[0]=t.l2r(c-1e3),l[1]=t.l2r(c+1e3);break}}else{if(!i(l[o])){if(!i(l[1-o])){t[e]=s;break}l[o]=l[1-o]*(o?10:.1)}if(l[o]<-h?l[o]=-h:l[o]>h&&(l[o]=h),l[0]===l[1]){var u=Math.max(1,Math.abs(1e-6*l[0]));l[0]-=u,l[1]+=u}}else a.nestedProperty(t,e).set(s)},t.setScale=function(n){var i=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=d.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var o=n&&t._r?"_r":"range",s=t.calendar;t.cleanRange(o);var l=t.r2l(t[o][0],s),c=t.r2l(t[o][1],s);if("y"===r?(t._offset=i.t+(1-t.domain[1])*i.h,t._length=i.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-c),t._b=-t._m*c):(t._offset=i.l+t.domain[0]*i.w,t._length=i.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-l),t._b=-t._m*l),!isFinite(t._m)||!isFinite(t._b))throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,i,o,s,l=t.type,c="date"===l&&e[r+"calendar"];if(r in e){if(n=e[r],s=e._length||n.length,a.isTypedArray(n)&&("linear"===l||"log"===l)){if(s===n.length)return n;if(n.subarray)return n.subarray(0,s)}for(i=new Array(s),o=0;o0?Number(c):l;else if("string"!=typeof c)e.dtick=l;else{var u=c.charAt(0),h=c.substr(1);((h=n(h)?Number(h):0)<=0||!("date"===o&&"M"===u&&h===Math.round(h)||"log"===o&&"L"===u||"log"===o&&"D"===u&&(1===h||2===h)))&&(e.dtick=l)}var f="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",f);"date"===o?e.tick0=i.cleanDate(p,f):n(p)&&"D1"!==c&&"D2"!==c?e.tick0=Number(p):e.tick0=f}else{void 0===r("tickvals")?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":661,"../../lib":684,"fast-isnumeric":214}],754:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../components/drawing"),o=t("./axes"),s=t("./constants").attrRegex;e.exports=function(t,e,r,l){var c=t._fullLayout,u=[];var h,f,p,d,g=function(t){var e,r,n,i,a={};for(e in t)if((r=e.split("."))[0].match(s)){var o=e.charAt(0),l=r[0];if(n=c[l],i={},Array.isArray(t[e])?i.to=t[e].slice(0):Array.isArray(t[e].range)&&(i.to=t[e].range.slice(0)),!i.to)continue;i.axisName=l,i.length=n._length,u.push(o),a[o]=i}return a}(e),m=Object.keys(g),v=function(t,e,r){var n,i,a,o=t._plots,s=[];for(n in o){var l=o[n];if(-1===s.indexOf(l)){var c=l.xaxis._id,u=l.yaxis._id,h=l.xaxis.range,f=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),i=r[c]?r[c].to:h,a=r[u]?r[u].to:f,h[0]===i[0]&&h[1]===i[1]&&f[0]===a[0]&&f[1]===a[1]||-1===e.indexOf(c)&&-1===e.indexOf(u)||s.push(l)}}return s}(c,m,g);if(!v.length)return function(){function e(e,r,n){for(var i=0;i rect").call(a.setTranslate,0,0).call(a.setScale,1,1),t.plot.call(a.setTranslate,e._offset,r._offset).call(a.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(a.setPointGroupScale,1,1),n.selectAll(".textpoint").call(a.setTextPointsScale,1,1),n.call(a.hideOutsideRangePoints,t)}function x(e,r){var n,s,l,u=g[e.xaxis._id],h=g[e.yaxis._id],f=[];if(u){s=(n=t._fullLayout[u.axisName])._r,l=u.to,f[0]=(s[0]*(1-r)+r*l[0]-s[0])/(s[1]-s[0])*e.xaxis._length;var p=s[1]-s[0],d=l[1]-l[0];n.range[0]=s[0]*(1-r)+r*l[0],n.range[1]=s[1]*(1-r)+r*l[1],f[2]=e.xaxis._length*(1-r+r*d/p)}else f[0]=0,f[2]=e.xaxis._length;if(h){s=(n=t._fullLayout[h.axisName])._r,l=h.to,f[1]=(s[1]*(1-r)+r*l[1]-s[1])/(s[0]-s[1])*e.yaxis._length;var m=s[1]-s[0],v=l[1]-l[0];n.range[0]=s[0]*(1-r)+r*l[0],n.range[1]=s[1]*(1-r)+r*l[1],f[3]=e.yaxis._length*(1-r+r*v/m)}else f[1]=0,f[3]=e.yaxis._length;!function(e,r){var n,a=[];for(a=[e._id,r._id],n=0;nr.duration?(function(){for(var e={},r=0;r0&&i["_"+r+"axes"][e])return i;if((i[r+"axis"]||r)===e){if(s(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,r,a);if(!l)return;if("histogram"===l.type&&a==={v:"y",h:"x"}[l.orientation||"v"])return void(t.type="linear");var c,u=a+"calendar",h=l[u];if(s(l,a)){var f=o(l),p=[];for(c=0;c0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}})}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(c)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(c){a(t,c,s.cache),s.check=function(){if(l){var e=a(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;hi*Math.PI/180}return!1},r.getPath=function(){return n.geo.path().projection(r)},r.getBounds=function(t){return r.getPath().bounds(t)},r.fitExtent=function(t,e){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),a&&r.clipExtent(null);var o=r.getBounds(e),s=Math.min(n/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+t[0][0]+(n-s*(o[1][0]+o[0][0]))/2,c=+t[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return a&&r.clipExtent(a),r.scale(150*s).translate([l,c])},r.precision(d.precision),i&&r.clipAngle(i-d.clipPad);return r}(e);u.center([c.lon-l.lon,c.lat-l.lat]).rotate([-l.lon,-l.lat,l.roll]).parallels(s.parallels);var h=[[r.l+r.w*o.x[0],r.t+r.h*(1-o.y[1])],[r.l+r.w*o.x[1],r.t+r.h*(1-o.y[0])]],f=e.lonaxis,p=e.lataxis,g=function(t,e){var r=d.clipPad,n=t[0]+r,i=t[1]-r,a=e[0]+r,o=e[1]-r;n>0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}(f.range,p.range);u.fitExtent(h,g);var m=this.bounds=u.getBounds(g),v=this.fitScale=u.scale(),y=u.translate();if(!isFinite(m[0][0])||!isFinite(m[0][1])||!isFinite(m[1][0])||!isFinite(m[1][1])||isNaN(y[0])||isNaN(y[0])){for(var x=this.graphDiv,b=["projection.rotation","center","lonaxis.range","lataxis.range"],_="Invalid geo settings, relayout'ing to default view.",w={},k=0;k0&&k<0&&(k+=360);var M,A,T,S=(w+k)/2;if(!c){var E=u?s.projRotate:[S,0,0];M=r("projection.rotation.lon",E[0]),r("projection.rotation.lat",E[1]),r("projection.rotation.roll",E[2]),r("showcoastlines",!u)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean")&&r("oceancolor")}(c?(A=-96.6,T=38.7):(A=u?S:M,T=(_[0]+_[1])/2),r("center.lon",A),r("center.lat",T),h)&&r("projection.parallels",s.projParallels||[0,60]);r("projection.scale"),r("showland")&&r("landcolor"),r("showlakes")&&r("lakecolor"),r("showrivers")&&(r("rivercolor"),r("riverwidth")),r("showcountries",u&&"usa"!==a)&&(r("countrycolor"),r("countrywidth")),("usa"===a||"north america"===a&&50===n)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),u||r("showframe",!0)&&(r("framecolor"),r("framewidth")),r("bgcolor")}e.exports=function(t,e,r){n(t,e,r,{type:"geo",attributes:a,handleDefaults:s,partition:"y"})}},{"../../subplot_defaults":809,"../constants":760,"./layout_attributes":765}],765:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../../domain").attributes,a=t("../constants"),o=t("../../../plot_api/edit_types").overrideAll,s={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:n.lightLine},gridwidth:{valType:"number",min:0,dflt:1}};e.exports=o({domain:i({name:"geo"},{}),resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(a.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(a.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:a.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:a.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:a.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:a.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:n.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:n.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:n.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:n.background},lonaxis:s,lataxis:s},"plot","from-root")},{"../../../components/color/attributes":557,"../../../plot_api/edit_types":715,"../../domain":757,"../constants":760}],766:[function(t,e,r){"use strict";e.exports=function(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return r(t,n)})};if(!c.hasOwnProperty(e.type))return null;var i=c[e.type];return t.geo.stream(e,n(i)),i.result()}t.geo.project=function(t,e){var i=e.stream;if(!i)throw new Error("not yet supported");return(t&&n.hasOwnProperty(t.type)?n[t.type]:r)(t,i)};var n={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},i=[],a=[],o={point:function(t,e){i.push([t,e])},result:function(){var t=i.length?i.length<2?{type:"Point",coordinates:i[0]}:{type:"MultiPoint",coordinates:i}:null;return i=[],t}},s={lineStart:u,point:function(t,e){i.push([t,e])},lineEnd:function(){i.length&&(a.push(i),i=[])},result:function(){var t=a.length?a.length<2?{type:"LineString",coordinates:a[0]}:{type:"MultiLineString",coordinates:a}:null;return a=[],t}},l={polygonStart:u,lineStart:u,point:function(t,e){i.push([t,e])},lineEnd:function(){var t=i.length;if(t){do{i.push(i[0].slice())}while(++t<4);a.push(i),i=[]}},polygonEnd:u,result:function(){if(!a.length)return null;var t=[],e=[];return a.forEach(function(r){!function(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++rn^p>n&&r<(f-c)*(n-u)/(p-u)+c&&(i=!i)}return i}(t[0],r))return t.push(e),!0})||t.push([e])}),a=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},c={Point:o,MultiPoint:o,LineString:s,MultiLineString:s,Polygon:l,MultiPolygon:l,Sphere:l};function u(){}var h=1e-6,f=h*h,p=Math.PI,d=p/2,g=(Math.sqrt(p),p/180),m=180/p;function v(t){return t>1?d:t<-1?-d:Math.asin(t)}function y(t){return t>1?0:t<-1?p:Math.acos(t)}var x=t.geo.projection,b=t.geo.projectionMutator;function _(t,e){var r=(2+d)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>h;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(p*(4+p))*t*(1+Math.cos(e)),2*Math.sqrt(p/(4+p))*Math.sin(e)]}t.geo.interrupt=function(e){var r,n=[[[[-p,0],[0,d],[p,0]]],[[[-p,0],[0,-d],[p,0]]]];function i(t,r){for(var i=r<0?-1:1,a=n[+(r<0)],o=0,s=a.length-1;oa[o][2][0];++o);var l=e(t-a[o][1][0],r);return l[0]+=e(a[o][1][0],i*r>i*a[o][0][1]?a[o][0][1]:r)[0],l}e.invert&&(i.invert=function(t,a){for(var o=r[+(a<0)],s=n[+(a<0)],c=0,u=o.length;c=0;--i){var o=n[1][i],l=180*o[0][0]/p,c=180*o[0][1]/p,u=180*o[1][1]/p,h=180*o[2][0]/p,f=180*o[2][1]/p;r.push(s([[h-e,f-e],[h-e,u+e],[l+e,u+e],[l+e,c-e]],30))}return{type:"Polygon",coordinates:[t.merge(r)]}}(),l)},i},a.lobes=function(t){return arguments.length?(n=t.map(function(t){return t.map(function(t){return[[t[0][0]*p/180,t[0][1]*p/180],[t[1][0]*p/180,t[1][1]*p/180],[t[2][0]*p/180,t[2][1]*p/180]]})}),r=n.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})}),a):n.map(function(t){return t.map(function(t){return[[180*t[0][0]/p,180*t[0][1]/p],[180*t[1][0]/p,180*t[1][1]/p],[180*t[2][0]/p,180*t[2][1]/p]]})})},a},_.invert=function(t,e){var r=.5*e*Math.sqrt((4+p)/p),n=v(r),i=Math.cos(n);return[t/(2/Math.sqrt(p*(4+p))*(1+i)),v((n+r*(i+2))/(2+d))]},(t.geo.eckert4=function(){return x(_)}).raw=_;var w=t.geo.azimuthalEqualArea.raw;function k(t,e){if(arguments.length<2&&(e=t),1===e)return w;if(e===1/0)return M;function r(r,n){var i=w(r/e,n);return i[0]*=t,i}return r.invert=function(r,n){var i=w.invert(r/t,n);return i[0]*=e,i},r}function M(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function A(t,e){return[3*t/(2*p)*Math.sqrt(p*p/3-e*e),e]}function T(t,e){return[t,1.25*Math.log(Math.tan(p/4+.4*e))]}function S(t){return function(e){var r,n=t*Math.sin(e),i=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>h&&--i>0);return e/2}}M.invert=function(t,e){var r=2*v(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=function(){var t=2,e=b(k),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}).raw=k,A.invert=function(t,e){return[2/3*p*t/Math.sqrt(p*p/3-e*e),e]},(t.geo.kavrayskiy7=function(){return x(A)}).raw=A,T.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*p]},(t.geo.miller=function(){return x(T)}).raw=T,S(p);var E=function(t,e,r){var n=S(r);function i(r,i){return[t*r*Math.cos(i=n(i)),e*Math.sin(i)]}return i.invert=function(n,i){var a=v(i/e);return[n/(t*Math.cos(a)),v((2*a+Math.sin(2*a))/r)]},i}(Math.SQRT2/d,Math.SQRT2,p);function C(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}(t.geo.mollweide=function(){return x(E)}).raw=E,C.invert=function(t,e){var r,n=e,i=25;do{var a=n*n,o=a*a;n-=r=(n*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-e)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))}while(Math.abs(r)>h&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return x(C)}).raw=C;var L=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];function z(t,e){var r,n=Math.min(18,36*Math.abs(e)/p),i=Math.floor(n),a=n-i,o=(r=L[i])[0],s=r[1],l=(r=L[++i])[0],c=r[1],u=(r=L[Math.min(19,++i)])[0],h=r[1];return[t*(l+a*(u-o)/2+a*a*(u-2*l+o)/2),(e>0?d:-d)*(c+a*(h-s)/2+a*a*(h-2*c+s)/2)]}function P(t,e){return[t*Math.cos(e),e]}function I(t,e){var r,n=Math.cos(e),i=(r=y(n*Math.cos(t/=2)))?r/Math.sin(r):1;return[2*n*Math.sin(t)*i,Math.sin(e)*i]}function O(t,e){var r=I(t,e);return[(r[0]+t/d)/2,(r[1]+e)/2]}L.forEach(function(t){t[1]*=1.0144}),z.invert=function(t,e){var r=e/d,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=L[a][1],s=L[a+1][1],l=L[Math.min(19,a+2)][1],c=l-o,u=l-2*s+o,h=2*(Math.abs(r)-s)/c,p=u/c,v=h*(1-p*h*(1-2*p*h));if(v>=0||1===a){n=(e>=0?5:-5)*(v+i);var y,x=50;do{v=(i=Math.min(18,Math.abs(n)/5))-(a=Math.floor(i)),o=L[a][1],s=L[a+1][1],l=L[Math.min(19,a+2)][1],n-=(y=(e>=0?d:-d)*(s+v*(l-o)/2+v*v*(l-2*s+o)/2)-e)*m}while(Math.abs(y)>f&&--x>0);break}}while(--a>=0);var b=L[a][0],_=L[a+1][0],w=L[Math.min(19,a+2)][0];return[t/(_+v*(w-b)/2+v*v*(w-2*_+b)/2),n*g]},(t.geo.robinson=function(){return x(z)}).raw=z,P.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return x(P)}).raw=P,I.invert=function(t,e){if(!(t*t+4*e*e>p*p+h)){var r=t,n=e,i=25;do{var a,o=Math.sin(r),s=Math.sin(r/2),l=Math.cos(r/2),c=Math.sin(n),u=Math.cos(n),f=Math.sin(2*n),d=c*c,g=u*u,m=s*s,v=1-g*l*l,x=v?y(u*l)*Math.sqrt(a=1/v):a=0,b=2*x*u*s-t,_=x*c-e,w=a*(g*m+x*u*l*d),k=a*(.5*o*f-2*x*c*s),M=.25*a*(f*s-x*c*g*o),A=a*(d*l+x*m*u),T=k*M-A*w;if(!T)break;var S=(_*k-b*A)/T,E=(b*M-_*w)/T;r-=S,n-=E}while((Math.abs(S)>h||Math.abs(E)>h)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return x(I)}).raw=I,O.invert=function(t,e){var r=t,n=e,i=25;do{var a,o=Math.cos(n),s=Math.sin(n),l=Math.sin(2*n),c=s*s,u=o*o,f=Math.sin(r),p=Math.cos(r/2),g=Math.sin(r/2),m=g*g,v=1-u*p*p,x=v?y(o*p)*Math.sqrt(a=1/v):a=0,b=.5*(2*x*o*g+r/d)-t,_=.5*(x*s+n)-e,w=.5*a*(u*m+x*o*p*c)+.5/d,k=a*(f*l/4-x*s*g),M=.125*a*(l*g-x*s*u*f),A=.5*a*(c*p+x*m*o)+.5,T=k*M-A*w,S=(_*k-b*A)/T,E=(b*M-_*w)/T;r-=S,n-=E}while((Math.abs(S)>h||Math.abs(E)>h)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return x(O)}).raw=O}},{}],767:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=Math.PI/180,o=180/Math.PI,s={cursor:"pointer"},l={cursor:"auto"};function c(t,e){return n.behavior.zoom().translate(e.translate()).scale(e.scale())}function u(t,e,r){var n=t.id,a=t.graphDiv,o=a.layout[n],s=a._fullLayout[n],l={};function c(t,e){var r=i.nestedProperty(s,t);r.get()!==e&&(r.set(e),i.nestedProperty(o,t).set(e),l[n+"."+t]=e)}r(c),c("projection.scale",e.scale()/t.fitScale),a.emit("plotly_relayout",l)}function h(t,e){var r=c(0,e);function i(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",function(){n.select(this).style(s)}).on("zoom",function(){e.scale(n.event.scale).translate(n.event.translate),t.render()}).on("zoomend",function(){n.select(this).style(l),u(t,e,i)}),r}function f(t,e){var r,i,a,o,h,f,p,d,g,m=c(0,e),v=2;function y(t){return e.invert(t)}function x(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return m.on("zoomstart",function(){n.select(this).style(s),r=n.mouse(this),i=e.rotate(),a=e.translate(),o=i,h=y(r)}).on("zoom",function(){if(f=n.mouse(this),function(t){var r=y(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>v||Math.abs(n[1]-t[1])>v}(r))return m.scale(e.scale()),void m.translate(e.translate());e.scale(n.event.scale),e.translate([a[0],n.event.translate[1]]),h?y(f)&&(d=y(f),p=[o[0]+(d[0]-h[0]),i[1],i[2]],e.rotate(p),o=p):h=y(r=f),g=!0,t.render()}).on("zoomend",function(){n.select(this).style(l),g&&u(t,e,x)}),m}function p(t,e){var r,i={r:e.rotate(),k:e.scale()},h=c(0,e),f=function(t){var e=0,r=arguments.length,i=[];for(;++ed?(a=(h>0?90:-90)-p,i=0):(a=Math.asin(h/d)*o-p,i=Math.sqrt(d*d-h*h));var m=180-a-2*p,y=(Math.atan2(f,u)-Math.atan2(c,i))*o,x=(Math.atan2(f,u)-Math.atan2(c,-i))*o,b=g(r[0],r[1],a,y),_=g(r[0],r[1],m,x);return b<=_?[a,y,r[2]]:[m,x,r[2]]}(k,r,E);isFinite(M[0])&&isFinite(M[1])&&isFinite(M[2])||(M=E),e.rotate(M),E=M}}else r=d(e,T=b);f.of(this,arguments)({type:"zoom"})}),A=f.of(this,arguments),p++||A({type:"zoomstart"})}).on("zoomend",function(){var r;n.select(this).style(l),m.call(h,"zoom",null),r=f.of(this,arguments),--p||r({type:"zoomend"}),u(t,e,x)}).on("zoom.redraw",function(){t.render()}),n.rebind(h,f,"on")}function d(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*a,r=t[1]*a,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function g(t,e,r,n){var i=m(r-t),a=m(n-e);return Math.sqrt(i*i+a*a)}function m(t){return(t%360+540)%360-180}function v(t,e,r){var n=r*a,i=t.slice(),o=0===e?1:0,s=2===e?1:2,l=Math.cos(n),c=Math.sin(n);return i[o]=t[o]*l-t[s]*c,i[s]=t[s]*l+t[o]*c,i}function y(t,e){for(var r=0,n=0,i=t.length;nMath.abs(s)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(a)*_*(s>=0?1:-1),c.boxEnd[1]l[3]&&(c.boxEnd[1]=l[3],c.boxEnd[0]=c.boxStart[0]+(l[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(s)/_*(a>=0?1:-1),c.boxEnd[0]l[2]&&(c.boxEnd[0]=l[2],c.boxEnd[1]=c.boxStart[1]+(l[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(a=c.boxStart[0]!==c.boxEnd[0],s=c.boxStart[1]!==c.boxEnd[1],a||s?(a&&(m(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),s&&(m(1,c.boxStart[1],c.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,e?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=i),Math.abs(c.dragStart[0]-n)Math.abs(e))c.rotate(a,0,0,-t*r*Math.PI*d.rotateSpeed/window.innerWidth);else{var o=-d.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,h*(Math.exp(o)-1))}}},!0),d};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset"),l=t("has-passive-events")},{"3d-view":43,"has-passive-events":379,"mouse-change":402,"mouse-event-offset":403,"mouse-wheel":405,"right-now":465}],774:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../components/fx/layout_attributes"),a=t("./scene"),o=t("../get_data").getSubplotData,s=t("../../lib"),l=t("../../constants/xmlns_namespaces");r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=r.attrRegex=s.counterRegex("scene"),r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.baseLayoutAttrOverrides=n({hoverlabel:i.hoverlabel},"plot","nested"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=e._subplots.gl3d,i=0;i1;o(t,e,r,{type:"gl3d",attributes:l,handleDefaults:c,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":558,"../../../lib":684,"../../../registry":817,"../../subplot_defaults":809,"./axis_defaults":777,"./layout_attributes":780}],780:[function(t,e,r){"use strict";var n=t("./axis_attributes"),i=t("../../domain").attributes,a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],dflt:"turntable",editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":684,"../../../lib/extend":673,"../../domain":757,"./axis_attributes":776}],781:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),i=["xaxis","yaxis","zaxis"];function a(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}a.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[i[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new a;return e.merge(t),e}},{"../../../lib/str2rgbarray":707}],782:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,l=t.fullSceneLayout,c=[[],[],[]],u=0;u<3;++u){var h=l[o[u]];if(h._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(h._length)===1/0)c[u]=[];else{h._input_range=h.range.slice(),h.range[0]=r[u].lo/t.dataScale[u],h.range[1]=r[u].hi/t.dataScale[u],h._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),h.range[0]===h.range[1]&&(h.range[0]-=1,h.range[1]+=1);var f=h.tickmode;if("auto"===h.tickmode){h.tickmode="linear";var p=h.nticks||i.constrain(h._length/40,4,9);n.autoTicks(h,Math.abs(h.range[1]-h.range[0])/p)}for(var d=n.calcTicks(h),g=0;g")}else m=c.textLabel;t.fullSceneLayout.hovermode&&h.loneHover({x:(.5+.5*d[0]/d[3])*i,y:(.5-.5*d[1]/d[3])*a,xLabel:w,yLabel:k,zLabel:M,text:m,name:l.name,color:h.castHoverOption(e,v,"bgcolor")||l.color,borderColor:h.castHoverOption(e,v,"bordercolor"),fontFamily:h.castHoverOption(e,v,"font.family"),fontSize:h.castHoverOption(e,v,"font.size"),fontColor:h.castHoverOption(e,v,"font.color")},{container:r,gd:t.graphDiv});var T={x:c.traceCoordinate[0],y:c.traceCoordinate[1],z:c.traceCoordinate[2],data:e._input,fullData:e,curveNumber:e.index,pointNumber:v};e._module.eventData&&(T=e._module.eventData(T,c,e,{},v)),h.appendArrayPointValue(T,e,v);var S={points:[T]};c.buttons&&c.distance<5?t.graphDiv.emit("plotly_click",S):t.graphDiv.emit("plotly_hover",S),o=S}else h.loneUnhover(r),t.graphDiv.emit("plotly_unhover",o);t.drawAnnotations(t)}.bind(null,t),t.traces={},!0}function b(t,e){var r=document.createElement("div"),n=t.container;this.graphDiv=t.graphDiv;var i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.style.position="absolute",i.style.top=i.style.left="0px",i.style.width=i.style.height="100%",i.style["z-index"]=20,i.style["pointer-events"]="none",r.appendChild(i),this.svgContainer=i,r.id=t.id,r.style.position="absolute",r.style.top=r.style.left="0px",r.style.width=r.style.height="100%",n.appendChild(r),this.fullLayout=e,this.id=t.id||"scene",this.fullSceneLayout=e[this.id],this.plotArgs=[[],{},{}],this.axesOptions=m(e[this.id]),this.spikeOptions=v(e[this.id]),this.container=r,this.staticMode=!!t.staticPlot,this.pixelRatio=t.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=l.getComponentMethod("annotations3d","convert"),this.drawAnnotations=l.getComponentMethod("annotations3d","draw"),x(this)}var _=b.prototype;_.recoverContext=function(){var t=this,e=this.glplot.gl,r=this.glplot.canvas;this.glplot.dispose(),requestAnimationFrame(function n(){e.isContextLost()?requestAnimationFrame(n):x(t,t.fullLayout,r,e)?t.plot.apply(t,t.plotArgs):c.error("Catastrophic and unrecoverable WebGL error. Context lost.")})};var w=["xaxis","yaxis","zaxis"];function k(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=w[i],o=a.charAt(0),s=n[a],l=e[o],u=e[o+"calendar"],h=e["_"+o+"length"];if(c.isArrayOrTypedArray(l))for(var f,p=0;p<(h||l.length);p++)if(c.isArrayOrTypedArray(l[p]))for(var d=0;dh[1][o]?p[o]=1:h[1][o]===h[0][o]?p[o]=1:p[o]=1/(h[1][o]-h[0][o]);for(this.dataScale=p,this.convertAnnotations(this),a=0;ag[1][a])g[0][a]=-1,g[1][a]=1;else{var E=g[1][a]-g[0][a];g[0][a]-=E/32,g[1][a]+=E/32}}else{var C=s.range;g[0][a]=s.r2l(C[0]),g[1][a]=s.r2l(C[1])}g[0][a]===g[1][a]&&(g[0][a]-=1,g[1][a]+=1),m[a]=g[1][a]-g[0][a],this.glplot.bounds[0][a]=g[0][a]*p[a],this.glplot.bounds[1][a]=g[1][a]*p[a]}var L=[1,1,1];for(a=0;a<3;++a){var z=v[l=(s=c[w[a]]).type];L[a]=Math.pow(z.acc,1/z.count)/p[a]}var P;if("auto"===c.aspectmode)P=Math.max.apply(null,L)/Math.min.apply(null,L)<=4?L:[1,1,1];else if("cube"===c.aspectmode)P=[1,1,1];else if("data"===c.aspectmode)P=L;else{if("manual"!==c.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var I=c.aspectratio;P=[I.x,I.y,I.z]}c.aspectratio.x=u.aspectratio.x=P[0],c.aspectratio.y=u.aspectratio.y=P[1],c.aspectratio.z=u.aspectratio.z=P[2],this.glplot.aspect=P;var O=c.domain||null,D=e._size||null;if(O&&D){var R=this.container.style;R.position="absolute",R.left=D.l+O.x[0]*D.w+"px",R.top=D.t+(1-O.y[1])*D.h+"px",R.width=D.w*(O.x[1]-O.x[0])+"px",R.height=D.h*(O.y[1]-O.y[0])+"px"}this.glplot.redraw()}},_.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},_.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),M(this.glplot.camera)},_.setCamera=function(t){var e;this.glplot.camera.lookAt.apply(this,[[(e=t).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]])},_.saveCamera=function(t){var e=this.getCamera(),r=c.nestedProperty(t,this.id+".camera"),n=r.get(),i=!1;function a(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}if(void 0===n)i=!0;else for(var o=0;o<3;o++)for(var s=0;s<3;s++)if(!a(e,n,o,s)){i=!0;break}return i&&r.set(e),i},_.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},_.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,i=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var a=new Uint8Array(r*i*4);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a);for(var o=0,s=i-1;o0)}function l(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);n.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset}),n.extendFlat(r,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}o.update=function(t){this.visible?this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=s(t)},o.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},o.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},o.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,s(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};"geojson"===r?e="data":"vector"===r&&(e="string"==typeof n?"url":"tiles");return i[e]=n,i}(t);e.addSource(this.idSource,r)}},o.updateLayer=function(t){var e=this.map,r=l(t);this.removeLayer(),this.layerType=t.type,s(t)&&e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type,layout:r.layout,paint:r.paint},t.below)},o.updateStyle=function(t){if(s(t)){var e=l(t);this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint)}},o.removeLayer=function(){var t=this.map;t.getLayer(this.idLayer)&&t.removeLayer(this.idLayer)},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var n=new a(t,e);return n.update(r),n}},{"../../lib":684,"./convert_text_opts":788}],791:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../domain").attributes,o=t("../font_attributes"),s=t("../../traces/scatter/attributes").textposition,l=t("../../plot_api/edit_types").overrideAll,c=t("../../plot_api/plot_template").templatedArray,u=o({});u.family.dflt="Open Sans Regular, Arial Unicode MS Regular",e.exports=l({_arrayAttrRegexps:[n.counterRegex("mapbox",".layers",!0)],domain:a({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:c("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:u,textposition:n.extendFlat({},s,{arrayOk:!1})}})},"plot","from-root")},{"../../components/color":558,"../../lib":684,"../../plot_api/edit_types":715,"../../plot_api/plot_template":722,"../../traces/scatter/attributes":1015,"../domain":757,"../font_attributes":758}],792:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../subplot_defaults"),a=t("../array_container_defaults"),o=t("./layout_attributes");function s(t,e,r,n){r("accesstoken",n.accessToken),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),a(t,e,{name:"layers",handleItemDefaults:l}),e._input=t}function l(t,e){function r(r,i){return n.coerce(t,e,o.layers,r,i)}if(r("visible")){var i=r("sourcetype");r("source"),"vector"===i&&r("sourcelayer");var a=r("type");r("below"),r("color"),r("opacity"),"circle"===a&&r("circle.radius"),"line"===a&&r("line.width"),"fill"===a&&r("fill.outlinecolor"),"symbol"===a&&(r("symbol.icon"),r("symbol.iconsize"),r("symbol.text"),n.coerceFont(r,"symbol.textfont"),r("symbol.textposition"))}}e.exports=function(t,e,r){i(t,e,r,{type:"mapbox",attributes:o,handleDefaults:s,partition:"y",accessToken:e._mapboxAccessToken})}},{"../../lib":684,"../array_container_defaults":728,"../subplot_defaults":809,"./layout_attributes":791}],793:[function(t,e,r){"use strict";var n=t("mapbox-gl"),i=t("../../components/fx"),a=t("../../lib"),o=t("../../components/dragelement"),s=t("../cartesian/select").prepSelect,l=t("./constants"),c=t("./layout_attributes"),u=t("./layers");function h(t){this.id=t.id,this.gd=t.gd,this.container=t.container,this.isStatic=t.staticPlot;var e=t.fullLayout;this.uid=e._uid+"-"+this.id,this.opts=e[this.id],this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(e),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[]}var f=h.prototype;function p(t){var e=c.style.values,r=c.style.dflt,n={};return a.isPlainObject(t)?(n.id=t.id,n.style=t):"string"==typeof t?(n.id=t,n.style=-1!==e.indexOf(t)?d(t):t):(n.id=r,n.style=d(r)),n.transition={duration:0,delay:0},n}function d(t){return l.styleUrlPrefix+t+"-"+l.styleUrlSuffix}function g(t){return[t.lon,t.lat]}e.exports=function(t){return new h(t)},f.plot=function(t,e,r){var n,i=this,a=i.opts=e[this.id];i.map&&a.accesstoken!==i.accessToken&&(i.map.remove(),i.map=null,i.styleObj=null,i.traceHash=[],i.layerList={}),n=i.map?new Promise(function(r,n){i.updateMap(t,e,r,n)}):new Promise(function(r,n){i.createMap(t,e,r,n)}),r.push(n)},f.createMap=function(t,e,r,a){var o=this,s=o.gd,c=o.opts,u=o.styleObj=p(c.style);o.accessToken=c.accesstoken;var h=o.map=new n.Map({container:o.div,style:u.style,center:g(c.center),zoom:c.zoom,bearing:c.bearing,pitch:c.pitch,interactive:!o.isStatic,preserveDrawingBuffer:o.isStatic,doubleClickZoom:!1,boxZoom:!1}),f=l.controlContainerClassName,d=o.div.getElementsByClassName(f)[0];if(o.div.removeChild(d),h._canvas.style.left="0px",h._canvas.style.top="0px",o.rejectOnError(a),h.once("load",function(){o.updateData(t),o.updateLayout(e),o.resolveOnRender(r)}),!o.isStatic){var m=!1;h.on("moveend",function(t){if(o.map){var e=o.getView();c._input.center=c.center=e.center,c._input.zoom=c.zoom=e.zoom,c._input.bearing=c.bearing=e.bearing,c._input.pitch=c.pitch=e.pitch,(t.originalEvent||m)&&y(e),m=!1}}),h.on("wheel",function(){m=!0}),h.on("mousemove",function(t){var e=o.div.getBoundingClientRect();t.clientX=t.point.x+e.left,t.clientY=t.point.y+e.top,t.target.getBoundingClientRect=function(){return e},o.xaxis.p2c=function(){return t.lngLat.lng},o.yaxis.p2c=function(){return t.lngLat.lat},i.hover(s,t,o.id)}),h.on("click",function(t){i.click(s,t.originalEvent)}),h.on("dragstart",v),h.on("zoomstart",v),h.on("dblclick",function(){s.emit("plotly_doubleclick",null);var t=o.viewInitial;h.setCenter(g(t.center)),h.setZoom(t.zoom),h.setBearing(t.bearing),h.setPitch(t.pitch);var e=o.getView();c._input.center=c.center=e.center,c._input.zoom=c.zoom=e.zoom,c._input.bearing=c.bearing=e.bearing,c._input.pitch=c.pitch=e.pitch,y(e)}),o.clearSelect=function(){s._fullLayout._zoomlayer.selectAll(".select-outline").remove()}}function v(){i.loneUnhover(e._toppaper)}function y(t){var e=o.id,r={};for(var n in t)r[e+"."+n]=t[n];s.emit("plotly_relayout",r)}},f.updateMap=function(t,e,r,n){var i=this,a=i.map;i.rejectOnError(n);var o=p(i.opts.style);i.styleObj.id!==o.id?(i.styleObj=o,a.setStyle(o.style),a.once("styledata",function(){i.traceHash={},i.updateData(t),i.updateLayout(e),i.resolveOnRender(r)})):(i.updateData(t),i.updateLayout(e),i.resolveOnRender(r))},f.updateData=function(t){var e,r,n,i,a=this.traceHash;for(n=0;n=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",function(){v.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&u.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL,r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1};var b,_=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];function k(t,e){var r=t._context.locale,n=!1,i={};function o(t){for(var r=!0,a=0;a1&&O.length>1){for(a.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&O.length>15&&0===s.shapes.length&&0===s.images.length,s._hasCartesian=s._has("cartesian"),s._hasGeo=s._has("geo"),s._hasGL3D=s._has("gl3d"),s._hasGL2D=s._has("gl2d"),s._hasTernary=s._has("ternary"),s._hasPie=s._has("pie"),v.linkSubplots(p,s,u,i),v.cleanPlot(p,s,u,i,y),g(s,i),v.doAutoMargin(t);var F=h.list(t);for(o=0;o0){var u=function(t){var e,r={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(r.left+=t[e].left||0,r.right+=t[e].right||0,r.bottom+=t[e].bottom||0,r.top+=t[e].top||0);return r}(t._boundingBoxMargins),h=u.left+u.right,f=u.bottom+u.top,p=1-2*s,d=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(p*(d.width-h)),a=Math.round(p*(d.height-f))}else{var g=c?window.getComputedStyle(t):{};n=parseFloat(g.width)||r.width,a=parseFloat(g.height)||r.height}var m=v.layoutAttributes.width.min,y=v.layoutAttributes.height.min;n1,b=!e.height&&Math.abs(r.height-a)>1;(b||x)&&(x&&(r.width=n),b&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),v.sanitizeMargins(r)},v.supplyLayoutModuleDefaults=function(t,e,r,n){var i,o,s,c=a.componentsRegistry,u=e._basePlotModules,h=a.subplotsRegistry.cartesian;for(i in c)(s=c[i]).includeBasePlot&&s.includeBasePlot(t,e);for(var f in u.length||u.push(h),e._has("cartesian")&&(a.getComponentMethod("grid","contentDefaults")(t,e),h.finalizeSubplots(t,e)),e._subplots)e._subplots[f].sort(l.subplotSort);for(o=0;o.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0);var l=void 0!==r.xl?r.xl:r.x,c=void 0!==r.xr?r.xr:r.x,u=void 0!==r.yt?r.yt:r.y,h=void 0!==r.yb?r.yb:r.y;i[e]={l:{val:l,size:r.l+o},r:{val:c,size:r.r+o},b:{val:h,size:r.b+o},t:{val:u,size:r.t+o}},a[e]=1}else delete i[e],delete a[e];n._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),A(e);var r=e._size,n=JSON.stringify(r),o=Math.max(e.margin.l||0,0),s=Math.max(e.margin.r||0,0),l=Math.max(e.margin.t||0,0),c=Math.max(e.margin.b||0,0),u=e._pushmargin,h=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var f in u)h[f]||delete u[f];for(var p in u.base={l:{val:0,size:o},r:{val:1,size:s},t:{val:1,size:l},b:{val:0,size:c}},u){var d=u[p].l||{},g=u[p].b||{},m=d.val,v=d.size,y=g.val,x=g.size;for(var b in u){if(i(v)&&u[b].r){var _=u[b].r.val,w=u[b].r.size;if(_>m){var k=(v*_+(w-e.width)*m)/(_-m),M=(w*(1-m)+(v-e.width)*(1-_))/(_-m);k>=0&&M>=0&&k+M>o+s&&(o=k,s=M)}}if(i(x)&&u[b].t){var T=u[b].t.val,S=u[b].t.size;if(T>y){var E=(x*T+(S-e.height)*y)/(T-y),C=(S*(1-y)+(x-e.height)*(1-T))/(T-y);E>=0&&C>=0&&E+C>c+l&&(c=E,l=C)}}}}}if(r.l=Math.round(o),r.r=Math.round(s),r.t=Math.round(l),r.b=Math.round(c),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1,a.call("plot",t)},v.graphJson=function(t,e,r,n,i){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var a=i?t._fullData:t.data,o=i?t._fullLayout:t.layout,s=(t._transitionData||{})._frames;function c(t){if("function"==typeof t)return null;if(l.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!l.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=c(t[e])}return i}return Array.isArray(t)?t.map(c):l.isJSDate(t)?l.ms2DateTimeLocal(+t):t}var u={data:(a||[]).map(function(t){var r=c(t);return e&&delete r.fit,r})};return e||(u.layout=c(o)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),s&&(u.frames=c(s)),"object"===n?u:JSON.stringify(u)},v.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){p=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return a.call("redraw",t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var n,s,c=0,u=0;function h(){return c++,function(){var r;u++,p||u!==c||(r=e,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(i.redraw)return a.call("redraw",t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(r)))}}var d=t._fullLayout._basePlotModules,g=!1;if(r)for(s=0;s=0;s--)if(o[s].enabled){r._indexToPoints=o[s]._indexToPoints;break}n&&n.calc&&(a=n.calc(t,r))}Array.isArray(a)&&a[0]||(a=[{x:u,y:u}]),a[0].t||(a[0].t={}),a[0].trace=r,p[e]=a}}for(m&&T(l),i=0;i=0?f.angularAxis.domain:n.extent(k),E=Math.abs(k[1]-k[0]);A&&!M&&(E=0);var C=S.slice();T&&M&&(C[1]+=E);var L=f.angularAxis.ticksCount||4;L>8&&(L=L/(L/8)+L%8),f.angularAxis.ticksStep&&(L=(C[1]-C[0])/L);var z=f.angularAxis.ticksStep||(C[1]-C[0])/(L*(f.minorTicks+1));w&&(z=Math.max(Math.round(z),1)),C[2]||(C[2]=z);var P=n.range.apply(this,C);if(P=P.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=s.domain(),u.layout.angularAxis.endPadding=T?E:0,void 0===(t=n.select(this).select("svg.chart-root"))||t.empty()){var I=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),O=this.appendChild(this.ownerDocument.importNode(I.documentElement,!0));t=n.select(O)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var D,R=t.select(".chart-group"),B={fill:"none",stroke:f.tickColor},F={"font-size":f.font.size,"font-family":f.font.family,fill:f.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+f.font.outlineColor}).join(",")};if(f.showLegend){D=t.select(".legend-group").attr({transform:"translate("+[x,f.margin.top]+")"}).style({display:"block"});var N=p.map(function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},o.Legend.defaultConfig().legendConfig,{container:D,elements:N,reverseOrder:f.legend.reverseOrder})})();var j=D.node().getBBox();x=Math.min(f.width-j.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,x=Math.max(10,x),_=[f.margin.left+x,f.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),D.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else D=t.select(".legend-group").style({display:"none"});t.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),R.attr("transform","translate("+_+")").style({cursor:"crosshair"});var V=[(f.width-(f.margin.left+f.margin.right+2*x+(j?j.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*x))/2];if(V[0]=Math.max(0,V[0]),V[1]=Math.max(0,V[1]),t.select(".outer-group").attr("transform","translate("+V+")"),f.title){var U=t.select("g.title-group text").style(F).text(f.title),q=U.node().getBBox();U.attr({x:_[0]-q.width/2,y:_[1]-x-20})}var H=t.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var G=H.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(B),G.attr("r",r),G.exit().remove()}H.select("circle.outside-circle").attr({r:x}).style(B);var W=t.select("circle.background-circle").attr({r:x}).style({fill:f.backgroundColor,stroke:f.stroke});function Y(t,e){return s(t)%360+f.orientation}if(f.radialAxis.visible){var X=n.svg.axis().scale(r).ticks(5).tickSize(5);H.call(X).attr({transform:"rotate("+f.radialAxis.orientation+")"}),H.selectAll(".domain").style(B),H.selectAll("g>text").text(function(t,e){return this.textContent+f.radialAxis.ticksSuffix}).style(F).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===f.radialAxis.tickOrientation?"rotate("+-f.radialAxis.orientation+") translate("+[0,F["font-size"]]+")":"translate("+[0,F["font-size"]]+")"}}),H.selectAll("g>line").style({stroke:"black"})}var Z=t.select(".angular.axis-group").selectAll("g.angular-tick").data(P),$=Z.enter().append("g").classed("angular-tick",!0);Z.attr({transform:function(t,e){return"rotate("+Y(t)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),Z.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(f.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(f.minorTicks+1)==0)}).style(B),$.selectAll(".minor").style({stroke:f.minorTickColor}),Z.select("line.grid-line").attr({x1:f.tickLength?x-f.tickLength:0,x2:x}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(F);var J=Z.select("text.axis-text").attr({x:x+f.labelOffset,dy:a+"em",transform:function(t,e){var r=Y(t),n=x+f.labelOffset,i=f.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:f.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(f.minorTicks+1)!=0?"":w?w[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix}).style(F);f.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)});var K=n.max(R.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));D.attr({transform:"translate("+[x+K,f.margin.top]+")"});var Q=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(p);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),p[0]||Q){var et=[];p.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=tt.filter(function(t,r){return r==e}),n.geometry=t.geometry,n.orientation=f.orientation,n.direction=f.direction,n.index=e,et.push({data:t,geometryConfig:n})});var rt=n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(et),nt=[];rt.forEach(function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map(function(t,e){return[t]})):nt.push(t.values)}),nt.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return i(o[r].defaultConfig(),t)});o[r]().config(n)()})}var it,at,ot=t.select(".guides-group"),st=t.select(".tooltips-group"),lt=o.tooltipPanel().config({container:st,fontSize:8})(),ct=o.tooltipPanel().config({container:st,fontSize:8})(),ut=o.tooltipPanel().config({container:st,hasTick:!0})();if(!M){var ht=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(W).angle;ht.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-f.orientation)%360;it=s.invert(n);var i=o.util.convertToCartesian(x+12,r+180);lt.text(o.util.round(it)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){ot.select("line").style({opacity:0})})}var ft=ot.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",function(t,e){var n=o.util.getMousePos(W).radius;ft.attr({r:n}).style({opacity:.5}),at=r.invert(o.util.getMousePos(W).radius);var i=o.util.convertToCartesian(n,f.radialAxis.orientation);ct.text(o.util.round(at)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){ft.style({opacity:0}),ut.hide(),lt.hide(),ct.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,r){var i=n.select(this),a=this.style.fill,s="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var c={t:o.util.round(e[0]),r:o.util.round(e[1])};M&&(c.t=w[e[0]]);var u="t: "+c.t+", r: "+c.r,h=this.getBoundingClientRect(),f=t.node().getBoundingClientRect(),p=[h.left+h.width/2-V[0]-f.left,h.top+h.height/2-V[1]-f.top];ut.config({color:s}).text(u),ut.move(p)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ut.show()}).on("mouseout.tooltip",function(t,e){ut.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})})}(c),this},f.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),i(l.data[e],o.Axis.defaultConfig().data[0]),i(l.data[e],t)}),i(l.layout,o.Axis.defaultConfig().layout),i(l.layout,e.layout),this},f.getLiveConfig=function(){return u},f.getinputConfig=function(){return c},f.radialScale=function(t){return r},f.angularScale=function(t){return s},f.svg=function(){return t},n.rebind(f,h,"on"),f},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},o.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:u(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return d.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return d.stroke(r,i,a)},"stroke-width":function(t,e){return d["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return d["stroke-dasharray"](r,i,a)},opacity:function(t,e){return d.opacity(r,i,a)},display:function(t,e){return d.display(r,i,a)}})}};var h=e.angularScale.range(),f=Math.abs(h[1]-h[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle(function(t){return-f/2}).endAngle(function(t){return f/2}).innerRadius(function(t){return e.radialScale(l+(t[2]||0))}).outerRadius(function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])});c.arc=function(t,r,i){n.select(this).attr({class:"mark arc",d:p,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var d={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,i){return r[t[i].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return void 0===t[n].data.visible||t[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var m=g.selectAll("path.mark").data(function(t,e){return t});m.enter().append("path").attr({class:"mark"}),m.style(d).each(c[e.geometryType]),m.exit().remove(),g.exit().remove()})}return a.config=function(e){return arguments.length?(e.forEach(function(e,r){t[r]||(t[r]={}),i(t[r],o.PolyChart.defaultConfig()),i(t[r],e)}),this):t},a.getColorScale=function(){},n.rebind(a,e,"on"),a},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,a=t.data.map(function(t,r){return[].concat(t).map(function(t,n){var a=i({},e.elements[r]);return a.name=t,a.color=[].concat(e.elements[r].color)[n],a})}),o=n.merge(a);o=o.filter(function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||void 0===e.elements[r].visibleInLegend)}),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),c=e.fontSize,u=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,h=u?e.height:c*o.length,f=s.classed("legend-group",!0).selectAll("svg").data([0]),p=f.enter().append("svg").attr({width:300,height:h+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var d=n.range(o.length),g=n.scale[u?"linear":"ordinal"]().domain(d).range(l),m=n.scale[u?"linear":"ordinal"]().domain(d)[u?"range":"rangePoints"]([0,h]);if(u){var v=f.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);v.enter().append("stop"),v.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),f.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var y=f.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[c/2,m(e)+c/2]+")"},d:function(t,e){var r,i,a,o=t.symbol;return a=3*(i=c),"line"===(r=o)?"M"+[[-i/2,-i/12],[i/2,-i/12],[i/2,i/12],[-i/2,i/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(a)():n.svg.symbol().type("square").size(a)()},fill:function(t,e){return g(e)}}),y.exit().remove()}var x=n.svg.axis().scale(m).orient("right"),b=f.select("g.legend-axis").attr({transform:"translate("+[u?e.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?e.textColor:"none"}),b.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text(function(t,e){return o[e].name}),r}return r.config=function(e){return arguments.length?(i(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,c=function(){var n=(t=a.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:a.padding+l,dy:.3*+a.fontSize}),c};return c.text=function(i){var o=n.hsl(a.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",h=i||"";e.style({fill:u,"font-size":a.fontSize+"px"}).text(h);var f=a.padding,p=e.node().getBBox(),d={fill:a.color,stroke:s,"stroke-width":"2px"},g=p.width+2*f+l,m=p.height+2*f;return r.attr({d:"M"+[[l,-m/2],[l,-m/4],[a.hasTick?0:l,0],[l,m/4],[l,m/2],[g,m/2],[g,-m/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[l,-m/2+2*f]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return i(a,t),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=i({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var s=i({},t.layout);if([[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?(void 0!==s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&void 0!==s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&void 0!==s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&void 0!==s.margin.t){var l=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(s.margin).forEach(function(t,e){u[c[l.indexOf(t.key)]]=t.value}),s.margin=u}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r}};return t}},{"../../../constants/alignment":656,"../../../lib":684,d3:147}],805:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../../lib"),a=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,c=e.exports={};c.framework=function(t){var e,r,i,a,u,h=new s;function f(r,s){return s&&(u=s),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,i||(i=o.Axis()),a=o.adapter.plotly().convert(e),i.config(a).render(u),t.data=e.data,t.layout=e.layout,c.fillLayout(t),e}return f.isPolar=!0,f.svg=function(){return i.svg()},f.getConfig=function(){return e},f.getLiveConfig=function(){return o.adapter.plotly().convert(i.getLiveConfig(),!0)},f.getLiveScales=function(){return{t:i.angularScale(),r:i.radialScale()}},f.setUndoPoint=function(){var t,n,i=this,a=o.util.cloneJson(e);t=a,n=r,h.add({undo:function(){n&&i(n)},redo:function(){i(t)}}),r=o.util.cloneJson(a)},f.undo=function(){h.undo()},f.redo=function(){h.redo()},f},c.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../../components/color":558,"../../../lib":684,"./micropolar":804,"./undo_manager":806,d3:147}],806:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function i(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n?this:(e.splice(r+1,e.length-r),e.push(t),r=e.length-1,this)},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(i(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(i(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return rn&&(n+=360);var i=M(k(t)),a=i+360;return i>=r&&i<=n||a>=r&&a<=n}function I(t,e){return e[D(e,function(e){return Math.abs(O(t,e))})]}function O(t,e){var r=e-t;return Math.atan2(Math.sin(r),Math.cos(r))}function D(t,e){e=e||o.identity;for(var r,n=1/0,i=0;i1e-10?t:0}function Y(t){return Math.abs(t)<1e-10?0:t>0?1:-1}function X(t){return Y(Math.cos(t))}function Z(t){return Y(Math.sin(t))}e.exports=function(t,e){return new E(t,e)},C.plot=function(t,e){var r=e[this.id];this._hasClipOnAxisFalse=!1;for(var n=0;n=90||s>90&&l>=450?1:u<=0&&f<=0?0:Math.max(u,f);e=s<=180&&l>=180||s>180&&l>=540?-1:c>=0&&h>=0?0:Math.min(c,h);r=s<=270&&l>=270||s>270&&l>=630?-1:u>=0&&f>=0?0:Math.min(u,f);n=l>=360?1:c<=0&&h<=0?0:Math.max(c,h);return[e,r,n,i]}(y),b=x[2]-x[0],_=x[3]-x[1],k=v/m,A=Math.abs(_/b);k>A?(h=m,g=(v-(f=m*A))/i.h/2,p=[a[0],a[1]],d=[c[0]+g,c[1]-g]):(f=v,g=(m-(h=v/A))/i.w/2,p=[a[0]+g,a[1]-g],d=[c[0],c[1]]),r.xLength2=h,r.yLength2=f,r.xDomain2=p,r.yDomain2=d;var T=r.xOffset2=i.l+i.w*p[0],S=r.yOffset2=i.t+i.h*(1-d[1]),E=r.radius=h/b,C=r.cx=T-E*x[0],L=r.cy=S+E*x[3],z=r.cxx=C-T,P=r.cyy=L-S,I={anchor:"free",position:0,_counteraxis:!0,automargin:!1};r.radialAxis=o.extendFlat({},e.radialaxis,I,{_axislayer:n["radial-axis"],_gridlayer:n["radial-grid"],_id:"x",_pos:0,side:{counterclockwise:"top",clockwise:"bottom"}[e.radialaxis.side],domain:[0,E/i.w]}),r.angularAxis=o.extendFlat({},e.angularaxis,I,{_axislayer:n["angular-axis"],_gridlayer:n["angular-grid"],_id:"angular",_pos:0,side:"right",domain:[0,Math.PI],autorange:!1}),r.doAutoRange(t,e),r.updateAngularAxis(t,e),r.updateRadialAxis(t,e),r.updateRadialAxisTitle(t,e);var O=r.radialAxis.range,D=O[1]-O[0],R=r.xaxis={type:"linear",_id:"x",range:[x[0]*D,x[2]*D],domain:p};u.setConvert(R,t),R.setScale();var B=r.yaxis={type:"linear",_id:"y",range:[x[1]*D,x[3]*D],domain:d};u.setConvert(B,t),B.setScale(),R.isPtWithinRange=function(t){return r.isPtWithinSector(t)},B.isPtWithinRange=function(){return!0},r.clipPaths.forTraces.select("path").attr("d",V(E,y,r.vangles)).attr("transform",H(z,P)),n.frontplot.attr("transform",H(T,S)).call(l.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.forTraces),n.bg.attr("d",V(E,y,r.vangles)).attr("transform",H(C,L)).call(s.fill,e.bgcolor),r.framework.selectAll(".crisp").classed("crisp",0)},C.doAutoRange=function(t,e){var r=e.radialaxis,n=this.radialAxis;L(n,r,t),h(n),r.range=n.range.slice(),r._input.range=n.range.slice()},C.updateRadialAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,o=r.cx,l=r.cy,c=e.radialaxis,h=e.sector,f=M(h[0]),p=r.radialAxis;r.fillViewInitialKey("radialaxis.angle",c.angle),r.fillViewInitialKey("radialaxis.range",p.range.slice()),"auto"===p.tickangle&&f>90&&f<=270&&(p.tickangle=180),p._transfn=function(t){return"translate("+p.l2p(t.x)+",0)"},p._gridpath=function(t){return j(p.r2p(t.x),h,r.vangles)};var d=z(c);r.radialTickLayout!==d&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=d),u.doTicksSingle(n,p,!0);var g=r.radialAxisAngle=r.vangles?k(I(w(c.angle),r.vangles)):c.angle,m=H(o,l)+G(-g);q(i["radial-axis"],c.showticklabels||c.ticks,{transform:m}),q(i["radial-grid"],c.showgrid,{transform:H(o,l)}).selectAll("path").attr("transform",null),q(i["radial-line"].select("line"),c.showline,{x1:0,y1:0,x2:a,y2:0,transform:m}).attr("stroke-width",c.linewidth).call(s.stroke,c.linecolor)},C.updateRadialAxisTitle=function(t,e,r){var n=this.gd,i=this.radius,a=this.cx,o=this.cy,s=e.radialaxis,c=this.id+"title",u=void 0!==r?r:this.radialAxisAngle,h=w(u),f=Math.cos(h),p=Math.sin(h),d=0;if(s.title){var m=l.bBox(this.layers["radial-axis"].node()).height,v=s.titlefont.size;d="counterclockwise"===s.side?-m-.4*v:m+.8*v}this.layers["radial-axis-title"]=g.draw(n,c,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:_(n,"Click to enter radial axis title"),attributes:{x:a+i/2*f+d*p,y:o-i/2*p+d*f,"text-anchor":"middle"},transform:{rotate:-u}})},C.updateAngularAxis=function(t,e){var r=this.gd,i=this.layers,a=this.radius,o=this.cx,l=this.cy,c=e.angularaxis,h=e.sector,f=h.map(w),p=this.angularAxis;function d(t){return p.c2rad(t.x,"degrees")}function g(t){return[a*Math.cos(t),a*Math.sin(t)]}if(this.fillViewInitialKey("angularaxis.rotation",c.rotation),"linear"===p.type)U(h)?p.range=h.slice():p.range=f.map(p.unTransformRad).map(k),"radians"===p.thetaunit&&(p.tick0=k(p.tick0),p.dtick=k(p.dtick));else if("category"===p.type){var m=c.period?Math.max(c.period,c._categories.length):c._categories.length;p.range=[0,m],p._tickFilter=function(t){return P(d(t),h)}}L(p,c,t),p._transfn=function(t){var e=d(t),r=g(e),i=H(o+r[0],l-r[1]),a=n.select(this);return a&&a.node()&&a.classed("ticks")&&(i+=G(-k(e))),i},p._gridpath=function(t){var e=g(d(t));return"M0,0L"+-e[0]+","+e[1]};var v="outside"!==c.ticks?.7:.5;p._labelx=function(t){var e=d(t),r=p._labelStandoff,n=p._pad;return(0===Z(e)?0:Math.cos(e)*(r+n+v*t.fontSize))+X(e)*(t.dx+r+n)},p._labely=function(t){var e=d(t),r=p._labelStandoff,n=p._labelShift,i=p._pad;return t.dy+t.fontSize*b-n+-Math.sin(e)*(r+i+v*t.fontSize)},p._labelanchor=function(t,e){var r=d(e);return 0===Z(r)?X(r)>0?"start":"end":"middle"};var y,x=z(c);this.angularTickLayout!==x&&(i["angular-axis"].selectAll(".angulartick").remove(),this.angularTickLayout=x),u.doTicksSingle(r,p,!0),"linear"===e.gridshape?O((y=p._vals.map(d))[0],y[1])<0&&(y=y.slice().reverse()):y=null,this.vangles=y,q(i["angular-line"].select("path"),c.showline,{d:V(a,h,y),transform:H(o,l)}).attr("stroke-width",c.linewidth).call(s.stroke,c.linecolor)},C.updateFx=function(t,e){this.gd._context.staticPlot||(this.updateAngularDrag(t,e),this.updateRadialDrag(t,e),this.updateMainDrag(t,e))},C.updateMainDrag=function(t,e){var r=this,s=r.gd,l=r.layers,c=t._zoomlayer,u=S.MINZOOM,h=S.OFFEDGE,g=r.radius,y=r.cx,x=r.cy,b=r.cxx,_=r.cyy,w=e.sector,k=r.vangles,M=S.cornerHalfWidth,A=S.cornerLen/2,T=p.makeDragger(l,"path","maindrag","crosshair");n.select(T).attr("d",V(g,w,k)).attr("transform",H(y,x));var E,C,L,z,P,I,N,j,U,q={element:T,gd:s,subplot:r.id,plotinfo:{xaxis:r.xaxis,yaxis:r.yaxis},xaxes:[r.xaxis],yaxes:[r.yaxis]};function G(t,e){return Math.sqrt(t*t+e*e)}function Y(t,e){return G(t-b,e-_)}function X(t,e){return Math.atan2(_-e,t-b)}function Z(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function $(t){return V(t,w,k)}function J(t,e){if(0===t)return $(2*M);var r=A/t,n=e-r,i=e+r,a=Math.max(0,Math.min(t,g)),o=a-M,s=a+M;return"M"+Z(o,n)+"A"+[o,o]+" 0,0,0 "+Z(o,i)+"L"+Z(s,i)+"A"+[s,s]+" 0,0,1 "+Z(s,n)+"Z"}function K(t,e,r){if(0===t)return $(2*M);var n,i,a=Z(t,e),o=Z(t,r),s=W((a[0]+o[0])/2),l=W((a[1]+o[1])/2);if(s&&l){var c=l/s,u=-1/c,h=B(M,c,s,l);n=B(A,u,h[0][0],h[0][1]),i=B(A,u,h[1][0],h[1][1])}else{var f,p;l?(f=A,p=M):(f=M,p=A),n=[[s-f,l-p],[s+f,l-p]],i=[[s-f,l+p],[s+f,l+p]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function Q(t,e){return e=Math.min(e,g),tu?(t0?r:1/0}),r=o.mod(e+1,k.length);return[k[e],k[r]]}function nt(t,e,r,n){var i=R(r,n,r,[t-b,_-e]);return G(i[0],i[1])}function it(t,e){var r,n,i=E+t,a=C+e,o=X(E,C),s=X(i,a),l=rt(o),c=rt(s);Q(nt(E,C,l[0],l[1]),Math.min(nt(i,a,c[0],c[1]),g))&&(r=P+$(z)+$(L),n=[K(L,l[0],l[1]),K(z,l[0],l[1])].join(" ")),tt(r,n)}function at(){if(p.removeZoombox(s),null!==L&&null!==z){p.showDoubleClickNotifier(s);var t=r.radialAxis.range,e=t[1]-t[0],n={};n[r.id+".radialaxis.range"]=[t[0]+L*e/g,t[0]+z*e/g],a.call("relayout",s,n)}}q.prepFn=function(t,e,n){var a=s._fullLayout.dragmode,o=T.getBoundingClientRect();if(E=e-o.left,C=n-o.top,k){var l=function(t,e,r){for(var n=1/0,i=1/0,a=F(t,e,r),o=0;o0==f>y[0]){T=d.range[1]=f,u.doTicksSingle(i,r.radialAxis,!0),s["radial-grid"].attr("transform",H(c,h)).selectAll("path").attr("transform",null);var p=T-y[0],g=r.sectorBBox;for(var v in r.xaxis.range=[g[0]*p,g[2]*p],r.yaxis.range=[g[1]*p,g[3]*p],r.xaxis.setScale(),r.yaxis.setScale(),r.traceHash){var b=r.traceHash[v],_=o.filterVisible(b),w=b[0][0].trace._module,k=i._fullLayout[r.id];if(w.plot(i,r,_,k),!a.traceIs(v,"gl"))for(var M=0;M<_.length;M++)w.style(i,_[M])}}}},C.updateAngularDrag=function(t,e){var r,i=this,s=i.gd,c=i.layers,h=i.radius,d=i.cx,g=i.cy,m=i.cxx,x=i.cyy,b=e.sector,_=S.angularDragBoxSize,M=p.makeDragger(c,"path","angulardrag","move"),E={element:M,gd:s};if(i.vangles){var C=N(F(h+_,b,i.vangles)),L=N(F(h,b,i.vangles));r="M"+C.reverse().join("L")+"M"+L.join("L")}else r=function(t,e,r){var n,i,a,o=Math.abs(r[1]-r[0])<=180?0:1;function s(t,e){return[t*Math.cos(e),-t*Math.sin(e)]}function l(t,e,r){return"A"+[t,t]+" "+[0,o,r]+" "+s(t,e)}return U(r)?(n=0,a=2*Math.PI,i=Math.PI,"M"+s(t,n)+l(t,i,0)+l(t,a,0)+"ZM"+s(e,n)+l(e,i,1)+l(e,a,1)+"Z"):(n=w(r[0]),a=w(r[1]),"M"+s(t,n)+"L"+s(e,n)+l(e,a,0)+"L"+s(t,a)+l(t,n,1)+"Z")}(h,h+_,b);function z(t,e){return Math.atan2(x+_-e,t-m-_)}n.select(M).attr("d",r).attr("transform",H(d,g)).call(y,"move");var P,I,O,D,R,B,j,V=c.frontplot.select(".scatterlayer").selectAll(".trace"),q=V.selectAll(".point"),W=V.selectAll(".textpoint");function Y(t,e){var r=i.gd._fullLayout,h=r[i.id],f=z(P+t,I+e),p=k(f-j);if(D=O+p,c.frontplot.attr("transform",H(i.xOffset2,i.yOffset2)+G([-p,m,x])),i.vangles){R=i.radialAxisAngle+p;var v=H(d,g)+G(-p),y=H(d,g)+G(-R);c.bg.attr("transform",v),c["radial-grid"].attr("transform",v),c["angular-line"].select("path").attr("transform",v),c["radial-axis"].attr("transform",y),c["radial-line"].select("line").attr("transform",y),i.updateRadialAxisTitle(r,h,R)}else i.clipPaths.forTraces.select("path").attr("transform",H(m,x)+G(p));q.each(function(){var t=n.select(this),e=l.getTranslate(t);t.attr("transform",H(e.x,e.y)+G([p]))}),W.each(function(){var t=n.select(this),e=t.select("text"),r=l.getTranslate(t);t.attr("transform",G([p,e.attr("x"),e.attr("y")])+H(r.x,r.y))});var _=i.angularAxis;for(var M in _.rotation=A(D),"linear"!==_.type||U(b)||(_.range=B.map(w).map(_.unTransformRad).map(k)),T(_),u.doTicksSingle(s,_,!0),i._hasClipOnAxisFalse&&!U(b)&&(i.sector=[B[0]-p,B[1]-p],V.call(l.hideOutsideRangePoints,i)),i.traceHash)if(a.traceIs(M,"gl")){var S=i.traceHash[M],E=o.filterVisible(S);S[0][0].trace._module.plot(s,i,E,h)}}function X(){W.select("text").attr("transform",null);var t={};t[i.id+".angularaxis.rotation"]=D,i.vangles&&(t[i.id+".radialaxis.angle"]=R),a.call("relayout",s,t)}E.prepFn=function(e,r,n){var a=t[i.id];B=a.sector.slice(),O=a.angularaxis.rotation;var o=M.getBoundingClientRect();P=r-o.left,I=n-o.top,j=z(P,I),E.moveFn=Y,E.doneFn=X,v(t._zoomlayer)},i.vangles&&!U(b)&&(E.prepFn=o.noop,y(n.select(M),null)),f.init(E)},C.isPtWithinSector=function(t){var e=this.sector;if(!P(t.rad,e))return!1;var r,n,i=this.vangles,a=this.radialAxis,o=a.range,s=a.c2r(t.r);if(o[1]>=o[0]?(r=o[0],n=o[1]):(r=o[1],n=o[0]),i){var l=x(F(r,e,i)),c=x(F(n,e,i)),u=[s*Math.cos(t.rad),s*Math.sin(t.rad)];return c.contains(u)&&!l.contains(u)}return s>=r&&s<=n},C.fillViewInitialKey=function(t,e){t in this.viewInitial||(this.viewInitial[t]=e)}},{"../../components/color":558,"../../components/dragelement":580,"../../components/drawing":583,"../../components/fx":600,"../../components/titles":649,"../../constants/alignment":656,"../../lib":684,"../../lib/polygon":696,"../../lib/setcursor":704,"../../registry":817,"../cartesian/autorange":731,"../cartesian/axes":732,"../cartesian/dragbox":740,"../cartesian/select":749,"../plots":795,"./constants":796,"./helpers":797,d3:147,tinycolor2:499}],808:[function(t,e,r){"use strict";function n(t,e){return"splom"===t?-1:"splom"===e?1:0}e.exports={sortBasePlotModules:function(t,e){return n(t.name,e.name)},sortModules:n}},{}],809:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plot_api/plot_template"),a=t("./domain").defaults;e.exports=function(t,e,r,o){var s,l,c=o.type,u=o.attributes,h=o.handleDefaults,f=o.partition||"x",p=e._subplots[c],d=p.length,g=d&&p[0].replace(/\d+$/,"");function m(t,e){return n.coerce(s,l,u,t,e)}for(var v=0;v=f&&(d.min=0,g.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:o,handleDefaults:c,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":558,"../../../plot_api/plot_template":722,"../../subplot_defaults":809,"./axis_defaults":813,"./layout_attributes":815}],815:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../../domain").attributes,a=t("./axis_attributes"),o=t("../../../plot_api/edit_types").overrideAll;e.exports=o({domain:i({name:"ternary"}),bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:a,baxis:a,caxis:a},"plot","from-root")},{"../../../components/color/attributes":557,"../../../plot_api/edit_types":715,"../../domain":757,"./axis_attributes":812}],816:[function(t,e,r){"use strict";var n=t("d3"),i=t("tinycolor2"),a=t("../../registry"),o=t("../../lib"),s=o._,l=t("../../components/color"),c=t("../../components/drawing"),u=t("../cartesian/set_convert"),h=t("../../lib/extend").extendFlat,f=t("../plots"),p=t("../cartesian/axes"),d=t("../../components/dragelement"),g=t("../../components/fx"),m=t("../../components/titles"),v=t("../cartesian/select").prepSelect,y=t("../cartesian/select").clearSelect,x=t("../cartesian/constants");function b(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e)}e.exports=b;var _=b.prototype;_.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},_.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var i=0;iw*x?i=(a=x)*w:a=(i=y)/w,o=m*i/y,s=v*a/x,r=e.l+e.w*d-i/2,n=e.t+e.h*(1-g)-a/2,f.x0=r,f.y0=n,f.w=i,f.h=a,f.sum=b,f.xaxis={type:"linear",range:[_+2*M-b,b-_-2*k],domain:[d-o/2,d+o/2],_id:"x"},u(f.xaxis,f.graphDiv._fullLayout),f.xaxis.setScale(),f.xaxis.isPtWithinRange=function(t){return t.a>=f.aaxis.range[0]&&t.a<=f.aaxis.range[1]&&t.b>=f.baxis.range[1]&&t.b<=f.baxis.range[0]&&t.c>=f.caxis.range[1]&&t.c<=f.caxis.range[0]},f.yaxis={type:"linear",range:[_,b-k-M],domain:[g-s/2,g+s/2],_id:"y"},u(f.yaxis,f.graphDiv._fullLayout),f.yaxis.setScale(),f.yaxis.isPtWithinRange=function(){return!0};var A=f.yaxis.domain[0],T=f.aaxis=h({},t.aaxis,{visible:!0,range:[_,b-k-M],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+s*w],_axislayer:f.layers.aaxis,_gridlayer:f.layers.agrid,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l"+a+",-"+i/2,automargin:!1});u(T,f.graphDiv._fullLayout),T.setScale();var S=f.baxis=h({},t.baxis,{visible:!0,range:[b-_-M,k],side:"bottom",_counterangle:30,domain:f.xaxis.domain,_axislayer:f.layers.baxis,_gridlayer:f.layers.bgrid,_counteraxis:f.aaxis,_pos:0,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+a,automargin:!1});u(S,f.graphDiv._fullLayout),S.setScale(),T._counteraxis=S;var E=f.caxis=h({},t.caxis,{visible:!0,range:[b-_-k,M],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+s*w],_axislayer:f.layers.caxis,_gridlayer:f.layers.cgrid,_counteraxis:f.baxis,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l-"+a+","+i/2,automargin:!1});u(E,f.graphDiv._fullLayout),E.setScale();var C="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";f.clipDef.select("path").attr("d",C),f.layers.plotbg.select("path").attr("d",C);var L="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";f.clipDefRelative.select("path").attr("d",L);var z="translate("+r+","+n+")";f.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",z),f.clipDefRelative.select("path").attr("transform",null);var P="translate("+(r-S._offset)+","+(n+a)+")";f.layers.baxis.attr("transform",P),f.layers.bgrid.attr("transform",P);var I="translate("+(r+i/2)+","+n+")rotate(30)translate(0,"+-T._offset+")";f.layers.aaxis.attr("transform",I),f.layers.agrid.attr("transform",I);var O="translate("+(r+i/2)+","+n+")rotate(-30)translate(0,"+-E._offset+")";f.layers.caxis.attr("transform",O),f.layers.cgrid.attr("transform",O),f.drawAxes(!0),f.plotContainer.selectAll(".crisp").classed("crisp",!1),f.layers.aline.select("path").attr("d",T.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(l.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),f.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(l.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),f.layers.cline.select("path").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(l.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),f.graphDiv._context.staticPlot||f.initInteractions(),c.setClipUrl(f.layers.frontplot,f._hasClipOnAxisFalse?null:f.clipId)},_.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.aaxis,i=this.baxis,a=this.caxis;if(p.doTicksSingle(e,n,!0),p.doTicksSingle(e,i,!0),p.doTicksSingle(e,a,!0),t){var o=Math.max(n.showticklabels?n.tickfont.size/2:0,(a.showticklabels?.75*a.tickfont.size:0)+("outside"===a.ticks?.87*a.ticklen:0));this.layers["a-title"]=m.draw(e,"a"+r,{propContainer:n,propName:this.id+".aaxis.title",placeholder:s(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-n.titlefont.size/3-o,"text-anchor":"middle"}});var l=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;this.layers["b-title"]=m.draw(e,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:s(e,"Click to enter Component B title"),attributes:{x:this.x0-l,y:this.y0+this.h+.83*i.titlefont.size+l,"text-anchor":"middle"}}),this.layers["c-title"]=m.draw(e,"c"+r,{propContainer:a,propName:this.id+".caxis.title",placeholder:s(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+l,y:this.y0+this.h+.83*a.titlefont.size+l,"text-anchor":"middle"}})}};var k=x.MINZOOM/2+.87,M="m-0.87,.5h"+k+"v3h-"+(k+5.2)+"l"+(k/2+2.6)+",-"+(.87*k+4.5)+"l2.6,1.5l-"+k/2+","+.87*k+"Z",A="m0.87,.5h-"+k+"v3h"+(k+5.2)+"l-"+(k/2+2.6)+",-"+(.87*k+4.5)+"l-2.6,1.5l"+k/2+","+.87*k+"Z",T="m0,1l"+k/2+","+.87*k+"l2.6,-1.5l-"+(k/2+2.6)+",-"+(.87*k+4.5)+"l-"+(k/2+2.6)+","+(.87*k+4.5)+"l2.6,1.5l"+k/2+",-"+.87*k+"Z",S="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",E=!0;function C(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}_.initInteractions=function(){var t,e,r,n,u,h,f,p,m,b,_=this,k=_.layers.plotbg.select("path").node(),L=_.graphDiv,z=L._fullLayout._zoomlayer,P={element:k,gd:L,plotinfo:{xaxis:_.xaxis,yaxis:_.yaxis},subplot:_.id,prepFn:function(a,o,s){P.xaxes=[_.xaxis],P.yaxes=[_.yaxis];var c=L._fullLayout.dragmode;a.shiftKey&&(c="pan"===c?"zoom":"pan"),P.minDrag="lasso"===c?1:void 0,"zoom"===c?(P.moveFn=R,P.doneFn=B,function(a,o,s){var c=k.getBoundingClientRect();t=o-c.left,e=s-c.top,r={a:_.aaxis.range[0],b:_.baxis.range[1],c:_.caxis.range[1]},u=r,n=_.aaxis.range[1]-r.a,h=i(_.graphDiv._fullLayout[_.id].bgcolor).getLuminance(),f="M0,"+_.h+"L"+_.w/2+", 0L"+_.w+","+_.h+"Z",p=!1,m=z.append("path").attr("class","zoombox").attr("transform","translate("+_.x0+", "+_.y0+")").style({fill:h>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",f),b=z.append("path").attr("class","zoombox-corners").attr("transform","translate("+_.x0+", "+_.y0+")").style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),y(z)}(0,o,s)):"pan"===c?(P.moveFn=F,P.doneFn=N,r={a:_.aaxis.range[0],b:_.baxis.range[1],c:_.caxis.range[1]},u=r,y(z)):"select"!==c&&"lasso"!==c||v(a,o,s,P,c)},clickFn:function(t,e){if(C(L),2===t){var r={};r[_.id+".aaxis.min"]=0,r[_.id+".baxis.min"]=0,r[_.id+".caxis.min"]=0,L.emit("plotly_doubleclick",null),a.call("relayout",L,r)}g.click(L,e,_.id)}};function I(t,e){return 1-e/_.h}function O(t,e){return 1-(t+(_.h-e)/Math.sqrt(3))/_.w}function D(t,e){return(t-(_.h-e)/Math.sqrt(3))/_.w}function R(i,a){var o=t+i,s=e+a,l=Math.max(0,Math.min(1,I(0,e),I(0,s))),c=Math.max(0,Math.min(1,O(t,e),O(o,s))),d=Math.max(0,Math.min(1,D(t,e),D(o,s))),g=(l/2+d)*_.w,v=(1-l/2-c)*_.w,y=(g+v)/2,k=v-g,E=(1-l)*_.h,C=E-k/w;k.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),b.transition().style("opacity",1).duration(200),p=!0)}function B(){if(C(L),u!==r){var t={};t[_.id+".aaxis.min"]=u.a,t[_.id+".baxis.min"]=u.b,t[_.id+".caxis.min"]=u.c,a.call("relayout",L,t),E&&L.data&&L._context.showTips&&(o.notifier(s(L,"Double-click to zoom back out"),"long"),E=!1)}}function F(t,e){var n=t/_.xaxis._m,i=e/_.yaxis._m,a=[(u={a:r.a-i,b:r.b+(n+i)/2,c:r.c-(n-i)/2}).a,u.b,u.c].sort(),o=a.indexOf(u.a),s=a.indexOf(u.b),l=a.indexOf(u.c);a[0]<0&&(a[1]+a[0]/2<0?(a[2]+=a[0]+a[1],a[0]=a[1]=0):(a[2]+=a[0]/2,a[1]+=a[0]/2,a[0]=0),u={a:a[o],b:a[s],c:a[l]},e=(r.a-u.a)*_.yaxis._m,t=(r.c-u.c-r.b+u.b)*_.xaxis._m);var h="translate("+(_.x0+t)+","+(_.y0+e)+")";_.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",h);var f="translate("+-t+","+-e+")";_.clipDefRelative.select("path").attr("transform",f),_.aaxis.range=[u.a,_.sum-u.b-u.c],_.baxis.range=[_.sum-u.a-u.c,u.b],_.caxis.range=[_.sum-u.a-u.b,u.c],_.drawAxes(!1),_.plotContainer.selectAll(".crisp").classed("crisp",!1),_._hasClipOnAxisFalse&&_.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,_)}function N(){var t={};t[_.id+".aaxis.min"]=u.a,t[_.id+".baxis.min"]=u.b,t[_.id+".caxis.min"]=u.c,a.call("relayout",L,t)}k.onmousemove=function(t){g.hover(L,t,_.id),L._fullLayout._lasthover=k,L._fullLayout._hoversubplot=_.id},k.onmouseout=function(t){L._dragging||d.unhover(L,t)},d.init(P)}},{"../../components/color":558,"../../components/dragelement":580,"../../components/drawing":583,"../../components/fx":600,"../../components/titles":649,"../../lib":684,"../../lib/extend":673,"../../registry":817,"../cartesian/axes":732,"../cartesian/constants":737,"../cartesian/select":749,"../cartesian/set_convert":750,"../plots":795,d3:147,tinycolor2:499}],817:[function(t,e,r){"use strict";var n=t("./lib/loggers"),i=t("./lib/noop"),a=t("./lib/push_unique"),o=t("./lib/is_plain_object"),s=t("./lib/extend"),l=t("./plots/attributes"),c=t("./plots/layout_attributes"),u=s.extendFlat,h=s.extendDeepAll;function f(t){var e=t.name,i=t.categories,a=t.meta;if(r.modules[e])n.log("Type "+e+" already registered");else{r.subplotsRegistry[t.basePlotModule.name]||function(t){var e=t.name;if(r.subplotsRegistry[e])return void n.log("Plot type "+e+" already registered.");for(var i in m(t),r.subplotsRegistry[e]=t,r.componentsRegistry)x(i,t.name)}(t.basePlotModule);for(var o={},s=0;s-1&&(u[f[r]].title="");for(r=0;r")?"":e.html(t).text()});return e.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":558,"../components/drawing":583,"../constants/xmlns_namespaces":663,"../lib":684,d3:147}],826:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){for(var r=0;ra))return e}return void 0!==r?r:t.dflt}function k(t,e,r){return a(e).isValid()?e:void 0!==r?r:t.dflt}e.exports=function(t,e,r,a){var h=e.xaxis,w=e.yaxis,k=t._fullLayout,M=a.selectAll("g.trace.bars").data(r,function(t){return t[0].trace.uid});M.enter().append("g").attr("class","trace bars").append("g").attr("class","points"),M.exit().remove(),M.order(),M.each(function(r){var a=r[0],u=a.t,M=a.trace,A=n.select(this);e.isRangePlot||(a.node3=A);var T=u.poffset,S=Array.isArray(T),E=A.select("g.points").selectAll("g.point").data(o.identity);E.enter().append("g").classed("point",!0),E.exit().remove(),E.each(function(a,u){var A,E,C,L,z=n.select(this),P=a.p+(S?T[u]:T),I=P+a.w,O=a.b,D=O+a.s;if("h"===M.orientation?(C=w.c2p(P,!0),L=w.c2p(I,!0),A=h.c2p(O,!0),E=h.c2p(D,!0),a.ct=[E,(C+L)/2]):(A=h.c2p(P,!0),E=h.c2p(I,!0),C=w.c2p(O,!0),L=w.c2p(D,!0),a.ct=[(A+E)/2,L]),i(A)&&i(E)&&i(C)&&i(L)&&A!==E&&C!==L){var R=(a.mlw+1||M.marker.line.width+1||(a.trace?a.trace.marker.line.width:0)+1)-1,B=n.round(R/2%1,2);if(!t._context.staticPlot){var F=l.opacity(a.mc||M.marker.color)<1||R>.01?N:function(t,e){return Math.abs(t-e)>=2?N(t):t>e?Math.ceil(t):Math.floor(t)};A=F(A,E),E=F(E,A),C=F(C,L),L=F(L,C)}o.ensureSingle(z,"path").style("vector-effect","non-scaling-stroke").attr("d","M"+A+","+C+"V"+L+"H"+E+"V"+C+"Z").call(c.setClipUrl,e.layerClipId),function(t,e,r,n,i,a,l,u){var h;function w(e,r,n){var i=o.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+h,transform:"","text-anchor":"middle","data-notex":1}).call(c.font,n).call(s.convertToTspans,t);return i}var k=r[0].trace,M=k.orientation,A=function(t,e){var r=b(t.text,e);return _(f,r)}(k,n);if(h=function(t,e){var r=b(t.textposition,e);return function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt}(p,r)}(k,n),!A||"none"===h)return void e.select("text").remove();var T,S,E,C,L,z,P=function(t,e,r){return x(d,t.textfont,e,r)}(k,n,t._fullLayout.font),I=function(t,e,r){return x(g,t.insidetextfont,e,r)}(k,n,P),O=function(t,e,r){return x(m,t.outsidetextfont,e,r)}(k,n,P),D=t._fullLayout.barmode,R="relative"===D,B="stack"===D||R,F=r[n],N=!B||F._outmost,j=Math.abs(a-i)-2*v,V=Math.abs(u-l)-2*v;"outside"===h&&(N||(h="inside"));if("auto"===h)if(N){h="inside",T=w(e,A,I),S=c.bBox(T.node()),E=S.width,C=S.height;var U=E>0&&C>0,q=E<=j&&C<=V,H=E<=V&&C<=j,G="h"===M?j>=E*(V/C):V>=C*(j/E);U&&(q||H||G)?h="inside":(h="outside",T.remove(),T=null)}else h="inside";if(!T&&(T=w(e,A,"outside"===h?O:I),S=c.bBox(T.node()),E=S.width,C=S.height,E<=0||C<=0))return void T.remove();"outside"===h?(z="both"===k.constraintext||"outside"===k.constraintext,L=function(t,e,r,n,i,a,o){var s,l="h"===a?Math.abs(n-r):Math.abs(e-t);l>2*v&&(s=v);var c=1;o&&(c="h"===a?Math.min(1,l/i.height):Math.min(1,l/i.width));var u,h,f,p,d=(i.left+i.right)/2,g=(i.top+i.bottom)/2;u=c*i.width,h=c*i.height,"h"===a?er?(f=(t+e)/2,p=n+s+h/2):(f=(t+e)/2,p=n-s-h/2);return y(d,g,f,p,c,!1)}(i,a,l,u,S,M,z)):(z="both"===k.constraintext||"inside"===k.constraintext,L=function(t,e,r,n,i,a,o){var s,l,c,u,h,f,p,d=i.width,g=i.height,m=(i.left+i.right)/2,x=(i.top+i.bottom)/2,b=Math.abs(e-t),_=Math.abs(n-r);b>2*v&&_>2*v?(b-=2*(h=v),_-=2*h):h=0;d<=b&&g<=_?(f=!1,p=1):d<=_&&g<=b?(f=!0,p=1):dr?(c=(t+e)/2,u=n-h-l/2):(c=(t+e)/2,u=n+h+l/2);return y(m,x,c,u,p,f)}(i,a,l,u,S,M,z));T.attr("transform",L)}(t,z,r,u,A,E,C,L),e.layerClipId&&c.hideOutsideRangePoint(r[u],z.select("text"),h,w,M.xcalendar,M.ycalendar)}else z.remove();function N(t){return 0===k.bargap&&0===k.bargroupgap?n.round(Math.round(t)-B,2):t}});var C=!1===r[0].trace.cliponaxis;c.setClipUrl(A,C?null:e.layerClipId)}),u.getComponentMethod("errorbars","plot")(M,e)}},{"../../components/color":558,"../../components/drawing":583,"../../lib":684,"../../lib/svg_text_utils":708,"../../registry":817,"./attributes":827,d3:147,"fast-isnumeric":214,tinycolor2:499}],835:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[];if(!1===e)for(r=0;rh+c||!n(u))&&(p=!0,g(f,t))}for(var m=0;m1||0===s.bargap&&0===s.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),r.selectAll("g.points").each(function(e){o(n.select(this),e[0].trace,t)}),a.getComponentMethod("errorbars","style")(r)},styleOnSelect:function(t,e){var r=e[0].node3,n=e[0].trace;n.selectedpoints?(i.selectedPointStyle(r.selectAll("path"),n),i.selectedTextStyle(r.selectAll("text"),n)):o(r,n,t)}}},{"../../components/drawing":583,"../../registry":817,d3:147}],839:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),i(t,"marker")&&a(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":558,"../../components/colorscale/defaults":568,"../../components/colorscale/has_colorscale":572}],840:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},text:a({},n.text,{}),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calcIfAutorange"},notched:{valType:"boolean",editType:"calcIfAutorange"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calcIfAutorange"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calcIfAutorange"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calcIfAutorange"},jitter:{valType:"number",min:0,max:1,editType:"calcIfAutorange"},pointpos:{valType:"number",min:-2,max:2,editType:"calcIfAutorange"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:a({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:a({},o.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:a({},o.color,{arrayOk:!1,editType:"style"}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:a({},s.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":557,"../../lib/extend":673,"../scatter/attributes":1015}],841:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=i._,o=t("../../plots/cartesian/axes");function s(t,e,r){var n={text:"tx"};for(var i in n)Array.isArray(e[i])&&(t[n[i]]=e[i][r])}function l(t,e){return t.v-e.v}function c(t){return t.v}e.exports=function(t,e){var r,u,h,f,p,d=t._fullLayout,g=o.getFromId(t,e.xaxis||"x"),m=o.getFromId(t,e.yaxis||"y"),v=[],y="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(u=g,h="x",f=m,p="y"):(u=m,h="y",f=g,p="x");var x=u.makeCalcdata(e,h),b=function(t,e,r,a,o){if(e in t)return r.makeCalcdata(t,e);var s;s=e+"0"in t?t[e+"0"]:"name"in t&&("category"===r.type||n(t.name)&&-1!==["linear","log"].indexOf(r.type)||i.isDateTime(t.name)&&"date"===r.type)?t.name:o;var l=r.d2c(s,0,t[e+"calendar"]);return a.map(function(){return l})}(e,p,f,x,d[y]),_=i.distinctVals(b),w=_.vals,k=_.minDiff/2,M=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&E0){var L=T[r].sort(l),z=L.map(c),P=z.length,I={pos:w[r],pts:L};I.min=z[0],I.max=z[P-1],I.mean=i.mean(z,P),I.sd=i.stdev(z,P,I.mean),I.q1=i.interp(z,.25),I.med=i.interp(z,.5),I.q3=i.interp(z,.75),I.lf=Math.min(I.q1,z[Math.min(i.findBin(2.5*I.q1-1.5*I.q3,z,!0)+1,P-1)]),I.uf=Math.max(I.q3,z[Math.max(i.findBin(2.5*I.q3-1.5*I.q1,z),0)]),I.lo=4*I.q1-3*I.q3,I.uo=4*I.q3-3*I.q1;var O=1.57*(I.q3-I.q1)/Math.sqrt(P);I.ln=I.med-O,I.un=I.med+O,v.push(I)}return function(t,e){if(i.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(v[0].t={num:d[y],dPos:k,posLetter:p,valLetter:h,labels:{med:a(t,"median:"),min:a(t,"min:"),q1:a(t,"q1:"),q3:a(t,"q3:"),max:a(t,"max:"),mean:"sd"===e.boxmean?a(t,"mean ± σ:"):a(t,"mean:"),lf:a(t,"lower fence:"),uf:a(t,"upper fence:")}},d[y]++,v):[{t:{empty:!0}}]}},{"../../lib":684,"../../plots/cartesian/axes":732,"fast-isnumeric":214}],842:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../components/color"),o=t("./attributes");function s(t,e,r,n){var a,o,s=r("y"),l=r("x"),c=l&&l.length;if(s&&s.length)a="v",c?o=Math.min(l.length,s.length):(r("x0"),o=s.length);else{if(!c)return void(e.visible=!1);a="h",r("y0"),o=l.length}e._length=o,i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],n),r("orientation",a)}function l(t,e,r,i){var a=i.prefix,s=n.coerce2(t,e,o,"marker.outliercolor"),l=r("marker.line.outliercolor"),c=r(a+"points",s||l?"suspectedoutliers":void 0);c?(r("jitter","all"===c?.3:0),r("pointpos","all"===c?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===c&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text")):delete e.marker,r("hoveron"),n.coerceSelectionMarkerOpacity(e,r)}e.exports={supplyDefaults:function(t,e,r,i){function c(r,i){return n.coerce(t,e,o,r,i)}s(t,e,c,i),!1!==e.visible&&(c("line.color",(t.marker||{}).color||r),c("line.width"),c("fillcolor",a.addOpacity(e.line.color,.5)),c("whiskerwidth"),c("boxmean"),c("notched",void 0!==t.notchwidth)&&c("notchwidth"),l(t,e,c,{prefix:"box"}))},handleSampleDefaults:s,handlePointsDefaults:l}},{"../../components/color":558,"../../lib":684,"../../registry":817,"./attributes":840}],843:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib"),a=t("../../components/fx"),o=t("../../components/color"),s=t("../scatter/fill_hover_text");function l(t,e,r,s){var l,c,u,h,f,p,d,g,m,v,y,x,b=t.cd,_=t.xa,w=t.ya,k=b[0].trace,M=b[0].t,A="violin"===k.type,T=[],S=M.bdPos,E=M.wHover,C=function(t){return t.pos+M.bPos-p};A&&"both"!==k.side?("positive"===k.side&&(m=function(t){var e=C(t);return a.inbox(e,e+E,v)}),"negative"===k.side&&(m=function(t){var e=C(t);return a.inbox(e-E,e,v)})):m=function(t){var e=C(t);return a.inbox(e-E,e+E,v)},x=A?function(t){return a.inbox(t.span[0]-f,t.span[1]-f,v)}:function(t){return a.inbox(t.min-f,t.max-f,v)},"h"===k.orientation?(f=e,p=r,d=x,g=m,l="y",u=w,c="x",h=_):(f=r,p=e,d=m,g=x,l="x",u=_,c="y",h=w);var L=Math.min(1,S/Math.abs(u.r2c(u.range[1])-u.r2c(u.range[0])));function z(t){return(d(t)+g(t))/2}v=t.maxHoverDistance-L,y=t.maxSpikeDistance-L;var P=a.getDistanceFunction(s,d,g,z);if(a.getClosest(b,P,t),!1===t.index)return[];var I=b[t.index],O=k.line.color,D=(k.marker||{}).color;o.opacity(O)&&k.line.width?t.color=O:o.opacity(D)&&k.boxpoints?t.color=D:t.color=k.fillcolor,t[l+"0"]=u.c2p(I.pos+M.bPos-S,!0),t[l+"1"]=u.c2p(I.pos+M.bPos+S,!0),t[l+"LabelVal"]=I.pos;var R=l+"Spike";t.spikeDistance=z(I)*y/v,t[R]=u.c2p(I.pos,!0);var B={},F=["med","min","q1","q3","max"];(k.boxmean||(k.meanline||{}).visible)&&F.push("mean"),(k.boxpoints||k.points)&&F.push("lf","uf");for(var N=0;Nt.uf}),l=Math.max((t.max-t.min)/10,t.q3-t.q1),c=1e-9*l,p=l*s,d=[],g=0;if(r.jitter){if(0===l)for(g=1,d=new Array(a.length),e=0;et.lo&&(_.so=!0)}return a});d.enter().append("path").classed("point",!0),d.exit().remove(),d.call(a.translatePoints,l,c)}function u(t,e,r,a){var o,s,l=e.pos,c=e.val,u=a.bPos,h=a.bPosPxOffset||0,f=r.boxmean||(r.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var p=t.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box&&r.meanline?i.identity:[]);p.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),p.exit().remove(),p.each(function(t){var e=l.c2p(t.pos+u,!0)+h,i=l.c2p(t.pos+u-o,!0)+h,a=l.c2p(t.pos+u+s,!0)+h,p=c.c2p(t.mean,!0),d=c.c2p(t.mean-t.sd,!0),g=c.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+p+","+i+"V"+a+("sd"===f?"m0,0L"+d+","+e+"L"+p+","+i+"L"+g+","+e+"Z":"")):n.select(this).attr("d","M"+i+","+p+"H"+a+("sd"===f?"m0,0L"+e+","+d+"L"+i+","+p+"L"+e+","+g+"Z":""))})}e.exports={plot:function(t,e,r,i){var a=t._fullLayout,o=e.xaxis,s=e.yaxis,h=i.selectAll("g.trace.boxes").data(r,function(t){return t[0].trace.uid});h.enter().append("g").attr("class","trace boxes"),h.exit().remove(),h.order(),h.each(function(t){var r=t[0],i=r.t,h=r.trace,f=n.select(this);e.isRangePlot||(r.node3=f);var p,d,g=a._numBoxes,m=1-a.boxgap,v="group"===a.boxmode&&g>1,y=i.dPos*m*(1-a.boxgroupgap)/(v?g:1),x=v?2*i.dPos*((i.num+.5)/g-.5)*m:0,b=y*h.whiskerwidth;!0!==h.visible||i.empty?f.remove():("h"===h.orientation?(p=s,d=o):(p=o,d=s),i.bPos=x,i.bdPos=y,i.wdPos=b,i.wHover=i.dPos*(v?m/g:1),l(f,{pos:p,val:d},h,i),c(f,{x:o,y:s},h,i),u(f,{pos:p,val:d},h,i))})},plotBoxAndWhiskers:l,plotPoints:c,plotBoxMean:u}},{"../../components/drawing":583,"../../lib":684,d3:147}],848:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r=10)return null;var i=1/0;var a=-1/0;var o=e.length;for(var s=0;s0?Math.floor:Math.ceil,P=C>0?Math.ceil:Math.floor,I=C>0?Math.min:Math.max,O=C>0?Math.max:Math.min,D=z(S+L),R=P(E-L),B=[[h=T(S)]];for(a=D;a*C=0;i--)a[u-i]=t[h][i],o[u-i]=e[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=t[i][0],o[h-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}},{}],863:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r){var a,o,s,l,c,u,h,f,p,d,g,m,v,y,x=t["_"+e],b=t[e+"axis"],_=b._gridlines=[],w=b._minorgridlines=[],k=b._boundarylines=[],M=t["_"+r],A=t[r+"axis"];"array"===b.tickmode&&(b.tickvals=x.slice());var T=t._xctrl,S=t._yctrl,E=T[0].length,C=T.length,L=t._a.length,z=t._b.length;n.prepTicks(b),"array"===b.tickmode&&delete b.tickvals;var P=b.smoothing?3:1;function I(n){var i,a,o,s,l,c,u,h,p,d,g,m,v=[],y=[],x={};if("b"===e)for(a=t.b2j(n),o=Math.floor(Math.max(0,Math.min(z-2,a))),s=a-o,x.length=z,x.crossLength=L,x.xy=function(e){return t.evalxy([],e,a)},x.dxy=function(e,r){return t.dxydi([],e,o,r,s)},i=0;i0&&(p=t.dxydi([],i-1,o,0,s),v.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),d=t.dxydi([],i-1,o,1,s),v.push(h[0]-d[0]/3),y.push(h[1]-d[1]/3)),v.push(h[0]),y.push(h[1]),l=h;else for(i=t.a2i(n),c=Math.floor(Math.max(0,Math.min(L-2,i))),u=i-c,x.length=L,x.crossLength=z,x.xy=function(e){return t.evalxy([],i,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},a=0;a0&&(g=t.dxydj([],c,a-1,u,0),v.push(l[0]+g[0]/3),y.push(l[1]+g[1]/3),m=t.dxydj([],c,a-1,u,1),v.push(h[0]-m[0]/3),y.push(h[1]-m[1]/3)),v.push(h[0]),y.push(h[1]),l=h;return x.axisLetter=e,x.axis=b,x.crossAxis=A,x.value=n,x.constvar=r,x.index=f,x.x=v,x.y=y,x.smoothing=A.smoothing,x}function O(n){var i,a,o,s,l,c=[],u=[],h={};if(h.length=x.length,h.crossLength=M.length,"b"===e)for(o=Math.max(0,Math.min(z-2,n)),l=Math.min(1,Math.max(0,n-o)),h.xy=function(e){return t.evalxy([],e,n)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},i=0;ix.length-1||_.push(i(O(o),{color:b.gridcolor,width:b.gridwidth}));for(f=u;fx.length-1||g<0||g>x.length-1))for(m=x[s],v=x[g],a=0;ax[x.length-1]||w.push(i(I(d),{color:b.minorgridcolor,width:b.minorgridwidth}));b.startline&&k.push(i(O(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&k.push(i(O(x.length-1),{color:b.endlinecolor,width:b.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((x[x.length-1]-b.tick0)/b.dtick*(1+l)),Math.ceil((x[0]-b.tick0)/b.dtick/(1+l))].sort(function(t,e){return t-e}))[0],h=c[1],f=u;f<=h;f++)p=b.tick0+b.dtick*f,_.push(i(I(p),{color:b.gridcolor,width:b.gridwidth}));for(f=u-1;fx[x.length-1]||w.push(i(I(d),{color:b.minorgridcolor,width:b.minorgridwidth}));b.startline&&k.push(i(I(x[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&k.push(i(I(x[x.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}},{"../../lib/extend":673,"../../plots/cartesian/axes":732}],864:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],i=0;i90&&(p-=180,l=-l),{angle:p,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],878:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("./map_1d_array"),o=t("./makepath"),s=t("./orient_text"),l=t("../../lib/svg_text_utils"),c=t("../../lib"),u=t("../../constants/alignment"),h=t("../../plots/get_data").getUidsFromCalcData;function f(t,e,r,n){var i=r[0],l=r[0].trace,u=e.xaxis,h=e.yaxis,f=l.aaxis,g=l.baxis,m=t._fullLayout._clips,y=c.ensureSingle(n,"g","carpet"+l.uid).classed("trace",!0),x=c.ensureSingle(y,"g","minorlayer"),b=c.ensureSingle(y,"g","majorlayer"),_=c.ensureSingle(y,"g","boundarylayer"),w=c.ensureSingle(y,"g","labellayer");y.style("opacity",l.opacity),p(u,h,b,f,"a",f._gridlines),p(u,h,b,g,"b",g._gridlines),p(u,h,x,f,"a",f._minorgridlines),p(u,h,x,g,"b",g._minorgridlines),p(u,h,_,f,"a-boundary",f._boundarylines),p(u,h,_,g,"b-boundary",g._boundarylines),function(t,e,r,n,i,a,o,l){var u,h,f,p;u=.5*(r.a[0]+r.a[r.a.length-1]),h=r.b[0],f=r.ab2xy(u,h,!0),p=r.dxyda_rough(u,h),void 0===o.angle&&c.extendFlat(o,s(r,i,a,f,r.dxydb_rough(u,h)));v(t,e,r,n,f,p,r.aaxis,i,a,o,"a-title"),u=r.a[0],h=.5*(r.b[0]+r.b[r.b.length-1]),f=r.ab2xy(u,h,!0),p=r.dxydb_rough(u,h),void 0===l.angle&&c.extendFlat(l,s(r,i,a,f,r.dxyda_rough(u,h)));v(t,e,r,n,f,p,r.baxis,i,a,l,"b-title")}(t,w,l,i,u,h,d(t,u,h,l,i,w,f._labels,"a-label"),d(t,u,h,l,i,w,g._labels,"b-label")),function(t,e,r,n,i){var s,l,u,h,f=r.select("#"+t._clipPathId);f.size()||(f=r.append("clipPath").classed("carpetclip",!0));var p=c.ensureSingle(f,"path","carpetboundary"),d=e.clipsegments,g=[];for(h=0;h0?"start":"end","data-notex":1}).call(i.font,o.font).text(o.text).call(l.convertToTspans,t),m=i.bBox(this);g.attr("transform","translate("+u.p[0]+","+u.p[1]+") rotate("+u.angle+")translate("+o.axis.labelpadding*f+","+.3*m.height+")"),p=Math.max(p,m.width+o.axis.labelpadding)}),f.exit().remove(),d.maxExtent=p,d}e.exports=function(t,e,r,i){var a=h(r);i.selectAll("g.trace").each(function(){var t=n.select(this).attr("class").split("carpet")[1].split(/\s/)[0];a[t]||n.select(this).remove()});for(var o=0;o90&&d<270,y=n.select(this);y.text(u.title||"").call(l.convertToTspans,t),v&&(x=(-l.lineCount(y)+m)*g*a-x),y.attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+x+")").classed("user-select-none",!0).attr("text-anchor","middle").call(i.font,u.titlefont)}),y.exit().remove()}},{"../../components/drawing":583,"../../constants/alignment":656,"../../lib":684,"../../lib/svg_text_utils":708,"../../plots/get_data":768,"./makepath":875,"./map_1d_array":876,"./orient_text":877,d3:147}],879:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/search").findBin,a=t("./compute_control_points"),o=t("./create_spline_evaluator"),s=t("./create_i_derivative_evaluator"),l=t("./create_j_derivative_evaluator");e.exports=function(t){var e=t._a,r=t._b,c=e.length,u=r.length,h=t.aaxis,f=t.baxis,p=e[0],d=e[c-1],g=r[0],m=r[u-1],v=e[e.length-1]-e[0],y=r[r.length-1]-r[0],x=v*n.RELATIVE_CULL_TOLERANCE,b=y*n.RELATIVE_CULL_TOLERANCE;p-=x,d+=x,g-=b,m+=b,t.isVisible=function(t,e){return t>p&&tg&&ed||em},t.setScale=function(){var e=t._x,r=t._y,n=a(t._xctrl,t._yctrl,e,r,h.smoothing,f.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=o([t._xctrl,t._yctrl],c,u,h.smoothing,f.smoothing),t.dxydi=s([t._xctrl,t._yctrl],h.smoothing,f.smoothing),t.dxydj=l([t._xctrl,t._yctrl],h.smoothing,f.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),c-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),u-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[c-1]|ir[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var h,f,p,d,g=0,m=0,v=[];ne[c-1]?(h=c-2,f=1,g=(n-e[c-1])/(e[c-1]-e[c-2])):f=o-(h=Math.max(0,Math.min(c-2,Math.floor(o)))),ir[u-1]?(p=u-2,d=1,m=(i-r[u-1])/(r[u-1]-r[u-2])):d=s-(p=Math.max(0,Math.min(u-2,Math.floor(s)))),g&&(t.dxydi(v,h,p,f,d),l[0]+=v[0]*g,l[1]+=v[1]*g),m&&(t.dxydj(v,h,p,f,d),l[0]+=v[0]*m,l[1]+=v[1]*m)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":703,"./compute_control_points":867,"./constants":868,"./create_i_derivative_evaluator":869,"./create_j_derivative_evaluator":870,"./create_spline_evaluator":871}],880:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a,o,s=[],l=[],c=t[0].length,u=t.length;function h(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&a0&&i1e-5);return n.log("Smoother converged to",M,"after",A,"iterations"),t}},{"../../lib":684}],881:[function(t,e,r){"use strict";var n=t("../../lib").isArray1D;e.exports=function(t,e,r){var i=r("x"),a=i&&i.length,o=r("y"),s=o&&o.length;if(!a&&!s)return!1;if(e._cheater=!i,a&&!n(i)||s&&!n(o))e._length=null;else{var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),e.a&&e.a.length&&(l=Math.min(l,e.a.length)),e.b&&e.b.length&&(l=Math.min(l,e.b.length)),e._length=l}return!0}},{"../../lib":684}],882:[function(t,e,r){"use strict";var n=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker.line;e.exports=s({locations:{valType:"data_array",editType:"calc"},locationmode:n.locationmode,z:{valType:"data_array",editType:"calc"},text:s({},n.text,{}),marker:{line:{color:l.color,width:s({},l.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:n.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:n.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:s({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]})},i("",{cLetter:"z",editTypeOverride:"calc"}),{colorbar:a})},{"../../components/colorbar/attributes":559,"../../components/colorscale/attributes":565,"../../lib/extend":673,"../../plots/attributes":729,"../scattergeo/attributes":1053}],883:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");e.exports=function(t,e){for(var r=e._length,l=new Array(r),c=0;c")}(t,h,o,f.mockAxis),[t]}},{"../../plots/cartesian/axes":732,"../scatter/fill_hover_text":1022,"./attributes":882}],887:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style").style,n.styleOnSelect=t("./style").styleOnSelect,n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="choropleth",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","noOpacity"],n.meta={},e.exports=n},{"../../plots/geo":762,"../heatmap/colorbar":928,"./attributes":882,"./calc":883,"./defaults":884,"./event_data":885,"./hover":886,"./plot":888,"./select":889,"./style":890}],888:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../lib/polygon"),o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("./style").style;function c(t,e){for(var r=t[0].trace,n=t.length,i=o(r,e),a=0;a0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===l||"FJI"===l?function(t){var e;if(null===u(t))e=t;else for(e=new Array(t.length),i=0;ie?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var o=a.tester(r);o.pts.pop(),c.push(o)}:function(t){c.push(a.tester(t))},o.type){case"MultiPolygon":for(r=0;r":h.value>f&&(s.prefixBoundary=!0);break;case"<":h.valuef)&&(s.prefixBoundary=!0);break;case"][":a=Math.min.apply(null,h.value),o=Math.max.apply(null,h.value),af&&(s.prefixBoundary=!0)}}},{}],899:[function(t,e,r){"use strict";var n=t("../../components/colorbar/draw"),i=t("./make_color_map"),a=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,o="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+o).remove(),r.showscale){var s=n(t,o);e[0].t.cb=s;var l=r.contours,c=r.line,u=l.size||1,h=l.coloring,f=i(r,{isColorbar:!0});"heatmap"===h&&s.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),s.fillcolor("fill"===h||"heatmap"===h?f:"").line({color:"lines"===h?f:c.color,width:!1!==l.showlines?c.width:0,dash:c.dash}).levels({start:l.start,end:a(l),size:u}).options(r.colorbar)()}}},{"../../components/colorbar/draw":563,"./end_plus":907,"./make_color_map":912}],900:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],901:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./label_defaults"),a=t("../../components/color"),o=a.addOpacity,s=a.opacity,l=t("../../constants/filter_ops"),c=l.CONSTRAINT_REDUCTION,u=l.COMPARISON_OPS2;e.exports=function(t,e,r,a,l,h){var f,p,d,g=e.contours,m=r("contours.operation");(g._operation=c[m],function(t,e){var r;-1===u.indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:n(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),n(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(r,g),"="===m?f=g.showlines=!0:(f=r("contours.showlines"),d=r("fillcolor",o((t.line||{}).color||l,.5))),f)&&(p=r("line.color",d&&s(d)?o(e.fillcolor,1):l),r("line.width",2),r("line.dash"));r("line.smoothing"),i(r,a,p,h)}},{"../../components/color":558,"../../constants/filter_ops":657,"./label_defaults":911,"fast-isnumeric":214}],902:[function(t,e,r){"use strict";var n=t("../../constants/filter_ops"),i=t("fast-isnumeric");function a(t,e){var r,a=Array.isArray(e);function o(t){return i(t)?+t:null}return-1!==n.COMPARISON_OPS2.indexOf(t)?r=o(a?e[0]:e):-1!==n.INTERVAL_OPS.indexOf(t)?r=a?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==n.SET_OPS.indexOf(t)&&(r=a?e.map(o):[o(e)]),r}function o(t){return function(e){e=a(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function s(t){return function(e){return{start:e=a(t,e),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},{"../../constants/filter_ops":657,"fast-isnumeric":214}],903:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},{}],904:[function(t,e,r){"use strict";var n=t("../../lib");function i(t){return n.extendFlat({},t,{edgepaths:n.extendDeep([],t.edgepaths),paths:n.extendDeep([],t.paths)})}e.exports=function(t,e){var r,a,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&n.warn("Contour data invalid for the specified inequality operation."),a=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return l}},{"../../lib":684,"./constraint_mapping":902,"./end_plus":907}],907:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],908:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./constants");function a(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==i.BOTTOMSTART.indexOf(t)?a=1:-1!==i.LEFTSTART.indexOf(t)?n=1:-1!==i.TOPSTART.indexOf(t)?a=-1:n=-1;return[n,a]}(f,r,e),d=[s(t,e,[-p[0],-p[1]])],g=p.join(","),m=t.z.length,v=t.z[0].length;for(c=0;c<1e4;c++){if(f>20?(f=i.CHOOSESADDLE[f][(p[0]||p[1])<0?0:1],t.crossings[h]=i.SADDLEREMAINDER[f]):delete t.crossings[h],!(p=i.NEWDELTA[f])){n.log("Found bad marching index:",f,e,t.level);break}d.push(s(t,e,p)),e[0]+=p[0],e[1]+=p[1],a(d[d.length-1],d[d.length-2],o,l)&&d.pop(),h=e.join(",");var y=p[0]&&(e[0]<0||e[0]>v-2)||p[1]&&(e[1]<0||e[1]>m-2);if(h===u&&p.join(",")===g||r&&y)break;f=t.crossings[h]}1e4===c&&n.log("Infinite loop in contour?");var x,b,_,w,k,M,A,T,S,E,C,L,z,P,I,O=a(d[0],d[d.length-1],o,l),D=0,R=.2*t.smoothing,B=[],F=0;for(c=1;c=F;c--)if((x=B[c])=F&&x+B[b]T&&S--,t.edgepaths[S]=C.concat(d,E));break}U||(t.edgepaths[T]=d.concat(E))}for(T=0;Tt?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(t){var e,r,a,o,s,l,c,u,h,f=t[0].z,p=f.length,d=f[0].length,g=2===p||2===d;for(r=0;rt.level}return r?"M"+e.join("L")+"Z":""}(t,e),f=0,p=t.edgepaths.map(function(t,e){return e}),d=!0;function g(t){return Math.abs(t[1]-e[2][1])<.01}function m(t){return Math.abs(t[0]-e[0][0])<.01}function v(t){return Math.abs(t[0]-e[2][0])<.01}for(;p.length;){for(c=a.smoothopen(t.edgepaths[f],t.smoothing),h+=d?c:c.replace(/^M/,"L"),p.splice(p.indexOf(f),1),r=t.edgepaths[f][t.edgepaths[f].length-1],s=-1,o=0;o<4;o++){if(!r){i.log("Missing end?",f,t);break}for(u=r,Math.abs(u[1]-e[0][1])<.01&&!v(r)?n=e[1]:m(r)?n=e[0]:g(r)?n=e[3]:v(r)&&(n=e[2]),l=0;l=0&&(n=y,s=l):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-y[1])<.01&&(y[0]-r[0])*(n[0]-y[0])>=0&&(n=y,s=l):i.log("endpt to newendpt is not vert. or horz.",r,n,y)}if(r=n,s>=0)break;h+="L"+n}if(s===t.edgepaths.length){i.log("unclosed perimeter path");break}f=s,(d=-1===p.indexOf(f))&&(f=p[0],h+="Z")}for(f=0;fn.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*o)),p=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(h)+Math.cos(c)*o);if(f<1||p<1)return 1/0;var d=v.EDGECOST*(1/(f-1)+1/(p-1));d+=v.ANGLECOST*c*c;for(var g=s-u,m=l-h,y=s+u,x=l+h,b=0;b2*v.MAXCOST)break;p&&(s/=2),l=(o=c-s/2)+1.5*s}if(f<=v.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var i=e.width/2,a=e.height/2,o=t.x,s=t.y,l=t.theta,c=Math.sin(l),u=Math.cos(l),h=i*u,f=a*c,p=i*c,d=-a*u,g=[[o-h-f,s-p-d],[o+h-f,s+p-d],[o+h+f,s+p+d],[o-h+f,s-p+d]];r.push({text:e.text,x:o,y:s,dy:e.dy,theta:l,level:e.level,width:e.width,height:e.height}),n.push(g)},r.drawLabels=function(t,e,r,a,s){var l=t.selectAll("text").data(e,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var e=t.x+Math.sin(t.theta)*t.dy,i=t.y-Math.cos(t.theta)*t.dy;n.select(this).text(t.text).attr({x:e,y:i,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+i+")"}).call(o.convertToTspans,r)}),s){for(var c="",u=0;ue.end&&(e.start=e.end=(e.start+e.end)/2),t._input.contours||(t._input.contours={}),i.extendFlat(t._input.contours,{start:e.start,end:e.end,size:e.size}),t._input.autocontour=!0}else if("constraint"!==e.type){var l,c=e.start,u=e.end,h=t._input.contours;if(c>u&&(e.start=h.start=u,u=e.end=h.end=c,c=e.start),!(e.size>0))l=c===u?1:a(c,u,t.ncontours).dtick,h.size=e.size=l}}},{"../../lib":684,"../../plots/cartesian/axes":732}],916:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("../heatmap/style"),o=t("./make_color_map");e.exports=function(t){var e=n.select(t).selectAll("g.contour");e.style("opacity",function(t){return t.trace.opacity}),e.each(function(t){var e=n.select(this),r=t.trace,a=r.contours,s=r.line,l=a.size||1,c=a.start,u="constraint"===a.type,h=!u&&"lines"===a.coloring,f=!u&&"fill"===a.coloring,p=h||f?o(r):null;e.selectAll("g.contourlevel").each(function(t){n.select(this).selectAll("path").call(i.lineGroupStyle,s.width,h?p(t.level):s.color,s.dash)});var d=a.labelfont;if(e.selectAll("g.contourlabels text").each(function(t){i.font(n.select(this),{family:d.family,size:d.size,color:d.color||(h?p(t.level):s.color)})}),u)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(f){var g;e.selectAll("g.contourfill path").style("fill",function(t){return void 0===g&&(g=t.level),p(t.level+.5*l)}),void 0===g&&(g=c),e.selectAll("g.contourbg path").style("fill",p(g-.5*l))}}),a(t)}},{"../../components/drawing":583,"../heatmap/style":938,"./make_color_map":912,d3:147}],917:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults"),i=t("./label_defaults");e.exports=function(t,e,r,a,o){var s,l=r("contours.coloring"),c="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&n(t,e,a,r,{prefix:"",cLetter:"z"}),r("line.smoothing"),i(r,a,c,o)}},{"../../components/colorscale/defaults":568,"./label_defaults":911}],918:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),i=t("../contour/attributes"),a=i.contours,o=t("../scatter/attributes"),s=t("../../components/colorscale/attributes"),l=t("../../components/colorbar/attributes"),c=t("../../lib/extend").extendFlat,u=o.line;e.exports=c({carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:i.fillcolor,autocontour:i.autocontour,ncontours:i.ncontours,contours:{type:a.type,start:a.start,end:a.end,size:a.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:a.showlines,showlabels:a.showlabels,labelfont:a.labelfont,labelformat:a.labelformat,operation:a.operation,value:a.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:c({},u.color,{}),width:u.width,dash:u.dash,smoothing:c({},u.smoothing,{}),editType:"plot"}},s("",{cLetter:"z",autoColorDflt:!1}),{colorbar:l})},{"../../components/colorbar/attributes":559,"../../components/colorscale/attributes":565,"../../lib/extend":673,"../contour/attributes":896,"../heatmap/attributes":925,"../scatter/attributes":1015}],919:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../../lib").isArray1D,a=t("../heatmap/convert_column_xyz"),o=t("../heatmap/clean_2d_array"),s=t("../heatmap/max_row_length"),l=t("../heatmap/interp2d"),c=t("../heatmap/find_empties"),u=t("../heatmap/make_bound_array"),h=t("./defaults"),f=t("../carpet/lookup_carpetid"),p=t("../contour/set_contours");e.exports=function(t,e){var r=e._carpetTrace=f(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var d=t.data[r.index],g=t.data[e.index];g.a||(g.a=d.a),g.b||(g.b=d.b),h(g,e,e._defaultColor,t._fullLayout)}var m=function(t,e){var r,h,f,p,d,g,m,v=e._carpetTrace,y=v.aaxis,x=v.baxis;y._minDtick=0,x._minDtick=0,i(e.z)&&a(e,y,x,"a","b",["z"]);r=e._a=e._a||e.a,p=e._b=e._b||e.b,r=r?y.makeCalcdata(e,"_a"):[],p=p?x.makeCalcdata(e,"_b"):[],h=e.a0||0,f=e.da||1,d=e.b0||0,g=e.db||1,m=e._z=o(e._z||e.z,e.transpose),e._emptypoints=c(m),l(m,e._emptypoints);var b=s(m),_="scaled"===e.xtype?"":r,w=u(e,_,h,f,b,y),k="scaled"===e.ytype?"":p,M=u(e,k,d,g,m.length,x),A={a:w,b:M,z:m};"levels"===e.contours.type&&"none"!==e.contours.coloring&&n(e,m,"","z");return[A]}(0,e);return p(e),m}}},{"../../components/colorscale/calc":566,"../../lib":684,"../carpet/lookup_carpetid":874,"../contour/set_contours":915,"../heatmap/clean_2d_array":927,"../heatmap/convert_column_xyz":929,"../heatmap/find_empties":931,"../heatmap/interp2d":934,"../heatmap/make_bound_array":935,"../heatmap/max_row_length":936,"./defaults":920}],920:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/xyz_defaults"),a=t("./attributes"),o=t("../contour/constraint_defaults"),s=t("../contour/contours_defaults"),l=t("../contour/style_defaults");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,a,r,i)}if(u("carpet"),t.a&&t.b){if(!i(t,e,u,c,"a","b"))return void(e.visible=!1);u("text");var h="constraint"===u("contours.type");h||delete e.showlegend,h?o(t,e,u,c,r,{hasHover:!1}):(s(t,e,u,function(r){return n.coerce2(t,e,a,r)}),l(t,e,u,c,{hasHover:!1}))}else e._defaultColor=r,e._length=null}},{"../../lib":684,"../contour/constraint_defaults":901,"../contour/contours_defaults":903,"../contour/style_defaults":917,"../heatmap/xyz_defaults":940,"./attributes":918}],921:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../contour/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../contour/style"),n.moduleType="trace",n.name="contourcarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":743,"../contour/colorbar":899,"../contour/style":916,"./attributes":918,"./calc":919,"./defaults":920,"./plot":924}],922:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../carpet/axis_aligned_line"),a=t("../../lib");e.exports=function(t,e,r,o,s,l,c,u){var h,f,p,d,g,m,v,y="",x=e.edgepaths.map(function(t,e){return e}),b=!0,_=1e-4*Math.abs(r[0][0]-r[2][0]),w=1e-4*Math.abs(r[0][1]-r[2][1]);function k(t){return Math.abs(t[1]-r[0][1])=0&&(p=C,g=m):Math.abs(f[1]-p[1])=0&&(p=C,g=m):a.log("endpt to newendpt is not vert. or horz.",f,p,C)}if(g>=0)break;y+=S(f,p),f=p}if(g===e.edgepaths.length){a.log("unclosed perimeter path");break}h=g,(b=-1===x.indexOf(h))&&(h=x[0],y+=S(f,p)+"Z",f=null)}for(h=0;h=0;q--)j=M.clipsegments[q],V=i([],j.x,C.c2p),U=i([],j.y,L.c2p),V.reverse(),U.reverse(),G.push(a(V,U,j.bicubic));var W="M"+G.join("L")+"Z";!function(t,e,r,n,o,l){var c,u,h,f,p=s.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);p.enter().append("path"),p.exit().remove();var d=[];for(f=0;fm&&(n.max=m);n.len=n.max-n.min}(this,r,t,n,c,e.height),!(n.len<(e.width+e.height)*f.LABELMIN)))for(var i=Math.min(Math.ceil(n.len/P),f.LABELMAX),a=0;az){C("x scale is not linear");break}}if(m.length&&"fast"===S){var P=(m[m.length-1]-m[0])/(m.length-1),I=Math.abs(P/100);for(b=0;bI){C("y scale is not linear");break}}}var O=c(x),D="scaled"===e.xtype?"":r,R=p(e,D,d,g,O,w),B="scaled"===e.ytype?"":m,F=p(e,B,v,y,x.length,k);T||(a.expand(w,R),a.expand(k,F));var N={x:R,y:F,z:x,text:e._text||e.text};if(D&&D.length===R.length-1&&(N.xCenter=D),B&&B.length===F.length-1&&(N.yCenter=B),A&&(N.xRanges=_.xRanges,N.yRanges=_.yRanges,N.pts=_.pts),M&&"constraint"===e.contours.type||s(e,x,"","z"),M&&e.contours&&"heatmap"===e.contours.coloring){var j={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};N.xfill=p(j,D,d,g,O,w),N.yfill=p(j,B,v,y,x.length,k)}return[N]}},{"../../components/colorscale/calc":566,"../../lib":684,"../../plots/cartesian/axes":732,"../../registry":817,"../histogram2d/calc":957,"./clean_2d_array":927,"./convert_column_xyz":929,"./find_empties":931,"./interp2d":934,"./make_bound_array":935,"./max_row_length":936}],927:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){var r,i,a,o,s,l;function c(t){if(n(t))return+t}if(e){for(r=0,s=0;s=0;o--)(s=((h[[(r=(a=f[o])[0])-1,i=a[1]]]||g)[2]+(h[[r+1,i]]||g)[2]+(h[[r,i-1]]||g)[2]+(h[[r,i+1]]||g)[2])/20)&&(l[a]=[r,i,s],f.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],u.push(l[a])}return u.sort(function(t,e){return e[2]-t[2]})}},{"./max_row_length":936}],932:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../../plots/cartesian/axes");e.exports=function(t,e,r,o,s,l){var c,u,h,f,p=t.cd[0],d=p.trace,g=t.xa,m=t.ya,v=p.x,y=p.y,x=p.z,b=p.xCenter,_=p.yCenter,w=p.zmask,k=[d.zmin,d.zmax],M=d.zhoverformat,A=v,T=y;if(!1!==t.index){try{h=Math.round(t.index[1]),f=Math.round(t.index[0])}catch(e){return void i.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(h<0||h>=x[0].length||f<0||f>x.length)return}else{if(n.inbox(e-v[0],e-v[v.length-1],0)>0||n.inbox(r-y[0],r-y[y.length-1],0)>0)return;if(l){var S;for(A=[2*v[0]-v[1]],S=1;Sg&&(v=Math.max(v,Math.abs(t[a][o]-d)/(m-g))))}return v}e.exports=function(t,e){var r,i=1;for(o(t,e),r=0;r.01;r++)i=o(t,e,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),t}},{"../../lib":684}],935:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,a,o,s){var l,c,u,h=[],f=n.traceIs(t,"contour"),p=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(i(e)&&e.length>1&&!p&&"category"!==s.type){var g=e.length;if(!(g<=o))return f?e.slice(0,o):e.slice(0,o+1);if(f||d)h=e.slice(0,o);else if(1===o)h=[e[0]-.5,e[0]+.5];else{for(h=[1.5*e[0]-.5*e[1]],u=1;u0;)h=_.c2p(A[y]),y--;for(h0;)v=w.c2p(T[y]),y--;if(v image").each(function(t){var e=t.trace||{};a[e.uid]||n.select(this.parentNode).remove()});for(var o=0;o0&&(a=!0);for(var l=0;la){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]c?t>o?t>1.1*i?i:t>1.1*a?a:o:t>s?s:t>l?l:c:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function p(t,e,r,n,a,s){if(n&&t>o){var l=d(e,a,s),c=d(r,a,s),u=t===i?0:1;return l[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function d(t,e,r){var n=e.c2d(t,i,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,a){var s,l,c=-1.1*e,f=-.1*e,p=t-f,d=r[0],g=r[1],m=Math.min(h(d+f,d+p,n,a),h(g+f,g+p,n,a)),v=Math.min(h(d+c,d+f,n,a),h(g+c,g+f,n,a));if(m>v&&vo){var y=s===i?1:6,x=s===i?"M12":"M1";return function(e,r){var o=n.c2d(e,i,a),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var c=n.d2c(o,0,a);if(cu.size/1.9?u.size:u.size/Math.ceil(u.size/x);var A=u.start+(u.size-x)/2;b=A-x*Math.ceil((A-b)/x)}for(s=0;s=0&&w=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(d,x.direction,x.currentbin);var Z=Math.min(h.length,d.length),$=[],J=0,K=Z-1;for(r=0;r=J;r--)if(d[r]){K=r;break}for(r=J;r<=K;r++)if(n(h[r])&&n(d[r])){var Q={p:h[r],s:d[r],b:0};x.enabled||(Q.pts=z[r],H?Q.p0=Q.p1=z[r].length?A[z[r][0]]:h[r]:(Q.p0=U(S[r]),Q.p1=U(S[r+1],!0))),$.push(Q)}return 1===$.length&&($[0].width1=a.tickIncrement($[0].p,M.size,!1,y)-$[0].p),o($,e),i.isArrayOrTypedArray(e.selectedpoints)&&i.tagSelected($,e,Y),$}}},{"../../constants/numerical":661,"../../lib":684,"../../plots/cartesian/axes":732,"../bar/arrays_to_calcdata":826,"./average":945,"./bin_functions":947,"./bin_label_vals":948,"./clean_bins":950,"./norm_functions":955,"fast-isnumeric":214}],950:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").cleanDate,a=t("../../constants/numerical"),o=a.ONEDAY,s=a.BADNUM;e.exports=function(t,e,r){var a=e.type,l=r+"bins",c=t[l];c||(c=t[l]={});var u="date"===a?function(t){return t||0===t?i(t,s,c.calendar):null}:function(t){return n(t)?Number(t):null};c.start=u(c.start),c.end=u(c.end);var h="date"===a?o:1,f=c.size;if(n(f))c.size=f>0?Number(f):h;else if("string"!=typeof f)c.size=h;else{var p=f.charAt(0),d=f.substr(1);((d=n(d)?Number(d):0)<=0||"date"!==a||"M"!==p||d!==Math.round(d))&&(c.size=h)}var g="autobin"+r;"boolean"!=typeof t[g]&&(t[g]=t._fullInput[g]=t._input[g]=!((c.start||0===c.start)&&(c.end||0===c.end))),t[g]||(delete t["nbins"+r],delete t._fullInput["nbins"+r])}},{"../../constants/numerical":661,"../../lib":684,"fast-isnumeric":214}],951:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),s=t("../bar/style_defaults"),l=t("./attributes");e.exports=function(t,e,r,c){function u(r,n){return i.coerce(t,e,l,r,n)}var h=u("x"),f=u("y");u("cumulative.enabled")&&(u("cumulative.direction"),u("cumulative.currentbin")),u("text");var p=u("orientation",f&&!h?"h":"v"),d="v"===p?"x":"y",g="v"===p?"y":"x",m=h&&f?Math.min(h.length&&f.length):(e[d]||[]).length;if(m){e._length=m,n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],c),e[g]&&u("histfunc"),o(t,e,u,[d]),s(t,e,u,r,c);var v=n.getComponentMethod("errorbars","supplyDefaults");v(t,e,a.defaultLine,{axis:"y"}),v(t,e,a.defaultLine,{axis:"x",inherit:"y"}),i.coerceSelectionMarkerOpacity(e,u)}else e.visible=!1}},{"../../components/color":558,"../../lib":684,"../../registry":817,"../bar/style_defaults":839,"./attributes":944,"./bin_defaults":946}],952:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){if(t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),!(r.cumulative||{}).enabled){var a,o=Array.isArray(i)?n[0].pts[i[0]][i[1]]:n[i].pts;if(t.pointNumbers=o,t.binNumber=t.pointNumber,delete t.pointNumber,delete t.pointIndex,r._indexToPoints){a=[];for(var s=0;sA&&m.splice(A,m.length-A),y.length>A&&y.splice(A,y.length-A),u(e,"x",m,g,_,k,x),u(e,"y",y,v,w,M,b);var T=[],S=[],E=[],C="string"==typeof e.xbins.size,L="string"==typeof e.ybins.size,z=[],P=[],I=C?z:e.xbins,O=L?P:e.ybins,D=0,R=[],B=[],F=e.histnorm,N=e.histfunc,j=-1!==F.indexOf("density"),V="max"===N||"min"===N?null:0,U=a.count,q=o[F],H=!1,G=[],W=[],Y="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";Y&&"count"!==N&&(H="avg"===N,U=a[N]);var X=e.xbins,Z=_(X.start),$=_(X.end)+(Z-i.tickIncrement(Z,X.size,!1,x))/1e6;for(r=Z;r<$;r=i.tickIncrement(r,X.size,!1,x))S.push(V),z.push(r),H&&E.push(0);z.push(r);var J=S.length,K=_(e.xbins.start),Q=(r-K)/J,tt=k(K+Q/2);for(Z=w((X=e.ybins).start),$=w(X.end)+(Z-i.tickIncrement(Z,X.size,!1,b))/1e6,r=Z;r<$;r=i.tickIncrement(r,X.size,!1,b)){T.push(S.slice()),P.push(r);var et=new Array(J);for(l=0;l=0&&c=0&&d0)u=a(t.alphahull,h);else{var p=["x","y","z"].indexOf(t.delaunayaxis);u=i(h.map(function(t){return[t[(p+1)%3],t[(p+2)%3]]}))}var d={positions:h,cells:u,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:l(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",d.vertexIntensity=t.intensity,d.vertexIntensityBounds=[t.cmin,t.cmax],d.colormap=s(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolor[0],d.vertexColors=f(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],d.cellColors=f(t.facecolor)):(this.color=t.color,d.meshColor=l(t.color)),this.mesh.update(d)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new u(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}},{"../../lib/gl_format_color":680,"../../lib/str2rgbarray":707,"../../plots/gl3d/zip3":785,"alpha-shape":55,"convex-hull":117,"delaunay-triangulate":149,"gl-mesh3d":268}],968:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}function c(t){var e=t.map(function(t){var e=l(t);return e&&i.isArrayOrTypedArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var u=c(["x","y","z"]),h=c(["i","j","k"]);u?(h&&h.forEach(function(t){for(var e=0;ed):p=_>y,d=_;var w=s(y,x,b,_);w.pos=v,w.yc=(y+_)/2,w.i=m,w.dir=p?"increasing":"decreasing",f&&(w.tx=e.text[m]),g.push(w)}}return a.expand(n,u.concat(c),{padded:!0}),g.length&&(g[0].t={labels:{open:i(t,"open:")+" ",high:i(t,"high:")+" ",low:i(t,"low:")+" ",close:i(t,"close:")+" "}}),g}e.exports={calc:function(t,e){var r=a.getFromId(t,e.xaxis),i=a.getFromId(t,e.yaxis),o=function(t,e,r){var i=r._minDiff;if(!i){var a,o=t._fullData,s=[];for(i=1/0,a=0;a"),t.y0=t.y1=h.c2p(E.yc,!0),[t]}},{"../../components/color":558,"../../components/fx":600,"../../plots/cartesian/axes":732,"../scatter/fill_hover_text":1022}],974:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"ohlc",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc").calc,plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover"),selectPoints:t("./select")}},{"../../plots/cartesian":743,"./attributes":970,"./calc":971,"./defaults":972,"./hover":973,"./plot":976,"./select":977,"./style":978}],975:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i){var a=r("x"),o=r("open"),s=r("high"),l=r("low"),c=r("close");if(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x"],i),o&&s&&l&&c){var u=Math.min(o.length,s.length,l.length,c.length);return a&&(u=Math.min(u,a.length)),e._length=u,u}}},{"../../registry":817}],976:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib");e.exports=function(t,e,r,a){var o=e.xaxis,s=e.yaxis,l=a.selectAll("g.trace").data(r,function(t){return t[0].trace.uid});l.enter().append("g").attr("class","trace ohlc"),l.exit().remove(),l.order(),l.each(function(t){var r=t[0],a=r.t,l=r.trace,c=n.select(this);if(e.isRangePlot||(r.node3=c),!0!==l.visible||a.empty)c.remove();else{var u=a.tickLen,h=c.selectAll("path").data(i.identity);h.enter().append("path"),h.exit().remove(),h.attr("d",function(t){var e=o.c2p(t.pos,!0),r=o.c2p(t.pos-u,!0),n=o.c2p(t.pos+u,!0);return"M"+r+","+s.c2p(t.o,!0)+"H"+e+"M"+e+","+s.c2p(t.h,!0)+"V"+s.c2p(t.l,!0)+"M"+n+","+s.c2p(t.c,!0)+"H"+e})}})}},{"../../lib":684,d3:147}],977:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[],s=n[0].t.bPos||0;if(!1===e)for(r=0;r=0;a--){var o=t[a];if(e>h(n,o))return c(n,i);if(e>o||a===t.length-1)return c(o,n);i=n,n=o}}function d(t,e){for(var r=0;r=e[r][0]&&t<=e[r][1])return!0;return!1}function g(t){t.attr("x",-n.bar.captureWidth/2).attr("width",n.bar.captureWidth)}function m(t){t.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function v(t){if(!t.brush.filterSpecified)return"0,"+t.height;for(var e,r,n,i=y(t.brush.filter.getConsolidated(),t.height),a=[0],o=i.length?i[0][0]:null,s=0;se){f=r;break}}if(a=u,isNaN(a)&&(a=isNaN(h)||isNaN(f)?isNaN(h)?f:h:e-c[h][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(d,e);g&&(o.interval=l[a],o.intervalPix=d,o.region=g)}}if(t.ordinal&&!o.region){var m=t.unitTickvals,v=t.unitToPaddedPx.invert(e);for(r=0;r=x[0]&&v<=x[1]){o.clickableOrdinalRange=x;break}}}return o}function k(t){t.on("mousemove",function(t){if(i.event.preventDefault(),!t.parent.inBrushDrag){var e=w(t,t.height-i.mouse(this)[1]-2*n.verticalPadding),r="crosshair";e.clickableOrdinalRange?r="pointer":e.region&&(r=e.region+"-resize"),i.select(document.body).style("cursor",r)}}).on("mouseleave",function(t){t.parent.inBrushDrag||x()}).call(i.behavior.drag().on("dragstart",function(t){i.event.sourceEvent.stopPropagation();var e=t.height-i.mouse(this)[1]-2*n.verticalPadding,r=t.unitToPaddedPx.invert(e),a=t.brush,o=w(t,e),s=o.interval,l=a.svgBrush;if(l.wasDragged=!1,l.grabbingBar="ns"===o.region,l.grabbingBar){var c=s.map(t.unitToPaddedPx);l.grabPoint=e-c[0]-n.verticalPadding,l.barLength=c[1]-c[0]}l.clickableOrdinalRange=o.clickableOrdinalRange,l.stayingIntervals=t.multiselect&&a.filterSpecified?a.filter.getConsolidated():[],s&&(l.stayingIntervals=l.stayingIntervals.filter(function(t){return t[0]!==s[0]&&t[1]!==s[1]})),l.startExtent=o.region?s["s"===o.region?1:0]:r,t.parent.inBrushDrag=!0,l.brushStartCallback()}).on("drag",function(t){i.event.sourceEvent.stopPropagation();var e=t.height-i.mouse(this)[1]-2*n.verticalPadding,r=t.brush.svgBrush;r.wasDragged=!0,r.grabbingBar?r.newExtent=[e-r.grabPoint,e+r.barLength-r.grabPoint].map(t.unitToPaddedPx.invert):r.newExtent=[r.startExtent,t.unitToPaddedPx.invert(e)].sort(s);var a=Math.max(0,-r.newExtent[0]),o=Math.max(0,r.newExtent[1]-1);r.newExtent[0]+=a,r.newExtent[1]-=o,r.grabbingBar&&(r.newExtent[1]+=a,r.newExtent[0]-=o),t.brush.filterSpecified=!0,r.extent=r.stayingIntervals.concat([r.newExtent]),r.brushCallback(t),_(this.parentNode)}).on("dragend",function(t){i.event.sourceEvent.stopPropagation();var e=t.brush,r=e.filter,n=e.svgBrush,a=n.grabbingBar;if(n.grabbingBar=!1,n.grabLocation=void 0,t.parent.inBrushDrag=!1,x(),!n.wasDragged)return n.wasDragged=void 0,n.clickableOrdinalRange?e.filterSpecified&&t.multiselect?n.extent.push(n.clickableOrdinalRange):(n.extent=[n.clickableOrdinalRange],e.filterSpecified=!0):a?(n.extent=n.stayingIntervals,0===n.extent.length&&A(e)):A(e),n.brushCallback(t),_(this.parentNode),void n.brushEndCallback(e.filterSpecified?r.getConsolidated():[]);var o=function(){r.set(r.getConsolidated())};if(t.ordinal){var s=t.unitTickvals;s[s.length-1]n.newExtent[0];n.extent=n.stayingIntervals.concat(l?[n.newExtent]:[]),n.extent.length||A(e),n.brushCallback(t),l?_(this.parentNode,o):(o(),_(this.parentNode))}else o();n.brushEndCallback(e.filterSpecified?r.getConsolidated():[])}))}function M(t,e){return t[0]-e[0]}function A(t){t.filterSpecified=!1,t.svgBrush.extent=[[0,1]]}function T(t){for(var e,r=t.slice(),n=[],i=r.shift();i;){for(e=i.slice();(i=r.shift())&&i[0]<=e[1];)e[1]=Math.max(e[1],i[1]);n.push(e)}return n}e.exports={makeBrush:function(t,e,r,n,i,a){var o,l=function(){var t,e,r=[];return{set:function(n){r=n.map(function(t){return t.slice().sort(s)}).sort(M),t=T(r),e=r.reduce(function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]},[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=i,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map(function(t){return t.slice()})}(e).slice();e.filter.set(r),o()}),brushEndCallback:a}}},ensureAxisBrush:function(t){var e=t.selectAll("."+n.cn.axisBrush).data(o,a);e.enter().append("g").classed(n.cn.axisBrush,!0),function(t){var e=t.selectAll(".background").data(o);e.enter().append("rect").classed("background",!0).call(g).call(m).style("pointer-events","auto").attr("transform","translate(0 "+n.verticalPadding+")"),e.call(k).attr("height",function(t){return t.height-n.verticalPadding});var r=t.selectAll(".highlight-shadow").data(o);r.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",n.bar.strokeColor).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),r.attr("y1",function(t){return t.height}).call(b);var i=t.selectAll(".highlight").data(o);i.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),i.attr("y1",function(t){return t.height}).call(b)}(e)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map(function(t){return t.sort(s)}),t=e.multiselect?T(t.sort(M)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map(function(t){var e=[f(r,t[0],[]),p(r,t[1],[])];if(e[1]>e[0])return e}).filter(function(t){return t})).length)return}return t.length>1?t:t[0]}}},{"../../lib":684,"../../lib/gup":681,"./constants":983,d3:147}],981:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=i(t.calcdata,"parcoords")[0];e.length&&a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter(function(t,e){return e===r.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus").each(function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})}),window.setTimeout(function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}},{"../../constants/xmlns_namespaces":663,"../../plots/get_data":768,"./plot":989,d3:147}],982:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("../../lib"),o=t("../../lib/gup").wrap;e.exports=function(t,e){var r=!!e.line.colorscale&&a.isArrayOrTypedArray(e.line.color),s=r?e.line.color:function(t){for(var e=new Array(t),r=0;ru&&(n.log("parcoords traces support up to "+u+" dimensions at the moment"),d.splice(u));var g=s(t,e,{name:"dimensions",handleItemDefaults:f}),m=function(t,e,r,o,s){var l=s("line.color",r);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,c,p);o(e,c,p),Array.isArray(g)&&g.length||(e.visible=!1),h(e,g,"values",m);var v={family:c.font.family,size:Math.round(c.font.size/1.2),color:c.font.color};n.coerceFont(p,"labelfont",v),n.coerceFont(p,"tickfont",v),n.coerceFont(p,"rangefont",v)}},{"../../components/colorscale/defaults":568,"../../components/colorscale/has_colorscale":572,"../../lib":684,"../../plots/array_container_defaults":728,"../../plots/domain":757,"./attributes":979,"./axisbrush":980,"./constants":983,"./merge_length":987}],985:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar={container:"line",min:"cmin",max:"cmax"},n.moduleType="trace",n.name="parcoords",n.basePlotModule=t("./base_plot"),n.categories=["gl","regl","noOpacity"],n.meta={},e.exports=n},{"./attributes":979,"./base_plot":981,"./calc":982,"./defaults":984,"./plot":989}],986:[function(t,e,r){"use strict";var n=t("glslify"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\nuniform sampler2D mask;\nuniform float maskHeight;\n\nuniform vec2 colorClamp;\n\nvarying vec4 fragColor;\n\nvec4 unit_1 = vec4(1, 1, 1, 1);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit_1, unit_1);\n}\n\nfloat axisY(\n float x,\n mat4 d[4],\n mat4 dim1A, mat4 dim2A, mat4 dim1B, mat4 dim2B, mat4 dim1C, mat4 dim2C, mat4 dim1D, mat4 dim2D\n ) {\n\n float y1 = val(d[0], dim1A) + val(d[1], dim1B) + val(d[2], dim1C) + val(d[3], dim1D);\n float y2 = val(d[0], dim2A) + val(d[1], dim2B) + val(d[2], dim2C) + val(d[3], dim2D);\n return y1 * (1.0 - x) + y2 * x;\n}\n\nconst int bitsPerByte = 8;\n\nint mod2(int a) {\n return a - 2 * (a / 2);\n}\n\nint mod8(int a) {\n return a - 8 * (a / 8);\n}\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit_0 = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nbool withinBoundingBox(\n mat4 d[4],\n mat4 loA, mat4 hiA, mat4 loB, mat4 hiB, mat4 loC, mat4 hiC, mat4 loD, mat4 hiD\n ) {\n\n return mshow(d[0], loA, hiA) &&\n mshow(d[1], loB, hiB) &&\n mshow(d[2], loC, hiC) &&\n mshow(d[3], loD, hiD);\n}\n\nbool withinRasterMask(mat4 d[4], sampler2D mask, float height) {\n bool result = true;\n int bitInByteStepper;\n float valY, valueY, scaleX;\n int hit, bitmask, valX;\n for(int i = 0; i < 4; i++) {\n for(int j = 0; j < 4; j++) {\n for(int k = 0; k < 4; k++) {\n bitInByteStepper = mod8(j * 4 + k);\n valX = i * 2 + j / 2;\n valY = d[i][j][k];\n valueY = valY * (height - 1.0) + 0.5;\n scaleX = (float(valX) + 0.5) / 8.0;\n hit = int(texture2D(mask, vec2(scaleX, (valueY + 0.5) / height))[3] * 255.0) / int(pow(2.0, float(bitInByteStepper)));\n result = result && mod2(hit) == 1;\n }\n }\n }\n return result;\n}\n\nvec4 position(\n float depth,\n vec2 resolution, vec2 viewBoxPosition, vec2 viewBoxSize,\n mat4 dims[4],\n float signum,\n mat4 dim1A, mat4 dim2A, mat4 dim1B, mat4 dim2B, mat4 dim1C, mat4 dim2C, mat4 dim1D, mat4 dim2D,\n mat4 loA, mat4 hiA, mat4 loB, mat4 hiB, mat4 loC, mat4 hiC, mat4 loD, mat4 hiD,\n sampler2D mask, float maskHeight\n ) {\n\n float x = 0.5 * signum + 0.5;\n float y = axisY(x, dims, dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D);\n\n float show = float(\n withinBoundingBox(dims, loA, hiA, loB, hiB, loC, hiC, loD, hiD)\n && withinRasterMask(dims, mask, maskHeight)\n );\n\n vec2 viewBoxXY = viewBoxPosition + viewBoxSize * vec2(x, y);\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n return vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n}\n\nvoid main() {\n\n float prominence = abs(pf[3]);\n\n mat4 p[4];\n p[0] = mat4(p0, p1, p2, p3);\n p[1] = mat4(p4, p5, p6, p7);\n p[2] = mat4(p8, p9, pa, pb);\n p[3] = mat4(pc, pd, pe, abs(pf));\n\n gl_Position = position(\n 1.0 - prominence,\n resolution, viewBoxPosition, viewBoxSize,\n p,\n sign(pf[3]),\n dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD,\n mask, maskHeight\n );\n\n float clampedColorIndex = clamp((prominence - colorClamp[0]) / (colorClamp[1] - colorClamp[0]), 0.0, 1.0);\n fragColor = texture2D(palette, vec2((clampedColorIndex * 255.0 + 0.5) / 256.0, 0.5));\n}\n"]),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nvarying vec4 fragColor;\n\nvec2 xyProjection = vec2(1, 1);\n\nvec4 unit = vec4(1, 1, 1, 1);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nfloat axisY(\n float x,\n mat4 d[4],\n mat4 dim1A, mat4 dim2A, mat4 dim1B, mat4 dim2B, mat4 dim1C, mat4 dim2C, mat4 dim1D, mat4 dim2D\n ) {\n\n float y1 = val(d[0], dim1A) + val(d[1], dim1B) + val(d[2], dim1C) + val(d[3], dim1D);\n float y2 = val(d[0], dim2A) + val(d[1], dim2B) + val(d[2], dim2C) + val(d[3], dim2D);\n return y1 * (1.0 - x) + y2 * x;\n}\n\nvec4 position(\n float depth,\n vec2 resolution, vec2 viewBoxPosition, vec2 viewBoxSize,\n mat4 dims[4],\n float signum,\n mat4 dim1A, mat4 dim2A, mat4 dim1B, mat4 dim2B, mat4 dim1C, mat4 dim2C, mat4 dim1D, mat4 dim2D\n ) {\n\n float x = 0.5 * signum + 0.5;\n float y = axisY(x, dims, dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D);\n\n vec2 viewBoxXY = viewBoxPosition + viewBoxSize * vec2(x, y);\n\n return vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depth,\n 1.0\n );\n}\n\nvoid main() {\n\n float prominence = abs(pf[3]);\n\n mat4 p[4];\n p[0] = mat4(p0, p1, p2, p3);\n p[1] = mat4(p4, p5, p6, p7);\n p[2] = mat4(p8, p9, pa, pb);\n p[3] = mat4(pc, pd, pe, abs(pf));\n\n gl_Position = position(\n 1.0 - prominence,\n resolution, viewBoxPosition, viewBoxSize,\n p,\n sign(pf[3]),\n dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D\n );\n\n float clampedColorIndex = clamp((prominence - colorClamp[0]) / (colorClamp[1] - colorClamp[0]), 0.0, 1.0);\n fragColor = texture2D(palette, vec2((clampedColorIndex * 255.0 + 0.5) / 256.0, 0.5));\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D mask;\nuniform float maskHeight;\n\nuniform vec2 colorClamp;\n\nvarying vec4 fragColor;\n\nvec4 unit_1 = vec4(1, 1, 1, 1);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit_1, unit_1);\n}\n\nfloat axisY(\n float x,\n mat4 d[4],\n mat4 dim1A, mat4 dim2A, mat4 dim1B, mat4 dim2B, mat4 dim1C, mat4 dim2C, mat4 dim1D, mat4 dim2D\n ) {\n\n float y1 = val(d[0], dim1A) + val(d[1], dim1B) + val(d[2], dim1C) + val(d[3], dim1D);\n float y2 = val(d[0], dim2A) + val(d[1], dim2B) + val(d[2], dim2C) + val(d[3], dim2D);\n return y1 * (1.0 - x) + y2 * x;\n}\n\nconst int bitsPerByte = 8;\n\nint mod2(int a) {\n return a - 2 * (a / 2);\n}\n\nint mod8(int a) {\n return a - 8 * (a / 8);\n}\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit_0 = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nbool withinBoundingBox(\n mat4 d[4],\n mat4 loA, mat4 hiA, mat4 loB, mat4 hiB, mat4 loC, mat4 hiC, mat4 loD, mat4 hiD\n ) {\n\n return mshow(d[0], loA, hiA) &&\n mshow(d[1], loB, hiB) &&\n mshow(d[2], loC, hiC) &&\n mshow(d[3], loD, hiD);\n}\n\nbool withinRasterMask(mat4 d[4], sampler2D mask, float height) {\n bool result = true;\n int bitInByteStepper;\n float valY, valueY, scaleX;\n int hit, bitmask, valX;\n for(int i = 0; i < 4; i++) {\n for(int j = 0; j < 4; j++) {\n for(int k = 0; k < 4; k++) {\n bitInByteStepper = mod8(j * 4 + k);\n valX = i * 2 + j / 2;\n valY = d[i][j][k];\n valueY = valY * (height - 1.0) + 0.5;\n scaleX = (float(valX) + 0.5) / 8.0;\n hit = int(texture2D(mask, vec2(scaleX, (valueY + 0.5) / height))[3] * 255.0) / int(pow(2.0, float(bitInByteStepper)));\n result = result && mod2(hit) == 1;\n }\n }\n }\n return result;\n}\n\nvec4 position(\n float depth,\n vec2 resolution, vec2 viewBoxPosition, vec2 viewBoxSize,\n mat4 dims[4],\n float signum,\n mat4 dim1A, mat4 dim2A, mat4 dim1B, mat4 dim2B, mat4 dim1C, mat4 dim2C, mat4 dim1D, mat4 dim2D,\n mat4 loA, mat4 hiA, mat4 loB, mat4 hiB, mat4 loC, mat4 hiC, mat4 loD, mat4 hiD,\n sampler2D mask, float maskHeight\n ) {\n\n float x = 0.5 * signum + 0.5;\n float y = axisY(x, dims, dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D);\n\n float show = float(\n withinBoundingBox(dims, loA, hiA, loB, hiB, loC, hiC, loD, hiD)\n && withinRasterMask(dims, mask, maskHeight)\n );\n\n vec2 viewBoxXY = viewBoxPosition + viewBoxSize * vec2(x, y);\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n return vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n}\n\nvoid main() {\n\n float prominence = abs(pf[3]);\n\n mat4 p[4];\n p[0] = mat4(p0, p1, p2, p3);\n p[1] = mat4(p4, p5, p6, p7);\n p[2] = mat4(p8, p9, pa, pb);\n p[3] = mat4(pc, pd, pe, abs(pf));\n\n gl_Position = position(\n 1.0 - prominence,\n resolution, viewBoxPosition, viewBoxSize,\n p,\n sign(pf[3]),\n dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD,\n mask, maskHeight\n );\n\n fragColor = vec4(pf.rgb, 1.0);\n}\n"]),s=n(["precision lowp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),l=t("../../lib"),c=1e-6,u=1e-7,h=2048,f=64,p=2,d=4,g=8,m=f/g,v=[119,119,119],y=new Uint8Array(4),x=new Uint8Array(4),b={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function _(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function w(t,e,r,n,i,a){var o=a.key;r.drawCompleted||(!function(t){t.read({x:0,y:0,width:1,height:1,data:y})}(t),r.drawCompleted=!0),function s(l){var c;c=Math.min(n,i-l*n),a.offset=p*l*n,a.count=p*c,0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],_(t,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(e(a),l*n+c>>8*e)%256/255}function A(t,e,r){var n,i,a,o=[];for(i=0;i=f-4?M(o,f-2-s):.5);return a}(d,p,i);!function(t,e,r){for(var n=0;n<16;n++)t["p"+n.toString(16)](A(e,r,n))}(C,d,o),L=S.texture(l.extendFlat({data:k(r.unitToColor,y,Math.round(255*(y?a:1)))},b))}var I=[0,1];var O=[];function D(t,e,n,i,a,o,s,c,u,h,f){var p,d,g,m,v=[t,e],y=[0,1].map(function(){return[0,1,2,3].map(function(){return new Float32Array(16)})});for(p=0;p<2;p++)for(m=v[p],d=0;d<4;d++)for(g=0;g<16;g++)y[p][d][g]=g+16*d===m?1:0;var x=r.lines.canvasOverdrag,b=r.domain,_=r.canvasWidth,w=r.canvasHeight;return l.extendFlat({key:s,resolution:[_,w],viewBoxPosition:[n+x,i],viewBoxSize:[a,o],i:t,ii:e,dim1A:y[0][0],dim1B:y[0][1],dim1C:y[0][2],dim1D:y[0][3],dim2A:y[1][0],dim2B:y[1][1],dim2C:y[1][2],dim2D:y[1][3],colorClamp:I,scissorX:(c===u?0:n+x)+(r.pad.l-x)+r.layoutWidth*b.x[0],scissorWidth:(c===h?_-n+x:a+.5)+(c===u?n+x:0),scissorY:i+r.pad.b+r.layoutHeight*b.y[0],scissorHeight:o,viewportX:r.pad.l-x+r.layoutWidth*b.x[0],viewportY:r.pad.b+r.layoutHeight*b.y[0],viewportWidth:_,viewportHeight:w},f)}return{setColorDomain:function(t){I[0]=t[0],I[1]=t[1]},render:function(t,e,n){var i,a,o,s=t.length,l=1/0,c=-1/0;for(i=0;ic&&(c=t[i].dim2.canvasX,o=i),t[i].dim1.canvasXn._length&&(T=T.slice(0,n._length));var S,E=n.tickvals;function C(t,e){return{val:t,text:S[e]}}function L(t,e){return t.val-e.val}if(Array.isArray(E)&&E.length){S=n.ticktext,Array.isArray(S)&&S.length?S.length>E.length?S=S.slice(0,E.length):E.length>S.length&&(E=E.slice(0,S.length)):S=E.map(o.format(n.tickformat));for(var z=1;z=r||s>=n)return;var l=t.lineLayer.readPixel(a,n-1-s),c=0!==l[3],u=c?l[2]+256*(l[1]+256*l[0]):null,h={x:a,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:u};u!==T&&(c?m.hover(h):m.unhover&&m.unhover(h),T=u)}}),A.style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var S=e.selectAll("."+i.cn.parcoords).data(M,c);S.exit().remove(),S.enter().append("g").classed(i.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),S.attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var E=S.selectAll("."+i.cn.parcoordsControlView).data(u,c);E.enter().append("g").classed(i.cn.parcoordsControlView,!0),E.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var C=E.selectAll("."+i.cn.yAxis).data(function(t){return t.dimensions},c);function L(t,e){for(var r=e.panels||(e.panels=[]),n=t.data(),i=n.length-1,a=0;aline").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),P.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var I=z.selectAll("."+i.cn.axisHeading).data(u,c);I.enter().append("g").classed(i.cn.axisHeading,!0);var O=I.selectAll("."+i.cn.axisTitle).data(u,c);O.enter().append("text").classed(i.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),O.attr("transform","translate(0,"+-i.axisTitleOffset+")").text(function(t){return t.label}).each(function(t){s.font(o.select(this),t.model.labelFont)});var D=z.selectAll("."+i.cn.axisExtent).data(u,c);D.enter().append("g").classed(i.cn.axisExtent,!0);var R=D.selectAll("."+i.cn.axisExtentTop).data(u,c);R.enter().append("g").classed(i.cn.axisExtentTop,!0),R.attr("transform","translate(0,"+-i.axisExtentOffset+")");var B=R.selectAll("."+i.cn.axisExtentTopText).data(u,c);function F(t,e){if(t.ordinal)return"";var r=t.domainScale.domain();return o.format(t.tickFormat)(r[e?r.length-1:0])}B.enter().append("text").classed(i.cn.axisExtentTopText,!0).call(b),B.text(function(t){return F(t,!0)}).each(function(t){s.font(o.select(this),t.model.rangeFont)});var N=D.selectAll("."+i.cn.axisExtentBottom).data(u,c);N.enter().append("g").classed(i.cn.axisExtentBottom,!0),N.attr("transform",function(t){return"translate(0,"+(t.model.height+i.axisExtentOffset)+")"});var j=N.selectAll("."+i.cn.axisExtentBottomText).data(u,c);j.enter().append("text").classed(i.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(b),j.text(function(t){return F(t)}).each(function(t){s.font(o.select(this),t.model.rangeFont)}),f.ensureAxisBrush(z)}},{"../../components/drawing":583,"../../lib":684,"../../lib/gup":681,"./axisbrush":980,"./constants":983,"./lines":986,d3:147}],989:[function(t,e,r){"use strict";var n=t("./parcoords"),i=t("../../lib/prepare_regl");e.exports=function(t,e){var r=t._fullLayout,a=r._toppaper,o=r._paperdiv,s=r._glcontainer;if(i(t)){var l={},c={},u=r._size;e.forEach(function(e,r){l[r]=t.data[r].dimensions,c[r]=t.data[r].dimensions.slice()});n(o,a,s,e,{width:u.w,height:u.h,margin:{t:u.t,r:u.r,b:u.b,l:u.l}},{filterChanged:function(e,r,n){var i=c[e][r],a=n.map(function(t){return t.slice()});a.length?(1===a.length&&(a=a[0]),i.constraintrange=a,a=[a]):(delete i.constraintrange,a=null);var o={};o["dimensions["+r+"].constraintrange"]=a,t.emit("plotly_restyle",[o,[e]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){function n(t){return!("visible"in t)||t.visible}function i(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}var a=function(t){return function(e,n){return i(r,t,e)-i(r,t,n)}}(c[e].filter(n));l[e].sort(a),c[e].filter(function(t){return!n(t)}).sort(function(t){return c[e].indexOf(t)}).forEach(function(t){l[e].splice(l[e].indexOf(t),1),l[e].splice(c[e].indexOf(t),0,t)}),t.emit("plotly_restyle")}})}}},{"../../lib/prepare_regl":697,"./parcoords":988}],990:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),i=t("../../plots/font_attributes"),a=t("../../plots/attributes"),o=t("../../plots/domain").attributes,s=t("../../lib/extend").extendFlat,l=i({editType:"calc",colorEditType:"style"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:s({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:s({},l,{}),insidetextfont:s({},l,{}),outsidetextfont:s({},l,{}),domain:o({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}},{"../../components/color/attributes":557,"../../lib/extend":673,"../../plots/attributes":729,"../../plots/domain":757,"../../plots/font_attributes":758}],991:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/get_data").getModuleCalcData;r.name="pie",r.plot=function(t){var e=n.getModule("pie"),r=i(t.calcdata,e)[0];r.length&&e.plot(t,r)},r.clean=function(t,e,r,n){var i=n._has&&n._has("pie"),a=e._has&&e._has("pie");i&&!a&&n._pielayer.selectAll("g.trace").remove()}},{"../../plots/get_data":768,"../../registry":817}],992:[function(t,e,r){"use strict";var n,i=t("fast-isnumeric"),a=t("../../lib").isArrayOrTypedArray,o=t("tinycolor2"),s=t("../../components/color"),l=t("./helpers");function c(t,e){if(!n){var r=s.defaults;n=u(r)}var i=e||n;return i[t%i.length]}function u(t){var e,r=t.slice();for(e=0;e")}}return y}},{"../../components/color":558,"../../lib":684,"./helpers":995,"fast-isnumeric":214,tinycolor2:499}],993:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults;e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}var l,c=n.coerceFont,u=s("values"),h=n.isArrayOrTypedArray(u),f=s("labels");if(Array.isArray(f)?(l=f.length,h&&(l=Math.min(l,u.length))):h&&(l=u.length,s("label0"),s("dlabel")),l){e._length=l,s("marker.line.width")&&s("marker.line.color"),s("marker.colors"),s("scalegroup");var p=s("text"),d=s("textinfo",Array.isArray(p)?"text+percent":"percent");if(s("hovertext"),d&&"none"!==d){var g=s("textposition"),m=Array.isArray(g)||"auto"===g,v=m||"inside"===g,y=m||"outside"===g;if(v||y){var x=c(s,"textfont",o.font);v&&c(s,"insidetextfont",x),y&&c(s,"outsidetextfont",x)}}a(e,o,s),s("hole"),s("sort"),s("direction"),s("rotation"),s("pull")}else e.visible=!1}},{"../../lib":684,"../../plots/domain":757,"./attributes":990}],994:[function(t,e,r){"use strict";var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),r}},{"../../components/fx/helpers":597}],995:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}e.exports=function(t,e){var r=t._fullLayout;!function(t,e){var r,n,i,a,o,s,l,c,u,h=[];for(i=0;il&&(l=s.pull[a]);o.r=Math.min(r,n)/(2+2*l),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&-1===h.indexOf(s.scalegroup)&&h.push(s.scalegroup)}for(a=0;ai.vTotal/2?1:0)}(e),p.each(function(){var p=n.select(this).selectAll("g.slice").data(e);p.enter().append("g").classed("slice",!0),p.exit().remove();var m=[[[],[]],[[],[]]],v=!1;p.each(function(e){if(e.hidden)n.select(this).selectAll("path,g").remove();else{e.pointNumber=e.i,e.curveNumber=g.index,m[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var a=d.cx,p=d.cy,y=n.select(this),x=y.selectAll("path.surface").data([e]),b=!1,_=!1;if(x.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),y.select("path.textline").remove(),y.on("mouseover",function(){var o=t._fullLayout,s=t._fullData[g.index];if(!t._dragging&&!1!==o.hovermode){var l=s.hoverinfo;if(Array.isArray(l)&&(l=i.castHoverinfo({hoverinfo:[c.castOption(l,e.pts)],_module:g._module},o,0)),"all"===l&&(l="label+text+value+percent+name"),"none"!==l&&"skip"!==l&&l){var f=h(e,d),m=a+e.pxmid[0]*(1-f),v=p+e.pxmid[1]*(1-f),y=r.separators,x=[];if(-1!==l.indexOf("label")&&x.push(e.label),-1!==l.indexOf("text")){var w=c.castOption(s.hovertext||s.text,e.pts);w&&x.push(w)}-1!==l.indexOf("value")&&x.push(c.formatPieValue(e.v,y)),-1!==l.indexOf("percent")&&x.push(c.formatPiePercent(e.v/d.vTotal,y));var k=g.hoverlabel,M=k.font;i.loneHover({x0:m-f*d.r,x1:m+f*d.r,y:v,text:x.join("
"),name:-1!==l.indexOf("name")?s.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:c.castOption(k.bgcolor,e.pts)||e.color,borderColor:c.castOption(k.bordercolor,e.pts),fontFamily:c.castOption(M.family,e.pts),fontSize:c.castOption(M.size,e.pts),fontColor:c.castOption(M.color,e.pts)},{container:o._hoverlayer.node(),outerContainer:o._paper.node(),gd:t}),b=!0}t.emit("plotly_hover",{points:[u(e,s)],event:n.event}),_=!0}}).on("mouseout",function(r){var a=t._fullLayout,o=t._fullData[g.index];_&&(r.originalEvent=n.event,t.emit("plotly_unhover",{points:[u(e,o)],event:n.event}),_=!1),b&&(i.loneUnhover(a._hoverlayer.node()),b=!1)}).on("click",function(){var r=t._fullLayout,a=t._fullData[g.index];t._dragging||!1===r.hovermode||(t._hoverdata=[u(e,a)],i.click(t,n.event))}),g.pull){var w=+c.castOption(g.pull,e.pts)||0;w>0&&(a+=w*e.pxmid[0],p+=w*e.pxmid[1])}e.cxFinal=a,e.cyFinal=p;var k=g.hole;if(e.v===d.vTotal){var M="M"+(a+e.px0[0])+","+(p+e.px0[1])+C(e.px0,e.pxmid,!0,1)+C(e.pxmid,e.px0,!0,1)+"Z";k?x.attr("d","M"+(a+k*e.px0[0])+","+(p+k*e.px0[1])+C(e.px0,e.pxmid,!1,k)+C(e.pxmid,e.px0,!1,k)+"Z"+M):x.attr("d",M)}else{var A=C(e.px0,e.px1,!0,1);if(k){var T=1-k;x.attr("d","M"+(a+k*e.px1[0])+","+(p+k*e.px1[1])+C(e.px1,e.px0,!1,k)+"l"+T*e.px0[0]+","+T*e.px0[1]+A+"Z")}else x.attr("d","M"+a+","+p+"l"+e.px0[0]+","+e.px0[1]+A+"Z")}var S=c.castOption(g.textposition,e.pts),E=y.selectAll("g.slicetext").data(e.text&&"none"!==S?[0]:[]);E.enter().append("g").classed("slicetext",!0),E.exit().remove(),E.each(function(){var r=s.ensureSingle(n.select(this),"text","",function(t){t.attr("data-notex",1)});r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(o.font,"outside"===S?g.outsidetextfont:g.insidetextfont).call(l.convertToTspans,t);var i,c=o.bBox(r.node());"outside"===S?i=f(c,e):(i=function(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),i=t.width/t.height,a=Math.PI*Math.min(e.v/r.vTotal,.5),o=1-r.trace.hole,s=h(e,r),l={scale:s*r.r*2/n,rCenter:1-s,rotate:0};if(l.scale>=1)return l;var c=i+1/(2*Math.tan(a)),u=r.r*Math.min(1/(Math.sqrt(c*c+.5)+c),o/(Math.sqrt(i*i+o/2)+i)),f={scale:2*u/t.height,rCenter:Math.cos(u/r.r)-u*i/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},p=1/i,d=p+1/(2*Math.tan(a)),g=r.r*Math.min(1/(Math.sqrt(d*d+.5)+d),o/(Math.sqrt(p*p+o/2)+p)),m={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/i/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=m.scale>f.scale?m:f;return l.scale<1&&v.scale>l.scale?v:l}(c,e,d),"auto"===S&&i.scale<1&&(r.call(o.font,g.outsidetextfont),g.outsidetextfont.family===g.insidetextfont.family&&g.outsidetextfont.size===g.insidetextfont.size||(c=o.bBox(r.node())),i=f(c,e)));var u=a+e.pxmid[0]*i.rCenter+(i.x||0),m=p+e.pxmid[1]*i.rCenter+(i.y||0);i.outside&&(e.yLabelMin=m-c.height/2,e.yLabelMid=m,e.yLabelMax=m+c.height/2,e.labelExtraX=0,e.labelExtraY=0,v=!0),r.attr("transform","translate("+u+","+m+")"+(i.scale<1?"scale("+i.scale+")":"")+(i.rotate?"rotate("+i.rotate+")":"")+"translate("+-(c.left+c.right)/2+","+-(c.top+c.bottom)/2+")")})}function C(t,r,n,i){return"a"+i*d.r+","+i*d.r+" 0 "+e.largeArc+(n?" 1 ":" 0 ")+i*(r[0]-t[0])+","+i*(r[1]-t[1])}}),v&&function(t,e){var r,n,i,a,o,s,l,u,h,f,p,d,g;function m(t,e){return t.pxmid[1]-e.pxmid[1]}function v(t,e){return e.pxmid[1]-t.pxmid[1]}function y(t,r){r||(r={});var i,u,h,p,d,g,m=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),v=n?t.yLabelMin:t.yLabelMax,y=n?t.yLabelMax:t.yLabelMin,x=t.cyFinal+o(t.px0[1],t.px1[1]),b=m-v;if(b*l>0&&(t.labelExtraY=b),Array.isArray(e.pull))for(u=0;u=(c.castOption(e.pull,h.pts)||0)||((t.pxmid[1]-h.pxmid[1])*l>0?(p=h.cyFinal+o(h.px0[1],h.px1[1]),(b=p-v-t.labelExtraY)*l>0&&(t.labelExtraY+=b)):(y+t.labelExtraY-x)*l>0&&(i=3*s*Math.abs(u-f.indexOf(t)),d=h.cxFinal+a(h.px0[0],h.px1[0]),(g=d+i-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*s>0&&(t.labelExtraX+=g)))}for(n=0;n<2;n++)for(i=n?m:v,o=n?Math.max:Math.min,l=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,s=r?1:-1,(u=t[n][r]).sort(i),h=t[1-n][r],f=h.concat(u),d=[],p=0;pMath.abs(c)?o+="l"+c*t.pxmid[0]/t.pxmid[1]+","+c+"H"+(i+t.labelExtraX+s):o+="l"+t.labelExtraX+","+l+"v"+(c-l)+"h"+s}else o+="V"+(t.yLabelMid+t.labelExtraY)+"h"+s;e.append("path").classed("textline",!0).call(a.stroke,g.outsidetextfont.color).attr({"stroke-width":Math.min(2,g.outsidetextfont.size/8),d:o,fill:"none"})}})})}),setTimeout(function(){p.selectAll("tspan").each(function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":558,"../../components/drawing":583,"../../components/fx":600,"../../lib":684,"../../lib/svg_text_utils":708,"./event_data":994,"./helpers":995,d3:147}],1000:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each(function(t){n.select(this).call(i,t,e)})})}},{"./style_one":1001,d3:147}],1001:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style({"stroke-width":s}).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":558,"./helpers":995}],1002:[function(t,e,r){"use strict";var n=t("../scatter/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"}}},{"../scatter/attributes":1015}],1003:[function(t,e,r){"use strict";var n=t("gl-pointcloud2d"),i=t("../../lib/str2rgbarray"),a=t("../../plots/cartesian/autorange").expand,o=t("../scatter/get_trace_color");function s(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=n(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var l=s.prototype;l.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},l.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=o(t,{})},l.updateFast=function(t){var e,r,n,a,o,s,l=this.xData=this.pickXData=t.x,c=this.yData=this.pickYData=t.y,u=this.pickXYData=t.xy,h=t.xbounds&&t.ybounds,f=t.indices,p=this.bounds;if(u){if(n=u,e=u.length>>>1,h)p[0]=t.xbounds[0],p[2]=t.xbounds[1],p[1]=t.ybounds[0],p[3]=t.ybounds[1];else for(s=0;sp[2]&&(p[2]=a),op[3]&&(p[3]=o);if(f)r=f;else for(r=new Int32Array(e),s=0;sp[2]&&(p[2]=a),op[3]&&(p[3]=o);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var d=i(t.marker.color),g=i(t.marker.border.color),m=t.opacity*t.marker.opacity;d[3]*=m,this.pointcloudOptions.color=d;var v=t.marker.blend;if(null===v){v=l.length<100||c.length<100}this.pointcloudOptions.blend=v,g[3]*=m,this.pointcloudOptions.borderColor=g;var y=t.marker.sizemin,x=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=y,this.pointcloudOptions.sizeMax=x,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions),this.expandAxesFast(p,x/2)},l.expandAxesFast=function(t,e){var r=e||.5;a(this.scene.xaxis,[t[0],t[2]],{ppad:r}),a(this.scene.yaxis,[t[1],t[3]],{ppad:r})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":707,"../../plots/cartesian/autorange":731,"../scatter/get_trace_color":1024,"gl-pointcloud2d":279}],1004:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio"),e._length=null}},{"../../lib":684,"./attributes":1002}],1005:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="pointcloud",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl","gl2d","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":771,"../scatter3d/calc":1041,"./attributes":1002,"./convert":1003,"./defaults":1004}],1006:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../plots/domain").attributes,l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;e.exports=c({hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),node:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20}},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]}}},"calc","nested")},{"../../components/color/attributes":557,"../../components/fx/attributes":592,"../../lib/extend":673,"../../plot_api/edit_types":715,"../../plots/attributes":729,"../../plots/domain":757,"../../plots/font_attributes":758}],1007:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../components/fx/layout_attributes");r.name="sankey",r.baseLayoutAttrOverrides=n({hoverlabel:o.hoverlabel},"plot","nested"),r.plot=function(t){var e=i(t.calcdata,"sankey")[0];a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("sankey"),a=e._has&&e._has("sankey");i&&!a&&n._paperdiv.selectAll(".sankey").remove()}},{"../../components/fx/layout_attributes":601,"../../plot_api/edit_types":715,"../../plots/get_data":768,"./plot":1012}],1008:[function(t,e,r){"use strict";var n=t("strongly-connected-components"),i=t("../../lib"),a=t("../../lib/gup").wrap;e.exports=function(t,e){return function(t,e,r){for(var a=t.length,o=i.init2dArray(a,0),s=0;s1})}(e.node.label,e.link.source,e.link.target)&&(i.error("Circularity is present in the Sankey data. Removing all nodes and links."),e.link.label=[],e.link.source=[],e.link.target=[],e.link.value=[],e.link.color=[],e.node.label=[],e.node.color=[]),a({link:e.link,node:e.node})}},{"../../lib":684,"../../lib/gup":681,"strongly-connected-components":491}],1009:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"cubic-in-out",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}],1010:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("tinycolor2"),s=t("../../plots/domain").defaults;e.exports=function(t,e,r,l){function c(r,a){return n.coerce(t,e,i,r,a)}c("node.label"),c("node.pad"),c("node.thickness"),c("node.line.color"),c("node.line.width");var u=l.colorway;c("node.color",e.node.label.map(function(t,e){return a.addOpacity(function(t){return u[t%u.length]}(e),.8)})),c("link.label"),c("link.source"),c("link.target"),c("link.value"),c("link.line.color"),c("link.line.width"),c("link.color",e.link.value.map(function(){return o(l.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)"})),s(e,l,c),c("orientation"),c("valueformat"),c("valuesuffix"),c("arrangement"),n.coerceFont(c,"textfont",n.extendFlat({},l.font)),e._length=null}},{"../../components/color":558,"../../lib":684,"../../plots/domain":757,"./attributes":1006,tinycolor2:499}],1011:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.moduleType="trace",n.name="sankey",n.basePlotModule=t("./base_plot"),n.categories=["noOpacity"],n.meta={},e.exports=n},{"./attributes":1006,"./base_plot":1007,"./calc":1008,"./defaults":1010,"./plot":1012}],1012:[function(t,e,r){"use strict";var n=t("d3"),i=t("./render"),a=t("../../components/fx"),o=t("../../components/color"),s=t("../../lib"),l=t("./constants").cn,c=s._;function u(t){return""!==t}function h(t,e){return t.filter(function(t){return t.key===e.traceId})}function f(t,e){n.select(t).select("path").style("fill-opacity",e),n.select(t).select("rect").style("fill-opacity",e)}function p(t){n.select(t).select("text.name").style("fill","black")}function d(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function g(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function m(t,e,r){e&&r&&h(r,e).selectAll("."+l.sankeyLink).filter(d(e)).call(y.bind(0,e,r,!1))}function v(t,e,r){e&&r&&h(r,e).selectAll("."+l.sankeyLink).filter(d(e)).call(x.bind(0,e,r,!1))}function y(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",.4),i&&h(e,t).selectAll("."+l.sankeyLink).filter(function(t){return t.link.label===i}).style("fill-opacity",.4),r&&h(e,t).selectAll("."+l.sankeyNode).filter(g(t)).call(m)}function x(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",function(t){return t.tinyColorAlpha}),i&&h(e,t).selectAll("."+l.sankeyLink).filter(function(t){return t.link.label===i}).style("fill-opacity",function(t){return t.tinyColorAlpha}),r&&h(e,t).selectAll(l.sankeyNode).filter(g(t)).call(v)}function b(t,e){var r=t.hoverlabel||{},n=s.nestedProperty(r,e).get();return!Array.isArray(n)&&n}e.exports=function(t,e){var r=t._fullLayout,s=r._paper,h=r._size,d=c(t,"source:")+" ",g=c(t,"target:")+" ",_=c(t,"incoming flow count:")+" ",w=c(t,"outgoing flow count:")+" ";i(s,e,{width:h.w,height:h.h,margin:{t:h.t,r:h.r,b:h.b,l:h.l}},{linkEvents:{hover:function(e,r,i){n.select(e).call(y.bind(0,r,i,!0)),t.emit("plotly_hover",{event:n.event,points:[r.link]})},follow:function(e,i){var s=i.link.trace,l=t._fullLayout._paperdiv.node().getBoundingClientRect(),c=e.getBoundingClientRect(),h=c.left+c.width/2,m=c.top+c.height/2,v=a.loneHover({x:h-l.left,y:m-l.top,name:n.format(i.valueFormat)(i.link.value)+i.valueSuffix,text:[i.link.label||"",d+i.link.source.label,g+i.link.target.label].filter(u).join("
"),color:b(s,"bgcolor")||o.addOpacity(i.tinyColorHue,1),borderColor:b(s,"bordercolor"),fontFamily:b(s,"font.family"),fontSize:b(s,"font.size"),fontColor:b(s,"font.color"),idealAlign:n.event.x"),color:b(o,"bgcolor")||i.tinyColorHue,borderColor:b(o,"bordercolor"),fontFamily:b(o,"font.family"),fontSize:b(o,"font.size"),fontColor:b(o,"font.color"),idealAlign:"left"},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});f(v,.85),p(v)},unhover:function(e,i,o){n.select(e).call(v,i,o),t.emit("plotly_unhover",{event:n.event,points:[i.node]}),a.loneUnhover(r._hoverlayer.node())},select:function(e,r,i){var o=r.node;o.originalEvent=n.event,t._hoverdata=[o],n.select(e).call(v,r,i),a.click(t,{target:!0})}}})}},{"../../components/color":558,"../../components/fx":600,"../../lib":684,"./constants":1009,"./render":1013,d3:147}],1013:[function(t,e,r){"use strict";var n=t("./constants"),i=t("d3"),a=t("tinycolor2"),o=t("../../components/color"),s=t("../../components/drawing"),l=t("@plotly/d3-sankey").sankey,c=t("d3-force"),u=t("../../lib"),h=u.isArrayOrTypedArray,f=u.isIndex,p=t("../../lib/gup"),d=p.keyFun,g=p.repeat,m=p.unwrap;function v(t){t.lastDraggedX=t.x,t.lastDraggedY=t.y}function y(t){return function(e){return e.node.originalX===t.node.originalX}}function x(t){for(var e=0;e1||t.linkLineWidth>0}function T(t){return"translate("+t.translateX+","+t.translateY+")"+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function S(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function E(t){return i.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+n.nodeTextOffsetHorizontal:n.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-n.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-n.nodeTextOffsetHorizontal,0]])}function C(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function L(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function z(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function P(t){return t.horizontal&&t.left?"100%":"0%"}function I(t,e,r){t.on(".basic",null).on("mouseover.basic",function(t){t.interactionState.dragInProgress||(r.hover(this,t,e),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){t.interactionState.dragInProgress||(r.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){t.interactionState.dragInProgress||(r.unhover(this,t,e),t.interactionState.hovered=!1)}).on("click.basic",function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||r.select(this,t,e)})}function O(t,e,r){var a=i.behavior.drag().origin(function(t){return t.node}).on("dragstart",function(i){if("fixed"!==i.arrangement&&(u.raiseToTop(this),i.interactionState.dragInProgress=i.node,v(i.node),i.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,i.interactionState.hovered),i.interactionState.hovered=!1),"snap"===i.arrangement)){var a=i.traceId+"|"+Math.floor(i.node.originalX);i.forceLayouts[a]?i.forceLayouts[a].alpha(1):function(t,e,r){var i=r.sankey.nodes().filter(function(t){return t.originalX===r.node.originalX});r.forceLayouts[e]=c.forceSimulation(i).alphaDecay(0).force("collide",c.forceCollide().radius(function(t){return t.dy/2+r.nodePad/2}).strength(1).iterations(n.forceIterations)).force("constrain",function(t,e,r,i){return function(){for(var t=0,a=0;a0&&i.forceLayouts[e].alpha(0)}}(0,e,i,r)).stop()}(0,a,i),function(t,e,r,i){window.requestAnimationFrame(function a(){for(var o=0;o0&&window.requestAnimationFrame(a)})}(t,e,i,a)}}).on("drag",function(r){if("fixed"!==r.arrangement){var n=i.event.x,a=i.event.y;"snap"===r.arrangement?(r.node.x=n,r.node.y=a):("freeform"===r.arrangement&&(r.node.x=n),r.node.y=Math.max(r.node.dy/2,Math.min(r.size-r.node.dy/2,a))),v(r.node),"snap"!==r.arrangement&&(r.sankey.relayout(),k(t.filter(y(r)),e))}}).on("dragend",function(t){t.interactionState.dragInProgress=!1});t.on(".drag",null).call(a)}e.exports=function(t,e,r,i){var c=t.selectAll("."+n.cn.sankey).data(e.filter(function(t){return m(t).trace.visible}).map(function(t,e,r){var i,a=m(e).trace,o=a.domain,s=a.node,c=a.link,u=a.arrangement,p="h"===a.orientation,d=a.node.pad,g=a.node.thickness,v=a.node.line.color,y=a.node.line.width,b=a.link.line.color,_=a.link.line.width,w=a.valueformat,k=a.valuesuffix,M=a.textfont,A=t.width*(o.x[1]-o.x[0]),T=t.height*(o.y[1]-o.y[0]),S=[],E=h(c.color),C={},L=s.label.length;for(i=0;i0&&f(P,L)&&f(I,L)&&(I=+I,C[P=+P]=C[I]=!0,S.push({pointNumber:i,label:c.label[i],color:E?c.color[i]:c.color,source:P,target:I,value:+z}))}var O=h(s.color),D=[],R=!1,B={};for(i=0;i5?t.node.label:""}).attr("text-anchor",function(t){return t.horizontal&&t.left?"end":"start"}),F.transition().ease(n.ease).duration(n.duration).attr("startOffset",P).style("fill",z)}},{"../../components/color":558,"../../components/drawing":583,"../../lib":684,"../../lib/gup":681,"./constants":1009,"@plotly/d3-sankey":49,d3:147,"d3-force":143,tinycolor2:499}],1014:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],1019:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":566,"../../components/colorscale/has_colorscale":572,"./subtypes":1037}],1020:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],1021:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),c=t("./marker_defaults"),u=t("./line_defaults"),h=t("./line_shape_defaults"),f=t("./text_defaults"),p=t("./fillcolor_defaults");e.exports=function(t,e,r,d){function g(r,i){return n.coerce(t,e,a,r,i)}var m=l(t,e,d,g),v=mV!=(I=E[T][1])>=V&&(L=E[T-1][0],z=E[T][0],I-P&&(C=L+(z-L)*(V-P)/(I-P),B=Math.min(B,C),F=Math.max(F,C)));B=Math.max(B,0),F=Math.min(F,f._length);var U=s.defaultLine;return s.opacity(h.fillcolor)?U=h.fillcolor:s.opacity((h.line||{}).color)&&(U=h.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:B,x1:F,y0:V,y1:V,color:U}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":558,"../../components/fx":600,"../../lib":684,"../../registry":817,"./fill_hover_text":1022,"./get_trace_color":1024}],1026:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc").calc,n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./marker_colorbar"),n.style=t("./style").style,n.styleOnSelect=t("./style").styleOnSelect,n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.animatable=!0,n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],n.meta={},e.exports=n},{"../../plots/cartesian":743,"./arrays_to_calcdata":1014,"./attributes":1015,"./calc":1016,"./clean_data":1018,"./defaults":1021,"./hover":1025,"./marker_colorbar":1032,"./plot":1034,"./select":1035,"./style":1036,"./subtypes":1037}],1027:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var c=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(c)&&c||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":568,"../../components/colorscale/has_colorscale":572,"../../lib":684}],1028:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,i=t("../../lib"),a=i.segmentsIntersect,o=i.constrain,s=t("./constants");e.exports=function(t,e){var r,l,c,u,h,f,p,d,g,m,v,y,x,b,_,w,k,M,A=e.xaxis,T=e.yaxis,S=e.connectGaps,E=e.baseTolerance,C=e.shape,L="linear"===C,z=[],P=s.minTolerance,I=new Array(t.length),O=0;function D(e){var r=t[e];if(!r)return!1;var i=A.c2p(r.x),a=T.c2p(r.y);return i===n||a===n?r.intoCenter||!1:[i,a]}function R(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,c=i*o+a*s;if(c>0&&cX||t[1]$)return[o(t[0],Y,X),o(t[1],Z,$)]}function Q(t,e){return t[0]===e[0]&&(t[0]===Y||t[0]===X)||(t[1]===e[1]&&(t[1]===Z||t[1]===$)||void 0)}function tt(t,e,r){return function(n,a){var o=K(n),s=K(a),l=[];if(o&&s&&Q(o,s))return l;o&&l.push(o),s&&l.push(s);var c=2*i.constrain((n[t]+a[t])/2,e,r)-((o||n)[t]+(s||a)[t]);c&&((o&&s?c>0==o[t]>s[t]?o:s:o||s)[t]+=c);return l}}function et(t){var e=t[0],r=t[1],n=e===I[O-1][0],i=r===I[O-1][1];if(!n||!i)if(O>1){var a=e===I[O-2][0],o=r===I[O-2][1];n&&(e===Y||e===X)&&a?o?O--:I[O-1]=t:i&&(r===Z||r===$)&&o?a?O--:I[O-1]=t:I[O++]=t}else I[O++]=t}function rt(t){I[O-1][0]!==t[0]&&I[O-1][1]!==t[1]&&et([V,U]),et(t),q=null,V=U=0}function nt(t){if(k=t[0]/A._length,M=t[1]/T._length,N=t[0]X?X:0,j=t[1]$?$:0,N||j){if(O)if(q){var e=G(q,t);e.length>1&&(rt(e[0]),I[O++]=e[1])}else H=G(I[O-1],t)[0],I[O++]=H;else I[O++]=[N||t[0],j||t[1]];var r=I[O-1];N&&j&&(r[0]!==N||r[1]!==j)?(q&&(V!==N&&U!==j?et(V&&U?(n=q,a=(i=t)[0]-n[0],o=(i[1]-n[1])/a,(n[1]*i[0]-i[1]*n[0])/a>0?[o>0?Y:X,$]:[o>0?X:Y,Z]):[V||N,U||j]):V&&U&&et([V,U])),et([N,j])):V-N&&U-j&&et([N||V,j||U]),q=t,V=N,U=j}else q&&rt(G(q,t)[0]),I[O++]=t;var n,i,a,o}for("linear"===C||"spline"===C?G=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var o=J[i],s=a(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);s&&(!n||Math.abs(s.x-r[0][0])>1||Math.abs(s.y-r[0][1])>1)&&(s=[s.x,s.y],n&&F(s,t)B(f,it))break;c=f,(x=g[0]*d[0]+g[1]*d[1])>v?(v=x,u=f,p=!1):x=t.length||!f)break;nt(f),l=f}}else nt(u)}q&&et([V||q[0],U||q[1]]),z.push(I.slice(0,O))}return z}},{"../../constants/numerical":661,"../../lib":684,"./constants":1020}],1029:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1030:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n,i,a=null;for(i=0;i0?Math.max(e,i):0}}},{"fast-isnumeric":214}],1032:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],1033:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),h=(t.line||{}).color;(c=c||{},h&&(r=h),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",h&&!Array.isArray(h)&&e.marker.color!==h?h:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":558,"../../components/colorscale/defaults":568,"../../components/colorscale/has_colorscale":572,"./subtypes":1037}],1034:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../lib"),o=t("../../components/drawing"),s=t("./subtypes"),l=t("./line_points"),c=t("./link_traces"),u=t("../../lib/polygon").tester;function h(t,e,r,c,h,f,p){var d,g;!function(t,e,r,i,o){var l=r.xaxis,c=r.yaxis,u=n.extent(a.simpleMap(l.range,l.r2c)),h=n.extent(a.simpleMap(c.range,c.r2c)),f=i[0].trace;if(!s.hasMarkers(f))return;var p=f.marker.maxdisplayed;if(0===p)return;var d=i.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]}),g=Math.ceil(d.length/p),m=0;o.forEach(function(t,r){var n=t[0].trace;s.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function v(t){return m?t.transition():t}var y=r.xaxis,x=r.yaxis,b=c[0].trace,_=b.line,w=n.select(f);if(i.getComponentMethod("errorbars","plot")(w,r,p),!0===b.visible){var k,M;v(w).style("opacity",b.opacity);var A=b.fill.charAt(b.fill.length-1);"x"!==A&&"y"!==A&&(A=""),r.isRangePlot||(c[0].node3=w);var T="",S=[],E=b._prevtrace;E&&(T=E._prevRevpath||"",M=E._nextFill,S=E._polygons);var C,L,z,P,I,O,D,R,B,F="",N="",j=[],V=a.noop;if(k=b._ownFill,s.hasLines(b)||"none"!==b.fill){for(M&&M.datum(c),-1!==["hv","vh","hvh","vhv"].indexOf(_.shape)?(z=o.steps(_.shape),P=o.steps(_.shape.split("").reverse().join(""))):z=P="spline"===_.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?o.smoothclosed(t.slice(1),_.smoothing):o.smoothopen(t,_.smoothing)}:function(t){return"M"+t.join("L")},I=function(t){return P(t.reverse())},j=l(c,{xaxis:y,yaxis:x,connectGaps:b.connectgaps,baseTolerance:Math.max(_.width||1,3)/4,shape:_.shape,simplify:_.simplify}),B=b._polygons=new Array(j.length),g=0;g1){var r=n.select(this);if(r.datum(c),t)v(r.style("opacity",0).attr("d",C).call(o.lineGroupStyle)).style("opacity",1);else{var i=v(r);i.attr("d",C),o.singleLineStyle(c,i)}}}}}var U=w.selectAll(".js-line").data(j);v(U.exit()).style("opacity",0).remove(),U.each(V(!1)),U.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(o.lineGroupStyle).each(V(!0)),o.setClipUrl(U,r.layerClipId),j.length?(k?O&&R&&(A?("y"===A?O[1]=R[1]=x.c2p(0,!0):"x"===A&&(O[0]=R[0]=y.c2p(0,!0)),v(k).attr("d","M"+R+"L"+O+"L"+F.substr(1)).call(o.singleFillStyle)):v(k).attr("d",F+"Z").call(o.singleFillStyle)):M&&("tonext"===b.fill.substr(0,6)&&F&&T?("tonext"===b.fill?v(M).attr("d",F+"Z"+T+"Z").call(o.singleFillStyle):v(M).attr("d",F+"L"+T.substr(1)+"Z").call(o.singleFillStyle),b._polygons=b._polygons.concat(S)):(H(M),b._polygons=null)),b._prevRevpath=N,b._prevPolygons=B):(k?H(k):M&&H(M),b._polygons=b._prevRevpath=b._prevPolygons=null);var q=w.selectAll(".points");d=q.data([c]),q.each(Z),d.enter().append("g").classed("points",!0).each(Z),d.exit().remove(),d.each(function(t){var e=!1===t[0].trace.cliponaxis;o.setClipUrl(n.select(this),e?null:r.layerClipId)})}function H(t){v(t).attr("d","M0,0Z")}function G(t){return t.filter(function(t){return t.vis})}function W(t){return t.id}function Y(t){if(t.ids)return W}function X(){return!1}function Z(e){var i,l=e[0].trace,c=n.select(this),u=s.hasMarkers(l),h=s.hasText(l),f=Y(l),p=X,d=X;u&&(p=l.marker.maxdisplayed||l._needsCull?G:a.identity),h&&(d=l.marker.maxdisplayed||l._needsCull?G:a.identity);var g,b=(i=c.selectAll("path.point").data(p,f)).enter().append("path").classed("point",!0);m&&b.call(o.pointStyle,l,t).call(o.translatePoints,y,x).style("opacity",0).transition().style("opacity",1),i.order(),u&&(g=o.makePointStyleFns(l)),i.each(function(e){var i=n.select(this),a=v(i);o.translatePoint(e,a,y,x)?(o.singlePointStyle(e,a,l,g,t),r.layerClipId&&o.hideOutsideRangePoint(e,a,y,x,l.xcalendar,l.ycalendar),l.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),m?i.exit().transition().style("opacity",0).remove():i.exit().remove(),(i=c.selectAll("g").data(d,f)).enter().append("g").classed("textpoint",!0).append("text"),i.order(),i.each(function(t){var e=n.select(this),i=v(e.select("text"));o.translatePoint(t,i,y,x)?r.layerClipId&&o.hideOutsideRangePoint(t,e,y,x,l.xcalendar,l.ycalendar):e.remove()}),i.selectAll("text").call(o.textPointStyle,l,t).each(function(t){var e=y.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each(function(){v(n.select(this)).attr({x:e,y:r})})}),i.exit().remove()}}e.exports=function(t,e,r,i,a,s){var l,u,f,p,d=!a,g=!!a&&a.duration>0;for((f=i.selectAll("g.trace").data(r,function(t){return t[0].trace.uid})).enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),c(t,e,r),function(t,e,r){var i;e.selectAll("g.trace").each(function(t){var e=n.select(this);if((i=t[0].trace)._nexttrace){if(i._nextFill=e.select(".js-fill.js-tonext"),!i._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),i._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),i._nextFill=null;i.fill&&("tozero"===i.fill.substr(0,6)||"toself"===i.fill||"to"===i.fill.substr(0,2)&&!i._prevtrace)?(i._ownFill=e.select(".js-fill.js-tozero"),i._ownFill.size()||(i._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),i._ownFill=null),e.selectAll(".js-fill").call(o.setClipUrl,r.layerClipId)})}(0,i,e),l=0,u={};lu[e[0].trace.uid]?1:-1}),g)?(s&&(p=s()),n.transition().duration(a.duration).ease(a.easing).each("end",function(){p&&p()}).each("interrupt",function(){p&&p()}).each(function(){i.selectAll("g.trace").each(function(n,i){h(t,i,e,n,r,this,a)})})):i.selectAll("g.trace").each(function(n,i){h(t,i,e,n,r,this,a)});d&&f.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":583,"../../lib":684,"../../lib/polygon":696,"../../registry":817,"./line_points":1028,"./link_traces":1030,"./subtypes":1037,d3:147}],1035:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],h=s[0].trace;if(!n.hasMarkers(h)&&!n.hasText(h))return[];if(!1===e)for(r=0;r=0&&(p[1]+=1),f.indexOf("top")>=0&&(p[1]-=1),f.indexOf("left")>=0&&(p[0]-=1),f.indexOf("right")>=0&&(p[0]+=1),p)),r.textColor=u(e.textfont,1,C),r.textSize=x(e.textfont.size,C,l.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var O=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;n<3;++n){var D=e.projection[O[n]];(r.project[n]=D.show)&&(r.projectOpacity[n]=D.opacity,r.projectScale[n]=D.scale)}r.errorBounds=d(e,b);var R=function(t){for(var e=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[0,0,0],i=0;i<3;i++){var a=t[i];a&&!1!==a.copy_zstyle&&(a=t[2]),a&&(e[i]=a.width/2,r[i]=c(a.color),n=a.thickness)}return{capSize:e,color:r,lineWidth:n}}([e.error_x,e.error_y,e.error_z]);return r.errorColor=R.color,r.errorLineWidth=R.lineWidth,r.errorCapSize=R.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=c(e.surfacecolor),r}function _(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}m.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){var e=t.index=t.data.index;return t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),t.textLabel="",this.textLabels&&(Array.isArray(this.textLabels)?(this.textLabels[e]||0===this.textLabels[e])&&(t.textLabel=this.textLabels[e]):t.textLabel=this.textLabels),t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},m.update=function(t){var e,r,l,c,u=this.scene.glplot.gl,h=f.solid;this.data=t;var p=b(this.scene,t);"mode"in p&&(this.mode=p.mode),"lineDashes"in p&&p.lineDashes in f&&(h=f[p.lineDashes]),this.color=_(p.scatterColor)||_(p.lineColor),this.dataPoints=p.position,e={gl:u,position:p.position,color:p.lineColor,lineWidth:p.lineWidth||1,dashes:h[0],dashScale:h[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=n(e),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var d=t.opacity;if(t.marker&&t.marker.opacity&&(d*=t.marker.opacity),r={gl:u,position:p.position,color:p.scatterColor,size:p.scatterSize,glyph:p.scatterMarker,opacity:d,orthographic:!0,lineWidth:p.scatterLineWidth,lineColor:p.scatterLineColor,project:p.project,projectScale:p.projectScale,projectOpacity:p.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=i(r),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),c={gl:u,position:p.position,glyph:p.text,color:p.textColor,size:p.textSize,angle:p.textAngle,alignment:p.textOffset,font:p.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=t.hovertext||t.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(c):(this.textMarkers=i(c),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),l={gl:u,position:p.position,color:p.errorColor,error:p.errorBounds,lineWidth:p.errorLineWidth,capSize:p.errorCapSize,opacity:t.opacity},this.errorBars?p.errorBounds?this.errorBars.update(l):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):p.errorBounds&&(this.errorBars=a(l),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),p.delaunayAxis>=0){var g=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&h("surfacecolor",f||p);for(var d=["x","y","z"],g=0;g<3;++g){var m="projection."+d[g];h(m+".show")&&(h(m+".opacity"),h(m+".scale"))}var v=n.getComponentMethod("errorbars","supplyDefaults");v(t,e,r,{axis:"z"}),v(t,e,r,{axis:"y",inherit:"z"}),v(t,e,r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":684,"../../registry":817,"../scatter/line_defaults":1027,"../scatter/marker_defaults":1033,"../scatter/subtypes":1037,"../scatter/text_defaults":1038,"./attributes":1040}],1045:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl3d_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/marker_colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","showLegend"],n.meta={},e.exports=n},{"../../constants/gl3d_markers":659,"../../plots/gl3d":774,"../scatter/marker_colorbar":1032,"./attributes":1040,"./calc":1041,"./convert":1043,"./defaults":1044}],1046:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,c=n.line,u=l.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),line:{color:c.color,width:c.width,dash:c.dash,shape:s({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:s({symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({width:u.width,editType:"calc"},a("marker.line")),gradient:l.gradient,editType:"calc"},a("marker"),{colorbar:o}),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:s({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":559,"../../components/colorscale/attributes":565,"../../lib/extend":673,"../../plots/attributes":729,"../scatter/attributes":1015}],1047:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e._carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var c;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var u,h,f=e._length,p=new Array(f),d=!1;for(c=0;c"),a}function w(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}}},{"../scatter/hover":1025}],1051:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/marker_colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../scatter/style").style,n.styleOnSelect=t("../scatter/style").styleOnSelect,n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scattercarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],n.meta={},e.exports=n},{"../../plots/cartesian":743,"../scatter/marker_colorbar":1032,"../scatter/select":1035,"../scatter/style":1036,"./attributes":1046,"./calc":1047,"./defaults":1048,"./event_data":1049,"./hover":1050,"./plot":1052}],1052:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r,o){var s,l,c,u=r[0][0].carpet,h={xaxis:i.getFromId(t,u.xaxis||"x"),yaxis:i.getFromId(t,u.yaxis||"y"),plot:e.plot};for(n(t,h,r,o),s=0;s")}(u,m,p.mockAxis,c[0].t.labels),[t]}}},{"../../components/fx":600,"../../constants/numerical":661,"../../plots/cartesian/axes":732,"../scatter/fill_hover_text":1022,"../scatter/get_trace_color":1024,"./attributes":1053}],1058:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/marker_colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.styleOnSelect=t("../scatter/style").styleOnSelect,n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattergeo",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","symbols","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/geo":762,"../scatter/marker_colorbar":1032,"../scatter/style":1036,"./attributes":1053,"./calc":1054,"./defaults":1055,"./event_data":1056,"./hover":1057,"./plot":1059,"./select":1060,"./style":1061}],1059:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM,o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("../../lib/geojson_utils"),c=t("../scatter/subtypes"),u=t("./style");function h(t,e){var r=t[0].trace;if(Array.isArray(r.locations))for(var n=o(r,e),i=r.locationmode,l=0;ld.TOO_MANY_POINTS?"rect":f.hasMarkers(e)?"rect":"round";if(o&&e.connectgaps){var l=n[0],c=n[1];for(i=0;i1?l[i]:l[0]:l,d=Array.isArray(c)?c.length>1?c[i]:c[0]:c,g=m[p],v=m[d],y=u?u/.8+1:0,x=-v*y-.5*v;o.offset[i]=[g*y/h,x/h]}}return o}}},{"../../components/drawing":583,"../../constants/interactions":660,"../../lib":684,"../../lib/gl_format_color":680,"../../plots/cartesian/axes":732,"../../plots/cartesian/axis_ids":735,"../../registry":817,"../scatter/make_bubble_size_func":1031,"../scatter/subtypes":1037,"./constants":1063,"color-normalize":107,"fast-isnumeric":214,"svg-path-sdf":497}],1065:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("../scatter/constants"),s=t("../scatter/subtypes"),l=t("../scatter/xy_defaults"),c=t("../scatter/marker_defaults"),u=t("../scatter/line_defaults"),h=t("../scatter/fillcolor_defaults"),f=t("../scatter/text_defaults");e.exports=function(t,e,r,p){function d(r,i){return n.coerce(t,e,a,r,i)}var g=!!t.marker&&/-open/.test(t.marker.symbol),m=s.isBubble(t),v=l(t,e,p,d);if(v){var y=v1&&u.extendFlat(o.line,_.linePositions(t,r,n)),o.errorX||o.errorY){var s=_.errorBarPositions(t,r,n,i,a);o.errorX&&u.extendFlat(o.errorX,s.x),o.errorY&&u.extendFlat(o.errorY,s.y)}return o.text&&(u.extendFlat(o.text,{positions:n},_.textPosition(t,r,o.text,o.marker)),u.extendFlat(o.textSel,{positions:n},_.textPosition(t,r,o.text,o.markerSel)),u.extendFlat(o.textUnsel,{positions:n},_.textPosition(t,r,o.text,o.markerUnsel))),o}function T(t,e){var r=e._scene,n={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[]},i={selectBatch:null,unselectBatch:null,fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:null};return e._scene||((r=e._scene={}).init=function(){u.extendFlat(r,i,n)},r.init(),r.update=function(t){var e,n=new Array(r.count);for(e=0;e=k&&(M.marker.cluster=p.tree),S.lineOptions.push(M.line),S.errorXOptions.push(M.errorX),S.errorYOptions.push(M.errorY),S.fillOptions.push(M.fill),S.markerOptions.push(M.marker),S.markerSelectedOptions.push(M.markerSel),S.markerUnselectedOptions.push(M.markerUnsel),S.textOptions.push(M.text),S.textSelectedOptions.push(M.textSel),S.textUnselectedOptions.push(M.textUnsel),S.count++,p._scene=S,p.index=S.count-1,p.x=d,p.y=y,p.positions=x,p.count=u,t.firstscatter=!1,[{x:!1,y:!1,t:p,trace:e}]},plot:function(t,e,r){if(r.length){var o,s=t._fullLayout,c=r[0][0].t._scene,p=s.dragmode;if(c){var d=s._size,g=s.width,m=s.height;if(h(t,["ANGLE_instanced_arrays","OES_element_index_uint"])){var v=s._glcanvas.data()[0].regl;if(y(t,e,r),c.dirty){if(!0===c.error2d&&(c.error2d=a(v)),!0===c.line2d&&(c.line2d=i(v)),!0===c.scatter2d&&(c.scatter2d=n(v)),!0===c.fill2d&&(c.fill2d=i(v)),!0===c.glText)for(c.glText=new Array(c.count),o=0;o=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),d=e-p;if(n.getClosest(l,function(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=i.wrap180(e[0]),a=e[1],o=f.project([n,a]),l=o.x-u.c2p([d,a]),c=o.y-h.c2p([n,r]),p=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-p,1-3/p)},t),!1!==t.index){var g=l[t.index],m=g.lonlat,v=[i.wrap180(m[0])+p,m[1]],y=u.c2p(v),x=h.c2p(v),b=g.mrc||1;return t.x0=y-b,t.x1=y+b,t.y0=x-b,t.y1=x+b,t.color=a(c,g),t.extraText=function(t,e,r){var n=(e.hi||t.hoverinfo).split("+"),i=-1!==n.indexOf("all"),a=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=e.lonlat,c=[];function u(t){return t+"°"}i||a&&s?c.push("("+u(l[0])+", "+u(l[1])+")"):a?c.push(r.lon+u(l[0])):s&&c.push(r.lat+u(l[1]));(i||-1!==n.indexOf("text"))&&o(e,t,c);return c.join("
")}(c,g,l[0].t.labels),[t]}}},{"../../components/fx":600,"../../constants/numerical":661,"../../lib":684,"../scatter/fill_hover_text":1022,"../scatter/get_trace_color":1024}],1072:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/marker_colorbar"),n.calc=t("../scattergeo/calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.style=function(t,e){e&&e[0].trace._glTrace.update(e)},n.moduleType="trace",n.name="scattermapbox",n.basePlotModule=t("../../plots/mapbox"),n.categories=["mapbox","gl","symbols","showLegend","scatterlike"],n.meta={},e.exports=n},{"../../plots/mapbox":789,"../scatter/marker_colorbar":1032,"../scattergeo/calc":1054,"./attributes":1067,"./defaults":1069,"./event_data":1070,"./hover":1071,"./plot":1073,"./select":1074}],1073:[function(t,e,r){"use strict";var n=t("./convert");function i(t,e){this.subplot=t,this.uid=e,this.sourceIds={fill:e+"-source-fill",line:e+"-source-line",circle:e+"-source-circle",symbol:e+"-source-symbol"},this.layerIds={fill:e+"-layer-fill",line:e+"-layer-line",circle:e+"-layer-circle",symbol:e+"-layer-symbol"},this.order=["fill","line","circle","symbol"]}var a=i.prototype;a.addSource=function(t,e){this.subplot.map.addSource(this.sourceIds[t],{type:"geojson",data:e.geojson})},a.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},a.addLayer=function(t,e){this.subplot.map.addLayer({type:t,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint})},a.update=function(t){for(var e=this.subplot,r=n(t),i=0;i")}e.exports={hoverPoints:function(t,e,r,i){var a=n(t,e,r,i);if(a&&!1!==a[0].index){var s=a[0];if(void 0===s.index)return a;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtWithinSector(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,s.extraText=o(c,u,l),a}},makeHoverPointText:o}},{"../../lib":684,"../../plots/cartesian/axes":732,"../scatter/hover":1025}],1079:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":798,"../scatter/marker_colorbar":1032,"../scatter/select":1035,"../scatter/style":1036,"./attributes":1075,"./calc":1076,"./defaults":1077,"./hover":1078,"./plot":1080}],1080:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){var a,o,s,l={xaxis:e.xaxis,yaxis:e.yaxis,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},c=e.radialAxis,u=c.range;for(s=u[0]>u[1]?function(t){return t<=0}:function(t){return t>=0},a=0;a=0?(m=o.c2r(g)-l[0],T=v,y=s.c2rad(T,b.thetaunit),C[d]=E[2*d]=m*Math.cos(y),L[d]=E[2*d+1]=m*Math.sin(y)):C[d]=L[d]=E[2*d]=E[2*d+1]=NaN;var z=a.sceneOptions(t,e,b,E);z.fill&&!h.fill2d&&(h.fill2d=!0),z.marker&&!h.scatter2d&&(h.scatter2d=!0),z.line&&!h.line2d&&(h.line2d=!0),!z.errorX&&!z.errorY||h.error2d||(h.error2d=!0),_.tree=n(E),z.marker&&S>=u&&(z.marker.cluster=_.tree),c.hasMarkers(b)&&(z.markerSel.positions=z.markerUnsel.positions=z.marker.positions),h.lineOptions.push(z.line),h.errorXOptions.push(z.errorX),h.errorYOptions.push(z.errorY),h.fillOptions.push(z.fill),h.markerOptions.push(z.marker),h.markerSelectedOptions.push(z.markerSel),h.markerUnselectedOptions.push(z.markerUnsel),h.count=r.length,_._scene=h,_.index=p,_.x=C,_.y=L,_.rawx=C,_.rawy=L,_.r=w,_.theta=k,_.positions=E,_.count=S}}),a.plot(t,e,r)},hoverPoints:function(t,e,r,n){var i=t.cd[0].t,o=i.r,s=i.theta,c=a.hoverPoints(t,e,r,n);if(c&&!1!==c[0].index){var u=c[0];if(void 0===u.index)return c;var h=t.subplot,f=h.angularAxis,p=u.cd[u.index],d=u.trace;if(p.r=o[u.index],p.theta=s[u.index],p.rad=f.c2rad(p.theta,d.thetaunit),h.isPtWithinSector(p))return u.xLabelVal=void 0,u.yLabelVal=void 0,u.extraText=l(p,d,h),c}},style:a.style,selectPoints:a.selectPoints,meta:{}}},{"../../plots/cartesian/axes":732,"../../plots/polar":798,"../scatter/colorscale_calc":1019,"../scatter/marker_colorbar":1032,"../scatter/subtypes":1037,"../scattergl":1066,"../scattergl/constants":1063,"../scatterpolar/hover":1078,"./attributes":1081,"./defaults":1082,"fast-isnumeric":214,"point-cluster":436}],1084:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../components/drawing/attributes").dash,l=t("../../lib/extend").extendFlat,c=n.marker,u=n.line,h=c.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:s,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,cliponaxis:n.cliponaxis,fill:l({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:h.width,editType:"calc"},a("marker.line")),gradient:c.gradient,editType:"calc"},a("marker"),{colorbar:o}),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":559,"../../components/colorscale/attributes":565,"../../components/drawing/attributes":582,"../../lib/extend":673,"../../plots/attributes":729,"../scatter/attributes":1015}],1085:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=["a","b","c"],c={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,u,h,f,p,d,g=t._fullLayout[e.subplot].sum,m=e.sum||g,v={a:e.a,b:e.b,c:e.c};for(r=0;r"),o}function v(t,e){m.push(t._hovertitle+": "+i.tickText(t,e,"hover").text)}}},{"../../plots/cartesian/axes":732,"../scatter/hover":1025}],1089:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/marker_colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../scatter/style").style,n.styleOnSelect=t("../scatter/style").styleOnSelect,n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/ternary":810,"../scatter/marker_colorbar":1032,"../scatter/select":1035,"../scatter/style":1036,"./attributes":1084,"./calc":1085,"./defaults":1086,"./event_data":1087,"./hover":1088,"./plot":1090}],1090:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var i=e.plotContainer;i.select(".scatterlayer").selectAll("*").remove();var a={xaxis:e.xaxis,yaxis:e.yaxis,plot:i,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},o=e.layers.frontplot.select("g.scatterlayer");n(t,a,r,o)}},{"../scatter/plot":1034}],1091:[function(t,e,r){"use strict";var n=t("../scattergl/attributes"),i=t("../../plots/cartesian/constants").idRegex,a=t("../../plot_api/plot_template").templatedArray;function o(t){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:i[t],editType:"plot"}}}e.exports={dimensions:a("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:n.text,marker:n.marker,xaxes:o("x"),yaxes:o("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:n.selected.marker,editType:"calc"},unselected:{marker:n.unselected.marker,editType:"calc"},opacity:n.opacity}},{"../../plot_api/plot_template":722,"../../plots/cartesian/constants":737,"../scattergl/attributes":1062}],1092:[function(t,e,r){"use strict";var n=t("regl-line2d"),i=t("../../registry"),a=t("../../lib"),o=t("../../lib/prepare_regl"),s=t("../../plots/get_data").getModuleCalcData,l=t("../../plots/cartesian"),c=t("../../plots/cartesian/axis_ids"),u="splom";function h(t,e,r){for(var n=e.dimensions,i=r.matrixOptions.data.length,a=new Array(i),o=0,s=0;o1&&ra&&l?r._splomSubplots[y]=1:iv;for(r=0,n=0;r2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function p(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function d(t,e){var r=t.fullSceneLayout,i=t.dataScale,c=e._len,u={};function d(t,e){var n=r[e],o=i[l[e]];return a.simpleMap(t,function(t){return n.d2l(t)*o})}u.vectors=s(d(e.u,"xaxis"),d(e.v,"yaxis"),d(e.w,"zaxis"),c);var g=h(e.x.slice(0,c)),m=h(e.y.slice(0,c)),v=h(e.z.slice(0,c));if(g.length*m.length*v.length>c)return{positions:[],cells:[]};var y=d(g,"xaxis"),x=d(m,"yaxis"),b=d(v,"zaxis");if(u.meshgrid=[y,x,b],e.starts){var _=e._slen;u.startingPositions=s(d(e.starts.x.slice(0,_),"xaxis"),d(e.starts.y.slice(0,_),"yaxis"),d(e.starts.z.slice(0,_),"zaxis"))}else{for(var w=x[0],k=f(y),M=f(b),A=new Array(k.length*M.length),T=0,S=0;S",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1109:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/extend").extendFlat,a=t("fast-isnumeric");function o(t){if(Array.isArray(t)){for(var e=0,r=0;r=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}e.exports=function(t,e){var r=l(e.cells.values),p=function(t){return t.slice(e.header.values.length,t.length)},d=l(e.header.values);d.length&&!d[0].length&&(d[0]=[""],d=l(d));var g=d.concat(p(r).map(function(){return c((d[0]||[""]).length)})),m=e.domain,v=Math.floor(t._fullLayout._size.w*(m.x[1]-m.x[0])),y=Math.floor(t._fullLayout._size.h*(m.y[1]-m.y[0])),x=e.header.values.length?g[0].map(function(){return e.header.height}):[n.emptyHeaderHeight],b=r.length?r[0].map(function(){return e.cells.height}):[],_=x.reduce(s,0),w=f(b,y-_+n.uplift),k=h(f(x,_),[]),M=h(w,k),A={},T=e._fullInput.columnorder.concat(p(r.map(function(t,e){return e}))),S=g.map(function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return a(n)?Number(n):1}),E=S.reduce(s,0);S=S.map(function(t){return t/E*v});var C=Math.max(o(e.header.line.width),o(e.cells.line.width)),L={key:e.index,translateX:m.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-m.y[1]),size:t._fullLayout._size,width:v,maxLineWidth:C,height:y,columnOrder:T,groupHeight:y,rowBlocks:M,headerRowBlocks:k,scrollY:0,cells:i({},e.cells,{values:r}),headerCells:i({},e.header,{values:g}),gdColumns:g.map(function(t){return t[0]}),gdColumnsOriginalOrder:g.map(function(t){return t[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:g.map(function(t,e){var r=A[t];return A[t]=(r||0)+1,{key:t+"__"+A[t],label:t,specIndex:e,xIndex:T[e],xScale:u,x:void 0,calcdata:void 0,columnWidth:S[e]}})};return L.columns.forEach(function(t){t.calcdata=L,t.x=u(t)}),L}},{"../../lib/extend":673,"./constants":1108,"fast-isnumeric":214}],1110:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0,n=e?r+e.rows.length:0;return[r,n]}(t);return(t.values||[]).slice(e[0],e[1]).map(function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}})}},{"../../lib/extend":673}],1111:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults;e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}a(e,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),n.coerceFont(s,"header.font",n.extendFlat({},o.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort(function(t,e){return t-e}),o=i.map(function(t){return a.indexOf(t)}),s=o.length;s/i),l=!o||s;t.mayHaveMarkup=o&&a.match(/[<&>]/);var c,u="string"==typeof(c=a)&&c.match(n.latexCheck);t.latex=u;var h,f,p=u?"":_(t.calcdata.cells.prefix,e,r)||"",d=u?"":_(t.calcdata.cells.suffix,e,r)||"",g=u?null:_(t.calcdata.cells.format,e,r)||null,m=p+(g?i.format(g)(t.value):t.value)+d;if(t.wrappingNeeded=!t.wrapped&&!l&&!u&&(h=b(m)),t.cellHeightMayIncrease=s||u||t.mayHaveMarkup||(void 0===h?b(m):h),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var v=(" "===n.wrapSplitCharacter?m.replace(/
i&&n.push(a),i+=l}return n}(i,l,s);1===c.length&&(c[0]===i.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),e.each(function(t,e){t.page=c[e],t.scrollY=l}),e.attr("transform",function(t){return"translate(0 "+(I(t.rowBlocks,t.page)-t.scrollY)+")"}),t&&(E(t,r,e,c,n.prevPages,n,0),E(t,r,e,c,n.prevPages,n,1),v(r,t))}}function S(t,e,r,a){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter(function(t){return s.key===t.key}),c=r||s.scrollbarState.dragMultiplier;s.scrollY=void 0===a?s.scrollY+c*i.event.dy:a;var u=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(k);T(t,u,l)}}function E(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout(function(){var a=r.filter(function(t,e){return e===o&&n[e]!==i[e]});y(t,e,a,r),i[o]=n[o]}))}function C(t,e,r){return function(){var a=i.select(e.parentNode);a.each(function(t){var e=t.fragments;a.selectAll("tspan.line").each(function(t,r){e[r].width=this.getComputedTextLength()});var r,i,o=e[e.length-1].width,s=e.slice(0,-1),l=[],c=0,u=t.column.columnWidth-2*n.cellPad;for(t.value="";s.length;)c+(i=(r=s.shift()).width+o)>u&&(t.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],c=0),l.push(r.text),c+=i;c&&(t.value+=l.join(n.wrapSpacer)),t.wrapped=!0}),a.selectAll("tspan.line").remove(),x(a.select("."+n.cn.cellText),r,t),i.select(e.parentNode.parentNode).call(P)}}function L(t,e,r,a,o){return function(){if(!o.settledY){var s=i.select(e.parentNode),l=R(o),c=o.key-l.firstRowIndex,u=l.rows[c].rowHeight,h=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*n.cellPad:u,f=Math.max(h,u);f-l.rows[c].rowHeight&&(l.rows[c].rowHeight=f,t.selectAll("."+n.cn.columnCell).call(P),T(null,t.filter(k),0),v(r,a,!0)),s.attr("transform",function(){var t=this.parentNode.getBoundingClientRect(),e=i.select(this.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),a=e.top-t.top+(r?r.matrix.f:n.cellPad);return"translate("+z(o,i.select(this.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+a+")"}),o.settledY=!0}}}function z(t,e){switch(t.align){case"left":return n.cellPad;case"right":return t.column.columnWidth-(e||0)-n.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return n.cellPad}}function P(t){t.attr("transform",function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce(function(t,e){return t+O(e,1/0)},0);return"translate(0 "+(O(R(t),t.key)+e)+")"}).selectAll("."+n.cn.cellRect).attr("height",function(t){return(e=R(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r})}function I(t,e){for(var r=0,n=e-1;n>=0;n--)r+=D(t[n]);return r}function O(t,e){for(var r=0,n=0;n0){var y,x,b,_,w,k=t.xa,M=t.ya;"h"===f.orientation?(w=e,y="y",b=M,x="x",_=k):(w=r,y="x",b=k,x="y",_=M);var A=h[t.index];if(w>=A.span[0]&&w<=A.span[1]){var T=n.extendFlat({},t),S=_.c2p(w,!0),E=o.getKdeValue(A,f,w),C=o.getPositionOnKdePath(A,f,S),L=b._offset,z=b._length;T[y+"0"]=C[0],T[y+"1"]=C[1],T[x+"0"]=T[x+"1"]=S,T[x+"Label"]=x+": "+i.hoverLabelText(_,w)+", "+h[0].t.labels.kde+" "+E.toFixed(3),T.spikeDistance=v[0].spikeDistance;var P=y+"Spike";T[P]=v[0][P],v[0].spikeDistance=void 0,v[0][P]=void 0,m.push(T),(u={stroke:t.color})[y+"1"]=n.constrain(L+C[0],L,L+z),u[y+"2"]=n.constrain(L+C[1],L,L+z),u[x+"1"]=u[x+"2"]=_._offset+S}}}-1!==p.indexOf("points")&&(c=a.hoverOnPoints(t,e,r));var I=l.selectAll(".violinline-"+f.uid).data(u?[0]:[]);return I.enter().append("line").classed("violinline-"+f.uid,!0).attr("stroke-width",1.5),I.exit().remove(),I.attr(u),"closest"===s?c?[c]:m:c?(m.push(c),m):m}},{"../../lib":684,"../../plots/cartesian/axes":732,"../box/hover":843,"./helpers":1117}],1119:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),setPositions:t("./set_positions"),plot:t("./plot"),style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}},{"../../plots/cartesian":743,"../box/select":848,"../scatter/style":1036,"./attributes":1114,"./calc":1115,"./defaults":1116,"./hover":1118,"./layout_attributes":1120,"./layout_defaults":1121,"./plot":1122,"./set_positions":1123,"./style":1124}],1120:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),i=t("../../lib").extendFlat;e.exports={violinmode:i({},n.boxmode,{}),violingap:i({},n.boxgap,{}),violingroupgap:i({},n.boxgroupgap,{})}},{"../../lib":684,"../box/layout_attributes":845}],1121:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("../box/layout_defaults");e.exports=function(t,e,r){a._supply(t,e,r,function(r,a){return n.coerce(t,e,i,r,a)},"violin")}},{"../../lib":684,"../box/layout_defaults":846,"./layout_attributes":1120}],1122:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../box/plot"),s=t("../scatter/line_points"),l=t("./helpers");e.exports=function(t,e,r,c){var u=t._fullLayout,h=e.xaxis,f=e.yaxis;function p(t){var e=s(t,{xaxis:h,yaxis:f,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0});return a.smoothopen(e[0],1)}var d=c.selectAll("g.trace.violins").data(r,function(t){return t[0].trace.uid});d.enter().append("g").attr("class","trace violins"),d.exit().remove(),d.order(),d.each(function(t){var r=t[0],a=r.t,s=r.trace,c=n.select(this);e.isRangePlot||(r.node3=c);var d=u._numViolins,g="group"===u.violinmode&&d>1,m=1-u.violingap,v=a.bdPos=a.dPos*m*(1-u.violingroupgap)/(g?d:1),y=a.bPos=g?2*a.dPos*((a.num+.5)/d-.5)*m:0;if(a.wHover=a.dPos*(g?m/d:1),!0!==s.visible||a.empty)n.select(this).remove();else{var x=e[a.valLetter+"axis"],b=e[a.posLetter+"axis"],_="both"===s.side,w=_||"positive"===s.side,k=_||"negative"===s.side,M=u._violinScaleGroupStats[s.scalegroup],A=c.selectAll("path.violin").data(i.identity);A.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin"),A.exit().remove(),A.each(function(t){var e,r,i,o,l,c,u,h,f=n.select(this),d=t.density,g=d.length,m=t.pos+y,A=b.c2p(m);switch(s.scalemode){case"width":e=M.maxWidth/v;break;case"count":e=M.maxWidth/v*(M.maxCount/t.pts.length)}if(w){for(u=new Array(g),l=0;la&&(a=u,o=c)}}return a?i(o):s};case"rms":return function(t,e){for(var r=0,a=0,o=0;o":return function(t){return f(t)>s};case">=":return function(t){return f(t)>=s};case"[]":return function(t){var e=f(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=f(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=f(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=f(t);return es[1]};case"](":return function(t){var e=f(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=f(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(f(t))};case"}{":return function(t){return-1===s.indexOf(f(t))}}}(r,a.getDataToCoordFunc(t,e,s,i),f),x={},b={},_=0;d?(m=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set(new Array(h))},v=function(t,e){var r=x[t.astr][e];t.get()[e]=r}):(m=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set([])},v=function(t,e){var r=x[t.astr][e];t.get().push(r)}),M(m);for(var w=o(e.transforms,r),k=0;k1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=o.styles=[];if(l)for(a=0;a=n.value)return this.search_node_=n,n}else for(;n=n.next;)if(t-EPSILON&&i0?Orientation.CCW:Orientation.CW}function inScanArea(t,n,e,i){return!((t.x-n.x)*(i.y-n.y)-(i.x-n.x)*(t.y-n.y)>=-EPSILON)&&!((t.x-e.x)*(i.y-e.y)-(i.x-e.x)*(t.y-e.y)<=EPSILON)}function isAngleObtuse(t,n,e){var i=n.x-t.x,o=n.y-t.y;return i*(e.x-t.x)+o*(e.y-t.y)<0}function triangulate(t){t.initTriangulation(),t.createAdvancingFront(),sweepPoints(t),finalizationPolygon(t)}function sweepPoints(t){var n,e=t.pointCount();for(n=1;nn.q.x,isEdgeSideOfTriangle(e.triangle,n.p,n.q)||(fillEdgeEvent(t,n,e),edgeEventByPoints(t,n.p,n.q,e.triangle,n.q))}function edgeEventByPoints(t,n,e,i,o){if(!isEdgeSideOfTriangle(i,n,e)){var r=i.pointCCW(o),s=orient2d(e,r,n);if(s===Orientation.COLLINEAR)throw new PointError("poly2tri EdgeEvent: Collinear not supported!",[e,r,n]);var a=i.pointCW(o),p=orient2d(e,a,n);if(p===Orientation.COLLINEAR)throw new PointError("poly2tri EdgeEvent: Collinear not supported!",[e,a,n]);s===p?edgeEventByPoints(t,n,e,i=s===Orientation.CW?i.neighborCCW(o):i.neighborCW(o),o):flipEdgeEvent(t,n,e,i,o)}}function isEdgeSideOfTriangle(t,n,e){var i=t.edgeIndex(n,e);if(-1!==i){t.markConstrainedEdgeByIndex(i);var o=t.getNeighbor(i);return o&&o.markConstrainedEdgeByPoints(n,e),!0}return!1}function newFrontTriangle(t,n,e){var i=new Triangle(n,e.point,e.next.point);i.markNeighbor(e.triangle),t.addToMap(i);var o=new PolyNode(n);return o.next=e.next,o.prev=e,e.next.prev=o,e.next=o,legalize(t,i)||t.mapTriangleToNodes(i),o}function fill(t,n){var e=new Triangle(n.prev.point,n.point,n.next.point);e.markNeighbor(n.prev.triangle),e.markNeighbor(n.triangle),t.addToMap(e),n.prev.next=n.next,n.next.prev=n.prev,legalize(t,e)||t.mapTriangleToNodes(e)}function fillAdvancingFront(t,n){for(var e=n.next;e.next&&!isAngleObtuse(e.point,e.next.point,e.prev.point);)fill(t,e),e=e.next;for(e=n.prev;e.prev&&!isAngleObtuse(e.point,e.next.point,e.prev.point);)fill(t,e),e=e.prev;n.next&&n.next.next&&isBasinAngleRight(n)&&fillBasin(t,n)}function isBasinAngleRight(t){var n=t.point.x-t.next.next.point.x,e=t.point.y-t.next.next.point.y;return assert(e>=0,"unordered y"),n>=0||Math.abs(n)0}function rotateTrianglePair(t,n,e,i){var o,r,s,a,p,l,g,d,h,u,f,c;o=t.neighborCCW(n),r=t.neighborCW(n),s=e.neighborCCW(i),a=e.neighborCW(i),p=t.getConstrainedEdgeCCW(n),l=t.getConstrainedEdgeCW(n),g=e.getConstrainedEdgeCCW(i),d=e.getConstrainedEdgeCW(i),h=t.getDelaunayEdgeCCW(n),u=t.getDelaunayEdgeCW(n),f=e.getDelaunayEdgeCCW(i),c=e.getDelaunayEdgeCW(i),t.legalize(n,i),e.legalize(i,n),e.setDelaunayEdgeCCW(n,h),t.setDelaunayEdgeCW(n,u),t.setDelaunayEdgeCCW(i,f),e.setDelaunayEdgeCW(i,c),e.setConstrainedEdgeCCW(n,p),t.setConstrainedEdgeCW(n,l),t.setConstrainedEdgeCCW(i,g),e.setConstrainedEdgeCW(i,d),t.clearNeighbors(),e.clearNeighbors(),o&&e.markNeighbor(o),r&&t.markNeighbor(r),s&&t.markNeighbor(s),a&&e.markNeighbor(a),t.markNeighbor(e)}function fillBasin(t,n){for(orient2d(n.point,n.next.point,n.next.next.point)===Orientation.CCW?t.basin.left_node=n.next.next:t.basin.left_node=n.next,t.basin.bottom_node=t.basin.left_node;t.basin.bottom_node.next&&t.basin.bottom_node.point.y>=t.basin.bottom_node.next.point.y;)t.basin.bottom_node=t.basin.bottom_node.next;if(t.basin.bottom_node!==t.basin.left_node){for(t.basin.right_node=t.basin.bottom_node;t.basin.right_node.next&&t.basin.right_node.point.yt.basin.right_node.point.y,fillBasinReq(t,t.basin.bottom_node))}}function fillBasinReq(t,n){if(!isShallow(t,n)&&(fill(t,n),n.prev!==t.basin.left_node||n.next!==t.basin.right_node)){if(n.prev===t.basin.left_node){if(orient2d(n.point,n.next.point,n.next.next.point)===Orientation.CW)return;n=n.next}else if(n.next===t.basin.right_node){if(orient2d(n.point,n.prev.point,n.prev.prev.point)===Orientation.CCW)return;n=n.prev}else n=n.prev.point.ye}function fillEdgeEvent(t,n,e){t.edge_event.right?fillRightAboveEdgeEvent(t,n,e):fillLeftAboveEdgeEvent(t,n,e)}function fillRightAboveEdgeEvent(t,n,e){for(;e.next.point.xn.p.x;)orient2d(n.q,e.prev.point,n.p)===Orientation.CW?fillLeftBelowEdgeEvent(t,n,e):e=e.prev}function fillLeftBelowEdgeEvent(t,n,e){e.point.x>n.p.x&&(orient2d(e.point,e.prev.point,e.prev.prev.point)===Orientation.CW?fillLeftConcaveEdgeEvent(t,n,e):(fillLeftConvexEdgeEvent(t,n,e),fillLeftBelowEdgeEvent(t,n,e)))}function fillLeftConvexEdgeEvent(t,n,e){orient2d(e.prev.point,e.prev.prev.point,e.prev.prev.prev.point)===Orientation.CW?fillLeftConcaveEdgeEvent(t,n,e.prev):orient2d(n.q,e.prev.prev.point,n.p)===Orientation.CW&&fillLeftConvexEdgeEvent(t,n,e.prev)}function fillLeftConcaveEdgeEvent(t,n,e){fill(t,e.prev),e.prev.point!==n.p&&orient2d(n.q,e.prev.point,n.p)===Orientation.CW&&orient2d(e.point,e.prev.point,e.prev.prev.point)===Orientation.CW&&fillLeftConcaveEdgeEvent(t,n,e)}function flipEdgeEvent(t,n,e,i,o){var r=i.neighborAcross(o);assert(r,"FLIP failed due to missing triangle!");var s=r.oppositePoint(i,o);if(i.getConstrainedEdgeAcross(o)){var a=i.index(o);throw new PointError("poly2tri Intersecting Constraints",[o,s,i.getPoint((a+1)%3),i.getPoint((a+2)%3)])}inScanArea(o,i.pointCCW(o),i.pointCW(o),s)?(rotateTrianglePair(i,o,r,s),t.mapTriangleToNodes(i),t.mapTriangleToNodes(r),o===e&&s===n?e===t.edge_event.constrained_edge.q&&n===t.edge_event.constrained_edge.p&&(i.markConstrainedEdgeByPoints(n,e),r.markConstrainedEdgeByPoints(n,e),legalize(t,i),legalize(t,r)):flipEdgeEvent(t,n,e,i=nextFlipTriangle(t,orient2d(e,s,n),i,r,o,s),o)):(flipScanEdgeEvent(t,n,e,i,r,nextFlipPoint(n,e,r,s)),edgeEventByPoints(t,n,e,i,o))}function nextFlipTriangle(t,n,e,i,o,r){var s;return n===Orientation.CCW?(s=i.edgeIndex(o,r),i.delaunay_edge[s]=!0,legalize(t,i),i.clearDelaunayEdges(),e):(s=e.edgeIndex(o,r),e.delaunay_edge[s]=!0,legalize(t,e),e.clearDelaunayEdges(),i)}function nextFlipPoint(t,n,e,i){var o=orient2d(n,i,t);if(o===Orientation.CW)return e.pointCCW(i);if(o===Orientation.CCW)return e.pointCW(i);throw new PointError("poly2tri [Unsupported] nextFlipPoint: opposing point on constrained edge!",[n,i,t])}function flipScanEdgeEvent(t,n,e,i,o,r){var s=o.neighborAcross(r);assert(s,"FLIP failed due to missing triangle");var a=s.oppositePoint(o,r);inScanArea(e,i.pointCCW(e),i.pointCW(e),a)?flipEdgeEvent(t,e,a,s,a):flipScanEdgeEvent(t,n,e,i,s,nextFlipPoint(n,e,s,a))}var kAlpha=.3,Edge=function(t,n){if(this.p=t,this.q=n,t.y>n.y)this.q=t,this.p=n;else if(t.y===n.y)if(t.x>n.x)this.q=t,this.p=n;else if(t.x===n.x)throw new PointError("poly2tri Invalid Edge constructor: repeated points!",[t]);this.q._p2t_edge_list||(this.q._p2t_edge_list=[]),this.q._p2t_edge_list.push(this)},Basin=function(){this.left_node=null,this.bottom_node=null,this.right_node=null,this.width=0,this.left_highest=!1};Basin.prototype.clear=function(){this.left_node=null,this.bottom_node=null,this.right_node=null,this.width=0,this.left_highest=!1};var EdgeEvent=function(){this.constrained_edge=null,this.right=!1},SweepContext=function(t,n){n=n||{},this.triangles_=[],this.map_=[],this.points_=n.cloneArrays?t.slice(0):t,this.edge_list=[],this.pmin_=this.pmax_=null,this.front_=null,this.head_=null,this.tail_=null,this.af_head_=null,this.af_middle_=null,this.af_tail_=null,this.basin=new Basin,this.edge_event=new EdgeEvent,this.initEdges(this.points_)};SweepContext.prototype.addHole=function(t){this.initEdges(t);var n,e=t.length;for(n=0;nn&&(n=s.x),s.xi&&(i=s.y),s.y>>=1,t}function tinf_read_bits(e,t,a){if(!t)return a;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,r+a}function tinf_decode_symbol(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,a+=t.table[n],r-=t.table[n]}while(r>=0);return e.tag=s,e.bitcount-=n,t.trans[a+r]}function tinf_decode_trees(e,t,a){var r,n,s,i,o,l;for(r=tinf_read_bits(e,5,257),n=tinf_read_bits(e,5,1),s=tinf_read_bits(e,4,4),i=0;i<19;++i)lengths[i]=0;for(i=0;i8;)e.sourceIndex--,e.bitcount-=8;if((t=256*(t=e.source[e.sourceIndex+1])+e.source[e.sourceIndex])!==(65535&~(256*e.source[e.sourceIndex+3]+e.source[e.sourceIndex+2])))return TINF_DATA_ERROR;for(e.sourceIndex+=4,a=t;a;--a)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,TINF_OK}function tinf_uncompress(e,t){var a,r,n=new Data(e,t);do{switch(a=tinf_getbit(n),tinf_read_bits(n,2,0)){case 0:r=tinf_inflate_uncompressed_block(n);break;case 1:r=tinf_inflate_block_data(n,sltree,sdtree);break;case 2:tinf_decode_trees(n,n.ltree,n.dtree),r=tinf_inflate_block_data(n,n.ltree,n.dtree);break;default:r=TINF_DATA_ERROR}if(r!==TINF_OK)throw new Error("Data error")}while(!a);return n.destLen0,"No English "+e+" specified.")}r("fontFamily"),r("weightName"),r("manufacturer"),r("copyright"),r("version"),a(this.unitsPerEm>0,"No unitsPerEm specified.")},Font.prototype.toTables=function(){return sfnt.fontToTable(this)},Font.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},Font.prototype.toArrayBuffer=function(){for(var e=this.toTables().encode(),t=new ArrayBuffer(e.length),a=new Uint8Array(t),r=0;r>4,s=15&r;if(15===n)break;if(t+=a[n],15===s)break;t+=a[s]}return parseFloat(t)}function parseOperand(e,t){if(28===t)return e.parseByte()<<8|e.parseByte();if(29===t)return e.parseByte()<<24|e.parseByte()<<16|e.parseByte()<<8|e.parseByte();if(30===t)return parseFloatOperand(e);if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return 256*(t-247)+e.parseByte()+108;if(t>=251&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function entriesToObject(e){for(var t={},a=0;a=0&&a>0&&(e+=" "),e+=t(r)}return e}e=void 0!==e?e:2;for(var r="",n=0;n>1,l.length=0,p=!0}return function a(y){for(var v,b,S,T,x,O,U,C,R,E,w,k,I=0;I1&&!p&&(f=l.shift()+e.nominalWidthX,p=!0),d+=l.pop(),m(h,d);break;case 5:for(;l.length>0;)h+=l.shift(),d+=l.shift(),o.lineTo(h,d);break;case 6:for(;l.length>0&&(h+=l.shift(),o.lineTo(h,d),0!==l.length);)d+=l.shift(),o.lineTo(h,d);break;case 7:for(;l.length>0&&(d+=l.shift(),o.lineTo(h,d),0!==l.length);)h+=l.shift(),o.lineTo(h,d);break;case 8:for(;l.length>0;)r=h+l.shift(),n=d+l.shift(),s=r+l.shift(),i=n+l.shift(),h=s+l.shift(),d=i+l.shift(),o.curveTo(r,n,s,i,h,d);break;case 10:x=l.pop()+e.subrsBias,(O=e.subrs[x])&&a(O);break;case 11:return;case 12:switch(F=y[I],I+=1,F){case 35:r=h+l.shift(),n=d+l.shift(),s=r+l.shift(),i=n+l.shift(),U=s+l.shift(),C=i+l.shift(),R=U+l.shift(),E=C+l.shift(),w=R+l.shift(),k=E+l.shift(),h=w+l.shift(),d=k+l.shift(),l.shift(),o.curveTo(r,n,s,i,U,C),o.curveTo(R,E,w,k,h,d);break;case 34:r=h+l.shift(),n=d,s=r+l.shift(),i=n+l.shift(),U=s+l.shift(),C=i,R=U+l.shift(),E=i,w=R+l.shift(),k=d,h=w+l.shift(),o.curveTo(r,n,s,i,U,C),o.curveTo(R,E,w,k,h,d);break;case 36:r=h+l.shift(),n=d+l.shift(),s=r+l.shift(),i=n+l.shift(),U=s+l.shift(),C=i,R=U+l.shift(),E=i,w=R+l.shift(),k=E+l.shift(),h=w+l.shift(),o.curveTo(r,n,s,i,U,C),o.curveTo(R,E,w,k,h,d);break;case 37:r=h+l.shift(),n=d+l.shift(),s=r+l.shift(),i=n+l.shift(),U=s+l.shift(),C=i+l.shift(),R=U+l.shift(),E=C+l.shift(),w=R+l.shift(),k=E+l.shift(),Math.abs(w-h)>Math.abs(k-d)?h=w+l.shift():d=k+l.shift(),o.curveTo(r,n,s,i,U,C),o.curveTo(R,E,w,k,h,d);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+F),l.length=0}break;case 14:l.length>0&&!p&&(f=l.shift()+e.nominalWidthX,p=!0),c&&(o.closePath(),c=!1);break;case 18:g();break;case 19:case 20:g(),I+=u+7>>3;break;case 21:l.length>2&&!p&&(f=l.shift()+e.nominalWidthX,p=!0),d+=l.pop(),m(h+=l.pop(),d);break;case 22:l.length>1&&!p&&(f=l.shift()+e.nominalWidthX,p=!0),m(h+=l.pop(),d);break;case 23:g();break;case 24:for(;l.length>2;)r=h+l.shift(),n=d+l.shift(),s=r+l.shift(),i=n+l.shift(),h=s+l.shift(),d=i+l.shift(),o.curveTo(r,n,s,i,h,d);h+=l.shift(),d+=l.shift(),o.lineTo(h,d);break;case 25:for(;l.length>6;)h+=l.shift(),d+=l.shift(),o.lineTo(h,d);r=h+l.shift(),n=d+l.shift(),s=r+l.shift(),i=n+l.shift(),h=s+l.shift(),d=i+l.shift(),o.curveTo(r,n,s,i,h,d);break;case 26:for(l.length%2&&(h+=l.shift());l.length>0;)r=h,n=d+l.shift(),s=r+l.shift(),i=n+l.shift(),h=s,d=i+l.shift(),o.curveTo(r,n,s,i,h,d);break;case 27:for(l.length%2&&(d+=l.shift());l.length>0;)r=h+l.shift(),n=d,s=r+l.shift(),i=n+l.shift(),h=s+l.shift(),d=i,o.curveTo(r,n,s,i,h,d);break;case 28:v=y[I],b=y[I+1],l.push((v<<24|b<<16)>>16),I+=2;break;case 29:x=l.pop()+e.gsubrsBias,(O=e.gsubrs[x])&&a(O);break;case 30:for(;l.length>0&&(r=h,n=d+l.shift(),s=r+l.shift(),i=n+l.shift(),h=s+l.shift(),d=i+(1===l.length?l.shift():0),o.curveTo(r,n,s,i,h,d),0!==l.length);)r=h+l.shift(),n=d,s=r+l.shift(),i=n+l.shift(),d=i+l.shift(),h=s+(1===l.length?l.shift():0),o.curveTo(r,n,s,i,h,d);break;case 31:for(;l.length>0&&(r=h+l.shift(),n=d,s=r+l.shift(),i=n+l.shift(),d=i+l.shift(),h=s+(1===l.length?l.shift():0),o.curveTo(r,n,s,i,h,d),0!==l.length);)r=h,n=d+l.shift(),s=r+l.shift(),i=n+l.shift(),h=s+l.shift(),d=i+(1===l.length?l.shift():0),o.curveTo(r,n,s,i,h,d);break;default:F<32?console.log("Glyph "+t.index+": unknown operator "+F):F<247?l.push(F-139):F<251?(v=y[I],I+=1,l.push(256*(F-247)+v+108)):F<255?(v=y[I],I+=1,l.push(256*-(F-251)-v-108)):(v=y[I],b=y[I+1],S=y[I+2],T=y[I+3],I+=4,l.push((v<<24|b<<16|S<<8|T)/65536))}}}(a),t.advanceWidth=f,o}function calcCFFSubroutineBias(e){return e.length<1240?107:e.length<33900?1131:32768}function parseCFFTable(e,t,a){a.tables.cff={};var r=parseCFFIndex(e,parseCFFHeader(e,t).endOffset,bytesToString),n=parseCFFIndex(e,r.endOffset),s=parseCFFIndex(e,n.endOffset,bytesToString),i=parseCFFIndex(e,s.endOffset);a.gsubrs=i.objects,a.gsubrsBias=calcCFFSubroutineBias(a.gsubrs);var o=parseCFFTopDict(new DataView(new Uint8Array(n.objects[0]).buffer),s.objects);a.tables.cff.topDict=o;var l=t+o.private[1],u=parseCFFPrivateDict(e,l,o.private[0],s.objects);if(a.defaultWidthX=u.defaultWidthX,a.nominalWidthX=u.nominalWidthX,0!==u.subrs){var p=parseCFFIndex(e,l+u.subrs);a.subrs=p.objects,a.subrsBias=calcCFFSubroutineBias(a.subrs)}else a.subrs=[],a.subrsBias=0;var f=parseCFFIndex(e,t+o.charStrings);a.nGlyphs=f.objects.length;var c=parseCFFCharset(e,t+o.charset,a.nGlyphs,s.objects);0===o.encoding?a.cffEncoding=new CffEncoding(cffStandardEncoding,c):1===o.encoding?a.cffEncoding=new CffEncoding(cffExpertEncoding,c):a.cffEncoding=parseCFFEncoding(e,t+o.encoding,c),a.encoding=a.encoding||a.cffEncoding,a.glyphs=new GlyphSet(a);for(var h=0;h=0&&(a=r),(r=t.indexOf(e))>=0?a=r+cffStandardStrings.length:(a=cffStandardStrings.length+t.length,t.push(e)),a}function makeHeader(){return new table.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function makeNameIndex(e){var t=new table.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);t.names=[];for(var a=0;a>1,l.skip("uShort",3),r.glyphIndexMap={};var u=new Parser(e,t+n+14),p=new Parser(e,t+n+16+2*o),f=new Parser(e,t+n+16+4*o),c=new Parser(e,t+n+16+6*o),h=t+n+16+8*o;for(a=0;a0?(s=e.parseByte(),0==(t&n)&&(s=-s),s=a+s):s=(t&n)>0?a:a+e.parseShort(),s}function parseGlyph(e,t,a){var r,n,s=new Parser(t,a);if(e.numberOfContours=s.parseShort(),e.xMin=s.parseShort(),e.yMin=s.parseShort(),e.xMax=s.parseShort(),e.yMax=s.parseShort(),e.numberOfContours>0){var i,o=e.endPointIndices=[];for(i=0;i0)for(var u=s.parseByte(),p=0;p0){var f,c=[];if(l>0){for(i=0;i=0,c.push(f);var h=0;for(i=0;i0?(g.dx=s.parseShort(),g.dy=s.parseShort()):(g.dx=s.parseChar(),g.dy=s.parseChar()),(8&r)>0?g.xScale=g.yScale=s.parseF2Dot14():(64&r)>0?(g.xScale=s.parseF2Dot14(),g.yScale=s.parseF2Dot14()):(128&r)>0&&(g.xScale=s.parseF2Dot14(),g.scale01=s.parseF2Dot14(),g.scale10=s.parseF2Dot14(),g.yScale=s.parseF2Dot14()),e.components.push(g),m=!!(32&r)}}}function transformPoints(e,t){for(var a=[],r=0;r>1;e=a.begin&&e=1&&(os2.ulCodePageRange1=a.parseULong(),os2.ulCodePageRange2=a.parseULong()),os2.version>=2&&(os2.sxHeight=a.parseShort(),os2.sCapHeight=a.parseShort(),os2.usDefaultChar=a.parseUShort(),os2.usBreakChar=a.parseUShort(),os2.usMaxContent=a.parseUShort()),os2}function makeOS2Table(e){return new table.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)}function parsePostTable(e,t){var a,r={},n=new Parser(e,t);switch(r.version=n.parseVersion(),r.italicAngle=n.parseFixed(),r.underlinePosition=n.parseShort(),r.underlineThickness=n.parseShort(),r.isFixedPitch=n.parseULong(),r.minMemType42=n.parseULong(),r.maxMemType42=n.parseULong(),r.minMemType1=n.parseULong(),r.maxMemType1=n.parseULong(),r.version){case 1:r.names=standardNames.slice();break;case 2:for(r.numberOfGlyphs=n.parseUShort(),r.glyphNameIndex=new Array(r.numberOfGlyphs),a=0;a=standardNames.length){var s=n.parseChar();r.names.push(n.parseString(s))}break;case 2.5:for(r.numberOfGlyphs=n.parseUShort(),r.offset=new Array(r.numberOfGlyphs),a=0;at.value.tag?1:-1}),t.fields=t.fields.concat(r),t.fields=t.fields.concat(n),t}function metricsForChar(e,t,a){for(var r=0;r0)return e.glyphs.get(n).getMetrics()}return a}function average(e){for(var t=0,a=0;ag||null===t)&&(t=g),u 123 are reserved for internal usage");h|=1<0?ltag.make(M):void 0,D=[S,T,x,O,N,C,post.make(),cff.make(e.glyphs,{version:e.getEnglishName("version"),fullName:w,familyName:R,weightName:E,postScriptName:k,unitsPerEm:e.unitsPerEm,fontBBox:[0,b.yMin,b.ascender,b.advanceWidthMax]}),U];A&&D.push(A);var P=makeSfntTable(D),L=computeCheckSum(P.encode()),B=P.fields,H=!1;for(d=0;d=0&&e<=255,"Byte value should be between 0 and 255."),[e]},sizeOf.BYTE=constant(1),encode.CHAR=function(e){return[e.charCodeAt(0)]},sizeOf.CHAR=constant(1),encode.CHARARRAY=function(e){for(var t=[],a=0;a>8&255,255&e]},sizeOf.USHORT=constant(2),encode.SHORT=function(e){return e>=LIMIT16&&(e=-(2*LIMIT16-e)),[e>>8&255,255&e]},sizeOf.SHORT=constant(2),encode.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},sizeOf.UINT24=constant(3),encode.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},sizeOf.ULONG=constant(4),encode.LONG=function(e){return e>=LIMIT32&&(e=-(2*LIMIT32-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},sizeOf.LONG=constant(4),encode.FIXED=encode.ULONG,sizeOf.FIXED=sizeOf.ULONG,encode.FWORD=encode.SHORT,sizeOf.FWORD=sizeOf.SHORT,encode.UFWORD=encode.USHORT,sizeOf.UFWORD=sizeOf.USHORT,encode.LONGDATETIME=function(){return[0,0,0,0,0,0,0,0]},sizeOf.LONGDATETIME=constant(8),encode.TAG=function(e){return assert(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},sizeOf.TAG=constant(4),encode.Card8=encode.BYTE,sizeOf.Card8=sizeOf.BYTE,encode.Card16=encode.USHORT,sizeOf.Card16=sizeOf.USHORT,encode.OffSize=encode.BYTE,sizeOf.OffSize=sizeOf.BYTE,encode.SID=encode.USHORT,sizeOf.SID=sizeOf.USHORT,encode.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?encode.NUMBER16(e):encode.NUMBER32(e)},sizeOf.NUMBER=function(e){return encode.NUMBER(e).length},encode.NUMBER16=function(e){return[28,e>>8&255,255&e]},sizeOf.NUMBER16=constant(3),encode.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},sizeOf.NUMBER32=constant(5),encode.REAL=function(e){var t=e.toString(),a=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(a){var r=parseFloat("1e"+((a[2]?+a[2]:0)+a[1].length));t=(Math.round(e*r)/r).toString()}var n,s,i="";for(n=0,s=t.length;n>8&255),t.push(255&r)}return t},sizeOf.UTF16=function(e){return 2*e.length};var eightBitMacEncodings={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};opentype_decode.MACSTRING=function(e,t,a,r){var n=eightBitMacEncodings[r];if(void 0!==n){for(var s="",i=0;i=128&&void 0===(s=a[s]))return;r.push(s)}return r}},sizeOf.MACSTRING=function(e,t){var a=encode.MACSTRING(e,t);return void 0!==a?a.length:0},encode.INDEX=function(e){var t,a=1,r=[a],n=[],s=0;for(t=0;t>8,a[p+1]=255&f,a=a.concat(n[t])}return a},sizeOf.TABLE=function(e){for(var t=0,a=e.fields.length,r=0;r=1)return a!=t&&(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3]),a;var u=Math.acos(e),i=Math.sqrt(1-e*e);if(Math.abs(i)<.001)return a[0]=.5*t[0]+.5*r[0],a[1]=.5*t[1]+.5*r[1],a[2]=.5*t[2]+.5*r[2],a[3]=.5*t[3]+.5*r[3],a;var o=Math.sin((1-n)*u)/i,c=Math.sin(n*u)/i;return a[0]=t[0]*o+r[0]*c,a[1]=t[1]*o+r[1]*c,a[2]=t[2]*o+r[2]*c,a[3]=t[3]*o+r[3]*c,a},quat4.str=function(t){return"["+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+"]"}; +WebGLUtils=function(){var e=function(e){return'
'+e+"
"},t=function(e,t){for(var r=["webgl","experimental-webgl","webkit-3d","moz-webgl"],n=null,i=0;i
Click here to upgrade your browser.'),null;var o=t(r,n);return o||i('It doesn\'t appear your computer can support WebGL.
Click here for more information.'),o}}}(),window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e,t){window.setTimeout(e,1e3/60)}; +!function(){"use strict";var e={version:"3.2"},t={declare:function(e,r){$.each(r,function(r,n){(null===n||void 0===n.value&&!n.get)&&(n={value:n}),n.name=r;var c=n.internal||"__"===r.substr(0,2);if(void 0===n.enumerable&&(n.enumerable=!c),void 0===n.type&&!n.get&&!c){var o=typeof n.value;"number"===o?n.type=t.check_number:"string"===o?n.type=t.check_string:n.value instanceof attributeVector?n.type=t.check_attributeVector:n.value instanceof attributeVectorPos?n.type=t.check_attributeVectorPos:n.value instanceof attributeVectorAxis?n.type=t.check_attributeVectorAxis:n.value instanceof attributeVectorSize?n.type=t.check_attributeVectorSize:n.value instanceof attributeVectorUp?n.type=t.check_attributeVectorUp:n.value instanceof vec&&(n.type=t.check_vec)}if(n.readonly&&n.set||n.onchanged&&n.set||void 0!==n.value&&n.get)throw new Error("Erroneous property definition '"+r+"'.");if(n.get)Object.defineProperty(e,r,{enumerable:n.enumerable,get:n.get,set:n.set||function(){throw new Error("Property '"+r+"' is read-only.")}});else if(n.type||n.onchanged){var i="__"+r,a={enumerable:n.enumerable,get:function(){return this[i]}};n.set?a.set=n.set:n.onchanged&&n.type?a.set=function(e){var t=this[i];this[i]=n.type.call(this,e,n),n.onchanged.call(this,t)}:n.onchanged?a.set=function(e){var t=this[i];this[i]=e,n.onchanged.call(this,t)}:n.type&&(a.set=function(e){this[i]=n.type.call(this,e,n)}),Object.defineProperty(e,i,{enumerable:!1,writable:!0,value:n.value}),Object.defineProperty(e,r,a)}else Object.defineProperty(e,r,{enumerable:n.enumerable,writable:!n.readonly,value:n.value})})},nullable_attributeVector:function(e,r){return null===e?null:t.check_attributeVector.call(this,e,r)},check_attributeVector:function(e,t){if(!(e instanceof vec))throw new Error("Property '"+t.name+"' must be a vector.");return new attributeVector(this,e.x,e.y,e.z)},check_attributeVectorPos:function(e,t){if(!(e instanceof vec))throw new Error("Property '"+t.name+"' must be a vector.");return new attributeVectorPos(this,e.x,e.y,e.z)},check_attributeVectorAxis:function(e,t){if(!(e instanceof vec))throw new Error("Property '"+t.name+"' must be a vector.");return new attributeVectorAxis(this,e.x,e.y,e.z)},check_attributeVectorSize:function(e,t){if(!(e instanceof vec))throw new Error("Property '"+t.name+"' must be a vector.");return new attributeVectorSize(this,e.x,e.y,e.z)},check_attributeVectorUp:function(e,t){if(!(e instanceof vec))throw new Error("Property '"+t.name+"' must be a vector.");return new attributeVectorUp(this,e.x,e.y,e.z)},check_vec:function(e,t){if(!(e instanceof vec))throw new Error("Property '"+t.name+"' must be a vector.");return e},check_number:function(e,t){return e},check_string:function(e,t){return e}},r=window;function n(t){for(var n in t)e[n]=t[n],r[n]=t[n]}n({glowscript:e,property:t,Export:n})}(); +!function(){"use strict";function t(t,e,r){if(t.__change(),0!==r.mag2){if(void 0!==t.__oldaxis&&(e=t.__oldaxis,t.__oldaxis=void 0),0!==r.dot(t.__up)){var n,i,o=e.diff_angle(r);if(o>1e-6)Math.abs(o-Math.PI)<1e-6?i=t.__up.multiply(-1):(n=cross(e,r),i=t.__up.rotate({angle:o,axis:n})),t.__up.__x=i.x,t.__up.__y=i.y,t.__up.__z=i.z}}else void 0===t.__oldaxis&&(t.__oldaxis=e)}function e(t,e,r){if(t.__change(),0===r.mag2&&void 0===t.__oldup&&(t.__oldup=e),void 0!==t.__oldup&&(e=t.__oldup,t.__oldup=void 0),0!==r.dot(t.__axis)){var n,i,o=e.diff_angle(r);if(o>1e-6)Math.abs(o-Math.PI)<1e-6?i=t.__axis.multiply(-1):(n=cross(e,r),i=t.__axis.rotate({angle:o,axis:n})),t.__axis.__x=i.x,t.__axis.__y=i.y,t.__axis.__z=i.z}}function r(t,e,n){if(!(this instanceof r))return void 0===e&&void 0===n?new r(t.x,t.y,t.z):new r(t,e,n);if(void 0===n||void 0===e)throw new Error("vector() requires 3 arguments: x, y, and z.");this.x=t,this.y=e,this.z=n}function n(t,e,r,n){this.__parent=t,this.__x=e,this.__y=r,this.__z=n,t&&t.__change()}function i(t,e,n,i){this.__parent=t,this.__x=e,this.__y=n,this.__z=i,t&&(t.__change(),t._pos_set=!0,t.__make_trail&&t.__update_trail(r(e,n,i)))}function o(e,n,i,o){let _;if(this.__parent=e,e&&(_=r(e.__axis)),this.__x=n,this.__y=i,this.__z=o,e){e.__axis=this;let r=Math.sqrt(n*n+i*i+o*o);e.__sizing&&(e.__size.__x=r),0===r?void 0===e.__oldaxis&&(e.__oldaxis=_):(void 0!==e.__oldaxis&&(_=e.__oldaxis,e.__oldaxis=void 0),window.__adjustupaxis&&t(e,_,this)),e.__change()}}function _(t,e,n,i){if(this.__parent=t,this.__x=e,this.__y=n,this.__z=i,t){if(t.__sizing){var o=t.__axis;0===o.x&&0===o.y&&0===o.z&&(void 0!==t.__oldaxis?(o=t.__oldaxis,t.__oldaxis=void 0):o=r(1,0,0));var _=o.norm().multiply(e);t.__axis.__x=_.x,t.__axis.__y=_.y,t.__axis.__z=_.z}t.__change()}}function s(t,r,n,i){var o;this.__parent=t,t&&(o=norm(t.__up)),this.__x=r,this.__y=n,this.__z=i,t&&(window.__adjustupaxis&&e(t,o,this),t.__change())}function a(){throw new Error("Cannot add a scalar and a vector.")}function u(){throw new Error("Cannot subtract a scalar and a vector.")}function p(){throw new Error("Cannot divide by a vector.")}function h(){throw new Error("Cannot use > with vectors.")}function c(){throw new Error("Cannot use < with vectors.")}function y(){throw new Error("Cannot use >= with vectors.")}function f(){throw new Error("Cannot use <= with vectors.")}function l(t){throw void 0===t?new Error("A variable is undefined."):new Error("A variable is 'NaN', not a number.")}n.prototype=new r(0,0,0),n.prototype.constructor=n,i.prototype=new r(0,0,0),i.prototype.constructor=i,o.prototype=new r(1,0,0),o.prototype.constructor=o,_.prototype=new r(1,1,1),_.prototype.constructor=_,s.prototype=new r(0,1,0),s.prototype.constructor=s,Object.defineProperty(n.prototype,"__x",{enumerable:!1,writable:!0,value:0}),Object.defineProperty(n.prototype,"x",{enumerable:!0,get:function(){return this.__x},set:function(t){this.__x=t,this.__parent.__change()}}),Object.defineProperty(n.prototype,"__y",{enumerable:!1,writable:!0,value:0}),Object.defineProperty(n.prototype,"y",{enumerable:!0,get:function(){return this.__y},set:function(t){this.__y=t,this.__parent.__change()}}),Object.defineProperty(n.prototype,"__z",{enumerable:!1,writable:!0,value:0}),Object.defineProperty(n.prototype,"z",{enumerable:!0,get:function(){return this.__z},set:function(t){this.__z=t,this.__parent.__change()}}),Object.defineProperty(i.prototype,"__x",{enumerable:!1,writable:!0,value:0}),Object.defineProperty(i.prototype,"x",{enumerable:!0,get:function(){return this.__x},set:function(t){this.__x=t,this.__parent.__change(),this.__parent._pos_set=!0,this.__parent.__make_trail&&this.__parent.__update_trail(r(this.__x,this.__y,this.__z))}}),Object.defineProperty(i.prototype,"__y",{enumerable:!1,writable:!0,value:0}),Object.defineProperty(i.prototype,"y",{enumerable:!0,get:function(){return this.__y},set:function(t){this.__y=t,this.__parent.__change(),this.__parent._pos_set=!0,this.__parent.__make_trail&&this.__parent.__update_trail(r(this.__x,this.__y,this.__z))}}),Object.defineProperty(i.prototype,"__z",{enumerable:!1,writable:!0,value:0}),Object.defineProperty(i.prototype,"z",{enumerable:!0,get:function(){return this.__z},set:function(t){this.__z=t,this.__parent.__change(),this.__parent._pos_set=!0,this.__parent.__make_trail&&this.__parent.__update_trail(r(this.__x,this.__y,this.__z))}}),Object.defineProperty(o.prototype,"__x",{enumerable:!1,writable:!0,value:0}),Object.defineProperty(o.prototype,"x",{enumerable:!0,get:function(){return this.__x},set:function(e){var r=norm(this.__parent.__axis);this.__x=e,this.__parent.__sizing&&(this.__parent.__size.x=this.mag),t(this.__parent,r,this)}}),Object.defineProperty(o.prototype,"__y",{enumerable:!1,writable:!0,value:0}),Object.defineProperty(o.prototype,"y",{enumerable:!0,get:function(){return this.__y},set:function(e){var r=norm(this.__parent.__axis);this.__y=e,this.__parent.__sizing&&(this.__parent.__size.x=this.mag),t(this.__parent,r,this)}}),Object.defineProperty(o.prototype,"__z",{enumerable:!1,writable:!0,value:0}),Object.defineProperty(o.prototype,"z",{enumerable:!0,get:function(){return this.__z},set:function(e){var r=norm(this.__parent.__axis);this.__z=e,this.__parent.__sizing&&(this.__parent.__size.x=this.mag),t(this.__parent,r,this)}}),Object.defineProperty(_.prototype,"__x",{enumerable:!1,writable:!0,value:0}),Object.defineProperty(_.prototype,"x",{enumerable:!0,get:function(){return this.__x},set:function(t){if(this.__x=t,this.__parent.__sizing){var e=this.__parent.__axis;0===e.x&&0===e.y&&0===e.z&&(void 0!==this.__parent.__oldaxis?(e=this.__parent.__oldaxis,this.__parent.__oldaxis=void 0):e=r(1,0,0));var n=e.norm().multiply(t);this.__parent.__axis.__x=n.x,this.__parent.__axis.__y=n.y,this.__parent.__axis.__z=n.z}this.__parent.__change()}}),Object.defineProperty(_.prototype,"__y",{enumerable:!1,writable:!0,value:0}),Object.defineProperty(_.prototype,"y",{enumerable:!0,get:function(){return this.__y},set:function(t){this.__y=t,this.__parent.__change()}}),Object.defineProperty(_.prototype,"__z",{enumerable:!1,writable:!0,value:0}),Object.defineProperty(_.prototype,"z",{enumerable:!0,get:function(){return this.__z},set:function(t){this.__z=t,this.__parent.__change()}}),Object.defineProperty(s.prototype,"__x",{enumerable:!1,writable:!0,value:0}),Object.defineProperty(s.prototype,"x",{enumerable:!0,get:function(){return this.__x},set:function(t){var r=norm(this.__parent.__up);this.__x=t,e(parent,r,this)}}),Object.defineProperty(s.prototype,"__y",{enumerable:!1,writable:!0,value:0}),Object.defineProperty(s.prototype,"y",{enumerable:!0,get:function(){return this.__y},set:function(t){var r=norm(this.__parent.__up);this.__y=t,e(parent,r,this)}}),Object.defineProperty(s.prototype,"__z",{enumerable:!1,writable:!0,value:0}),Object.defineProperty(s.prototype,"z",{enumerable:!0,get:function(){return this.__z},set:function(t){var r=norm(this.__parent.__up);this.__z=t,e(parent,r,this)}}),r.prototype.toString=function(){for(var t=[this.x,this.y,this.z],e=[],r=0;r<3;r++)e.push(__convert(t[r]));return"< "+e[0]+", "+e[1]+", "+e[2]+" >"},r.prototype.add=function(t){return t instanceof r||a(),new r(this.x+t.x,this.y+t.y,this.z+t.z)},r.prototype.sub=function(t){return t instanceof r||u(),new r(this.x-t.x,this.y-t.y,this.z-t.z)},r.prototype.multiply=function(t){return t instanceof r&&function(){throw new Error("Cannot multiply a vector by a vector.")}(),(void 0===t||Number.isNaN(t))&&l(t),new r(this.x*t,this.y*t,this.z*t)},r.prototype.divide=function(t){return t instanceof r&&p(),(void 0===t||Number.isNaN(t))&&l(t),new r(this.x/t,this.y/t,this.z/t)},property.declare(r.prototype,{mag:{get:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},set:function(t){var e=this.norm().multiply(t);this.x=e.x,this.y=e.y,this.z=e.z}},mag2:{get:function(){return this.x*this.x+this.y*this.y+this.z*this.z},set:function(t){var e=this.norm().multiply(Math.sqrt(t));this.x=e.x,this.y=e.y,this.z=e.z}},hat:{get:function(){return this.norm()},set:function(t){var e=t.hat.multiply(this.mag);this.x=e.x,this.y=e.y,this.z=e.z}}}),r.prototype.norm=function(){var t=this.mag;return 0==t?new r(0,0,0):new r(this.x/t,this.y/t,this.z/t)},r.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},r.prototype.equals=function(t){return null!==t&&(this.x===t.x&&this.y===t.y&&this.z===t.z)},r.prototype.proj=function(t){var e=norm(t);return e.multiply(this.dot(e))},r.prototype.comp=function(t){return this.dot(norm(t))},r.prototype.cross=function(t){return new r(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)},r.prototype.diff_angle=function(t){var e=this.norm().dot(t.norm());return e>1?0:e<-1?Math.PI:Math.acos(e)},r.prototype.rotate=function(t){var e,n,i=arguments.length;if(i<1||i>2)throw new Error("vector.rotate takes 1 or 2 arguments");for(var o=0;o"]=function(t){return t instanceof r?h():this>t},Number.prototype["<"]=function(t){return t instanceof r?c():this="]=function(t){return t instanceof r?y():this>=t},Number.prototype["<="]=function(t){return t instanceof r?f():this<=t},Number.prototype["%"]=function(t){return this%t},Number.prototype["-u"]=function(){return-this},r.prototype["+"]=r.prototype.add,r.prototype["-"]=r.prototype.sub,r.prototype["*"]=r.prototype.multiply,r.prototype["/"]=function(t){return this.divide(t)},r.prototype["**"]=function(t){!function(){throw new Error("Cannot raise a vector to a power.")}()},r.prototype["-u"]=function(){return new r(-this.x,-this.y,-this.z)},r.prototype[">"]=function(t){h()},r.prototype["<"]=function(t){c()},r.prototype[">="]=function(t){y()},r.prototype["<="]=function(t){f()},Export({vec:r,vector:r,attributeVector:n,attributeVectorPos:i,attributeVectorAxis:o,attributeVectorSize:_,attributeVectorUp:s})}(),function(){"use strict";String.prototype.__GSrep=function(t,e,r){void 0===r&&(r=1e6);var n=this;if(t===e)return n;for(var i=t.length,o=0;;){if(o>=r)return n;o++;var _=n.search(t);if(_<0)return n;n=n.slice(0,_)+e+n.slice(_+i)}},Export({log10:function(t){const e=Math.log(10);return log(t)/e},mag:function(t){return t.mag},mag2:function(t){return t.mag2},norm:function(t){return t.norm()},hat:function(t){return t.hat},dot:function(t,e){return t.dot(e)},cross:function(t,e){return t.cross(e)},proj:function(t,e){return t.proj(e)},comp:function(t,e){return t.comp(e)},diff_angle:function(t,e){return t.diff_angle(e)},rotate:function(t){var e,r,n,i,o=arguments.length;if(o<1||o>3)throw new Error("rotate(vector, ...) takes 1 to 3 arguments");e=arguments[0];for(var _=1;_=429e7)return null;h<0?this.index.push(a+h):((null===i||p.__pos.xo)&&(o=p.__pos.x),(null===n||p.__pos.yt)&&(t=p.__pos.y),(null===u||p.__pos.ze)&&(e=p.__pos.z),this.pos.push(p.__pos.x,p.__pos.y,p.__pos.z),this.normal.push(p.__normal.x,p.__normal.y,p.__normal.z),this.color.push(p.__color.x,p.__color.y,p.__color.z),p.__opacity<1&&(this.model_transparent=!0),this.opacity.push(p.__opacity),this.shininess.push(p.__shininess),this.emissive.push(p.__emissive),this.texpos.push(p.__texpos.x,p.__texpos.y),this.bumpaxis.push(p.__bumpaxis.x,p.__bumpaxis.y,p.__bumpaxis.z),this.index.push(a))}else{if(a+s.pos.length/3>=429e7)return null;for(var r=[p.__color.x,p.__color.y,p.__color.z],l=0;lo)&&(o=s.pos[l])):l%3==1?((null===n||s.pos[l]t)&&(t=s.pos[l])):l%3==2&&((null===u||s.pos[l]e)&&(e=s.pos[l])),this.pos.push(s.pos[l]);for(l=0;l","?",")","!","@","#","$","%","^","&","*","(",":",":","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","^","_","~","","","","","","","","","","*","+","","","","","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","","{","|","}","~","delete"];i[187]="+",i[189]="_",i[192]="~",i[219]="{",i[220]="|",i[221]="}",i[186]=":",i[222]='"',i[188]="<",i[190]=">",i[191]="?";var s,n,a=!1;window.print_anchor=$("
").css("white-space","pre").appendTo($("body")),window.print_anchor.css({float:"left"});var _=0;function r(t){if(!(this instanceof r))return new r(t);for(var e in t||(t={}),r.activated=[],r.selected=this,r.hasmouse=null,this.__title_anchor=$("
"),this.__caption_anchor=$("
"),this.__titletext="",this.__captiontext="","title"in t&&(this.__titletext=t.title,delete t.title),"caption"in t&&(this.__captiontext=t.caption,delete t.caption),this.__align="none","align"in t&&(this.__align=t.align,delete t.align),this.__lastevent=null,this.__autoscale=!0,"autoscale"in t&&(this.__autoscale=t.autoscale,delete t.autoscale),this.__range=10,"width"in t&&(this.__width=t.width,delete t.width),"height"in t&&(this.__height=t.height,delete t.height),t)this[e]=t[e];this.hasmouse=!1,this.__needs_update=!1,this.events=[],this.wrapper=$("
"),this.menu=$("
"),this.__canvas_element=document.createElement("canvas"),this.__overlay_element=document.createElement("canvas"),this.elements=$([this.__canvas_element,this.__overlay_element]),this.__overlay_objects={objects:[],__changed:!1},this.__mouse_move=null,this.__visiblePrimitives={},this.lights=[],distant_light({canvas:this,direction:vec(.22,.44,.88),color:vec(.8,.8,.8)}),distant_light({canvas:this,direction:vec(-.88,-.22,-.44),color:vec(.3,.3,.3)}),this.trails=[],this.arrows=[],this.attached_lights=[],this.billboards=[],this.update_billboards=!1,this.__points_objects=[],this.__opaque_objects={},this.__transparent_objects={},this.vertex_id=1;var i=100;this.__vertices={Nalloc:i,pos:new Float32Array(300),normal:new Float32Array(300),color:new Float32Array(300),opacity:new Float32Array(i),shininess:new Float32Array(i),emissive:new Float32Array(i),texpos:new Float32Array(200),bumpaxis:new Float32Array(300),object_info:{},available:[]},this.__vertices.normal[2]=1,this.__sort_objects={opaque:{plain:{},textures:{},bumpmaps:{},textures_and_bumpmaps:{}},transparent:{plain:{},textures:{},bumpmaps:{},textures_and_bumpmaps:{}}},this.camera=orbital_camera(this),this.mouse=new o(this),this.mouse.pos=vec(0,0,0),this.mouse.ray=vec(0,0,1),this.textures={},this.textures_requested={},this.__changed={},this.__vertex_changed={},this.visible=!0,this.waitfor_textures=!1,s="",this.__expecting_key=!1,this.center=this.center,this.axis=this.axis,this.up=this.up,this.__triggered=void 0,this.__waitfor_bound=void 0,this.__id=_,_++}function o(t){this.canvas=t}property.declare(r.prototype,{__activate:function(){this.__activated=!0,this.__activate=function(){};var t=r.container;this.__title_anchor.css("white-space","pre").appendTo(t),this.menu.css("white-space","pre").appendTo(t),this.wrapper.addClass("glowscript-canvas-wrapper").css("display","inline-block").appendTo(t),this.__caption_anchor.css("white-space","pre").appendTo(t),this.wrapper.css("position","relative");var e=this.__canvas_element;e.style.position="absolute";var i=this.__overlay_element;i.style.position="relative",i.style.backgroundColor="transparent",this.width=this.__width,this.height=this.__height,this.wrapper.append(this.__canvas_element),this.wrapper.append(this.__overlay_element),this.wrapper.resizable({alsoResize:[this.__canvas_element,this.__overlay_element],resize:function(t,e){this.__canvas_element.width=this.__canvas_element.style.width=this.__overlay_element.width=this.__overlay_element.style.width=this.__width=e.size.width,this.__canvas_element.height=this.__canvas_element.style.height=this.__overlay_element.height=this.__overlay_element.style.height=this.__height=e.size.height,this.trigger("resize",{event:"resize"})}.bind(this)}),this.resizable||this.wrapper.resizable("disable"),this.wrapper.css("float",this.__align),this.camera.__activate&&this.camera.__activate(),this.__handleEvents(),this.__titletext&&(this.title=this.__titletext),this.__captiontext&&(this.caption=this.__captiontext),this.__renderer=new WebGLRenderer(this,e,i),r.activated.push(this)},remove:function(){for(var t in this.__visiblePrimitives)this.__visiblePrimitives[t].visible=!1;for(var t in this.__overlay_objects.objects)this.__overlay_objects.objects[t].visible=!1;this.__activated&&(r.activated[this.__id]=null),this.wrapper.remove()},__handleEvents:function(){var s=this;s.elements.bind("mouseenter mouseleave",function(t){s.trigger("mouse",t)});var n={shift:16,ctrl:17,alt:18};$(document).bind("keydown keyup",function(_){for(var r in n)if(n[r]==_.which){s.mouse[r]="keydown"==_.type;break}_.shift=s.mouse.shift||a,_.key=e[_.which],a&&65<=_.which&&_.which<=90?_.key=i[_.which]:s.mouse.shift&&(_.key=i[_.which]);var o=t.indexOf(_.key);"keydown"==_.type?o<0&&t.push(_.key):o>=0&&t.splice(o,1),s.__expecting_key&&(_.event=_.type,20==_.which&&"keydown"==_.type&&(a=!a),_.alt=s.mouse.alt,_.ctrl=s.mouse.ctrl,s.trigger(_.type,_))})},screenshot:async function(t){var e=await this.__renderer.screenshot();if(t){var i=this.__overlay_element,s=document.createElement("canvas");s.width=i.width,s.height=i.height,await e.decode(),s.getContext("2d").drawImage(e,0,0),s.getContext("2d").drawImage(i,0,0);var n=s.toDataURL();return s.remove(),n}return e.src},capture:async function(t,e){if(void 0===e&&(e=!0),t.constructor!==String)throw new Error("A capture file name must be a string.");".png"!=t.slice(-4)&&(t+=".png");var i=await this.screenshot(e),s=document.createElement("a");s.href=i,s.download=t,s.click(),s.remove()},waitfor:async function(t){var e,i=this,s=this.__expecting_key,n=t;function a(t){i.__waitfor_bound=t}for(i.__waitfor_bound=void 0,i.__expecting_key=n.search("key")>=0,"textures"==n&&(i.waitfor_textures=!0),i.bind(n,a);;)if(await rate(60),void 0!==(e=i.__waitfor_bound)){if("textures"==n&&null===e)break;if(n.search(e.type)>=0)break}return i.__waitfor_bound=void 0,i.unbind(n,a),n="",i.__expecting_key=s,new Promise(t=>{t(e)})},pause:async function(t){var e,i=this;n=this.__expecting_key,i.__waitfor_bound=void 0;var a="";function _(t){i.__waitfor_bound=t}if(void 0!==t&&(a=t.toString()),a.length>0){for(null==i.__prompt&&(i.__prompt=label({canvas:i,align:"right",pixel_pos:!0,height:14,color:color.black,background:color.white,opacity:1,box:!1})),i.__prompt.pos=vec(i.__width,i.__height-12,0),i.__prompt.text=a,i.__prompt.visible=!0,i.bind("click",_);;)if(await rate(60),void 0!==(e=i.__waitfor_bound)){i.__prompt.visible=!1;break}}else{null==i.__draw&&(i.__draw=draw({canvas:i}));var r=i.width-5,o=i.height-20;for(i.__draw.points=[vec(r,o,0),vec(r-30,o-13,0),vec(r-30,o+15,0),vec(r,o,0)],i.__draw.opacity=1,i.__draw.color=color.black,i.__draw.fillcolor=color.white,i.__draw.visible=!0,i.bind("click",_);;)if(await rate(60),void 0!==(e=i.__waitfor_bound)){i.__draw.visible=!1;break}}return i.__waitfor_bound=void 0,i.unbind(s,_),i.__expecting_key=n,new Promise(t=>{t(e)})},select:function(){window.__context.canvas_selected=this},title_anchor:{get:function(){return this.__activated||this.__activate(),this.__title_anchor},set:function(t){throw new Error("Cannot change title_anchor")}},caption_anchor:{get:function(){return this.__activated||this.__activate(),this.__caption_anchor},set:function(t){throw new Error("Cannot change caption_anchor")}},title:{get:function(){return this.__titletext},set:function(t){this.__titletext=t,this.__title_anchor.html(t)}},caption:{get:function(){return this.__captiontext},set:function(t){this.__captiontext=t,this.__caption_anchor.html(t)}},append_to_title:function(t){for(var e="",i=arguments.length,s=0;s=0&&(this.__expecting_key=!0);for(var i=0;i=0&&(this.__expecting_key=!1);for(var i=t.split(" "),s=0;s=0&&(n=n.replace(_,""))}return void(this.events[s][0]=n)}}},trigger:async function(t,e){var i={type:t,event:e};if("mouse"==t){i={type:e.type,pageX:e.pageX,pageY:e.pageY,which:1};this.mouse.__update(i),i.event=i.type,i.pos=this.mouse.pos,"mousedown"==i.type?(i.press="left",i.release=null):"mousemove"==i.type?(i.press=null,i.release=null):"mouseup"==i.type?(i.press=null,i.release="left"):"mouseenter"==i.type||"mouseleave"==i.type?(i.press=null,i.release=null):"click"==i.type&&(i.press=null,i.release="left")}else"key"==t.slice(0,3)&&((i={type:t,event:t,which:e.which}).key=e.key,i.alt=e.alt,i.ctrl=e.ctrl,i.shift=e.shift);if(null===e||(this.__triggered=i,i.canvas=this,void 0!==i.type)){for(var s=0;s=0){let t=this.events[s][1];try{await t(i)}catch(t){window.__reportScriptError(t)}}"mousemove"==i.type&&(this.__mouse_move=null)}},background:new vec(0,0,0),opacity:1,ambient:new vec(.2,.2,.2),__change:function(){null!==this.__lastevent&&this.hasmouse&&this.mouse.__update(this.__lastevent),this.__overlay_objects&&(this.__overlay_objects.__changed=!0)},center:new attributeVector(null,0,0,0),axis:new attributeVector(null,0,0,-1),up:new attributeVector(null,0,1,0),forward:{get:function(){return this.__axis},set:function(t){this.axis=t}},__last_axis:null,__last_center:null,__activated:!1,userzoom:!0,userspin:!0,userpan:!0,fov:60*Math.PI/180,width:{value:480,onchanged:function(){this.__canvas_element.width=this.__canvas_element.style.width=this.__overlay_element.width=this.__overlay_element.style.width=this.__width}},height:{value:300,onchanged:function(){this.__canvas_element.height=this.__canvas_element.style.height=this.__overlay_element.height=this.__overlay_element.style.height=this.wrapper[0].style.height=this.__height}},align:{get:function(){return this.__align},set:function(t){if("left"!=t&&"right"!=t&&"none"!=t)throw new Error("align must be 'left', 'right', or 'none' (the default).");this.__align=t}},resizable:{value:!0,onchanged:function(){this.__activated&&this.wrapper.resizable((this.resizable?"en":"dis")+"able")}},autoscale:{get:function(){return this.__autoscale},set:function(t){this.__autoscale&&!t&&Autoscale.compute_autoscale(this),this.__autoscale=t}},range:{get:function(){return this.__autoscale&&Autoscale.compute_autoscale(this),this.__range},set:function(t){this.__autoscale=!1,this.__range=t,null!==this.__lastevent&&this.mouse.__update(this.__lastevent)}},pixel_to_world:{get:function(){var t=this.__width,e=this.__height,i=2*this.range;return t>=e?i/e:i/t},set:function(t){throw new Error("Cannot assign a value to pixel_to_world.")}},objects:{get:function(){var t=[];for(var e in this.__visiblePrimitives){var i=this.__visiblePrimitives[e];i.__obj?i==i.__obj.__components[0]&&i.__obj.visible&&t.push(i.__obj):t.push(i)}for(var e in this.__overlay_objects.objects){var s=this.__overlay_objects.objects[e];s instanceof label&&t.push(s)}return t}}}),property.declare(r,{selected:{get:function(){return window.__context.canvas_selected||null},set:function(t){window.__context.canvas_selected=t}},get_selected:function(){return window.__context.canvas_selected||null},all:{get:function(){var t=window.__context.canvas_all;return void 0===t&&(t=window.__context.canvas_all=[]),t}},container:{get:function(){return window.__context.glowscript_container||null},set:function(t){window.__context.glowscript_container=$(t)}}}),property.declare(o.prototype,{canvas:null,pos:null,ray:null,__pickx:null,__picky:null,pick:function(){return this.canvas.__renderer.render(1)},project:function(t){if(void 0===t.normal)throw new Error("scene.mouse.project() must specify a normal");var e,i=t.normal;void 0===t.d&&void 0===t.point?e=i.dot(this.canvas.__center):void 0!==t.d?e=t.d:void 0!==t.point&&(e=i.dot(t.point));var s=i.dot(this.canvas.camera.pos)-e,n=i.dot(this.ray);if(0==n)return null;var a=-s/n;return this.canvas.camera.pos.add(this.ray.multiply(a))},alt:!1,ctrl:!1,shift:!1,__update:function(t){var e,i=this.canvas;e=i.__width>i.__height?2*i.__range/i.__height:2*i.__range/i.__width;var s=$(i.__canvas_element).offset();this.__pickx=t.pageX-s.left,this.__picky=i.__height-(t.pageY-s.top);var n=(this.__pickx-i.__width/2)*e,a=(this.__picky-i.__height/2)*e,_=i.__axis.norm().cross(i.__up).norm(),o=_.cross(i.__axis.norm());this.pos=i.__center.add(_.multiply(n).add(o.multiply(a))),this.ray=this.pos.sub(i.camera.pos).norm(),r.hasmouse=i,i.__lastevent=t}}),Export({canvas:r,keysdown:function(){for(var e=[],i=0;i3)throw new Error("camera.rotate takes 1 to 3 arguments");for(var n,t={},s=0;s1e-6&&(r.axis=r.__axis.rotate({angle:o,axis:u})),r.up=r.__up.rotate({angle:o,axis:u}),r.center=l.add(this.axis),window.__adjustupaxis=!0}},follow:function(e){this.follower=e},__activate:function(){var e,a,n,t,s,i,l=this.canvas,o=!1,u=[null,null],r=[null,null],c=[null,null],h=[null,null],g=null,_=0,p=!1,m=!1,f=!1,v=null,d=null,x=0,w=!1,b=[null,null],M=function(e){var a=Math.exp(.05*-e);l.range=l.range*a},Y=function(e){var a=e.pageX-u[0],n=e.pageY-r[0];.01*a,(_+=.01*n)<-1.4&&(_=-1.4),_>1.4&&(_=1.4),l.__axis=l.__axis.rotate({angle:-.01*a,axis:l.__up});var t=l.__up.diff_angle(l.__axis.multiply(-1)),s=.01*n;s>=t||s<=t-Math.PI||(l.__axis=l.__axis.rotate({angle:-s,axis:l.__axis.cross(l.__up)}))};$(document).bind("contextmenu",function(e){return!o}),l.elements.mousewheel(function(e,a){return l.userzoom&&M(a),!1}),l.elements.mousedown(function(a){if(1==a.which&&(m=!0),3==a.which&&(f=!0),e=l.userspin&&(3==a.which||1==a.which&&l.mouse.ctrl&&!l.mouse.alt),n=l.userzoom&&(2==a.which||1==a.which&&l.mouse.alt&&!l.mouse.ctrl||m&&f),t=l.userpan&&1==a.which&&l.mouse.shift,3!=a.which||e||n)return c[0]=u[0]=a.pageX,h[0]=r[0]=a.pageY,e||n||t?o=!0:1==a.which&&l.trigger("mouse",a),t&&(l.autoscale=!1,l.mouse.__update(a),g=l.mouse.pos),p=!0,a.preventDefault(),a.stopPropagation(),!1}),l.elements.mousemove(function(a){if(a.pageX!==u[0]||a.pageY!==r[0])if(p){if(n){var s=r[0]-a.pageY;0!==s&&M(.1*s)}else e?Y(a):t?function(e){var a=vec(l.__last_center);l.mouse.__update(e);var n=l.mouse.pos,t=l.__axis.cross(l.__up).hat,s=t.cross(l.__axis).hat,i=n.sub(g),o=i.dot(t),u=i.dot(s);g=n.sub(i),l.__center=l.__center.sub(t.multiply(o).add(s.multiply(u))),l.__last_center=a}(a):1==a.which&&(l.__mouse_move=a);t||(u[0]=a.pageX,r[0]=a.pageY)}else l.mouse.__update(a)}),l.elements.mouseup(function(a){if(1==a.which&&(m=!1),3==a.which&&(f=!1),p){if(3==a.which&&o&&setTimeout(function(){o=!1},0),!(e||n||t))if(1==a.which)l.trigger("mouse",a),abs(a.pageX-c[0])<=5&&abs(a.pageY-h[0])<=5&&(a.type="click",l.trigger("mouse",a));else if(3==a.which)return void(o=!0);e=n=t=p=!1,u=[null,null],r=[null,null]}}),l.elements.bind("touchstart",function(a){var t;e=n=w=!1,v=d=null;var o=a.originalEvent.targetTouches;if(!(o.length>2)&&(2!=o.length||l.userspin||l.userzoom)){x++;for(var g=0;g2)){for(var _,p,m=[null,null],f=[null,null],x=[0,0],y=[0,0],X=0;X15||z[1].mag>15))return;i=null,n=!0;var E=b[1].sub(b[0]).norm();E.cross(z[1]).sub(E.cross(z[0])).mag>10&&(a=l.userspin,l.userspin||(n=!1))}}if(null!==i)if(2==g.length)i=null;else{var k=Math.abs(x[0])<=5&&Math.abs(y[0])<=5;!e&&o>150&&k?(l.trigger("mouse",i),i=null):k||(e=l.userspin,i=null)}else{if(m[0]===u[0]&&f[0]===r[0]&&m[1]===u[1]&&f[1]===r[1])return;if(t.pageX=m[0],t.pageY=f[0],t.type="mousemove",e)Y(t);else if(n){var T=m[1]-m[0],j=f[1]-f[0];if(a){var q=Math.atan2(j,T);if(null!==d){var P,D=vec(Math.cos(d),Math.sin(d),0),A=vec(Math.cos(q),Math.sin(q),0),C=D.cross(A),I=Math.abs(Math.asin(C.mag));P=C.z>=0?-I:I,p=P,l.up=l.up.rotate({angle:2*p,axis:l.__axis})}d=q}else if(l.userzoom){var L=Math.sqrt(T*T+j*j);null!==v&&L!=v&&M(.2*(L-v)),v=L}}else l.__mouse_move=t}u[0]=m[0],u[1]=m[1],r[0]=f[0],r[1]=f[1]}}}),l.elements.bind("touchend",function(a){x--,null===i||e||n||(l.trigger("mouse",i),i=null);var t=a.originalEvent.changedTouches;a.pageX=t[0].clientX,a.pageY=t[0].clientY,e||n||(a.type="mouseup",l.trigger("mouse",a),Math.abs(a.pageX-c[0])<=5&&Math.abs(a.pageY-h[0])<=5&&(a.type="click",l.trigger("mouse",a))),n&&(x>0?w=!0:n=w=!1),e=!1,u=[null,null],r=[null,null],v=d=null})}}),Export({orbital_camera:e})}(); +!function(){"use strict";function _(){}$.extend(_.prototype,{xmin:null,ymin:null,zmin:null,xmax:null,ymax:null,zmax:null,zx_camera:0,zy_camera:0,last_zx_camera:-1,last_zy_camera:-1,point_extent:function(_,a){this.xmin=Math.min(a.x,this.xmin),this.ymin=Math.min(a.y,this.ymin),this.zmin=Math.min(a.z,this.zmin),this.xmax=Math.max(a.x,this.xmax),this.ymax=Math.max(a.y,this.ymax),this.zmax=Math.max(a.z,this.zmax),_.__xmin=Math.min(a.x,_.__xmin),_.__ymin=Math.min(a.y,_.__ymin),_.__zmin=Math.min(a.z,_.__zmin),_.__xmax=Math.max(a.x,_.__xmax),_.__ymax=Math.max(a.y,_.__ymax),_.__zmax=Math.max(a.z,_.__zmax)}}),Export({Autoscale:{compute_autoscale:function(a){var t=a.__extent;t||(t=a.__extent=new _);var e=a.center.x,m=a.center.y,n=a.center.z,r=a.__visiblePrimitives;t.zx_camera=0,t.zy_camera=0;var i=1/Math.tan(a.__fov/2);t.__cot_hfov=i,t.__centerx=a.center.x,t.__centery=a.center.y,t.__centerz=a.center.z;var x,c=!1;for(var s in r)if("point"!=(x=r[s]).constructor.name&&"points"!=x.constructor.name){if(c=!0,a.__changed[x.__id]||null===x.__zx_camera||null===x.__zy_camera){if(x.__get_extent(t),null===x.__xmin)continue;var h=Math.max(Math.abs(x.__xmin-e),Math.abs(x.__xmax-e)),z=Math.max(Math.abs(x.__ymin-m),Math.abs(x.__ymax-m)),o=Math.max(Math.abs(x.__zmin-n),Math.abs(x.__zmax-n));x.__zx_camera=h*i+o,x.__zy_camera=z*i+o}t.zx_camera=Math.max(t.zx_camera,x.__zx_camera),t.zy_camera=Math.max(t.zy_camera,x.__zy_camera)}c&&((t.zx_camera>t.last_zx_camera||t.zx_camerat.last_zy_camera||t.zy_camerat.zy_camera?a.__width>=a.__height?a.__range=a.__height/a.__width*1.1*t.zx_camera/i:a.__range=1.1*t.zx_camera/i:a.__width>=a.__height?a.__range=1.1*t.zy_camera/i:a.__range=a.__width/a.__height*1.1*t.zy_camera/i,t.last_zx_camera=t.zx_camera,t.last_zy_camera=t.zy_camera))},find_extent:function(_,a){if("points"!=_.constructor.name)if("simple_sphere"!=_.constructor.name&&"vp_simple_sphere"!=_.constructor.name||!_.__pixels){var t,e=_.__size,m=e.x,n=e.y,r=e.z,i=_.__pos,x=i.x,c=i.y,s=i.z,h=_.__hasPosAtCenter;t=h?Math.sqrt(m*m+n*n+r*r)/2:Math.sqrt(m*m+n*n/4+r*r/4);var z=x-a.__centerx,o=c-a.__centery,y=s-a.__centerz,l=(Math.abs(z)+t)*a.__cot_hfov+Math.abs(y)+t,p=(Math.abs(o)+t)*a.__cot_hfov+Math.abs(y)+t;if(!(l>r;return e+1}this.reset(),this.initTexture=function(e,r,t){if(t?r.__tex.bumpmap=e:r.__tex.file=e,e in b.textures)t?r.__tex.bumpmap_ref.reference=b.textures[e]:r.__tex.texture_ref.reference=b.textures[e];else if(e in b.textures_requested)b.textures_requested[e].push([r,t]);else{b.textures_requested[e]=[[r,t]];var _=msclock();t?r.__tex.bumpmap_t0=_:r.__tex.texture_t0=_;var a=new Image;a.crossOrigin="anonymous",a.src=e,a.onload=function(){!function(e,r,t){var _,a;if(t?(_=r.__tex.bumpmap,a=r.__tex.bumpmap_ref,r.__tex.bumpmap_t0):(_=r.__tex.file,a=r.__tex.texture_ref,r.__tex.texture_t0),msclock(),_ in b.textures)a.reference=b.textures[_];else{if(b.textures[_]=a.reference=x.createTexture(),x.bindTexture(x.TEXTURE_2D,a.reference),x.pixelStorei(x.UNPACK_FLIP_Y_WEBGL,!0),!ge(e.width)||!ge(e.height)){var i=document.createElement("canvas");i.width=Be(e.width),i.height=Be(e.height),i.getContext("2d").drawImage(e,0,0,i.width,i.height),e=i}x.texImage2D(x.TEXTURE_2D,0,x.RGBA,x.RGBA,x.UNSIGNED_BYTE,e),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MAG_FILTER,x.LINEAR),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MIN_FILTER,x.LINEAR_MIPMAP_NEAREST),x.generateMipmap(x.TEXTURE_2D),x.bindTexture(x.TEXTURE_2D,null)}if(_ in b.textures_requested)for(var n=b.textures_requested[_];n.length>0;){var s=n.pop();s[1]?s[0].__tex.bumpmap_ref.reference=a.reference:s[0].__tex.texture_ref.reference=a.reference,s[0].__change()}}(a,r,t)}}};var De=0;b.__last_width=-1,b.__last_height=-1,b.__last_axis=b.__axis,b.__last_up=b.__up,b.__waitfor_image=!1;var Ue=1,ye={C0:null,D0:null,C1:null,D1:null,C2:null,D2:null,C3:null,D3:null,C4:null,EXTENT_TEXTURE:null},we=x.getParameter(x.MAX_TEXTURE_IMAGE_UNITS)>=16,Ne={C0:x.TEXTURE2,D0:x.TEXTURE3,C1:x.TEXTURE4,D1:x.TEXTURE5,C2:x.TEXTURE6,D2:x.TEXTURE7,C3:x.TEXTURE8,D3:x.TEXTURE9,C4:x.TEXTURE10,EXTENT_TEXTURE:x.TEXTURE11};function Ye(e){x.activeTexture(Ne[e]),x.bindTexture(x.TEXTURE_2D,ye[e]),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MIN_FILTER,x.LINEAR),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_S,x.CLAMP_TO_EDGE),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_T,x.CLAMP_TO_EDGE),x.texImage2D(x.TEXTURE_2D,0,x.RGBA,Ue*b.__width,Ue*b.__height,0,x.RGBA,x.UNSIGNED_BYTE,null),x.bindTexture(x.TEXTURE_2D,null)}for(var Ce in ye)ye[Ce]=x.createTexture(),Ye(Ce);var Me=x.createFramebuffer();x.bindFramebuffer(x.FRAMEBUFFER,Me);var Ie=x.createRenderbuffer();x.bindRenderbuffer(x.RENDERBUFFER,Ie),x.renderbufferStorage(x.RENDERBUFFER,x.DEPTH_COMPONENT16,Ue*b.__width,Ue*b.__height),x.framebufferRenderbuffer(x.FRAMEBUFFER,x.DEPTH_ATTACHMENT,x.RENDERBUFFER,Ie),x.bindRenderbuffer(x.RENDERBUFFER,null),x.bindFramebuffer(x.FRAMEBUFFER,null);var Pe=new Uint8Array(3),ke=x.createTexture();x.activeTexture(x.TEXTURE1),x.bindTexture(x.TEXTURE_2D,ke),x.texImage2D(x.TEXTURE_2D,0,x.RGB,1,1,0,x.RGB,x.UNSIGNED_BYTE,Pe);var Xe=x.createTexture();x.activeTexture(x.TEXTURE0),x.bindTexture(x.TEXTURE_2D,Xe),x.texImage2D(x.TEXTURE_2D,0,x.RGB,1,1,0,x.RGB,x.UNSIGNED_BYTE,Pe),this.render=function(m){if(m==e&&b.waitfor_textures){var R=b.objects;for(var p in R)if(void 0!==(Qe=R[p]).__tex&&!Qe.ready)return;b.waitfor_textures=!1,b.trigger("textures",null)}if(!b.visible){if(m==e)return;return null}if(b.__width!=b.__last_width||b.__height!=b.__last_height){for(var h in ye)Ye(h);x.bindFramebuffer(x.FRAMEBUFFER,Me),x.bindRenderbuffer(x.RENDERBUFFER,Ie),x.renderbufferStorage(x.RENDERBUFFER,x.DEPTH_COMPONENT16,Ue*b.__width,Ue*b.__height),x.framebufferRenderbuffer(x.FRAMEBUFFER,x.DEPTH_ATTACHMENT,x.RENDERBUFFER,Ie),x.bindRenderbuffer(x.RENDERBUFFER,null),x.bindFramebuffer(x.FRAMEBUFFER,null)}if(m==e){for(let e of b.arrows){let r;if(e.__run){if(void 0!==e.__object){if(void 0===e.__object.pos)continue;r=e.__object.pos}if(e.pos=r,void 0!==e.__object[e.__attr]){let r=e.__object[e.__attr];r.mag>0?(e.visible||(e.visible=!0),e.axis=r.multiply(e.scale)):e.visible=!1}}}for(var v in b.trails){var A;if((Ze=b.trails[v]).__run&&void 0!==(Qe=Ze.__obj)){if("string"==typeof Qe){if(void 0===(A=Ze[Qe]))continue}else if("function"!=typeof Qe){if(void 0===Qe||!Qe.visible)continue;if(!Qe._pos_set)continue;if(Qe.__interval>0)continue;if(void 0===Qe.__pos)continue;A=Qe.__pos}else A=Qe();if(null===Ze.__last_pos||!A.equals(Ze.__last_pos)){if(Ze.pps>0){var $=msclock();if(null===Ze.__last_time&&(Ze.last_time=$),$-Ze.__last_time>1e3/Ze.pps)Ze.__last_time=$;else if($!=Ze.__last_time)continue}Ze.__trail.push({pos:A,color:Ze.color,radius:Ze.radius,retain:Ze.retain}),Ze.__last_pos=vec(A)}}}for(let e of b.attached_lights)e.pos=e.__obj.light_in_world(e.offset);if(b.update_billboards||!b.__axis.equals(b.__last_axis)||!b.__up.equals(b.__last_up))for(b.update_billboards=!1,v=0;v=E.clientHeight?Fe.distance=b.__range/Math.tan(b.__fov/2):Fe.distance=b.__range*(E.clientHeight/E.clientWidth)/Math.tan(b.__fov/2),Fe.pos=mat4.multiplyVec3(mat4.rotateX(mat4.rotateY(mat4.identity(mat4.create()),-Fe.angleX),-Fe.angleY),vec3.create([0,0,Fe.distance])),Fe.pos=vec3.create([b.__center.x+Fe.pos[0],b.__center.y+Fe.pos[1],b.__center.z+Fe.pos[2]]),Fe.zNear=Fe.distance/100,Fe.zFar=10*Fe.distance;var Ee=mat4.perspective(Fe.fovy,E.clientWidth/E.clientHeight,Fe.zNear,Fe.zFar),ve=mat4.lookAt(Fe.pos,Fe.target,Fe.up);for(v=0;v0){var Pe=2*b.__range/b.__width;for(v=0;v0&&(b.__overlay_objects.__changed||!(b.__axis.equals(b.__last_axis)&&b.__center.equals(b.__last_center)&&b.__up.equals(b.__last_up)&&b.__width==b.__last_width&&b.__height==b.__last_height&&b.__range==b.__last_range))){b.__overlay_objects.__changed=!1;var Se=b.overlay_context;for(Se.clearRect(0,0,b.__width,b.__height),v=0;vi)&&x.uniform2fv(r.uniforms.canvas_size,B),t!=c&&(m!=e&&t!=a&&t!=n&&t!=l&&t!=u&&t!=d||(x.uniform1i(r.uniforms.light_count,xe),x.uniform4fv(r.uniforms.light_pos,T),x.uniform3fv(r.uniforms.light_color,F),x.uniform3fv(r.uniforms.light_ambient,g),x.enableVertexAttribArray(r.attributes.normal),r!=w&&(x.enableVertexAttribArray(r.attributes.color),x.enableVertexAttribArray(r.attributes.opacity),x.enableVertexAttribArray(r.attributes.shininess),x.enableVertexAttribArray(r.attributes.emissive),x.enableVertexAttribArray(r.attributes.texpos),x.enableVertexAttribArray(r.attributes.bumpaxis),x.uniform1i(r.uniforms.texmap,0),x.uniform1i(r.uniforms.bumpmap,1))),x.uniformMatrix4fv(r.uniforms.viewMatrix,!1,ve),x.uniformMatrix4fv(r.uniforms.projMatrix,!1,Ee)),t==c?(x.uniform1i(r.uniforms.C0,2),x.uniform1i(r.uniforms.C1,4),we&&(x.uniform1i(r.uniforms.C2,6),x.uniform1i(r.uniforms.C3,8),x.uniform1i(r.uniforms.C4,10))):t>i&&(x.uniform1i(r.uniforms.D0,3),t==l||t==f?x.uniform1i(r.uniforms.D1,5):t==u||t==o?x.uniform1i(r.uniforms.D2,7):t==d&&x.uniform1i(r.uniforms.D3,9))}function cr(R,p,h){if(m==_&&h.length>0)for(var E=0;Ei)break;f&&(R==e||R==a?(null==w&&(w=de(shaders.opaque_render_fragment,shaders.curve_render_vertex,x)),dr(w,R)):R==i?(null==ae&&(ae=de(shaders.peel_depth_fragmentD0,shaders.curve_peel_depth_vertex,x)),dr(ae,R)):R==r&&(null==ne&&(ne=de(shaders.pick_fragment,shaders.curve_pick_vertex,x)),dr(ne,R)),x.bindBuffer(x.ARRAY_BUFFER,_.posBuffer),x.vertexAttribPointer(_r.attributes.pos,4,x.FLOAT,!1,0,0),R!=r&&Ri){if("opaque"==v)continue}else if("transparent"==v)continue;var A=!0;for(var T in E[v])for(var F in E[v][T]){if(A){switch(A=!1,R){case e:case a:null===N&&(N=de(shaders.opaque_render_fragment,shaders.tri_render_vertex,x)),dr(N,R);break;case t:null===fe&&(fe=de(shaders.pick_fragment,shaders.extent_vertex,x)),dr(fe,R);break;case i:null===K&&(K=de(shaders.peel_depth_fragmentD0,shaders.tri_peel_depth_vertex,x)),dr(K,R);break;case s:null===J&&(J=de(shaders.peel_depth_fragmentD1,shaders.tri_peel_depth_vertex,x)),dr(J,R);break;case f:null===ee&&(ee=de(shaders.peel_depth_fragmentD2,shaders.tri_peel_depth_vertex,x)),dr(ee,R);break;case o:null===te&&(te=de(shaders.peel_depth_fragmentD3,shaders.tri_peel_depth_vertex,x)),dr(te,R);break;case n:null===Q&&(Q=de(shaders.peel_color_fragmentC1,shaders.tri_render_vertex,x)),dr(Q,R);break;case l:null===Z&&(Z=de(shaders.peel_color_fragmentC2,shaders.tri_render_vertex,x)),dr(Z,R);break;case u:null===re&&(re=de(shaders.peel_color_fragmentC3,shaders.tri_render_vertex,x)),dr(re,R);break;case d:null===_e&&(_e=de(shaders.peel_color_fragmentC4,shaders.tri_render_vertex,x)),dr(_e,R)}x.bindBuffer(x.ARRAY_BUFFER,c.posBuffer),De&&x.bufferData(x.ARRAY_BUFFER,h.pos,x.DYNAMIC_DRAW),x.vertexAttribPointer(_r.attributes.pos,3,x.FLOAT,!1,0,0),m!=e&&R!=a&&R!=n&&R!=l&&R!=u&&R!=d||(x.bindBuffer(x.ARRAY_BUFFER,c.normalBuffer),De&&x.bufferData(x.ARRAY_BUFFER,h.normal,x.DYNAMIC_DRAW),x.vertexAttribPointer(_r.attributes.normal,3,x.FLOAT,!1,0,0),x.bindBuffer(x.ARRAY_BUFFER,c.colorBuffer),De&&x.bufferData(x.ARRAY_BUFFER,h.color,x.DYNAMIC_DRAW),x.vertexAttribPointer(_r.attributes.color,3,x.FLOAT,!1,0,0),x.bindBuffer(x.ARRAY_BUFFER,c.opacityBuffer),De&&x.bufferData(x.ARRAY_BUFFER,h.opacity,x.DYNAMIC_DRAW),x.vertexAttribPointer(_r.attributes.opacity,1,x.FLOAT,!1,0,0),x.bindBuffer(x.ARRAY_BUFFER,c.shininessBuffer),De&&x.bufferData(x.ARRAY_BUFFER,h.shininess,x.DYNAMIC_DRAW),x.vertexAttribPointer(_r.attributes.shininess,1,x.FLOAT,!1,0,0),x.bindBuffer(x.ARRAY_BUFFER,c.emissiveBuffer),De&&x.bufferData(x.ARRAY_BUFFER,h.emissive,x.DYNAMIC_DRAW),x.vertexAttribPointer(_r.attributes.emissive,1,x.FLOAT,!1,0,0),x.bindBuffer(x.ARRAY_BUFFER,c.texposBuffer),De&&x.bufferData(x.ARRAY_BUFFER,h.texpos,x.DYNAMIC_DRAW),x.vertexAttribPointer(_r.attributes.texpos,2,x.FLOAT,!1,0,0),x.bindBuffer(x.ARRAY_BUFFER,c.bumpaxisBuffer),De&&x.bufferData(x.ARRAY_BUFFER,h.bumpaxis,x.DYNAMIC_DRAW),x.vertexAttribPointer(_r.attributes.bumpaxis,3,x.FLOAT,!1,0,0),De=0)}var g=E[v][T][F],B=g[0],D=new Uint32Array(g.slice(1)),U=D.length;x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,c.indexBuffer),x.bufferData(x.ELEMENT_ARRAY_BUFFER,D,x.DYNAMIC_DRAW),m==t&&(p=x.POINTS);var y=0,w=0;if("textures"==T){if((m==e||m==_)&&null!==B.__tex.file){if(null===B.__tex.texture_ref.reference)continue;x.activeTexture(x.TEXTURE0),x.bindTexture(x.TEXTURE_2D,B.__tex.texture_ref.reference),y=1}}else if("bumpmaps"==T){if((m==e||m==_)&&null!==B.__tex.bumpmap){if(null===B.__tex.bumpmap_ref.reference)continue;x.activeTexture(x.TEXTURE1),x.bindTexture(x.TEXTURE_2D,B.__tex.bumpmap_ref.reference),w=1}}else if("textures_and_bumpmaps"==T){if((m==e||m==_)&&null!==B.__tex.file){if(null===B.__tex.texture_ref.reference)continue;x.activeTexture(x.TEXTURE0),x.bindTexture(x.TEXTURE_2D,B.__tex.texture_ref.reference),y=1}if((m==e||m==_)&&null!==B.__tex.bumpmap){if(null===B.__tex.bumpmap_ref.reference)continue;x.activeTexture(x.TEXTURE1),x.bindTexture(x.TEXTURE_2D,B.__tex.bumpmap_ref.reference),w=1}}x.uniform1f(_r.uniforms.T,y),x.uniform1f(_r.uniforms.B,w),x.drawElements(p,U,x.UNSIGNED_INT,0)}}}function F(){var e=Ae.quad,r=e.elementType,t=e.index.length;we?(null==ue&&(ue=de(shaders.merge_fragment,shaders.merge_vertex,x)),dr(ue,R)):(null==oe&&(oe=de(shaders.merge_fragment2,shaders.merge_vertex,x)),dr(oe,R)),x.bindBuffer(x.ARRAY_BUFFER,e.posBuffer),x.vertexAttribPointer(_r.attributes.pos,3,x.FLOAT,!1,0,0),x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,e.indexBuffer),x.drawElements(r,t,x.UNSIGNED_INT,0)}for(var g in null===p?x.bindFramebuffer(x.FRAMEBUFFER,null):(x.bindFramebuffer(x.FRAMEBUFFER,Me),x.framebufferTexture2D(x.FRAMEBUFFER,x.COLOR_ATTACHMENT0,x.TEXTURE_2D,ye[p],0)),x.viewport(0,0,B[0],B[1]),x.enable(x.DEPTH_TEST),m==r||R>a?x.clearColor(0,0,0,0):m==t?x.clearColor(0,0,0,1):x.clearColor(b.__background.x,b.__background.y,b.__background.z,b.__opacity),m==t?(x.depthFunc(x.GREATER),x.clearDepth(0)):(x.depthFunc(x.LEQUAL),x.clearDepth(1)),x.clear(x.COLOR_BUFFER_BIT|x.DEPTH_BUFFER_BIT),Ae){if(R>=c){F();break}if("quad"!=g&&"triangle"!=g)if("curve"!=g){var U,$=Ae[g],ce=$.elementType,me=$.index.length;if(R>i){if(void 0===b.__transparent_objects[g])continue;U=b.__transparent_objects[g]}else{if(void 0===b.__opaque_objects[g])continue;U=b.__opaque_objects[g]}var Re=!1;for(var pe in U){Re=!0;break}if(Re){var he="ring"==g||"vp_ring"==g;switch(R){case e:case a:he?(null===Y&&(Y=de(shaders.opaque_render_fragment,shaders.ring_render_vertex,x)),dr(Y,R)):(null===y&&(y=de(shaders.opaque_render_fragment,shaders.render_vertex,x)),dr(y,R));break;case r:he?(null===le&&(le=de(shaders.pick_fragment,shaders.ring_pick_vertex,x)),dr(le,R)):(null===ie&&(ie=de(shaders.pick_fragment,shaders.pick_vertex,x)),dr(ie,R));break;case t:null===fe&&(fe=de(shaders.pick_fragment,shaders.extent_vertex,x)),dr(fe,R);break;case i:he?(null===S&&(S=de(shaders.peel_depth_fragmentD0,shaders.ring_peel_depth_vertex,x)),dr(S,R)):(null===C&&(C=de(shaders.peel_depth_fragmentD0,shaders.peel_depth_vertex,x)),dr(C,R));break;case s:he?(null===G&&(G=de(shaders.peel_depth_fragmentD1,shaders.ring_peel_depth_vertex,x)),dr(G,R)):(null===I&&(I=de(shaders.peel_depth_fragmentD1,shaders.peel_depth_vertex,x)),dr(I,R));break;case f:he?(null===W&&(W=de(shaders.peel_depth_fragmentD2,shaders.ring_peel_depth_vertex,x)),dr(W,R)):(null===k&&(k=de(shaders.peel_depth_fragmentD2,shaders.peel_depth_vertex,x)),dr(k,R));break;case o:he?(null===H&&(H=de(shaders.peel_depth_fragmentD3,shaders.ring_peel_depth_vertex,x)),dr(H,R)):(null===L&&(L=de(shaders.peel_depth_fragmentD3,shaders.peel_depth_vertex,x)),dr(L,R));break;case n:he?(null===O&&(O=de(shaders.peel_color_fragmentC1,shaders.ring_render_vertex,x)),dr(O,R)):(null===M&&(M=de(shaders.peel_color_fragmentC1,shaders.render_vertex,x)),dr(M,R));break;case l:he?(null===q&&(q=de(shaders.peel_color_fragmentC2,shaders.ring_render_vertex,x)),dr(q,R)):(null===P&&(P=de(shaders.peel_color_fragmentC2,shaders.render_vertex,x)),dr(P,R));break;case u:he?(null===z&&(z=de(shaders.peel_color_fragmentC3,shaders.ring_render_vertex,x)),dr(z,R)):(null===X&&(X=de(shaders.peel_color_fragmentC3,shaders.render_vertex,x)),dr(X,R));break;case d:he?(null===V&&(V=de(shaders.peel_color_fragmentC4,shaders.ring_render_vertex,x)),dr(V,R)):(null===j&&(j=de(shaders.peel_color_fragmentC4,shaders.render_vertex,x)),dr(j,R))}for(var pe in x.bindBuffer(x.ARRAY_BUFFER,$.posBuffer),x.vertexAttribPointer(_r.attributes.pos,3,x.FLOAT,!1,0,0),m==r||m!=e&&R!=a&&R!=n&&R!=l&&R!=u&&R!=d?he&&(x.bindBuffer(x.ARRAY_BUFFER,$.normalBuffer),x.vertexAttribPointer(_r.attributes.normal,3,x.FLOAT,!1,0,0)):(x.bindBuffer(x.ARRAY_BUFFER,$.normalBuffer),x.vertexAttribPointer(_r.attributes.normal,3,x.FLOAT,!1,0,0),x.bindBuffer(x.ARRAY_BUFFER,$.colorBuffer),x.vertexAttribPointer(_r.attributes.color,3,x.FLOAT,!1,0,0),x.bindBuffer(x.ARRAY_BUFFER,$.opacityBuffer),x.vertexAttribPointer(_r.attributes.opacity,1,x.FLOAT,!1,0,0),x.bindBuffer(x.ARRAY_BUFFER,$.shininessBuffer),x.vertexAttribPointer(_r.attributes.shininess,1,x.FLOAT,!1,0,0),x.bindBuffer(x.ARRAY_BUFFER,$.emissiveBuffer),x.vertexAttribPointer(_r.attributes.emissive,1,x.FLOAT,!1,0,0),x.bindBuffer(x.ARRAY_BUFFER,$.texposBuffer),x.vertexAttribPointer(_r.attributes.texpos,2,x.FLOAT,!1,0,0),x.bindBuffer(x.ARRAY_BUFFER,$.bumpaxisBuffer),x.vertexAttribPointer(_r.attributes.bumpaxis,3,x.FLOAT,!1,0,0)),x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,$.indexBuffer),m==t&&(ce=x.POINTS),U){var be=U[pe],Ee=be.__data;if(R128&&(Rr=-(Rr-128),mr=-mr),0==mr&&0==Rr||Math.exp(mr+Rr),null}if(m==r){if(x.readPixels(b.mouse.__pickx,b.mouse.__picky,1,1,x.RGBA,x.UNSIGNED_BYTE,U),he=16777216*U[0]+65536*U[1]+256*U[2]+U[3],!(Qe=b.__visiblePrimitives[he]))return null;if(Qe.__obj&&Qe.__obj.pickable)return Qe.__obj;if("point"==Qe.constructor.name){if(!Qe.__curve.pickable||!Qe.pickable)return null;var pr=Qe.__curve.__points,hr=pr.length;for(v=0;v0,_=msclock(),a=0;t&&(a=_-p),p=_,b.trigger("redraw",{dt:a}),A.render(e),_=msclock(),a=0,t&&(a=_-h),h=_,t?(R=.95*R+.05*(_-p),m=.95*m+1e3/a*.05):(R=_-p,m=0);var i=m*R;$("#fps").text(m.toFixed(1)+" renders/s * "+R.toFixed(1)+" ms/render = "+i.toFixed(1)+" ms rendering/s"),b.__last_center=b.__center,b.__last_axis=b.__axis,b.__last_range=b.__range,b.__last_up=b.__up,b.__last_width=b.__width,b.__last_height=b.__height,b.trigger("draw_complete",{dt:a}),b.__waitfor_image&&(b.__image=new Image,b.__image.src=E.toDataURL(),b.__waitfor_image=!1),null!==b.__mouse_move&&b.trigger("mouse",b.__mouse_move)}()},rate:async function(e,r){var t;if(v>0)if(v--,(t=msclock())>b&&(v=1),v>1){if(void 0===r)return;r()}else{var _;v=0,(_=b-Math.ceil(t))<5&&(_=0),void 0===r?await sleep(_/1e3):setTimeout(r,_)}else if(e<=120)_=Math.ceil(1e3/e),void 0===r?await sleep(_/1e3):setTimeout(r,_);else{if(t=msclock(),v=Math.ceil(e/E),b=msclock()+Math.ceil(1e3/E),void 0===r)return;r()}}})}(); +!function(){"use strict";function t(t){return Math.log(t)/Math.LN10}var i=!1,_=0,e=0;function s(s,o){if(0==o.ticks.length){for(var r,a,h=o.tickSize,n=o.min,l=o.max,d=Math.floor((l-n)/h+.5)+1,c=0;cr&&0!=a)&&(r=a);e=Math.floor(t(r))+1;var g=Math.floor(t(h))+1;g>3?(i=!0,_=g):g>0?(i=!1,_=0):g<0?(i=!0,_=g,e>=0&&(i=!1,_=1-g)):(i=!1,_=1)}if(0==s)return"0";if(i){var p,f,u=s*Math.pow(10,1-_);return p=0,f=_-1,e>_&&(u*=.1,p+=1,f+=1),u.toFixed(p)+"e"+f}return s.toFixed(_)}var o=16,r=0;function a(i){if(a.activated=[],a.__selected=null,a.get_selected=function(){return a.__selected},!(this instanceof a))return new a(i);if(void 0!==(i=i||{}).x&&delete i.x,void 0!==i.y&&delete i.y,this.fast=!0,void 0!==i.fast&&(this.fast=i.fast,delete i.fast),this.scroll=!1,void 0!==i.scroll&&(this.scroll=i.scroll,delete i.scroll),this.graph_options={},this.fast&&(this.graph_options={series:{shadowSize:0},crosshair:{mode:"xy",color:"rgba(0,0,0,1)"},xaxis:{min:null,max:null,tickFormatter:s},yaxis:{min:null,max:null,tickFormatter:s}}),this.__lock=!1,this.__id="graph"+r,r++,this.container=$('
'),this.__activated=!1,this.__deleted=!1,this.graph_series=[],this.__todo_list=[],a.__selected=this,this.__width=480,this.__height=300,this.__plot=null,this.__xmin=this.__ymin=null,this.__xmax=this.__ymax=null,this.__xmin_actual=this.__ymin_actual=null,this.__xmax_actual=this.__ymax_actual=null,this.__title=this.__xtitle=this.__ytitle="",this.__made_title=!1,this.__made_xtitle=!1,this.__made_ytitle=!1,void 0!==i.width&&(this.__width=i.width,delete i.width),void 0!==i.height&&(this.__height=i.height,delete i.height),this.__align="none",void 0!==i.align&&(this.__align=i.align,delete i.align),void 0!==i.title&&(this.__title=print_to_string(i.title),delete i.title),void 0!==i.xtitle&&(this.__xtitle=print_to_string(i.xtitle),delete i.xtitle),void 0!==i.ytitle&&(this.__ytitle=print_to_string(i.ytitle),delete i.ytitle),this.__foreground=color.black,this.__background=color.white,void 0!==i.foreground){if(!((_=i.foreground)instanceof vec))throw new Error("graph foreground must be a vector.");this.__foreground=_,delete i.foreground}if(void 0!==i.background){var _;if(!((_=i.background)instanceof vec))throw new Error("graph background must be a vector.");var e=color.rgb_to_hsv(_);e.z<.5&&(e.z=.5),this.__background=color.hsv_to_rgb(e),delete i.background}var h=0;if(void 0!==i.xmin&&(this.__xmin=i.xmin,this.fast&&(this.graph_options.xaxis.min=i.xmin),h++,delete i.xmin),void 0!==i.xmax&&(this.__xmax=i.xmax,this.fast&&(this.graph_options.xaxis.max=i.xmax),h++,delete i.xmax),this.scroll){if(2!=h)throw new Error("For a scrolling graph, both xmin and xmax must be specified.");if(this.__xmax<=this.xmin)throw new Error("For a scrolling graph, xmax must be greater than xmin.")}if(!this.fast&&1==h)if(null===this.__xmin&&this.__xmax>0)this.__xmin=0;else{if(!(this.__xmin<0&&null===this.__xmax))throw new Error("You must specify both xmin and xmax.");this.__xmax=0}if(h=0,void 0!==i.ymin&&(this.__ymin=i.ymin,this.fast&&(this.graph_options.yaxis.min=i.ymin),h++,delete i.ymin),void 0!==i.ymax&&(this.__ymax=i.ymax,this.fast&&(this.graph_options.yaxis.max=i.ymax),h++,delete i.ymax),!this.fast&&1==h)if(null===this.__ymin&&this.__ymax>0)this.__ymin=0;else{if(!(this.__ymin<0&&null===this.__ymax))throw new Error("You must specify both ymin and ymax.");this.__ymax=0}this.__logx=this.__logy=!1,void 0!==i.logx&&(this.__logx=this.graph_options.logx=i.logx,delete i.logx),void 0!==i.logy&&(this.__logy=this.graph_options.logy=i.logy,delete i.logy),this.fast&&(this.__logx&&(this.graph_options.xaxis.transform=function(i){return t(i)},this.graph_options.xaxis.inverseTransform=function(t){return Math.pow(10,t)}),this.__logy&&(this.graph_options.yaxis.transform=function(i){return t(i)},this.graph_options.yaxis.inverseTransform=function(t){return Math.pow(10,t)}));var n="",l=0;for(var d in i)l+=1,n+=d+", ";if(n.length>0)throw 1==l?new Error(n.slice(0,n.length-2)+" is not an attribute of a graph"):new Error("These are not attributes of a graph: "+n.slice(0,n.length-2));function c(t){return null==t||""==t?0:1==(t=(t=(t=t.replace("
","\n")).replace("
","\n")).split("\n")).length?o:o+1.3*o*(t.length-1)}if(this.fast){var g=0,p=0,f=0,u=0;"right"==this.__align&&(f=40);if(""!==this.__title&&(g=10+c(this.__title)),""!==this.__ytitle){if((p=c(this.__ytitle))>o)throw new Error("graph ytitle must not contain line breaks.");p+=10}if(null!==this.__xtitle&&""!==this.__xtitle){if((u=c(this.__xtitle))>o)throw new Error("graph xtitle must not contain line breaks.");u+=10}this.graph_options.grid={color:color.to_html(this.__foreground),backgroundColor:color.to_html(this.__background),offsets:{left:p,right:f,top:g,bottom:u}}}}property.declare(a.prototype,{type:{get:function(){return this.__type},set:function(){throw new Error("Cannot change the type of a graph.")}},select:function(){a.__selected=this},__todo:function(t,i){this.__lock?this.__todo_list.push([t,i]):Plotly.restyle(this.__id,t,i)},__changed:!1,remove:function(){this.__activated&&(this.fast||Plotly.purge(this.__id),this.__deleted=!0,this.container.remove())},title:{get:function(){return this.__title},set:function(t){var i=t.match(/([^\n])*/);t=i[0],this.__title=t,this.__activated&&(this.fast?this.make_title(t):Plotly.relayout(this.__id,{title:t}))}},xtitle:{get:function(){return this.__xtitle},set:function(t){var i=t.match(/([^\n])*/);t=i[0],this.__xtitle=t,this.__activated&&(this.fast?this.make_xtitle(t):Plotly.relayout(this.__id,{"xaxis.title":t}))}},ytitle:{get:function(){return this.__ytitle},set:function(t){var i=t.match(/([^\n])*/);t=i[0],this.__ytitle=t,this.__activated&&(this.fast?this.make_ytitle(t):Plotly.relayout(this.__id,{"yaxis.title":t}))}},width:{get:function(){return this.__width},set:function(t){if(this.__width=t,this.fast){this.container.css("width",t);var i=$.plot(this.container,[],this.graph_options);i.resize(),i.setupGrid()}else this.__activated&&Plotly.relayout(this.__id,{width:t})}},height:{get:function(){return this.__height},set:function(t){if(this.__height=t,this.fast){this.container.css("height",t);var i=$.plot(this.container,[],this.graph_options);i.resize(),i.setupGrid()}else this.__activated&&Plotly.relayout(this.__id,{height:t})}},align:{get:function(){return this.__align},set:function(t){if(this.__activated)throw new Error("Cannot change align after the graph is activated.");if("left"!=t&&"right"!=t&&"none"!=t)throw new Error("align must be 'left', 'right', or 'none' (the default).");this.__align=t}},xmin:{get:function(){return this.__xmin},set:function(t){this.__xmin=t,this.fast?this.graph_options.xaxis.min=t:this.__activated&&Plotly.relayout(this.__id,{"xaxis.range":[t,this.__xmax]})}},xmax:{get:function(){return this.__xmax},set:function(t){this.__xmax=t,this.fast?this.graph_options.xaxis.max=t:this.__activated&&Plotly.relayout(this.__id,{"xaxis.range":[this.__xmin,t]})}},ymin:{get:function(){return this.__ymin},set:function(t){this.__ymin=t,this.fast?this.graph_options.yaxis.min=t:this.__activated&&Plotly.relayout(this.__id,{"yaxis.range":[t,this.__ymax]})}},ymax:{get:function(){return this.__ymax},set:function(t){this.__ymax=t,this.fast?this.graph_options.yaxis.max=t:this.__activated&&Plotly.relayout(this.__id,{"yaxis.range":[this.__ymin,t]})}},logx:{get:function(){return this.__logx},set:function(i){this.__logx=i,this.__logx!=i&&(this.fast?i?(this.graph_options.xaxis.transform=function(i){return t(i)},this.graph_options.xaxis.inverseTransform=function(t){return Math.pow(10,t)}):(delete this.graph_options.xaxis.transform,delete this.graph_options.xaxis.inverseTransform):this.__activated&&(i?Plotly.relayout(this.__id,{"xaxis.type":"log"}):Plotly.relayout(this.__id,{"xaxis.type":null})))}},logy:{get:function(){return this.__logy},set:function(i){this.__logy=i,this.__logy!=i&&(this.fast?i?(this.graph_options.yaxis.transform=function(i){return t(i)},this.graph_options.yaxis.inverseTransform=function(t){return Math.pow(10,t)}):(delete this.graph_options.yaxis.transform,delete this.graph_options.yaxis.inverseTransform):this.__activated&&(i?Plotly.relayout(this.__id,{"yaxis.type":"log"}):Plotly.relayout(this.__id,{"yaxis.type":null})))}},foreground:{get:function(){return this.__foreground},set:function(t){if(!(t instanceof vec))throw new Error("graph foreground color must be a vector.");this.__foreground=t;var i=color.to_html(t);this.fast?this.graph_options.grid.color=i:this.__activated&&Plotly.relayout(this.__id,{paper_bgcolor:i})}},background:{get:function(){return this.__background},set:function(t){if(!(t instanceof vec))throw new Error("graph background color must be a vector.");this.__background=t;var i=color.to_html(t);this.fast?this.graph_options.grid.backgroundColor=i:this.__activated&&Plotly.relayout(this.__id,{plot_bgcolor:i})}},make_title:function(t){var i=this.graph_options.grid.offsets;if(0===i.top)throw new Error("Cannot change a graph title if it does not already have a title.");var _=this.__plot.getCanvas().getContext("2d");_.fillStyle=color.to_html_rgba(vec(1,1,1),1),_.fillRect(0,0,this.__width,i.top);if(null!==t&&""!==t){var e=i.left+(this.__width-i.left-i.right)/2,s=parse_html({ctx:_,text:t.toString(),x:e,y:15,align:"center",font:"Arial",fontsize:o,angle:0});display_2D(s)}},make_xtitle:function(t){var i=this.graph_options.grid.offsets;if(0===i.bottom)throw new Error("Cannot change a graph xtitle if it does not already have an xtitle.");var _=this.__plot.getCanvas().getContext("2d");_.fillStyle=color.to_html_rgba(vec(1,1,1),1),_.fillRect(i.left,this.__height-i.bottom,this.__width-i.right,this.__height);if(null!==t&&""!==t){var e=i.left+(this.__width-i.left-i.right)/2,s=this.__height+i.top-5,r=parse_html({ctx:_,text:t.toString(),x:e,y:s,align:"center",font:"Arial",fontsize:o,angle:0});display_2D(r)}},make_ytitle:function(t){var i=this.graph_options.grid.offsets;if(0===i.left)throw new Error("Cannot change a graph ytitle if it does not already have a ytitle.");var _=this.__plot.getCanvas().getContext("2d");_.fillStyle=color.to_html_rgba(vec(1,1,1),1),_.fillRect(0,i.top,i.left,this.__height-i.top-i.bottom);if(null!==t&&""!==t){var e=i.top+(this.__height-i.bottom-15)/2,s=parse_html({ctx:_,text:t.toString(),x:15,y:e,align:"center",font:"Arial",fontsize:o,angle:-Math.PI/2});display_2D(s)}},add_to_graph:function(t){t.__id=this.graph_series.length,t.__activated=!1,t.__scrolldata=[],this.graph_series.push(t)},__activate:function(t){this.__activated||(this.fast?(this.container.addClass("glowscript-graph").css("width",this.__width).css("height",this.__height+this.graph_options.grid.offsets.top).appendTo(canvas.container),this.container.css("float",this.__align)):(this.container.addClass("glowscript-graph").css("width",this.__width).css("height",this.__height+t).appendTo(canvas.container),"none"!=this.__align&&this.container.css("float",this.__align)),a.activated.push(this),this.__activated=!0)},__update:function(){if(this.__changed&&!this.__deleted&&!this.__lock){var t=this.__activated,i=this.__xmax;if(this.fast){for(o=[],s=0;s0)(b=x.__data[_-1][0])>i&&(i=b);if(o.push(x.options),null!==x.__linemarker&&x.__markers&&(x.__linemarker.data=x.__data,x.__linemarker.color=x.__linemarker.points.fillColor,x.__linemarker.points.radius=x.__radius,o.push(x.__linemarker)),x.__dot&&"lines"==x.__realtype&&x.__data.length>0){var e={points:{show:!0}};null!==x.__dot_radius?e.points.radius=x.__dot_radius:e.points.radius=x.__width+1,null!==x.__dot_color?e.color=color.to_html(x.__dot_color):e.color=color.to_html(x.__color),e.points.fillColor=e.color,e.data=[x.options.data[x.options.data.length-1]],o.push(e)}}}if(this.scroll&&i>this.__xmax){E=i-this.__xmax;this.xmin+=E,this.xmax+=E}o.length>0&&(this.__activate(0),this.__plot=$.plot(this.container,o,this.graph_options),this.__plot.draw()),t||(null!==this.__title&&""!==this.__title&&this.make_title(this.__title),null!==this.__xtitle&&""!==this.__xtitle&&this.make_xtitle(this.__xtitle),null!==this.__ytitle&&""!==this.__ytitle&&this.make_ytitle(this.__ytitle))}else{for(var s=0;s0)r.title=this.title,l=65,(y=T(this.title))>0&&(l+=45*(y-1)),n+=45*(y+1),r.height+=n;var c=65;if(void 0!==this.ytitle&&this.ytitle.length>0){if(r.yaxis.title=this.ytitle,(E=T(this.ytitle))>0)throw new Error("A ytitle must not contain
.");c=80}if(void 0!==this.xtitle&&this.xtitle.length>0)if(r.xaxis.title=this.xtitle,(E=T(this.xtitle))>0)throw new Error("An xtitle must not contain
.");r.margin={l:c,r:20,b:45,t:l,pad:4},this.__activate(n),this.__activated=!0}for(var g=[],s=0;sintegral of selected points = "+e.toPrecision(6)+"",font:{color:"black",size:14},showarrow:!1}]};Plotly.relayout(u,r);for(var a=0;ai&&(i=j))}m.push(b),v.push(k),x.__newdata=[]}if(this.scroll&&i>this.__xmax){var E=i-this.__xmax;this.xmin+=E,this.xmax+=E}if(!this.__lock){this.__lock=!0;var C=this;Plotly.extendTraces(this.__id,{x:m,y:v},g).then(function(){C.__lock=!1})}}this.__changed=!1,t||new d(this)}function T(t){var i=t.match(/
/g);return null===i?0:i.length}}});var h={lines:"lines",scatter:"markers",markers:"markers",bar:"bar"},n={lines:"lines",scatter:"points",markers:"points",bar:"bars"};function l(t){t=t||{},this.__data=[],this.__newdata=[],this.__color=vec(0,0,0),this.__marker_color=vec(0,0,0),this.__linemarker=null,this.__lineobj=null,this.__markerobj=null,this.__label=null,this.__save_label=null,this.__delta=1,this.__width=2,this.__radius=3,this.__horizontal=!1,this.__dot=!1,this.__xmin=null,this.__xmax=null,this.__ymin=null,this.__ymax=null,this.__label="",this.__legend=!1,this.__markers=!1,this.__interval=-1,this.__integrate_selected=!1;var i=!0;if(void 0!==t.fast&&(i=t.fast,delete t.fast),void 0!==t.graph)this.__graph=t.graph,delete t.graph;else if(void 0!==t.gdisplay)this.__graph=t.gdisplay,delete t.gdisplay;else try{this.__graph=a.get_selected()}catch(l){this.__graph=a({fast:i})}if(this.__type="lines",void 0!==t.type&&(this.__type=t.type,delete t.type),this.__graph.fast?this.__realtype=n[this.__type]:this.__realtype=h[this.__type],!this.__realtype)throw new Error("Unknown series type: "+this.__type);this.options={};var _=this.__realtype,e=[];if(void 0!==t.data&&(e=t.data,delete t.data),void 0!==t.color){if(!((s=t.color)instanceof vec))throw new Error("graph color must be a vector.");this.__color=s,this.__marker_color=s,delete t.color}if(this.__graph.fast&&("lines"==_?this.options[_]={show:!0,lineWidth:this.__width}:"points"==_?this.options[_]={show:!0,radius:this.__radius,fill:!0,lineWidth:0}:"bars"==_&&(this.options[_]={show:!0,align:"center",horizontal:!1,barWidth:1,lineWidth:1,fill:.5})),this.options.color=color.to_html(this.__color),this.__graph.fast&&("points"==this.__realtype?this.options[_].fillColor=this.options.color:this.options.fillColor=this.options.color),void 0!==t.marker_color){var s;if(!((s=t.marker_color)instanceof vec))throw new Error("graph color must be a vector.");this.__marker_color=s,delete t.marker_color}if(void 0!==t.width&&(this.__width=t.width,this.__graph.fast&&(this.options[_].lineWidth=t.width),delete t.width),void 0!==t.markers){if("lines"!=this.__realtype)throw new Error("One can add markers only to graph curves.");if(!0===t.markers){this.__markers=t.markers;var o=this.__width/2+2;void 0!==t.radius&&(o=t.radius),this.__graph.fast?this.__linemarker={points:{show:!0,radius:o,lineWidth:0,fillColor:color.to_html(this.__marker_color),fill:!0}}:this.__radius=o}delete t.markers}if(void 0!==t.radius&&(this.__radius=t.radius,this.__graph.fast&&(this.options[_].radius=t.radius),delete t.radius),void 0!==t.size&&(this.__radius=t.size/2,this.__graph.fast&&(this.options[_].radius=t.size/2),delete t.size),void 0!==t.horizontal&&(this.__horizontal=t.horizontal,this.__graph.fast&&(this.options[_].horizontal=t.horizontal),delete t.horizontal),void 0!==t.delta&&(this.__delta=t.delta,this.__graph.fast&&(this.options[_].barWidth=t.delta),delete t.delta),void 0!==t.label&&(this.__label=t.label,this.__save_label=t.label,this.__graph.fast&&(this.options.label=t.label),t.label.length>0&&(this.__legend=!0),delete t.label),void 0!==t.legend&&(this.__legend=t.legend,this.__graph.fast&&!t.legend&&null!==this.__label&&delete this.options.label,delete t.legend),void 0!==t.__lineobj&&(this.__lineobj=t.__lineobj,delete t.__lineobj),void 0!==t.__markerobj&&(this.__markerobj=t.__markerobj,delete t.__markerobj),void 0!==t.dot){if("lines"!=this.__realtype)throw new Error('Can add a moving dot only to a gcurve or "lines" object');this.__dot=t.dot,this.__dot_radius=this.__width/2+4,this.__dot_color=this.__color,delete t.dot}if(void 0!==t.dot_radius&&(this.__dot_radius=t.dot_radius,delete t.dot_radius),this.__dot_color=this.__color,void 0!==t.dot_color){var r=t.dot_color;if(!(r instanceof vec))throw new Error("graph dot_color must be a vector.");this.__dot_color=r,delete t.dot_color}void 0!==t.interval&&(this.__interval=t.interval,this.__ninterval=t.interval,delete t.interval),void 0!==t.integrate_selected&&(this.__integrate_selected=t.integrate_selected,delete t.integrate_selected),this.__visible=!0,void 0!==t.visible&&(this.__visible=t.visible,delete t.visible);var l="",d=0;for(var g in t)d+=1,l+=g+", ";if(l.length>0)throw 1==d?new Error(l.slice(0,l.length-2)+" is not an attribute of a series"):new Error("These are not attributes of a graph object: "+l.slice(0,l.length-2));if(this.__graph.add_to_graph(this),!this.__graph.fast&&1==this.__graph.graph_series.length){c().plot(0,0)}this.remove=function(){this.data=[]};var p=function(t){return{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase()},f=function(t){var i,_;if(_=[],"array"!=p(arguments[0][0]))for(var e=0;e0){if(this.__ninterval++,!(this.__ninterval>=this.__interval))continue;this.__ninterval=0}if(this.__graph.fast?this.__data.push(i[e]):this.__newdata.push(i[e]),!this.__graph.fast&&"lines"==this.__realtype&&this.__newdata.length>0){this.__newdata[this.__newdata.length-1];this.__dot&&(this.__dotobject.data=[i[e]]),this.__markers&&this.__markerobject.__newdata.push(i[e])}}else{var s,o,r,a,h,n,l,d,c,g=this.__graph,m=(g.__xmin,g.__xmax,g.__ymin,g.__ymax,g.__xmin_actual),v=g.__xmax_actual,y=g.__ymin_actual,x=g.__ymax_actual;Math.floor(msclock()-this.__lasttime),this.__lasttime=msclock(),h=n=null,this.__data.length>0&&(h=(l=this.__data[this.__data.length-1])[0],n=l[1]);for(e=0;e0){if(this.__ninterval++,!(this.__ninterval>=this.__interval))continue;this.__ninterval=0}s=(l=i[e])[0],o=l[1],u(s),u(o),g.scroll?(g.__xmin_actual=m=g.__xmin,g.__xmax_actual=v=g.__xmax):((null===m||sv)&&(g.__xmax_actual=v=s)),(null===y||ox)&&(g.__ymax_actual=x=o),null!==h&&(r=0===(d=v-m)?0:Math.abs(s-h)/d,a=0===(c=x-y)?0:Math.abs(o-n)/c,r<.001&&a<.001)||(this.__graph.fast?this.__data.push(l):this.__newdata.push(l),h=s,n=o)}this.__dot&&!this.__graph.fast&&this.__newdata.length>0&&(this.__dotobject.data=[this.__newdata[this.__newdata.length-1]])}this.__graph.__changed=!0,this.__graph.__activated||this.__graph.__update()},e.length>0&&this.plot(e)}function d(t){!function i(){window.requestAnimationFrame(i),t.__update()}()}function c(t){(t=t||{}).type="lines",void 0!==t.pos&&(t.data=t.pos,delete t.pos),void 0!==t.size&&(t.dot_radius=t.size/2,delete t.size);var i=new l(t);return i.__graph.fast||(i.dot&&(i.__dotobject=g({color:i.__dot_color,radius:i.__dot_radius,__lineobj:i})),i.markers&&(i.__markerobject=g({color:i.__marker_color,radius:i.__radius,__markerobj:i}))),i}function g(t){return(t=t||{}).type="scatter",void 0!==t.pos&&(t.data=t.pos,delete t.pos),new l(t)}property.declare(l.prototype,{graph:{get:function(){return this.__graph},set:function(t){throw new Error("Cannot change the choice of graph for an existing graphing object.")}},type:{get:function(){return this.__type},set:function(t){throw new Error("Cannot change the type of an existing graphing object.")}},data:{get:function(){return this.__data.concat(this.__newdata)},set:function(t){this.__data=[],this.options.data=[],this.__newdata=[],this.__graph.fast||("lines"==this.__realtype&&(this.__dot&&(this.__dotobject.__data=[],this.__dotobject.__newdata=[],this.__graph.__activated&&this.__graph.__todo({x:[[]],y:[[]]},this.__dotobject.__id)),this.__markers&&(this.__markerobject.__data=[],this.__markerobject.__newdata=[],this.__graph.__activated&&this.__graph.__todo({x:[[]],y:[[]]},this.__markerobject.__id))),this.__graph.__activated&&this.__graph.__todo({x:[[]],y:[[]]},this.__id)),this.__graph.__changed=!0,t.length>0&&this.plot(t)}},markers:{get:function(){return this.__markers},set:function(t){if("lines"!=this.__realtype)throw new Error("One can add markers only to graph curves.");if(this.__markers!==t){this.__markers=t;var i=this.__radius+2;if(this.__activated)if(t){(_={})["marker.color"]=color.to_html(this.__color),this.__graph.fast?this.options.points={show:!0,radius:i}:this.__graph.__todo(_,this.__markerobject.__id)}else{var _={"marker.size":.1};this.__graph.fast?this.options.points={show:!1,radius:i}:this.__graph.__todo(_,this.__markerobject.__id),this.__graph.__changed=!0}}}},color:{get:function(){return this.__color},set:function(t){if(!(t instanceof vec))throw new Error("graphing color must be a vector.");if(!this.__color.equals(t)){this.__color=t;var i=color.to_html(t);if(this.__graph.fast&&(this.options.color=i),this.__activated)if(this.__graph.fast)"points"==this.__realtype?this.options[ftype].fillColor=this.options.color:this.options.fillColor=this.options.color,this.__graph.__changed=!0;else{var _={};"bar"==this.__realtype?(_["marker.color"]=color.to_html_rgba(t,.5),_["marker.line.color"]=color.to_html_rgba(t,1)):"markers"==this.__realtype?_["marker.color"]=i:"lines"==this.__realtype&&(_["line.color"]=i,_["marker.color"]=i),this.__graph.__todo(_,this.__id)}}}},marker_color:{get:function(){return this.__marker_color},set:function(t){if(!(t instanceof vec))throw new Error("graphing marker_color must be a vector.");if(!this.__marker_color.equals(t)){this.__marker_color=t;var i=color.to_html(t);if(this.__graph.fast&&(this.options.marker_color=i),this.__activated)if(this.__graph.fast)"lines"==this.__realtype?this.__linemarker.points.fillColor=i:this.options.color=i,this.__graph.__changed=!0;else if(this.__markerobject.__activated){var _={};_["marker.color"]=i,this.__graph.__todo(_,this.__markerobject.__id)}}}},label:{get:function(){return void 0===this.__label?"":this.__label},set:function(t){var i=t.match(/([^\n])*/);t=i[0],this.__label!=t&&(this.__label=t,this.__graph.fast&&(this.options.label=t),t.length>0&&(this.__legend=!0),this.__activated&&(this.__graph.fast?(this.options.label=t,this.__graph.__changed=!0):this.__graph.__todo({name:t,showlegend:this.__legend},this.__id)))}},legend:{get:function(){return this.__legend},set:function(t){this.__legend!=t&&(this.__legend=t,this.__graph.fast&&(this.options.legend=t),this.__activated&&(this.__graph.fast?(null!==this.options.label&&(t?this.options.label=this.__save_label:delete this.options.label),this.options.legend=t,this.__graph.__changed=!0):this.__graph.__todo({showlegend:t},this.__id)))}},delta:{get:function(){return this.__delta},set:function(t){this.__delta!=t&&(this.__delta=t,this.__graph.fast&&(this.options[this.__realtype].barWidth=t),this.__activated&&(this.__graph.fast?this.__graph.__changed=!0:this.__graph.__todo({width:t},this.__id)))}},width:{get:function(){return this.__width},set:function(t){if(this.__width!=t&&(this.__width=t,this.__graph.fast&&(this.options[this.__realtype].lineWidth=t),this.__activated))if(this.__graph.fast)this.__graph.__changed=!0;else{var i={};if("bar"==this.__realtype)return;if("lines"==this.__realtype)i["line.width"]=t;else if("markers"==this.__realtype)return;this.__graph.__todo(i,this.__id)}}},radius:{get:function(){return this.__radius},set:function(t){if(this.__radius!=t&&(this.__radius=t,this.__graph.fast&&(this.options[this.__realtype].radius=t),this.__activated))if(this.__graph.fast)this.__graph.__changed=!0;else{var i={};if(i["marker.size"]=2*t,"lines"==this.__realtype){if(!this.__markers)return;this.__graph.__todo(i,this.__markerobject.__id)}else"markers"==this.__realtype&&this.__graph.__todo(i,this.__id)}}},size:{get:function(){return 2*this.__radius},set:function(t){if(2*this.__radius!=t&&(this.__radius=t/2,this.__graph.fast&&(this.options[this.__realtype].radius=t/2),this.__activated))if(this.__graph.fast)this.__graph.__changed=!0;else{var i={};if("bar"==this.__realtype)return;"lines"==this.__realtype?(i["line.width"]=t,i["marker.size"]=t):"markers"==this.__realtype&&(i["marker.size"]=t),this.__graph.__todo(i,this.__id)}}},horizontal:{get:function(){return this.__horizontal},set:function(t){this.__horizontal!=t&&(this.__horizontal=t,this.__graph.fast&&(this.options[this.__realtype].horizontal=t),this.__activated&&(this.__graph.fast?this.__graph.__changed=!0:t?this.__graph.__todo({orientation:"h"},this.__id):this.__graph.__todo({orientation:"v"},this.__id)))}},orientation:{get:function(){return this.__horizontal?"h":"v"},set:function(t){var i=t.match(/([^\n])*/);if(t=i[0],this.__orientation=t,"v"==t)this.__horizontal=!1;else{if("h"!=t)throw new Error("orientation must be either 'v' for vertical or 'h' for horizontal");this.__horizontal=!0}this.__activated&&(this.__graph.fast?this.__graph.__changed=!0:this.__graph.__todo({orientation:t},this.__id))}},dot:{get:function(){return this.__dot},set:function(t){if(this.__activated)throw new Error("Cannot change gcurve dot after the gcurve has been activated.");this.__dot!=t&&(this.__dot=t)}},dot_color:{get:function(){return this.__dot_color},set:function(t){if(!(t instanceof vec))throw new Error("graph dot_color must be a vector.");if(!this.__dot_color.equals(t)){this.__dot_color=t;var i=color.to_html(t);if(this.__graph.fast)this.options.dot_color=i,this.__graph.__changed=!0;else if(this.__dotobject.__activated){var _={};_["marker.color"]=i,this.__graph.__todo(_,this.__dotobject.__id)}}}},dot_radius:{get:function(){return this.__dot_radius},set:function(t){if(this.__dot_radius!=t)if(this.__dot_radius=t,this.__graph.fast)this.options.dot_radius=t,this.__graph.__changed=!0;else if(this.__dotobject.__activated){var i={};i["marker.size"]=2*t,this.__graph.__todo(i,this.__dotobject.__id)}}},visible:{get:function(){return this.__visible},set:function(t){this.__visible!=t&&(this.__visible=t,this.__activated&&(this.__graph.fast||this.__graph.__todo({visible:t},this.__id),this.__graph.__changed=!0))}}}),Export({graph:a,vp_graph:a,gdisplay:a,series:function(t){var i=new l(t);return i.dot&&(t={type:"scatter",color:i.__dot_color,radius:i.__dot_radius},i.__dotobject=new l(t)),i},gcurve:c,gdots:g,gvbars:function(t){return(t=t||{}).type="bar",t.horizontal=!1,void 0!==t.pos&&(t.data=t.pos,delete t.pos),new l(t)},ghbars:function(t){return(t=t||{}).type="bar",t.horizontal=!0,void 0!==t.pos&&(t.data=t.pos,delete t.pos),new l(t)},ghistogram:function(t){throw new Error("ghistogram is not currently implemented in GlowScript.")}})}(); +!function(){"use strict";var r={red:vec(1,0,0),green:vec(0,1,0),blue:vec(0,0,1),yellow:vec(1,1,0),orange:vec(1,.6,0),cyan:vec(0,1,1),magenta:vec(1,0,1),purple:vec(.4,.2,.6),white:vec(1,1,1),black:vec(0,0,0),gray:function(r){return vec(r,r,r)},hsv_to_rgb:function(r){var e=r.x,t=r.y,c=r.z;if(0==t)return vec(c,c,c);var n=Math.floor(6*e),o=6*e-n,v=c*(1-t),a=c*(1-t*o),u=c*(1-t*(1-o));switch(n%=6){case 0:return vec(c,u,v);case 1:return vec(a,c,v);case 2:return vec(v,c,u);case 3:return vec(v,a,c);case 4:return vec(u,v,c);case 5:return vec(c,v,a)}},rgb_to_hsv:function(r){var e=r.x,t=r.y,c=r.z,n=Math.max(e,t,c),o=Math.min(e,t,c),v=n;if(o==n)return vec(0,0,v);var a,u=(n-e)/(n-o),h=(n-t)/(n-o),l=(n-c)/(n-o);return a=e==n?l-h:t==n?2+u-l:4+h-u,(a/=6)<0&&a++,vec(a,(n-o)/n,v)},to_html:function(r){return"rgb("+Math.floor(255*r.x)+","+Math.floor(255*r.y)+","+Math.floor(255*r.z)+")"},to_html_rgba:function(r,e){return"rgba("+Math.floor(255*r.x)+","+Math.floor(255*r.y)+","+Math.floor(255*r.z)+","+e+")"},blend:function(e,t){let c,n,o,v,a,u;return c=r.rgb_to_hsv(e),n=r.rgb_to_hsv(t),c.x.5&&(a=o+1,o=v,v=a),u=(o+v)/2,r.hsv_to_rgb(vec(u,(c.y+n.y)/2,(c.z+n.z)/2))}};Export({color:r})}(); +!function(){"use strict";function s(){}function t(){}s.prototype.roundc=function(s,t){var e,a=[];for(e=0;e0&&(t=this.roundc(t,{roundness:s.roundness,invert:s.invert}),e=this.roundc(e,{roundness:s.roundness,invert:s.invert})),[t,e]},s.prototype.rectangle=function(s){var t,e,a;return void 0===(s=s||{}).pos&&(s.pos=[0,0]),void 0===s.width&&(s.width=1),void 0===s.height&&(s.height=null),void 0===s.rotate&&(s.rotate=0),void 0===s.thickness&&(s.thickness=0),void 0===s.roundness&&(s.roundness=0),void 0===s.invert&&(s.invert=!1),void 0===s.scale&&(s.scale=1),void 0===s.xscale&&(s.xscale=1),void 0===s.yscale&&(s.yscale=1),null===s.height&&(s.height=s.width),0===s.thickness?(a=[],a=[[t=s.width/2,-(e=s.height/2)],[t,e],[-t,e],[-t,-e],[t,-e]],a=this.addpos(s.pos,a),0!==s.rotate&&(a=this.rotatecp(a,s.pos,s.rotate)),1!==s.scale&&(s.xscale=s.yscale=s.scale),1===s.xscale&&1===s.yscale||(a=this.scale(a,s.xscale,s.yscale)),s.roundness>0&&(a=this.roundc(a,{roundness:s.roundness,invert:s.invert}))):a=this.rframe(s),a},s.prototype.cross=function(s){var t,e,a;return void 0===(s=s||{}).pos&&(s.pos=[0,0]),void 0===s.width&&(s.width=1),void 0===s.rotate&&(s.rotate=0),void 0===s.thickness&&(s.thickness=.2),void 0===s.roundness&&(s.roundness=0),void 0===s.invert&&(s.invert=!1),void 0===s.scale&&(s.scale=1),void 0===s.xscale&&(s.xscale=1),void 0===s.yscale&&(s.yscale=1),(s.width+s.thickness)/2,a=[[t=s.width/2,-(e=s.thickness/2)],[t,e],[e,e],[e,t],[-e,t],[-e,e],[-t,e],[-t,-e],[-e,-e],[-e,-t],[e,-t],[e,-e],[t,-e]],a=this.addpos(s.pos,a),0!==rotate&&(a=this.rotatecp(a,s.pos,s.rotate)),1!==s.scale&&(s.xscale=s.yscale=s.scale),1===s.xscale&&1===s.yscale||(a=this.scale(a,s.xscale,s.yscale)),s.roundness>0&&(a=this.roundc(a,{roundness:s.roundness,invert:s.invert})),a},s.prototype.trframe=function(s){var t,e,a,o;return void 0===(s=s||{}).pos&&(s.pos=[0,0]),void 0===s.width&&(s.width=2),void 0===s.height&&(s.height=1),void 0===s.top&&(s.top=null),void 0===s.rotate&&(s.rotate=0),void 0===s.thickness&&(s.thickness=0),void 0===s.roundness&&(s.roundness=0),void 0===s.invert&&(s.invert=!1),void 0===s.scale&&(s.scale=1),void 0===s.xscale&&(s.xscale=1),void 0===s.yscale&&(s.yscale=1),null===s.top&&(s.top=width/2),null===s.thickness?s.thickness=.2*min(s.height,s.top):s.thickness=min(s.height,s.top)*s.thickness*2,a=this.trapezoid({pos:s.pos,width:s.width,height:s.height,top:s.top}),t=Math.atan((s.width-s.top)/2/s.height),e=s.thickness/Math.cos(t),o=this.trapezoid({pos:s.pos,width:s.width-e-s.thickness*Math.tan(t),height:s.height-s.thickness,top:s.top-(e-s.thickness*Math.tan(t))}),a=this.addpos(s.pos,a),o=this.addpos(s.pos,o),0!==s.rotate&&(a=this.rotatecp(a,s.pos,s.rotate),o=this.rotatecp(o,s.pos,s.rotate)),1!==s.scale&&(s.xscale=s.yscale=s.scale),1===s.xscale&&1===s.yscale||(a=this.scale(a,s.xscale,s.yscale),o=this.scale(o,s.xscale,s.yscale)),s.roundness>0&&(a=this.roundc(a,{roundness:s.roundness,invert:s.invert}),o=this.roundc(o,{roundness:s.roundness,invert:s.invert})),[a,o]},s.prototype.trapezoid=function(s){var t,e,a,o;return void 0===(s=s||{}).pos&&(s.pos=[0,0]),void 0===s.width&&(s.width=2),void 0===s.height&&(s.height=1),void 0===s.top&&(s.top=null),void 0===s.rotate&&(s.rotate=0),void 0===s.thickness&&(s.thickness=0),void 0===s.roundness&&(s.roundness=0),void 0===s.invert&&(s.invert=!1),void 0===s.scale&&(s.scale=1),void 0===s.xscale&&(s.xscale=1),void 0===s.yscale&&(s.yscale=1),t=s.width/2,e=s.height/2,null===s.top&&(s.top=t),a=s.top/2,0===s.thickness?(o=[[t,-e],[a,e],[-a,e],[-t,-e],[t,-e]],o=this.addpos(s.pos,o),0!==s.rotate&&(o=this.rotatecp(o,s.pos,s.rotate)),1!==s.scale&&(s.xscale=s.yscale=s.scale),1===s.xscale&&1===s.yscale||(o=this.scale(o,s.xscale,s.yscale)),s.roundness>0&&(o=this.roundc(o,{roundness:s.roundness,invert:s.invert}))):o=this.trframe(s),o},s.prototype.circframe=function(s){var t,e;if(void 0===(s=s||{}).pos&&(s.pos=[0,0]),void 0===s.radius&&(s.radius=.5),void 0===s.iradius&&(s.iradius=null),void 0===s.np&&(s.np=64),void 0===s.scale&&(s.scale=1),void 0===s.xscale&&(s.xscale=1),void 0===s.yscale&&(s.yscale=1),void 0===s.angle1&&(s.angle1=0),void 0===s.angle2&&(s.angle2=2*Math.PI),void 0===s.rotate&&(s.rotate=0),s.thickness=0,null===s.iradius&&(s.iradius=.8*s.radius),t=this.circle(s),0===s.angle1&&s.angle2==2*Math.PI)s.radius=s.iradius;else{var a=s.radius-s.iradius,o=(s.angle1+s.angle2)/2,i=a/Math.sin((s.angle2-s.angle1)/2);s.corner=[s.pos[0]+i*Math.cos(o),s.pos[1]+i*Math.sin(o)];var n=Math.asin(a/s.iradius);s.angle1=s.angle1+n,s.angle2=s.angle2-n,s.radius=s.iradius}return e=this.circle(s),0!==s.rotate&&(t=this.rotatecp(t,s.pos,s.rotate),e=this.rotatecp(e,s.pos,s.rotate)),1!==s.scale&&(s.xscale=s.yscale=s.scale),1===s.xscale&&1===s.yscale||(t=this.scale(t,s.xscale,s.yscale),e=this.scale(e,s.xscale,s.yscale)),[t,e]},s.prototype.circle=function(s){void 0===(s=s||{}).pos&&(s.pos=[0,0]);var t,e,a,o,i,n,r,h,d,c,l,p,u=s.pos;if(void 0!==s.corner&&(u=s.corner),void 0===s.radius&&(s.radius=.5),void 0===s.np&&(s.np=64),void 0===s.scale&&(s.scale=1),void 0===s.xscale&&(s.xscale=1),void 0===s.yscale&&(s.yscale=1),void 0===s.thickness&&(s.thickness=0),void 0===s.angle1&&(s.angle1=0),void 0===s.angle2&&(s.angle2=2*Math.PI),void 0===s.rotate&&(s.rotate=0),p=[],s.thickness>0)s.iradius=s.radius-s.radius*s.thickness,p=this.circframe(s);else{for(0===s.angle1&&s.angle2===2*Math.PI||p.push([u[0],u[1]]),t=2*Math.PI/s.np,e=Math.floor(Math.abs((s.angle2-s.angle1)/t+.5)),t=(s.angle2-s.angle1)/e,0===s.angle1&&s.angle2===2*Math.PI||(e+=1),d=s.radius*Math.cos(s.angle1),c=s.radius*Math.sin(s.angle1),a=Math.cos(t),o=Math.sin(t),i=s.pos[0],n=s.pos[1],p.push([i+d,n+c]),l=0;l0&&(a=this.roundc(a,{roundness:s.roundness,invert:s.invert}),o=this.roundc(o,{roundness:s.roundness,invert:s.invert})),[a,o]},s.prototype.ngon=function(s){var t,e,a,o,i,n,r;if(void 0===(s=s||{}).thickness&&(s.thickness=0),void 0===s.pos&&(s.pos=[0,0]),void 0===s.length&&(s.length=1),void 0===s.rotate&&(s.rotate=0),void 0===s.roundness&&(s.roundness=0),void 0===s.invert&&(s.invert=!1),void 0===s.scale&&(s.scale=1),void 0===s.xscale&&(s.xscale=1),void 0===s.yscale&&(s.yscale=1),void 0===s.np&&(s.np=3),r=[],s.np<3)throw Error("number of sides can not be less than 3");if(o=2*Math.PI/s.np,i=s.length/2/Math.sin(o/2),0===s.thickness){for(t=2*Math.PI/s.np,o=0,n=0;n0&&(r=this.roundc(r,{roundness:s.roundness,invert:s.invert}))}else r=this.nframe(s);return r},s.prototype.triangle=function(s){return void 0===(s=s||{}).rotate&&(s.rotate=0),s.np=3,s.rotate=s.rotate-Math.PI/6,this.ngon(s)},s.prototype.pentagon=function(s){return void 0===(s=s||{}).rotate&&(s.rotate=0),s.np=5,s.rotate=s.rotate+Math.PI/10,this.ngon(s)},s.prototype.hexagon=function(s){return void 0===(s=s||{}).rotate&&(s.rotate=0),s.np=6,this.ngon(s)},s.prototype.octagon=function(s){return void 0===(s=s||{}).rotate&&(s.rotate=0),s.np=8,s.rotate=s.rotate+Math.PI/8,this.ngon(s)},s.prototype.sframe=function(s){var t,e;return void 0===(s=s||{}).pos&&(s.pos=[0,0]),void 0===s.radius&&(s.radius=1),void 0===s.n&&(s.n=5),void 0===s.iradius&&(s.iradius=null),void 0===s.rotate&&(s.rotate=0),void 0===s.thickness&&(s.thickness=0),void 0===s.roundness&&(s.roundness=0),void 0===s.invert&&(s.invert=!1),void 0===s.scale&&(s.scale=1),void 0===s.xscale&&(s.xscale=1),void 0===s.yscale&&(s.yscale=1),null===s.iradius&&(s.iradius=.5*s.radius),null===s.thickness?s.thickness=.2*s.radius:s.thickness=2*s.thickness*s.iradius,t=this.star({pos:s.pos,n:s.n,radius:s.radius,iradius:s.iradius}),e=this.star({pos:s.pos,n:s.n,radius:s.radius-s.thickness,iradius:(s.radius-s.thickness)*s.iradius/s.radius}),0!==s.rotate&&(t=this.rotatecp(t,s.pos,s.rotate),e=this.rotatecp(e,s.pos,s.rotate)),1!==s.scale&&(s.xscale=s.yscale=s.scale),1===s.xscale&&1===s.yscale||(t=this.scale(t,s.xscale,s.yscale),e=this.scale(e,s.xscale,s.yscale)),s.roundness>0&&(t=this.roundc(t,{roundness:s.roundness,invert:s.invert}),e=this.roundc(e,{roundness:s.roundness,invert:s.invert})),[t,e]},s.prototype.star=function(s){var t,e,a,o;if(void 0===(s=s||{}).pos&&(s.pos=[0,0]),void 0===s.radius&&(s.radius=1),void 0===s.n&&(s.n=5),void 0===s.iradius&&(s.iradius=null),void 0===s.rotate&&(s.rotate=0),void 0===s.thickness&&(s.thickness=0),void 0===s.roundness&&(s.roundness=0),void 0===s.invert&&(s.invert=!1),void 0===s.scale&&(s.scale=1),void 0===s.xscale&&(s.xscale=1),void 0===s.yscale&&(s.yscale=1),null===s.iradius&&(s.iradius=.5*s.radius),0===s.thickness){for(o=[],t=Math.PI/s.n,e=0,a=0;a<2*s.n+1;a++)a%2==0?o.push([-s.radius*Math.sin(e),s.radius*Math.cos(e)]):o.push([-s.iradius*Math.sin(e),s.iradius*Math.cos(e)]),e+=t;(o=this.addpos(s.pos,o))[o.length-1]=o[0],0!==s.rotate&&(o=this.rotatecp(o,s.pos,s.rotate)),1!==s.scale&&(s.xscale=s.yscale=s.scale),1===s.xscale&&1===s.yscale||(o=this.scale(o,s.xscale,s.yscale)),s.roundness>0&&(o=this.roundc(o,{roundness:s.roundness,invert:s.invert}))}else o=this.sframe(s);return o},s.prototype.points=function(s){var t,e=!1;return void 0===(s=s||{}).pos&&(s.pos=[]),void 0===s.rotate&&(s.rotate=0),void 0===s.roundness&&(s.roundness=0),void 0===s.invert&&(s.invert=!1),void 0===s.scale&&(s.scale=1),void 0===s.xscale&&(s.xscale=1),void 0===s.yscale&&(s.yscale=1),void 0===s.path&&(e=s.path),(t=s.pos)[t.length-1][0]===t[0][0]&&t[t.length-1][1]===t[0][1]||e||t.push(t[0]),t.length&&0!==s.rotate&&(t=this.rotatecp(t,t[0],s.rotate)),1!==s.scale&&(s.xscale=s.yscale=s.scale),1===s.xscale&&1===s.yscale||(t=this.scale(t,s.xscale,s.yscale)),s.roundness>0&&(t=this.roundc(t,{roundness:s.roundness,invert:s.invert})),t},s.prototype.ToothOutline=function(s){var t,e,a,o,i,n,r,h,d,c,l,p,u,v,g,y,M,f,k,x,m,w,P,T,I,b,B,A,D;for(void 0===(s=s||{}).n&&(s.n=30),void 0===s.res&&(s.res=1),void 0===s.phi&&(s.phi=20),void 0===s.radius&&(s.radius=50),void 0===s.addendum&&(s.addendum=.4),void 0===s.dedendum&&(s.dedendum=.5),void 0===s.fradius&&(s.fradius=.1),void 0===s.bevel&&(s.bevel=.05),e={Bottom:(t={PitchRadius:s.radius,TeethN:s.n,PressureAng:s.phi,Addendum:s.addendum,Dedendum:s.dedendum,Fillet:s.fradius,Bevel:s.bevel,Resolution:s.res}).PitchRadius-t.Dedendum-t.Fillet,Ded:t.PitchRadius-t.Dedendum,Base:t.PitchRadius*cos(t.PressureAng*Math.PI/180),Bevel:t.PitchRadius+t.Addendum-t.Bevel,Add:t.PitchRadius+t.Addendum},a=t.TeethN/(2*t.PitchRadius),o=Math.PI/2/a,i=Math.PI/a,n=sqrt((1-Math.cos(t.PressureAng*Math.PI/1800))/Math.cos(t.PressureAng*Math.PI/180)),r=sqrt(e.Bevel*e.Bevel/(e.Ded*e.Ded)-1),h=Math.atan((sin(n)-n*Math.cos(n))/(Math.cos(n)+n*Math.sin(n))),d=Math.atan((sin(r)-r*Math.cos(r))/(Math.cos(r)+r*Math.sin(r))),l={Theta0:i/(2*t.PitchRadius),Theta1:(c=h+o/(2*t.PitchRadius))+t.Fillet/e.Ded,Theta2:c,Theta3:c-d,Theta4:c-d-t.Bevel/e.Add},B=t.Resolution,p=[],u=[],v=0;v<2*B;v++)b=(l.Theta1-l.Theta0)*v/(2*B-1)+l.Theta0,p.push([e.Bottom*Math.cos(b),e.Bottom*Math.sin(b)]),u.push([-Math.cos(b),-Math.sin(b)]);for(w=e.Ded*Math.cos(l.Theta1),P=e.Ded*Math.sin(l.Theta1),g=Math.PI/2+l.Theta2-l.Theta1,v=0;vp&&(p=d),(c=g[1])v&&(v=c);for(y=[(l+p)/2,(u+v)/2],M=s.pos[0]-y[0],f=s.pos[1]-y[1],k=[],h=0;h0,o=t.cross(s.up),i=[],h=0;h=16777216&&(t-=16777216*(i=Math.floor(t/16777216))),t>=65536&&(t-=65536*(e=Math.floor(t/65536))),t>=256&&(t-=256*(s=Math.floor(t/256))),[i/255,e/255,s/255,t/255]}function RSdict_to_JSobjectliteral(t){if(void 0!==t.jsmap){var i={};for(var[e,s]of t.jsmap)i[e]=s;return i}return t}function makeTrail(t,i){if(t.__interval=-1,t.constructor!=curve&&t.constructor!=points&&void 0!==i.make_trail){if(t.__make_trail=i.make_trail,delete i.make_trail,t.__trail_type="curve",void 0!==i.trail_type){if("curve"!=i.trail_type&&"points"!=i.trail_type&&"spheres"!=i.trail_type)throw new Error("trail_type = "+i.trail_type+" but must be 'curve' or 'points' (or 'spheres').");t.__trail_type=i.trail_type,delete i.trail_type}if(void 0!==i.interval?(t.__interval=i.interval,delete i.interval):"curve"!=t.__trail_type&&(t.__interval=1),void 0!==i.retain?(t.__retain=i.retain,delete i.retain):t.__retain=-1,t.__trail_color=color.white,void 0!==t.color&&(t.__trail_color=t.color),void 0!==i.trail_color&&(t.__trail_color=i.trail_color,delete i.trail_color),t.__trail_radius=0,void 0!==i.trail_radius?(t.__trail_radius=i.trail_radius,delete i.trail_radius):"points"==t.__trail_type&&(t.__trail_radius=.1*t.__size.y),t.__pps=0,void 0!==i.pps){if(t.__interval>0)throw"curve"!=t.__trail_type?new Error("pps cannot be used with a "+t.__trail_type+"-type trail"):new Error("pps cannot be used with interval > 0");t.__pps=i.pps,delete i.pps}t.__trail_object=attach_trail(t,{type:t.__trail_type,color:t.__trail_color,radius:t.__trail_radius,pps:t.__pps,retain:t.__retain}),void 0!==i.pos&&t.__make_trail&&t.__trail_object.__trail.push(i.pos),t.__make_trail||t.__trail_object.stop(),t.__ninterval=0,t._pos_set=void 0!==i.pos}}function init(t,i){if(t.constructor!=text){for(var e in"vpython"==window.__GSlang&&void 0!==i.display&&(i.canvas=i.display,delete i.display),void 0!==i.canvas?(t.canvas=i.canvas,delete i.canvas):t.canvas=canvas.selected,t.canvas&&(t.constructor!=distant_light&&t.constructor!=local_light&&t.canvas.__activate(),t.__model=t.__get_model()),i.__obj&&(t.__obj=i.__obj,delete i.__obj),void 0!==i.radius&&(t.radius=i.radius,delete i.radius),void 0!==i.size_units&&(t.size_units=i.size_units,delete i.size_units),void 0!==i.axis&&(0===i.axis.mag2&&(t.__oldaxis=vec(1,0,0)),t.axis=i.axis,delete i.axis),void 0!==i.size&&(t.size=i.size,delete i.size),void 0!==i.up&&(0===i.up.mag2&&(t.__oldup=vec(0,1,0)),t.up=i.up,delete i.up),void 0!==i.color&&(t.color=i.color,delete i.color),void 0!==i.make_trail&&makeTrail(t,i),i)t[e]=i[e];void 0===i.visible&&null!==t.canvas&&(t.visible=!0)}}function initObject(t,i,e){if(!(t instanceof i))return new i(e);e=e||{},t.__tex={file:null,bumpmap:null,texture_ref:{reference:null},bumpmap_ref:{reference:null},left:!1,right:!1,sides:!1,flipx:!1,flipy:!1,turn:0,flags:0},t.__sizing=!1,i!=sphere&&i!=simple_sphere&&i!=ring&&i!=text&&i!=compound&&(t.__sizing=!0),i==curve&&(t.origin=t.origin),i!=curve&&i!=points&&i!=text&&(t.pos=t.pos),i!=points&&i!=text&&(t.axis=t.axis,t.up=t.up,t.size=t.size,t.color=t.color),void 0===e.opacity&&(t.__opacity=1),t.__opacity_change=!0,init(t,e)}var nextVisibleId=1,textures={flower:":flower_texture.jpg",granite:":granite_texture.jpg",gravel:":gravel_texture.jpg",earth:":earth_texture.jpg",metal:":metal_texture.jpg",rock:":rock_texture.jpg",rough:":rough_texture.jpg",rug:":rug_texture.jpg",stones:":stones_texture.jpg",stucco:":stucco_texture.jpg",wood:":wood_texture.jpg",wood_old:":wood_old_texture.jpg"},bumpmaps={gravel:":gravel_bumpmap.jpg",rock:":rock_bumpmap.jpg",stones:":stones_bumpmap.jpg",stucco:":stucco_bumpmap.jpg",wood_old:":wood_old_bumpmap.jpg"};function setup_texture(t,i,e){if(":"==t.slice(0,1)){var s=window.Jupyter_VPython;t=void 0!==s?s+t.slice(1):"https://s3.amazonaws.com/glowscript/textures/"+t.slice(1)}i.canvas.__renderer.initTexture(t,i,e)}function Primitive(){}function box(t){return initObject(this,box,t)}function pyramid(t){return initObject(this,pyramid,t)}function cylinder(t){return initObject(this,cylinder,t)}function cone(t){return initObject(this,cone,t)}function sphere(t){return initObject(this,sphere,t)}function simple_sphere(t){return initObject(this,simple_sphere,t)}function ellipsoid(t){return initObject(this,ellipsoid,t)}function arrow_update(t){let i=t.__oldaxis;var e=t.__pos;t.__color;let s=t.__axis;var n=mag(s),o=s.norm(),_=t.__shaftwidth||.1*n,r=t.__headwidth||2*_,a=t.__headlength||3*_;if(_<.02*n){var h=.02*n/_;t.__shaftwidth||(_*=h),t.__headwidth||(r*=h),t.__headlength||(a*=h)}if(a>.5*n){h=.5*n/a;t.__shaftwidth||(_*=h),t.__headwidth||(r*=h),t.__headlength||(a*=h)}var c=t.__components;c||((c=t.__round?t.__components=[cylinder({canvas:t.canvas,__obj:t}),cone({canvas:t.canvas,__obj:t})]:t.__components=[box({canvas:t.canvas,__obj:t}),pyramid({canvas:t.canvas,__obj:t})])[0].__oldaxis=void 0,c[1].__oldaxis=void 0,0===n&&(c[0].__oldaxis=vec(1,0,0),c[1].__oldaxis=vec(1,0,0)));var l=c[0],u=c[1];n>0?(t.__round?l.pos=e:l.pos=e.add(o.multiply(.5*(n-a))),u.pos=e.add(o.multiply(n-a)),window.__adjustupaxis=!1,l.axis=u.axis=s,l.up=u.up=t.__up,l.__oldaxis=u.__oldaxis=void 0,window.__adjustupaxis=!0,l.size=vec(n-a,_,_),u.size=vec(a,r,r),l.color=u.color=t.color,l.opacity=u.opacity=t.opacity,l.pickable=u.pickable=t.pickable,t.size=vec(n,r,r)):(l.axis=vec(0,0,0),u.axis=vec(0,0,0)),l.__update(),u.__update(),t.__oldaxis=i}function arrow(t){return this instanceof arrow?(t=t||{},this.__shaftwidth=0,this.__headwidth=0,this.__headlength=0,void 0!==t.round?(this.__round=t.round,delete t.round):this.__round=!1,initObject(this,arrow,t)):new arrow(t)}function text(t){if(!(this instanceof text))return new text(t);if(null!==(t=t||{}).canvas){if(void 0===t.text||0===t.text.length)throw new Error("A text object needs non-empty text.");if(void 0!==t.length&&void 0===t.__comp)throw new Error("The length cannot be specified when constructing 3D text.");if(void 0!==t.size)throw new Error("A text object does not have a size attribute.");if(this.pos=this.pos,this.axis=this.axis,this.up=this.up,this.color=this.color,this.__stage=0,void 0===t.__comp){t.text=print_to_string(t.text);var i=text3D(t);for(var e in this.__comp=i[0],void 0!==(t=i[1]).make_trail&&(this.__realtrail=t.make_trail,this.__stage=1,makeTrail(this.__comp,t),delete t.make_trail),this.__id=nextVisibleId,nextVisibleId++,t)this[e]=t[e];this.__pseudosize=vec(this.__comp.size),this.__height_fraction=this.__height/this.__comp.size.y,this.__descender_fraction=this.__descender/this.__comp.size.y,this.__offset=this.__comp.__pos,this.__offset.x/=t.__length,this.__offset.y/=t.__height,this.__offset.z/=t.__depth}else{this.__comp=t.__comp,delete t.__comp;var s=t.newargs;for(var e in delete t.newargs,void 0!==t.make_trail&&void 0===s.make_trail?(this.__realtrail=t.make_trail,delete t.make_trail,this.__stage=1,makeTrail(this.__comp,t)):void 0!==s.make_trail&&(t.make_trail=this.__realtrail=s.make_trail,delete s.make_trail,this.__stage=1,makeTrail(this.__comp,t)),this.__id=nextVisibleId,nextVisibleId++,this.canvas=t.canvas,delete t.canvas,this.__offset=t.__offset,delete t.__offset,t)this["__"+e]=t[e];this.__pseudosize=vec(this.__comp.size),this.__height_fraction=this.__height/this.__comp.size.y,this.__descender_fraction=this.__descender/this.__comp.size.y}for(var e in initObject(this,text,{}),s)this[e]=s[e];this.__billboard&&(this.canvas.update_billboards=!0,this.canvas.billboards.push(this)),this.__update()}}function vertex(t){if(!(this instanceof vertex))return new vertex(t);for(var i in void 0!==(t=t||{}).canvas?this.canvas=t.canvas:void 0!==t.display?this.canvas=t.display:this.canvas=canvas.selected,t)"canvas"!=i&&"display"!=i&&(this[i]=t[i]);if(void 0===this.opacity&&(this.opacity=1),0!==this.__texpos.z)throw new Error("In a vertex the z component of texpos must be zero.");if(this.canvas.vertex_id>=429e7)throw new Error("Currently the number of vertices is limited to 4.29e9.");var e={pos:3,normal:3,color:3,opacity:1,shininess:1,emissive:1,texpos:2,bumpaxis:3};if(this.__id=this.canvas.__vertices.available.pop(),void 0===this.__id){this.__id=this.canvas.vertex_id;var s=this.canvas.__vertices;if(this.__id%s.Nalloc==0){var n,o=this.canvas.vertex_id+s.Nalloc;for(var _ in e)(n=new Float32Array(e[_]*o)).set(s[_],0),s[_]=n}this.canvas.vertex_id++}this.canvas.__vertices.object_info[this.__id]={},this.__change()}function tri_quad_error(t,i){throw new Error("A "+t+" has no "+i+" attribute.")}function triangle(t){if(!(this instanceof triangle))return new triangle(t);if(void 0!==(t=t||{}).canvas)throw new Error("A triangle does not have a canvas; its vertex objects do.");var i=["v0","v1","v2"];if(void 0!==t.vs){if(3!=t.vs.length)throw new Error("A triangle must specify three vertex objects.");for(var e=0;e<3;e++)t[i[e]]=t.vs[e];delete t.vs}this.__tex={file:null,bumpmap:null,texture_ref:{reference:null},bumpmap_ref:{reference:null},left:!1,right:!1,sides:!1,flipx:!1,flipy:!1,turn:0,flags:0},t.canvas=t.v0.canvas,init(this,t),this.canvas=t.v0.canvas;for(e=0;e<3;e++){if(this[i[e]].constructor!==vertex)throw new Error("In a triangle, "+i[e]+" must be a vertex object.");if(this[i[e]].canvas.__id!==this.canvas.__id)throw new Error("All triangle vertex objects must be in the same canvas.");this.canvas.__vertices.object_info[this[i[e]].__id][this.__id]=this}}function quad(t){if(!(this instanceof quad))return new quad(t);if(void 0!==(t=t||{}).canvas)throw new Error("A quad does not have a canvas; its vertex objects do.");var i=["v0","v1","v2","v3"];if(void 0!==t.vs){if(4!=t.vs.length)throw new Error("A quad must specify four vertex objects.");for(var e=0;e<4;e++)t[i[e]]=t.vs[e];delete t.vs}this.__tex={file:null,bumpmap:null,texture_ref:{reference:null},bumpmap_ref:{reference:null},left:!1,right:!1,sides:!1,flipx:!1,flipy:!1,turn:0,flags:0},t.canvas=t.v0.canvas,init(this,t),this.canvas=t.v0.canvas;for(e=0;e<4;e++){if(this[i[e]].constructor!==vertex)throw new Error("In a quad, "+i[e]+" must be a vertex object.");if(this[i[e]].canvas.__id!==this.canvas.__id)throw new Error("All quad vertex objects must be in the same canvas.");this.canvas.__vertices.object_info[this[i[e]].__id][this.__id]=this}}property.declare(Primitive.prototype,{__id:null,__hasPosAtCenter:!1,__deleted:!1,__zx_camera:null,__zy_camera:null,__xmin:null,__ymin:null,__zmin:null,__xmax:null,__ymax:null,__zmax:null,pos:new attributeVectorPos(null,0,0,0),size:new attributeVector(null,1,1,1),axis:new attributeVectorAxis(null,1,0,0),up:new attributeVectorUp(null,0,1,0),color:new attributeVector(null,1,1,1),opacity:{get:function(){return this.__opacity},set:function(t){t!=this.__opacity&&((this.__opacity<1&&1==t||1==this.__opacity&&t<1)&&(this.__opacity_change=!0),this.__opacity=t,this.__change())}},x:{get:function(){throw new Error('"object.x" is not supported; perhaps you meant "object.pos.x"')},set:function(t){throw new Error('"object.x" is not supported; perhaps you meant "object.pos.x"')}},y:{get:function(){throw new Error('"object.y" is not supported; perhaps you meant "object.pos.y"')},set:function(t){throw new Error('"object.y" is not supported; perhaps you meant "object.pos.y"')}},z:{get:function(){throw new Error('"object.z" is not supported; perhaps you meant "object.pos.z"')},set:function(t){throw new Error('"object.z" is not supported; perhaps you meant "object.pos.z"')}},__opacity_change:!1,__prev_opacity:null,shininess:{value:.6,onchanged:function(){this.__change()}},emissive:{value:!1,onchanged:function(){this.__change()}},pickable:{value:!0,onchanged:function(){this.__change()}},ready:{get:function(){return null===this.__tex.file||null!==this.__tex.texture_ref.reference&&null===this.__tex.bumpmap||null!==this.__tex.bumpmap_ref.reference}},make_trail:{get:function(){return this.__make_trail},set:function(t){this.__make_trail!==t&&(t?(this.__trail_object.start(),this.__trail_object.__trail.push(this.__pos)):this.__trail_object.stop(),this.__make_trail=t)}},retain:{get:function(){return this.__retain},set:function(t){this.__retain=t,void 0!==this.__trail_object&&(this.__trail_object.retain=t)}},trail_type:{get:function(){return"curve"==this.__trail_type?"curve":"spheres"==this.__trail_type?"points":this.__trail_type},set:function(t){throw new Error('"trail_type" cannot be changed.')}},trail_color:{get:function(){return this.__color},set:function(t){this.__trail_color=t,void 0!==this.__trail_object&&(this.__trail_object.color=t)}},trail_radius:{get:function(){return this.__radius},set:function(t){this.__trail_radius=t,void 0!==this.__trail_object&&(this.__trail_object.radius=t)}},pps:{get:function(){return this.__pps},set:function(t){this.__pps=t,void 0!==this.__trail_object&&(this.__trail_object.pps=t)}},clear_trail:function(){void 0!==this.__trail_object&&this.__trail_object.clear()},__update_trail:function(t){if(this.__trail_object.__run&&this.visible&&-1!==this.__interval){this.__ninterval++;var i=!1;this.__ninterval>=this.__interval?(this.__ninterval=0,i=!0):1==this.__ninterval&&0===this.__trail_object.__trail.__points.length&&(i=!0),i&&(-1==this.__retain?this.__trail_object.__trail.push({pos:t,color:this.__trail_color,radius:this.__trail_radius}):this.__trail_object.__trail.push({pos:t,color:this.__trail_color,radius:this.__trail_radius,retain:this.__retain}))}},texture:{get:function(){return{file:this.__tex.file,bumpmap:this.__tex.bumpmap,left:this.__tex.left,right:this.__tex.right,sides:this.__tex.sides,flipx:this.__tex.flipx,flipy:this.__tex.flipy,turn:this.__tex.turn}},set:function(t){if(this.__tex={file:null,bumpmap:null,texture_ref:{reference:null},bumpmap_ref:{reference:null},left:!1,right:!1,sides:!1,flipx:!1,flipy:!1,turn:0,flags:0},null===t);else if("string"==typeof t)this.__tex.left=this.__tex.right=this.__tex.sides=!0,setup_texture(t,this,!1);else{if(void 0===(t=RSdict_to_JSobjectliteral(t)).file||"string"!=typeof t.file)throw new Error("You must specify a file name for a texture.");if(setup_texture(t.file,this,!1),void 0!==t.bumpmap&&null!==t.bumpmap){if("string"!=typeof t.bumpmap)throw new Error("You must specify a file name for a bumpmap.");setup_texture(t.bumpmap,this,!0)}if(void 0!==t.flipx&&(this.__tex.flipx=t.flipx),void 0!==t.flipy&&(this.__tex.flipy=t.flipy),void 0!==t.turn&&(this.__tex.turn=Math.round(t.turn)),void 0!==t.place){"string"==typeof t.place&&(t.place=[t.place]);for(var i=0;i3)throw new Error("object.rotate takes 1 to 3 arguments");for(var e={},s=0;s1e-6&&(o.axis=o.__axis.rotate({angle:h,axis:a})),o.up=o.__up.rotate({angle:h,axis:a}),window.__adjustupaxis=!0)},bounding_box:function(){let t=norm(this.axis),i=norm(this.up),e=norm(cross(t,i)),s=this.size.x,n=this.size.y,o=this.size.z,_=vec(this.pos);["box","compound","ellipsoid","sphere","simple_sphere","ring"].indexOf(this.constructor.name)<0&&(_=_.add(t.multiply(.5*s)));let r,a,h,c=[];for(r of[-s/2,s/2])for(a of[-n/2,n/2])for(h of[-o/2,o/2])c.push(_.add(t.multiply(r)).add(i.multiply(a)).add(e.multiply(h)));return c},getTransformedMesh:function(){var t=this.__axis.norm(),i=this.__up.norm(),e=t.cross(i),s=this.__pos;if(this instanceof ring){var n=Mesh.makeRing_compound(this.__size),o=[t.x,t.y,t.z,0,i.x,i.y,i.z,0,e.x,e.y,e.z,0,s.x,s.y,s.z,1];return n.transformed(o)}t=t.multiply(this.__size.x),i=i.multiply(this.__size.y),e=e.multiply(this.__size.z);o=[t.x,t.y,t.z,0,i.x,i.y,i.z,0,e.x,e.y,e.z,0,s.x,s.y,s.z,1];return this.__model.mesh.transformed(o)},light_in_world:function(t){let i=this.__axis.hat,e=this.__up.hat,s=i.cross(e),n=t.x,o=t.y,_=t.z;return this.__pos.add(i.multiply(n)).add(e.multiply(o)).add(s.multiply(_))}}),subclass(box,Primitive),box.prototype.__hasPosAtCenter=!0,property.declare(box.prototype,{size:new attributeVectorSize(null,1,1,1),length:{get:function(){return this.__size.__x},set:function(t){0===t?(void 0===this.__oldaxis&&(this.__oldaxis=vec(this.__axis.__x,this.__axis.__y,this.__axis.z)),this.__axis.__x=0,this.__axis.__y=0,this.__axis.__z=0,this.__size.__x=0):(void 0!==this.__oldaxis&&(this.__axis.__x=this.__oldaxis.x,this.__axis.__y=this.__oldaxis.y,this.__axis.__z=this.__oldaxis.z,this.__oldaxis=void 0),0===this.length?this.axis=vec(t,0,0):this.axis=this.__axis.norm().multiply(t)),this.__change()}},height:{get:function(){return this.__size.__y},set:function(t){this.__size.__y=t,this.__change()}},width:{get:function(){return this.__size.__z},set:function(t){this.__size.__z=t,this.__change()}},red:{get:function(){return this.__color.__x},set:function(t){this.__color.__x=t,this.__change()}},green:{get:function(){return this.__color.__y},set:function(t){this.__color.__y=t,this.__change()}},blue:{get:function(){return this.__color.__z},set:function(t){this.__color.__z=t,this.__change()}}}),subclass(pyramid,box),pyramid.prototype.__hasPosAtCenter=!1,subclass(cylinder,box),cylinder.prototype.__hasPosAtCenter=!1,property.declare(cylinder.prototype,{size:new attributeVectorSize(null,1,2,2),radius:{get:function(){return this.__size.__y/2},set:function(t){this.__size.__y=this.__size.__z=2*t,this.__change()}}}),subclass(cone,cylinder),cone.prototype.__hasPosAtCenter=!1,subclass(sphere,Primitive),sphere.prototype.__hasPosAtCenter=!0,property.declare(sphere.prototype,{axis:new attributeVectorAxis(null,1,0,0),size:new attributeVector(null,2,2,2),radius:{get:function(){return this.__size.__y/2},set:function(t){this.size=vec(2*t,2*t,2*t),this.__change()}}}),subclass(simple_sphere,sphere),property.declare(simple_sphere.prototype,{axis:new attributeVectorAxis(null,1,0,0),size:new attributeVector(null,2,2,2)}),subclass(ellipsoid,box),property.declare(ellipsoid.prototype,{radius:{get:function(){throw new Error("An ellipsoid does not have a radius attribute.")},set:function(t){throw new Error("An ellipsoid does not have a radius attribute.")}}}),subclass(arrow,box),property.declare(arrow.prototype,{__primitiveCount:2,axis_and_length:{get:function(){throw new Error("As of GlowScript 3.0, arrow does not have an axis_and_length attribute.")},set:function(t){throw new Error("As of GlowScript 3.0, arrow does not have an axis_and_length attribute.")}},round:{get:function(){return this.__round},set:function(t){throw new Error('Cannot change the "round" attribute of an arrow.')}},shaftwidth:{get:function(){return this.__shaftwidth},set:function(t){this.__shaftwidth=t,this.__change()}},headwidth:{get:function(){return this.__headwidth},set:function(t){this.__headwidth=t,this.__change()}},headlength:{get:function(){return this.__headlength},set:function(t){this.__headlength=t,this.__change()}},__change:function(){this.__components&&(this.__components[0].__change(),this.__components[1].__change())},__update:function(){arrow_update(this)},__get_extent:function(t){this.__components||this.__update(),Autoscale.find_extent(this.__components[0],t),Autoscale.find_extent(this.__components[1],t)},scale:{get:function(){return this.__scale},set:function(t){this.__scale=t,this.__change()}},start:function(){this.visible=this.__run=!0},stop:function(){this.visible=this.__run=!1}}),subclass(text,Primitive),property.declare(text.prototype,{size:{get:function(){throw new Error("A text object does not have a size attribute.")},set:function(t){throw new Error("A text object does not have a size attribute.")}},visible:{get:function(){return this.__comp.visible},set:function(t){this.__comp.visible=t}},__update:function(){window.__adjustupaxis=!1,this.__comp.axis=this.axis,this.__comp.up=this.up,window.__adjustupaxis=!0;var t=this.__pseudosize.y;this.__comp.size=vec(this.length,t,Math.abs(this.depth)),this.__comp.color=this.color;var i=cross(this.__axis,this.__up).norm();this.__comp.pos=this.__pos.add(this.__axis.norm().multiply(this.__offset.x*this.length)).add(this.__up.norm().multiply(this.__offset.y*this.height)).add(i.multiply(this.__offset.z*this.depth)),this.__stage>0&&(1==this.__stage?(this.__comp.make_trail=!1,this.__stage=2):2==this.__stage&&(this.__comp.make_trail=this.__realtrail,this.__stage=0))},length:{get:function(){return this.__pseudosize.x},set:function(t){t!==this.__pseudosize.x&&(this.__pseudosize.x=t,this.__change())}},height:{get:function(){return this.__height_fraction*this.__pseudosize.y},set:function(t){this.__pseudosize.y=t/this.__height_fraction,this.__change()}},depth:{get:function(){return this.__depth>=0?this.__pseudosize.z:-this.__pseudosize.z},set:function(t){var i=this.__depth;Math.abs(t)<.01*i&&(t=t<0?-.01*i:.01*i),this.__depth=t,this.__pseudosize.z=Math.abs(t),this.__change()}},descender:{get:function(){return this.__descender_fraction*this.__pseudosize.y},set:function(t){throw new Error("descender is read-only")}},opacity:{get:function(){return this.__opacity},set:function(t){this.__comp.opacity=this.__opacity=t,this.__change()}},shininess:{get:function(){return this.__shininess},set:function(t){this.__shininess=this.__comp.shininess=t,this.__change()}},emissive:{get:function(){return this.__emissive},set:function(t){this.__comp.emissive=this.__emissive=t,this.__change()}},texture:{get:function(){throw new Error("Cannot currently apply a texture to a text object")},set:function(t){throw new Error("Cannot currently apply a texture to a text object")}},text:{get:function(){return this.__text},set:function(t){throw new Error("text is read-only")}},font:{get:function(){return this.__font},set:function(t){throw new Error("font is read-only")}},align:{get:function(){return this.__align},set:function(t){throw new Error("align is read-only")}},billboard:{get:function(){return this.__billboard},set:function(t){throw new Error("billboard is read-only")}},show_start_face:{get:function(){return this.__show_start_face},set:function(t){throw new Error("show_start_face is read-only")}},show_end_face:{get:function(){return this.__show_end_face},set:function(t){throw new Error("show_end_face is read-only")}},start_face_color:{get:function(){return this.__start_face_color},set:function(t){throw new Error("start_face_color is read-only")}},end_face_color:{get:function(){return this.__end_face_color},set:function(t){throw new Error("end_face_color is read-only")}},start:{get:function(){return this.upper_left.sub(this.up.norm().multiply(this.height))},set:function(t){throw new Error("start is read-only")}},end:{get:function(){return this.upper_right.sub(this.up.norm().multiply(this.height))},set:function(t){throw new Error("end is read-only")}},vertical_spacing:{get:function(){return 1.5*this.height},set:function(t){throw new Error("vertical_spacing is read-only")}},upper_left:{get:function(){var t=0;return"right"==this.__align?t=-this.length:"center"==this.__align&&(t=-this.length/2),this.pos.add(this.up.norm().multiply(this.height)).add(this.axis.norm().multiply(t))},set:function(t){throw new Error("upper_left is read-only")}},upper_right:{get:function(){return this.upper_left.add(this.axis.norm().multiply(this.length))},set:function(t){throw new Error("upper_right is read-only")}},lower_left:{get:function(){return this.upper_left.add(this.up.norm().multiply(-this.height-this.descender-1.5*this.height*(this.__lines-1)))},set:function(t){throw new Error("lower_left is read-only")}},lower_right:{get:function(){return this.lower_left.add(this.axis.norm().multiply(this.length))},set:function(t){throw new Error("lower_right is read-only")}},lines:{get:function(){return this.__lines},set:function(t){throw new Error("lines is read-only")}}}),property.declare(vertex.prototype,{__id:null,__hasPosAtCenter:!0,pos:new attributeVector(null,0,0,0),normal:new attributeVector(null,0,0,1),color:new attributeVector(null,1,1,1),opacity:{get:function(){return this.__opacity},set:function(t){if(t!=this.__opacity){if(this.__opacity<1&&1==t||1==this.__opacity&&t<1){var i=this.canvas.__vertices.object_info[this.__id];for(var e in i)i[e].__change(),i[e].__opacity_change=!0}this.__opacity=t,this.canvas.__vertex_changed[this.__id]=this}}},texpos:new attributeVector(null,0,0,0),bumpaxis:new attributeVector(null,1,0,0),shininess:{value:.6,onchanged:function(){this.__change()}},emissive:{value:!1,onchanged:function(){this.__change()}},__change:function(){if(this.__id&&(this.canvas.__vertex_changed[this.__id]=this,this.canvas.__autoscale)){var t=this.canvas.__vertices.object_info[this.__id];for(var i in t)t[i].__change()}},rotate:function(t){if(void 0===t.angle)throw new Error("vertex.rotate() requires angle:...");var i=t.angle;if(void 0===t.axis)throw new Error("vertex.rotate() requires axis:...");var e,s=t.axis.norm();e=void 0===t.origin?vec(0,0,0):t.origin,this.pos=e.add(this.__pos.sub(e).rotate({angle:i,axis:s})),this.normal=this.__normal.rotate({angle:i,axis:s}),this.__change()}}),subclass(triangle,box),property.declare(triangle.prototype,{v0:{get:function(){return this.__v0},set:function(t){if(!(t instanceof vertex))throw new Error("v0 must be a vertex object.");this.__v0=t,this.__change()}},v1:{get:function(){return this.__v1},set:function(t){if(!(t instanceof vertex))throw new Error("v1 must be a vertex object.");this.__v1=t,this.__change()}},v2:{get:function(){return this.__v2},set:function(t){if(!(t instanceof vertex))throw new Error("v2 must be a vertex object.");this.__v2=t,this.__change()}},vs:{get:function(){return[this.__v0,this.__v1,this.__v2]},set:function(t){if("array"!=toType(t)||3!=t.length)throw new Error("triangle.vs must be a list of 3 vertex objects.");for(var i=0;i<3;i++)if(!(t[i]instanceof vertex))throw new Error("triangle.vs must contain vertex objects.");this.__v0=t[0],this.__v1=t[1],this.__v2=t[2],this.__change()}},pos:{get:function(){tri_quad_error("triangle","pos")},set:function(t){tri_quad_error("triangle","pos")}},color:{get:function(){tri_quad_error("triangle","color")},set:function(t){tri_quad_error("triangle","color")}},size:{get:function(){tri_quad_error("triangle","size")},set:function(t){tri_quad_error("triangle","size")}},axis:{get:function(){tri_quad_error("triangle","axis")},set:function(t){tri_quad_error("triangle","axis")}},up:{get:function(){tri_quad_error("triangle","up")},set:function(t){tri_quad_error("triangle","up")}},opacity:{get:function(){tri_quad_error("triangle","opacity")},set:function(t){tri_quad_error("triangle","opacity")}},shininess:{get:function(){tri_quad_error("triangle","shininess")},set:function(t){tri_quad_error("triangle","shininess")}},emissive:{get:function(){tri_quad_error("triangle","emissive")},set:function(t){tri_quad_error("triangle","emissive")}},__prev_texture:null,__prev_bumpmap:null,__update:function(){this.__model.id_object[this.__id]=this},__get_extent:function(t){for(var i=["__v0","__v1","__v2"],e=0;e<3;e++)t.point_extent(this,this[i[e]].pos)},rotate:function(t){throw new Error("A triangle has no rotate method; rotate the vertices instead.")}}),subclass(quad,box),property.declare(quad.prototype,{v0:{get:function(){return this.__v0},set:function(t){if(!(t instanceof vertex))throw new Error("v0 must be a vertex object.");this.__v0=t,this.__change()}},v1:{get:function(){return this.__v1},set:function(t){if(!(t instanceof vertex))throw new Error("v1 must be a vertex object.");this.__v1=t,this.__change()}},v2:{get:function(){return this.__v2},set:function(t){if(!(t instanceof vertex))throw new Error("v2 must be a vertex object.");this.__v2=t,this.__change()}},v3:{get:function(){return this.__v3},set:function(t){if(!(t instanceof vertex))throw new Error("v3 must be a vertex object.");this.__v3=t,this.__change()}},vs:{get:function(){return[this.__v0,this.__v1,this.__v2,this.__v3]},set:function(t){if("array"!=toType(t)||4!=t.length)throw new Error("quad.vs must be a list of 4 vertex objects.");for(var i=0;i<4;i++)if(!(t[i]instanceof vertex))throw new Error("quad.vs must contain vertex objects.");this.__v0=t[0],this.__v1=t[1],this.__v2=t[2],this.__v3=t[3],this.__change()}},pos:{get:function(){tri_quad_error("quad","pos")},set:function(t){tri_quad_error("quad","pos")}},color:{get:function(){tri_quad_error("quad","color")},set:function(t){tri_quad_error("quad","color")}},size:{get:function(){tri_quad_error("quad","size")},set:function(t){tri_quad_error("quad","size")}},axis:{get:function(){tri_quad_error("quad","axis")},set:function(t){tri_quad_error("quad","axis")}},up:{get:function(){tri_quad_error("quad","up")},set:function(t){tri_quad_error("quad","up")}},opacity:{get:function(){tri_quad_error("quad","opacity")},set:function(t){tri_quad_error("quad","opacity")}},shininess:{get:function(){tri_quad_error("quad","shininess")},set:function(t){tri_quad_error("quad","shininess")}},__prev_texture:null,__prev_bumpmap:null,__update:function(){this.__model.id_object[this.__id]=this},__get_extent:function(t){for(var i=["__v0","__v1","__v2","__v3"],e=0;e<4;e++)t.point_extent(this,this[i[e]].pos)},rotate:function(t){throw new Error("A quad has no rotate method; rotate the vertices instead.")}});var compound_id=0;function make_compound(t,i){function e(t,i){if(null!==i.__xmin)for(var e in i){var s=i[e];"min"==e.slice(-3)?(null===t[e]||st[e])&&(t[e]=s)}}var s=i.self;delete i.self,void 0!==i.origin&&(this.__origin=i.origin,delete i.origin);for(var n=new Mesh,o=[],_=0;_0&&this.__push_and_append(pos,{})}}function point(t){if(!(this instanceof point))return new point(t);for(var i in t instanceof vec&&(t={pos:t}),this.radius=0,t)this[i]=t[i];if(void 0===this.pos)throw new Error("Must specify pos for a point on a curve")}function points(t){if(!(this instanceof points)){for(var i=[],e=0;e0&&this.__push_and_append(pos,{}),this.__pixels&&this.canvas.__points_objects.push(this)}}function helix(t){return initObject(this,helix,t)}function arrayequals(t,i){var e=t.length;if(e!==i.length)return!1;for(var s=0;so)&&(o=i.x+c.x),(null===_||i.y+c.y>_)&&(_=i.y+c.y),(null===r||i.z+c.z>r)&&(r=i.z+c.z);var u=vec((e+o)/2,(s+_)/2,(n+r)/2),d=vec(o-e,_-s,r-n),p=this.__pos,f=this.__size;this.__pos=u,this.__size=d,this.__hasPosAtCenter=!0,t.xmin=e,t.xmax=o,t.ymin=s,t.ymax=_,t.zmin=n,t.zmax=r,Autoscale.find_extent(this,t),this.__pos=p,this.__size=f}},__setup:function(t){var i=[],e={};if(t instanceof vec)!0,i=[t];else if(t.length>1){!0;for(var s=0;s-1&&this.__points.length>=e){for(var a=this.__points.length-e,h=0;h-1&&this.__points.length>=e){for(a=this.__points.length-e,h=0;h=this.canvas.__height)var _=2*this.canvas.__range/this.canvas.__height;else _=2*this.canvas.__range/this.canvas.__width;var r=mat4.lookAt(i.pos,i.target,i.up),a=mat4.multiplyVec3(r,vec3.create([this.pos.x,this.pos.y,this.pos.z]));if(a[2]>-i.zNear||a[2]<-i.zFar)return;var h=-i.distance/(a[2]*_);e=Math.round(h*a[0]+this.canvas.__width/2),s=Math.round(-h*a[1]+this.canvas.__height/2)}var c=this.__height,l=.4*this.__height,u=this.__font;"sans"==this.__font?u="Arial":"serif"==this.__font&&(u="Georgia"),t.textBaseline="middle",t.lineWidth=this.__linewidth;var d=vec(1,1,1);this.canvas.__background.equals(vec(1,1,1))&&(d=vec(0,0,0)),t.strokeStyle=color.to_html(this.__linecolor||this.__color||d);var p=parse_html({ctx:t,text:print_to_string(this.__text),x:e,y:s,align:this.__align||"center",font:u,fontsize:c,color:this.__color||d}),f=p.lines.length,v=p.maxwidth;this.__width=v;var g,b,x,m=1.3*this.__height,w=this.__height+(f-1)*m,y=this.__border;if(n||o)Math.abs(o)>Math.abs(n)?o>0?(g=e+n-v/2,b=s-o-w-y+l):(g=e+n-v/2,b=s-o+y+l):Math.abs(n)>0&&(b=s-o-w/2+l,n>0?g=e+n+y:n<0&&(g=e+n-v-y));else switch(b=s,this.__align){case null:case"center":g=e-v/2;break;case"right":g=e-v;break;case"left":g=e}if(x=null==this.__background?this.canvas.__background:this.__background,t.fillStyle=color.to_html_rgba(x,this.__opacity),t.fillRect(g-y,b-l-y,v+2*y,w+2*y),(n||o)&&this.__line){if(t.beginPath(),this.space>0){var z=vec(n,-o,0).norm().multiply(this.space);z=z.add(vec(e,s,0)),t.moveTo(z.x,z.y)}else t.moveTo(e,s);t.lineTo(e+n,s-o),t.stroke()}switch(this.__box&&(t.beginPath(),t.moveTo(g-y,b-l-y),t.lineTo(g+v+y,b-l-y),t.lineTo(g+v+y,b-l+w+y),t.lineTo(g-y,b-l+w+y),t.closePath(),t.stroke()),p.x=g,p.y=b,this.__align){case null:case"center":p.x+=v/2;break;case"right":p.x+=v;break;case"left":p.x+=0}display_2D(p)},__change:function(){void 0!==this.canvas&&(this.canvas.__overlay_objects.__changed=!0)}}),property.declare(attach_trail.prototype,{color:{get:function(){return this.__options.color},set:function(t){this.__options.color=t}},radius:{get:function(){return this.__options.radius},set:function(t){this.__options.radius=t}},pps:{get:function(){return this.__options.pps},set:function(t){this.__options.pps=t}},retain:{get:function(){return this.__options.retain},set:function(t){this.__options.retain=t}},start:function(){this.__run=!0;var t={};for(var i in this.__options)t[i]=this.__options[i];"curve"===this.type?this.__trail=curve(t):this.__trail=points(t),this.__trails.push(this.__trail)},stop:function(){this.__run=!1},clear:function(){this.__last_pos=null,this.__last_time=null,this.__elements=0;for(var t=0;t').css({width:"16px",height:"16px"}).appendTo(i.pos).click(function(){if(null===i.name)i.checked=!i.checked,$(i.jradio).prop("checked",i.checked),i.bind(e);else if(!i.checked){let t=i.name,s=__radio_buttons;null!==s[t]&&(s[t].checked=!1),s[t]=e,i.checked=!0,$(i.jradio).prop("checked",i.checked),i.bind(e)}}),$(" "+i.text+"").appendTo(i.pos);var e={get disabled(){return i.disabled},set disabled(t){if(i.disabled=booleanize(t),null!==i.name&&i.disabled){let t=__radio_buttons,e=i.name;null!==t[e]&&t[e]._id==i._id&&(t[e]=null)}$(i.jradio).attr("disabled",i.disabled),i.disabled?$("#"+i._id).css({color:rgb_to_css(vec(.7,.7,.7))}):$("#"+i._id).css({color:rgb_to_css(vec(0,0,0))})},get checked(){return i.checked},set checked(t){if(null!==i.name){let s=i.name,n=__radio_buttons;t?(null!==n[s]&&(n[s].checked=!1),n[s]=e):null!==n[s]&&n[s]._id==i._id&&(n[s]=null)}i.checked=t,$(i.jradio).prop("checked",t)},get text(){return i.text},set text(t){i.text=t,$("#"+i._id).html(" "+t)},set text(t){i.text=t,$("#"+i._id).html(" "+t)},get name(){return void 0===i.name?"":i.name},set name(t){throw new Error("Cannot change a radio button's name.")},remove:function(){let t=__radio_buttons,e=i.name;null!==t[e]&&t[e]._id==i._id&&(t[e]=null),$(i.jradio).remove(),$("#"+i._id).remove()}};for(var s in t)e[s]=t[s];let n=i.name;if(null!==n){let t=__radio_buttons;null!==t[n]&&i.checked?(t[n].checked=!1,t[n]=e):i.checked&&(t[n]=e)}return e.checked=i.checked,e}function checkbox(t){if(!(this instanceof checkbox))return new checkbox(t);var i={pos:canvas.get_selected().caption_anchor,checked:!1,text:"",disabled:!1};if(void 0===t.bind)throw new Error("A checkbox must have a bind attribute.");for(s in i.bind=t.bind,delete t.bind,i)void 0!==t[s]&&(i[s]=t[s],delete t[s]);i.disabled=booleanize(i.disabled),widgetid++,i._id=widgetid.toString(),i.jcheckbox=$('').css({width:"16px",height:"16px"}).appendTo(i.pos).click(function(){i.checked=!i.checked,$(i.jcheckbox).prop("checked",i.checked),i.bind(e)}),$(" "+i.text+"").appendTo(i.pos);var e={get disabled(){return i.disabled},set disabled(t){i.disabled=booleanize(t),$(i.jcheckbox).attr("disabled",i.disabled),i.disabled?$("#"+i._id).css({color:rgb_to_css(vec(.7,.7,.7))}):$("#"+i._id).css({color:rgb_to_css(vec(0,0,0))})},get checked(){return i.checked},set checked(t){i.checked=t,$(i.jcheckbox).prop("checked",t)},get text(){return i.text},set text(t){i.text=t,$("#"+i._id).html(" "+t)},remove:function(){$(i.jcheckbox).remove(),$("#"+i._id).remove()}};for(var s in t)e[s]=t[s];return e.checked=i.checked,e}function wtext(t){if(!(this instanceof wtext))return new wtext(t);t=t||{};var i={pos:canvas.get_selected().caption_anchor,text:""};for(var e in i)void 0!==t[e]&&(i[e]=t[e],delete t[e]);widgetid++,i._id=widgetid.toString(),$(""+print_to_string(i.text)+"").appendTo(i.pos);var s={get text(){return i.text},set text(t){i.text=t,$("#"+i._id).html(print_to_string(t))},remove:function(){$("#"+i._id).remove()}};for(var e in t)s[e]=t[e];return s}var mathfunctions=["e","E","abs","sqrt","sin","cos","tan","asin","acos","atan","atan2","exp","log","pow","pi","ceil","floor","round","random","factorial","combin","radians","degrees"];function winput(t){t=t||{};var i={pos:canvas.get_selected().caption_anchor,text:void 0,prompt:"",width:100,height:20,type:"numeric",number:null,disabled:!1};for(var e in i)void 0!==t[e]&&(i[e]=t[e],delete t[e]);if("numeric"!=i.type&&"string"!=i.type)throw new Error('A winput type must be "numeric" or "string".');if(void 0!==t.bind&&(i.bind=t.bind),void 0===i.bind)for(;;){if(void 0!==i.prompt&&""!==i.prompt?i.text=prompt(i.prompt,i.text):i.text=prompt(),null===i.text)return null;if(i.number=null,"numeric"!=i.type)return i.text;if(s())return i.number;alert("Numeric input error")}function s(){i.number=null;var t=!0;if("numeric"==i.type&&function(t){for(var i="",e=0;e0){if(mathfunctions.indexOf(i)<0)return!1;i=""}}return!(i.length>0&&mathfunctions.indexOf(i)<0)}(i.text))try{i.number=Function('"use strict";return('+i.text+")")()}catch(e){i.number=null,t=!1}return t}i.disabled=booleanize(i.disabled),widgetid++,i._id=widgetid.toString(),""!=i.prompt&&(i.__wprompt=wtext({text:i.prompt+" ",pos:i.pos})),i.jwinput=$('').val(i.text).appendTo(i.pos).css({width:i.width.toString()+"px",height:i.height.toString()+"px","font-size":(i.height-5).toString()+"px","font-family":"sans-serif"}).keypress(function(t){if(13==t.keyCode){if(i.text=i.jwinput.val(),!s())return void alert("Numeric input error");i.bind(n)}}).blur(function(t){(i.text=i.jwinput.val(),0!==i.text.trim().length)&&(s()?i.bind(n):alert("Numeric input error"))});var n={get disabled(){return i.disabled},set disabled(t){i.disabled=booleanize(t),$(i.jwinput).attr("disabled",i.disabled),i.disabled?$("#"+i._id).css({color:rgb_to_css(vec(.7,.7,.7))}):$("#"+i._id).css({color:rgb_to_css(vec(0,0,0))})},get text(){return i.text},set text(t){i.text=t,$("#"+i._id).val(t)},get number(){return i.number},remove:function(){""!=i.prompt&&i.__wprompt.remove(),$(i.jwinput).remove()}};for(var e in t)n[e]=t[e];return n}function button(t){if(!(this instanceof button))return new button(t);var i={pos:canvas.get_selected().caption_anchor,text:" ",color:vec(0,0,0),background:vec(1,1,1),disabled:!1};if(void 0===t.bind)throw new Error("A button must have a bind attribute.");for(s in i.bind=t.bind,delete t.bind,i)void 0!==t[s]&&(i[s]=t[s],delete t[s]);i.disabled=booleanize(i.disabled),i.jbutton=$("