(function(AV, window, document) {

	function AdjustmentsPanel(e) {
			this.config = e || {}
		}! function(e, t) {
			function n(e) {
                console.log(e);
                console.log(AV.build.feather_baseURL);                
                console.log('99999');
				return L.isWindow(e) ? e : 9 === e.nodeType ? e.defaultView || e.parentWindow : !1
			}

			function a(e) {
				if (!mt[e]) {
					var t = N.body,
						n = L("<" + e + ">").appendTo(t),
						a = n.css("display");
					n.remove(), ("none" === a || "" === a) && (ft || (ft = N.createElement("iframe"), ft.frameBorder = ft.width = ft.height = 0), t.appendChild(ft), ht && ft.createElement || (ht = (ft.contentWindow || ft.contentDocument).document, ht.write(("CSS1Compat" === N.compatMode ? "<!doctype html>" : "") + "<html><body>"), ht.close()), n = ht.createElement(e), ht.body.appendChild(n), a = L.css(n, "display"), t.removeChild(ft)), mt[e] = a
				}
				return mt[e]
			}

			function i(e, t) {
				var n = {};
				return L.each(Ct.concat.apply([], Ct.slice(0, t)), function() {
					n[this] = e
				}), n
			}

			function o() {
				gt = t
			}

			function r() {
				return setTimeout(o, 0), gt = L.now()
			}

			function s() {
				try {
					return new e.ActiveXObject("Microsoft.XMLHTTP")
				} catch (t) {}
			}

			function l() {
				try {
					return new e.XMLHttpRequest
				} catch (t) {}
			}

			function c(e, n) {
				e.dataFilter && (n = e.dataFilter(n, e.dataType));
				var a, i, o, r, s, l, c, p, u = e.dataTypes,
					d = {},
					v = u.length,
					_ = u[0];
				for (a = 1; v > a; a++) {
					if (1 === a)
						for (i in e.converters) "string" == typeof i && (d[i.toLowerCase()] = e.converters[i]);
					if (r = _, _ = u[a], "*" === _) _ = r;
					else if ("*" !== r && r !== _) {
						if (s = r + " " + _, l = d[s] || d["* " + _], !l) {
							p = t;
							for (c in d)
								if (o = c.split(" "), (o[0] === r || "*" === o[0]) && (p = d[o[1] + " " + _])) {
									c = d[c], c === !0 ? l = p : p === !0 && (l = c);
									break
								}
						}!l && !p && L.error("No conversion from " + s.replace(" ", " to ")), l !== !0 && (n = l ? l(n) : p(c(n)))
					}
				}
				return n
			}

			function p(e, n, a) {
				var i, o, r, s, l = e.contents,
					c = e.dataTypes,
					p = e.responseFields;
				for (o in p) o in a && (n[p[o]] = a[o]);
				for (;
					"*" === c[0];) c.shift(), i === t && (i = e.mimeType || n.getResponseHeader("content-type"));
				if (i)
					for (o in l)
						if (l[o] && l[o].test(i)) {
							c.unshift(o);
							break
						}
				if (c[0] in a) r = c[0];
				else {
					for (o in a) {
						if (!c[0] || e.converters[o + " " + c[0]]) {
							r = o;
							break
						}
						s || (s = o)
					}
					r = r || s
				}
				return r ? (r !== c[0] && c.unshift(r), a[r]) : void 0
			}

			function u(e, t, n, a) {
				if (L.isArray(t)) L.each(t, function(t, i) {
					n || je.test(e) ? a(e, i) : u(e + "[" + ("object" == typeof i || L.isArray(i) ? t : "") + "]", i, n, a)
				});
				else if (n || null == t || "object" != typeof t) a(e, t);
				else
					for (var i in t) u(e + "[" + i + "]", t[i], n, a)
			}

			function d(e, n) {
				var a, i, o = L.ajaxSettings.flatOptions || {};
				for (a in n) n[a] !== t && ((o[a] ? e : i || (i = {}))[a] = n[a]);
				i && L.extend(!0, e, i)
			}

			function v(e, n, a, i, o, r) {
				o = o || n.dataTypes[0], r = r || {}, r[o] = !0;
				for (var s, l = e[o], c = 0, p = l ? l.length : 0, u = e === rt; p > c && (u || !s); c++) s = l[c](n, a, i), "string" == typeof s && (!u || r[s] ? s = t : (n.dataTypes.unshift(s), s = v(e, n, a, i, s, r)));
				return (u || !s) && !r["*"] && (s = v(e, n, a, i, "*", r)), s
			}

			function _(e) {
				return function(t, n) {
					if ("string" != typeof t && (n = t, t = "*"), L.isFunction(n))
						for (var a, i, o, r = t.toLowerCase().split(nt), s = 0, l = r.length; l > s; s++) a = r[s], o = /^\+/.test(a), o && (a = a.substr(1) || "*"), i = e[a] = e[a] || [], i[o ? "unshift" : "push"](n)
				}
			}

			function f(e, t, n) {
				var a = "width" === t ? e.offsetWidth : e.offsetHeight,
					i = "width" === t ? Re : Me,
					o = 0,
					r = i.length;
				if (a > 0) {
					if ("border" !== n)
						for (; r > o; o++) n || (a -= parseFloat(L.css(e, "padding" + i[o])) || 0), "margin" === n ? a += parseFloat(L.css(e, n + i[o])) || 0 : a -= parseFloat(L.css(e, "border" + i[o] + "Width")) || 0;
					return a + "px"
				}
				if (a = We(e, t, t), (0 > a || null == a) && (a = e.style[t] || 0), a = parseFloat(a) || 0, n)
					for (; r > o; o++) a += parseFloat(L.css(e, "padding" + i[o])) || 0, "padding" !== n && (a += parseFloat(L.css(e, "border" + i[o] + "Width")) || 0), "margin" === n && (a += parseFloat(L.css(e, n + i[o])) || 0);
				return a + "px"
			}

			function h(e, t) {
				t.src ? L.ajax({
					url: t.src,
					async: !1,
					dataType: "script"
				}) : L.globalEval((t.text || t.textContent || t.innerHTML || "").replace(ke, "/*$0*/")), t.parentNode && t.parentNode.removeChild(t)
			}

			function w(e) {
				var t = N.createElement("div");
				return Se.appendChild(t), t.innerHTML = e.outerHTML, t.firstChild
			}

			function g(e) {
				var t = (e.nodeName || "").toLowerCase();
				"input" === t ? m(e) : "script" !== t && "undefined" != typeof e.getElementsByTagName && L.grep(e.getElementsByTagName("input"), m)
			}

			function m(e) {
				("checkbox" === e.type || "radio" === e.type) && (e.defaultChecked = e.checked)
			}

			function b(e) {
				return "undefined" != typeof e.getElementsByTagName ? e.getElementsByTagName("*") : "undefined" != typeof e.querySelectorAll ? e.querySelectorAll("*") : []
			}

			function y(e, t) {
				var n;
				1 === t.nodeType && (t.clearAttributes && t.clearAttributes(), t.mergeAttributes && t.mergeAttributes(e), n = t.nodeName.toLowerCase(), "object" === n ? t.outerHTML = e.outerHTML : "input" !== n || "checkbox" !== e.type && "radio" !== e.type ? "option" === n ? t.selected = e.defaultSelected : ("input" === n || "textarea" === n) && (t.defaultValue = e.defaultValue) : (e.checked && (t.defaultChecked = t.checked = e.checked), t.value !== e.value && (t.value = e.value)), t.removeAttribute(L.expando))
			}

			function C(e, t) {
				if (1 === t.nodeType && L.hasData(e)) {
					var n, a, i, o = L._data(e),
						r = L._data(t, o),
						s = o.events;
					if (s) {
						delete r.handle, r.events = {};
						for (n in s)
							for (a = 0, i = s[n].length; i > a; a++) L.event.add(t, n + (s[n][a].namespace ? "." : "") + s[n][a].namespace, s[n][a], s[n][a].data)
					}
					r.data && (r.data = L.extend({}, r.data))
				}
			}

			function A(e, t) {
				return L.nodeName(e, "table") ? e.getElementsByTagName("tbody")[0] || e.appendChild(e.ownerDocument.createElement("tbody")) : e
			}

			function x(e) {
				var t = fe.split("|"),
					n = e.createDocumentFragment();
				if (n.createElement)
					for (; t.length;) n.createElement(t.pop());
				return n
			}

			function I(e, t, n) {
				if (t = t || 0, L.isFunction(t)) return L.grep(e, function(e, a) {
					var i = !!t.call(e, a, e);
					return i === n
				});
				if (t.nodeType) return L.grep(e, function(e, a) {
					return e === t === n
				});
				if ("string" == typeof t) {
					var a = L.grep(e, function(e) {
						return 1 === e.nodeType
					});
					if (ue.test(t)) return L.filter(t, a, !n);
					t = L.filter(t, a)
				}
				return L.grep(e, function(e, a) {
					return L.inArray(e, t) >= 0 === n
				})
			}

			function T(e) {
				return !e || !e.parentNode || 11 === e.parentNode.nodeType
			}

			function k() {
				return !0
			}

			function V() {
				return !1
			}

			function S(e, t, n) {
				var a = t + "defer",
					i = t + "queue",
					o = t + "mark",
					r = L._data(e, a);
				!(!r || "queue" !== n && L._data(e, i) || "mark" !== n && L._data(e, o) || !setTimeout(function() {
					!L._data(e, i) && !L._data(e, o) && (L.removeData(e, a, !0), r.fire())
				}, 0))
			}

			function W(e) {
				for (var t in e)
					if (("data" !== t || !L.isEmptyObject(e[t])) && "toJSON" !== t) return !1;
				return !0
			}

			function D(e, n, a) {
				if (a === t && 1 === e.nodeType) {
					var i = "data-" + n.replace(R, "-$1").toLowerCase();
					if (a = e.getAttribute(i), "string" == typeof a) {
						try {
							a = "true" === a ? !0 : "false" === a ? !1 : "null" === a ? null : L.isNumeric(a) ? parseFloat(a) : z.test(a) ? L.parseJSON(a) : a
						} catch (o) {}
						L.data(e, n, a)
					} else a = t
				}
				return a
			}

			function E(e) {
				var t, n, a = O[e] = {};
				for (e = e.split(/\s+/), t = 0, n = e.length; n > t; t++) a[e[t]] = !0;
				return a
			}
			var N = e.document,
				P = e.navigator,
				$ = e.location,
				L = function() {
					function n() {
						if (!s.isReady) {
							try {
								N.documentElement.doScroll("left")
							} catch (e) {
								return void setTimeout(n, 1)
							}
							s.ready()
						}
					}
					var a, i, o, r, s = function(e, t) {
							return new s.fn.init(e, t, a)
						},
						l = e.jQuery,
						c = e.$,
						p = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
						u = /\S/,
						d = /^\s+/,
						v = /\s+$/,
						_ = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
						f = /^[\],:{}\s]*$/,
						h = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
						w = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
						g = /(?:^|:|,)(?:\s*\[)+/g,
						m = /(webkit)[ \/]([\w.]+)/,
						b = /(opera)(?:.*version)?[ \/]([\w.]+)/,
						y = /(msie) ([\w.]+)/,
						C = /(mozilla)(?:.*? rv:([\w.]+))?/,
						A = /-([a-z]|[0-9])/gi,
						x = /^-ms-/,
						I = function(e, t) {
							return (t + "").toUpperCase()
						},
						T = P.userAgent,
						k = Object.prototype.toString,
						V = Object.prototype.hasOwnProperty,
						S = Array.prototype.push,
						W = Array.prototype.slice,
						D = String.prototype.trim,
						E = Array.prototype.indexOf,
						$ = {};
					return s.fn = s.prototype = {
						constructor: s,
						init: function(e, n, a) {
							var i, o, r, l;
							if (!e) return this;
							if (e.nodeType) return this.context = this[0] = e, this.length = 1, this;
							if ("body" === e && !n && N.body) return this.context = N, this[0] = N.body, this.selector = e, this.length = 1, this;
							if ("string" == typeof e) {
								if (i = "<" !== e.charAt(0) || ">" !== e.charAt(e.length - 1) || e.length < 3 ? p.exec(e) : [null, e, null], i && (i[1] || !n)) {
									if (i[1]) return n = n instanceof s ? n[0] : n, l = n ? n.ownerDocument || n : N, r = _.exec(e), r ? s.isPlainObject(n) ? (e = [N.createElement(r[1])], s.fn.attr.call(e, n, !0)) : e = [l.createElement(r[1])] : (r = s.buildFragment([i[1]], [l]), e = (r.cacheable ? s.clone(r.fragment) : r.fragment).childNodes), s.merge(this, e);
									if (o = N.getElementById(i[2]), o && o.parentNode) {
										if (o.id !== i[2]) return a.find(e);
										this.length = 1, this[0] = o
									}
									return this.context = N, this.selector = e, this
								}
								return !n || n.jquery ? (n || a).find(e) : this.constructor(n).find(e)
							}
							return s.isFunction(e) ? a.ready(e) : (e.selector !== t && (this.selector = e.selector, this.context = e.context), s.makeArray(e, this))
						},
						selector: "",
						jquery: "1.7.1",
						length: 0,
						size: function() {
							return this.length
						},
						toArray: function() {
							return W.call(this, 0)
						},
						get: function(e) {
							return null == e ? this.toArray() : 0 > e ? this[this.length + e] : this[e]
						},
						pushStack: function(e, t, n) {
							var a = this.constructor();
							return s.isArray(e) ? S.apply(a, e) : s.merge(a, e), a.prevObject = this, a.context = this.context, "find" === t ? a.selector = this.selector + (this.selector ? " " : "") + n : t && (a.selector = this.selector + "." + t + "(" + n + ")"), a
						},
						each: function(e, t) {
							return s.each(this, e, t)
						},
						ready: function(e) {
							return s.bindReady(), o.add(e), this
						},
						eq: function(e) {
							return e = +e, -1 === e ? this.slice(e) : this.slice(e, e + 1)
						},
						first: function() {
							return this.eq(0)
						},
						last: function() {
							return this.eq(-1)
						},
						slice: function() {
							return this.pushStack(W.apply(this, arguments), "slice", W.call(arguments).join(","))
						},
						map: function(e) {
							return this.pushStack(s.map(this, function(t, n) {
								return e.call(t, n, t)
							}))
						},
						end: function() {
							return this.prevObject || this.constructor(null)
						},
						push: S,
						sort: [].sort,
						splice: [].splice
					}, s.fn.init.prototype = s.fn, s.extend = s.fn.extend = function() {
						var e, n, a, i, o, r, l = arguments[0] || {},
							c = 1,
							p = arguments.length,
							u = !1;
						for ("boolean" == typeof l && (u = l, l = arguments[1] || {}, c = 2), "object" != typeof l && !s.isFunction(l) && (l = {}), p === c && (l = this, --c); p > c; c++)
							if (null != (e = arguments[c]))
								for (n in e) a = l[n], i = e[n], l !== i && (u && i && (s.isPlainObject(i) || (o = s.isArray(i))) ? (o ? (o = !1, r = a && s.isArray(a) ? a : []) : r = a && s.isPlainObject(a) ? a : {}, l[n] = s.extend(u, r, i)) : i !== t && (l[n] = i));
						return l
					}, s.extend({
						noConflict: function(t) {
							return e.$ === s && (e.$ = c), t && e.jQuery === s && (e.jQuery = l), s
						},
						isReady: !1,
						readyWait: 1,
						holdReady: function(e) {
							e ? s.readyWait++ : s.ready(!0)
						},
						ready: function(e) {
							if (e === !0 && !--s.readyWait || e !== !0 && !s.isReady) {
								if (!N.body) return setTimeout(s.ready, 1);
								if (s.isReady = !0, e !== !0 && --s.readyWait > 0) return;
								o.fireWith(N, [s]), s.fn.trigger && s(N).trigger("ready").off("ready")
							}
						},
						bindReady: function() {
							if (!o) {
								if (o = s.Callbacks("once memory"), "complete" === N.readyState) return setTimeout(s.ready, 1);
								if (N.addEventListener) N.addEventListener("DOMContentLoaded", r, !1), e.addEventListener("load", s.ready, !1);
								else if (N.attachEvent) {
									N.attachEvent("onreadystatechange", r), e.attachEvent("onload", s.ready);
									var t = !1;
									try {
										t = null == e.frameElement
									} catch (a) {}
									N.documentElement.doScroll && t && n()
								}
							}
						},
						isFunction: function(e) {
							return "function" === s.type(e)
						},
						isArray: Array.isArray || function(e) {
							return "array" === s.type(e)
						},
						isWindow: function(e) {
							return e && "object" == typeof e && "setInterval" in e
						},
						isNumeric: function(e) {
							return !isNaN(parseFloat(e)) && isFinite(e)
						},
						type: function(e) {
							return null == e ? String(e) : $[k.call(e)] || "object"
						},
						isPlainObject: function(e) {
							if (!e || "object" !== s.type(e) || e.nodeType || s.isWindow(e)) return !1;
							try {
								if (e.constructor && !V.call(e, "constructor") && !V.call(e.constructor.prototype, "isPrototypeOf")) return !1
							} catch (n) {
								return !1
							}
							var a;
							for (a in e);
							return a === t || V.call(e, a)
						},
						isEmptyObject: function(e) {
							for (var t in e) return !1;
							return !0
						},
						error: function(e) {
							throw new Error(e)
						},
						parseJSON: function(t) {
							return "string" == typeof t && t ? (t = s.trim(t), e.JSON && e.JSON.parse ? e.JSON.parse(t) : f.test(t.replace(h, "@").replace(w, "]").replace(g, "")) ? new Function("return " + t)() : void s.error("Invalid JSON: " + t)) : null
						},
						parseXML: function(n) {
							var a, i;
							try {
								e.DOMParser ? (i = new DOMParser, a = i.parseFromString(n, "text/xml")) : (a = new ActiveXObject("Microsoft.XMLDOM"), a.async = "false", a.loadXML(n))
							} catch (o) {
								a = t
							}
							return (!a || !a.documentElement || a.getElementsByTagName("parsererror").length) && s.error("Invalid XML: " + n), a
						},
						noop: function() {},
						globalEval: function(t) {
							t && u.test(t) && (e.execScript || function(t) {
								e.eval.call(e, t)
							})(t)
						},
						camelCase: function(e) {
							return e.replace(x, "ms-").replace(A, I)
						},
						nodeName: function(e, t) {
							return e.nodeName && e.nodeName.toUpperCase() === t.toUpperCase()
						},
						each: function(e, n, a) {
							var i, o = 0,
								r = e.length,
								l = r === t || s.isFunction(e);
							if (a)
								if (l) {
									for (i in e)
										if (n.apply(e[i], a) === !1) break
								} else
									for (; r > o && n.apply(e[o++], a) !== !1;);
							else if (l) {
								for (i in e)
									if (n.call(e[i], i, e[i]) === !1) break
							} else
								for (; r > o && n.call(e[o], o, e[o++]) !== !1;);
							return e
						},
						trim: D ? function(e) {
							return null == e ? "" : D.call(e)
						} : function(e) {
							return null == e ? "" : (e + "").replace(d, "").replace(v, "")
						},
						makeArray: function(e, t) {
							var n = t || [];
							if (null != e) {
								var a = s.type(e);
								null == e.length || "string" === a || "function" === a || "regexp" === a || s.isWindow(e) ? S.call(n, e) : s.merge(n, e)
							}
							return n
						},
						inArray: function(e, t, n) {
							var a;
							if (t) {
								if (E) return E.call(t, e, n);
								for (a = t.length, n = n ? 0 > n ? Math.max(0, a + n) : n : 0; a > n; n++)
									if (n in t && t[n] === e) return n
							}
							return -1
						},
						merge: function(e, n) {
							var a = e.length,
								i = 0;
							if ("number" == typeof n.length)
								for (var o = n.length; o > i; i++) e[a++] = n[i];
							else
								for (; n[i] !== t;) e[a++] = n[i++];
							return e.length = a, e
						},
						grep: function(e, t, n) {
							var a, i = [];
							n = !!n;
							for (var o = 0, r = e.length; r > o; o++) a = !!t(e[o], o), n !== a && i.push(e[o]);
							return i
						},
						map: function(e, n, a) {
							var i, o, r = [],
								l = 0,
								c = e.length,
								p = e instanceof s || c !== t && "number" == typeof c && (c > 0 && e[0] && e[c - 1] || 0 === c || s.isArray(e));
							if (p)
								for (; c > l; l++) i = n(e[l], l, a), null != i && (r[r.length] = i);
							else
								for (o in e) i = n(e[o], o, a), null != i && (r[r.length] = i);
							return r.concat.apply([], r)
						},
						guid: 1,
						proxy: function(e, n) {
							if ("string" == typeof n) {
								var a = e[n];
								n = e, e = a
							}
							if (!s.isFunction(e)) return t;
							var i = W.call(arguments, 2),
								o = function() {
									return e.apply(n, i.concat(W.call(arguments)))
								};
							return o.guid = e.guid = e.guid || o.guid || s.guid++, o
						},
						access: function(e, n, a, i, o, r) {
							var l = e.length;
							if ("object" == typeof n) {
								for (var c in n) s.access(e, c, n[c], i, o, a);
								return e
							}
							if (a !== t) {
								i = !r && i && s.isFunction(a);
								for (var p = 0; l > p; p++) o(e[p], n, i ? a.call(e[p], p, o(e[p], n)) : a, r);
								return e
							}
							return l ? o(e[0], n) : t
						},
						now: function() {
							return (new Date).getTime()
						},
						uaMatch: function(e) {
							e = e.toLowerCase();
							var t = m.exec(e) || b.exec(e) || y.exec(e) || e.indexOf("compatible") < 0 && C.exec(e) || [];
							return {
								browser: t[1] || "",
								version: t[2] || "0"
							}
						},
						sub: function() {
							function e(t, n) {
								return new e.fn.init(t, n)
							}
							s.extend(!0, e, this), e.superclass = this, e.fn = e.prototype = this(), e.fn.constructor = e, e.sub = this.sub, e.fn.init = function(n, a) {
								return a && a instanceof s && !(a instanceof e) && (a = e(a)), s.fn.init.call(this, n, a, t)
							}, e.fn.init.prototype = e.fn;
							var t = e(N);
							return e
						},
						browser: {}
					}), s.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(e, t) {
						$["[object " + t + "]"] = t.toLowerCase()
					}), i = s.uaMatch(T), i.browser && (s.browser[i.browser] = !0, s.browser.version = i.version), s.browser.webkit && (s.browser.safari = !0), u.test("Â ") && (d = /^[\s\xA0]+/, v = /[\s\xA0]+$/), a = s(N), N.addEventListener ? r = function() {
						N.removeEventListener("DOMContentLoaded", r, !1), s.ready()
					} : N.attachEvent && (r = function() {
						"complete" === N.readyState && (N.detachEvent("onreadystatechange", r), s.ready())
					}), s
				}(),
				O = {};
			L.Callbacks = function(e) {
				e = e ? O[e] || E(e) : {};
				var n, a, i, o, r, s = [],
					l = [],
					c = function(t) {
						var n, a, i, o;
						for (n = 0, a = t.length; a > n; n++) i = t[n], o = L.type(i), "array" === o ? c(i) : "function" === o && (!e.unique || !u.has(i)) && s.push(i)
					},
					p = function(t, c) {
						for (c = c || [], n = !e.memory || [t, c], a = !0, r = i || 0, i = 0, o = s.length; s && o > r; r++)
							if (s[r].apply(t, c) === !1 && e.stopOnFalse) {
								n = !0;
								break
							}
						a = !1, s && (e.once ? n === !0 ? u.disable() : s = [] : l && l.length && (n = l.shift(), u.fireWith(n[0], n[1])))
					},
					u = {
						add: function() {
							if (s) {
								var e = s.length;
								c(arguments), a ? o = s.length : n && n !== !0 && (i = e, p(n[0], n[1]))
							}
							return this
						},
						remove: function() {
							if (s)
								for (var t = arguments, n = 0, i = t.length; i > n; n++)
									for (var l = 0; l < s.length && (t[n] !== s[l] || (a && o >= l && (o--, r >= l && r--), s.splice(l--, 1), !e.unique)); l++);
							return this
						},
						has: function(e) {
							if (s)
								for (var t = 0, n = s.length; n > t; t++)
									if (e === s[t]) return !0;
							return !1
						},
						empty: function() {
							return s = [], this
						},
						disable: function() {
							return s = l = n = t, this
						},
						disabled: function() {
							return !s
						},
						lock: function() {
							return l = t, (!n || n === !0) && u.disable(), this
						},
						locked: function() {
							return !l
						},
						fireWith: function(t, i) {
							return l && (a ? e.once || l.push([t, i]) : (!e.once || !n) && p(t, i)), this
						},
						fire: function() {
							return u.fireWith(this, arguments), this
						},
						fired: function() {
							return !!n
						}
					};
				return u
			};
			var U = [].slice;
			L.extend({
				Deferred: function(e) {
					var t, n = L.Callbacks("once memory"),
						a = L.Callbacks("once memory"),
						i = L.Callbacks("memory"),
						o = "pending",
						r = {
							resolve: n,
							reject: a,
							notify: i
						},
						s = {
							done: n.add,
							fail: a.add,
							progress: i.add,
							state: function() {
								return o
							},
							isResolved: n.fired,
							isRejected: a.fired,
							then: function(e, t, n) {
								return l.done(e).fail(t).progress(n), this
							},
							always: function() {
								return l.done.apply(l, arguments).fail.apply(l, arguments), this
							},
							pipe: function(e, t, n) {
								return L.Deferred(function(a) {
									L.each({
										done: [e, "resolve"],
										fail: [t, "reject"],
										progress: [n, "notify"]
									}, function(e, t) {
										var n, i = t[0],
											o = t[1];
										l[e](L.isFunction(i) ? function() {
											n = i.apply(this, arguments), n && L.isFunction(n.promise) ? n.promise().then(a.resolve, a.reject, a.notify) : a[o + "With"](this === l ? a : this, [n])
										} : a[o])
									})
								}).promise()
							},
							promise: function(e) {
								if (null == e) e = s;
								else
									for (var t in s) e[t] = s[t];
								return e
							}
						},
						l = s.promise({});
					for (t in r) l[t] = r[t].fire, l[t + "With"] = r[t].fireWith;
					return l.done(function() {
						o = "resolved"
					}, a.disable, i.lock).fail(function() {
						o = "rejected"
					}, n.disable, i.lock), e && e.call(l, l), l
				},
				when: function(e) {
					function t(e) {
						return function(t) {
							r[e] = arguments.length > 1 ? U.call(arguments, 0) : t, l.notifyWith(c, r)
						}
					}

					function n(e) {
						return function(t) {
							a[e] = arguments.length > 1 ? U.call(arguments, 0) : t, --s || l.resolveWith(l, a)
						}
					}
					var a = U.call(arguments, 0),
						i = 0,
						o = a.length,
						r = Array(o),
						s = o,
						l = 1 >= o && e && L.isFunction(e.promise) ? e : L.Deferred(),
						c = l.promise();
					if (o > 1) {
						for (; o > i; i++) a[i] && a[i].promise && L.isFunction(a[i].promise) ? a[i].promise().then(n(i), l.reject, t(i)) : --s;
						s || l.resolveWith(l, a)
					} else l !== e && l.resolveWith(l, o ? [e] : []);
					return c
				}
			}), L.support = function() {
				{
					var t, n, a, i, o, r, s, l, c, p, u, d, v = N.createElement("div");
					N.documentElement
				}
				if (v.setAttribute("className", "t"), v.innerHTML = "   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>", n = v.getElementsByTagName("*"), a = v.getElementsByTagName("a")[0], !n || !n.length || !a) return {};
				i = N.createElement("select"), o = i.appendChild(N.createElement("option")), r = v.getElementsByTagName("input")[0], t = {
					leadingWhitespace: 3 === v.firstChild.nodeType,
					tbody: !v.getElementsByTagName("tbody").length,
					htmlSerialize: !!v.getElementsByTagName("link").length,
					style: /top/.test(a.getAttribute("style")),
					hrefNormalized: "/a" === a.getAttribute("href"),
					opacity: /^0.55/.test(a.style.opacity),
					cssFloat: !!a.style.cssFloat,
					checkOn: "on" === r.value,
					optSelected: o.selected,
					getSetAttribute: "t" !== v.className,
					enctype: !!N.createElement("form").enctype,
					html5Clone: "<:nav></:nav>" !== N.createElement("nav").cloneNode(!0).outerHTML,
					submitBubbles: !0,
					changeBubbles: !0,
					focusinBubbles: !1,
					deleteExpando: !0,
					noCloneEvent: !0,
					inlineBlockNeedsLayout: !1,
					shrinkWrapBlocks: !1,
					reliableMarginRight: !0
				}, r.checked = !0, t.noCloneChecked = r.cloneNode(!0).checked, i.disabled = !0, t.optDisabled = !o.disabled;
				try {
					delete v.test
				} catch (_) {
					t.deleteExpando = !1
				}
				if (!v.addEventListener && v.attachEvent && v.fireEvent && (v.attachEvent("onclick", function() {
						t.noCloneEvent = !1
					}), v.cloneNode(!0).fireEvent("onclick")), r = N.createElement("input"), r.value = "t", r.setAttribute("type", "radio"), t.radioValue = "t" === r.value, r.setAttribute("checked", "checked"), v.appendChild(r), l = N.createDocumentFragment(), l.appendChild(v.lastChild), t.checkClone = l.cloneNode(!0).cloneNode(!0).lastChild.checked, t.appendChecked = r.checked, l.removeChild(r), l.appendChild(v), v.innerHTML = "", e.getComputedStyle && (s = N.createElement("div"), s.style.width = "0", s.style.marginRight = "0", v.style.width = "2px", v.appendChild(s), t.reliableMarginRight = 0 === (parseInt((e.getComputedStyle(s, null) || {
						marginRight: 0
					}).marginRight, 10) || 0)), v.attachEvent)
					for (u in {
							submit: 1,
							change: 1,
							focusin: 1
						}) p = "on" + u, d = p in v, d || (v.setAttribute(p, "return;"), d = "function" == typeof v[p]), t[u + "Bubbles"] = d;
				return l.removeChild(v), l = i = o = s = v = r = null, L(function() {
					var e, n, a, i, o, r, s, l, p, u, _ = N.getElementsByTagName("body")[0];
					!_ || (r = 1, s = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;", l = "visibility:hidden;border:0;", p = "style='" + s + "border:5px solid #000;padding:0;'", u = "<div " + p + "><div></div></div><table " + p + " cellpadding='0' cellspacing='0'><tr><td></td></tr></table>", e = N.createElement("div"), e.style.cssText = l + "width:0;height:0;position:static;top:0;margin-top:" + r + "px", _.insertBefore(e, _.firstChild), v = N.createElement("div"), e.appendChild(v), v.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>", c = v.getElementsByTagName("td"), d = 0 === c[0].offsetHeight, c[0].style.display = "", c[1].style.display = "none", t.reliableHiddenOffsets = d && 0 === c[0].offsetHeight, v.innerHTML = "", v.style.width = v.style.paddingLeft = "1px", L.boxModel = t.boxModel = 2 === v.offsetWidth, "undefined" != typeof v.style.zoom && (v.style.display = "inline", v.style.zoom = 1, t.inlineBlockNeedsLayout = 2 === v.offsetWidth, v.style.display = "", v.innerHTML = "<div style='width:4px;'></div>", t.shrinkWrapBlocks = 2 !== v.offsetWidth), v.style.cssText = s + l, v.innerHTML = u, n = v.firstChild, a = n.firstChild, i = n.nextSibling.firstChild.firstChild, o = {
						doesNotAddBorder: 5 !== a.offsetTop,
						doesAddBorderForTableAndCells: 5 === i.offsetTop
					}, a.style.position = "fixed", a.style.top = "20px", o.fixedPosition = 20 === a.offsetTop || 15 === a.offsetTop, a.style.position = a.style.top = "", n.style.overflow = "hidden", n.style.position = "relative", o.subtractsBorderForOverflowNotVisible = -5 === a.offsetTop, o.doesNotIncludeMarginInBodyOffset = _.offsetTop !== r, _.removeChild(e), v = e = null, L.extend(t, o))
				}), t
			}();
			var z = /^(?:\{.*\}|\[.*\])$/,
				R = /([A-Z])/g;
			L.extend({
				cache: {},
				uuid: 0,
				expando: "jQuery" + (L.fn.jquery + Math.random()).replace(/\D/g, ""),
				noData: {
					embed: !0,
					object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
					applet: !0
				},
				hasData: function(e) {
					return e = e.nodeType ? L.cache[e[L.expando]] : e[L.expando], !!e && !W(e)
				},
				data: function(e, n, a, i) {
					if (L.acceptData(e)) {
						var o, r, s, l = L.expando,
							c = "string" == typeof n,
							p = e.nodeType,
							u = p ? L.cache : e,
							d = p ? e[l] : e[l] && l,
							v = "events" === n;
						if (!(d && u[d] && (v || i || u[d].data) || !c || a !== t)) return;
						return d || (p ? e[l] = d = ++L.uuid : d = l), u[d] || (u[d] = {}, p || (u[d].toJSON = L.noop)), ("object" == typeof n || "function" == typeof n) && (i ? u[d] = L.extend(u[d], n) : u[d].data = L.extend(u[d].data, n)), o = r = u[d], i || (r.data || (r.data = {}), r = r.data), a !== t && (r[L.camelCase(n)] = a), v && !r[n] ? o.events : (c ? (s = r[n], null == s && (s = r[L.camelCase(n)])) : s = r, s)
					}
				},
				removeData: function(e, t, n) {
					if (L.acceptData(e)) {
						var a, i, o, r = L.expando,
							s = e.nodeType,
							l = s ? L.cache : e,
							c = s ? e[r] : r;
						if (!l[c]) return;
						if (t && (a = n ? l[c] : l[c].data)) {
							L.isArray(t) || (t in a ? t = [t] : (t = L.camelCase(t), t = t in a ? [t] : t.split(" ")));
							for (i = 0, o = t.length; o > i; i++) delete a[t[i]];
							if (!(n ? W : L.isEmptyObject)(a)) return
						}
						if (!n && (delete l[c].data, !W(l[c]))) return;
						L.support.deleteExpando || !l.setInterval ? delete l[c] : l[c] = null, s && (L.support.deleteExpando ? delete e[r] : e.removeAttribute ? e.removeAttribute(r) : e[r] = null)
					}
				},
				_data: function(e, t, n) {
					return L.data(e, t, n, !0)
				},
				acceptData: function(e) {
					if (e.nodeName) {
						var t = L.noData[e.nodeName.toLowerCase()];
						if (t) return t !== !0 && e.getAttribute("classid") === t
					}
					return !0
				}
			}), L.fn.extend({
				data: function(e, n) {
					var a, i, o, r = null;
					if ("undefined" == typeof e) {
						if (this.length && (r = L.data(this[0]), 1 === this[0].nodeType && !L._data(this[0], "parsedAttrs"))) {
							i = this[0].attributes;
							for (var s = 0, l = i.length; l > s; s++) o = i[s].name, 0 === o.indexOf("data-") && (o = L.camelCase(o.substring(5)), D(this[0], o, r[o]));
							L._data(this[0], "parsedAttrs", !0)
						}
						return r
					}
					return "object" == typeof e ? this.each(function() {
						L.data(this, e)
					}) : (a = e.split("."), a[1] = a[1] ? "." + a[1] : "", n === t ? (r = this.triggerHandler("getData" + a[1] + "!", [a[0]]), r === t && this.length && (r = L.data(this[0], e), r = D(this[0], e, r)), r === t && a[1] ? this.data(a[0]) : r) : this.each(function() {
						var t = L(this),
							i = [a[0], n];
						t.triggerHandler("setData" + a[1] + "!", i), L.data(this, e, n), t.triggerHandler("changeData" + a[1] + "!", i)
					}))
				},
				removeData: function(e) {
					return this.each(function() {
						L.removeData(this, e)
					})
				}
			}), L.extend({
				_mark: function(e, t) {
					e && (t = (t || "fx") + "mark", L._data(e, t, (L._data(e, t) || 0) + 1))
				},
				_unmark: function(e, t, n) {
					if (e !== !0 && (n = t, t = e, e = !1), t) {
						n = n || "fx";
						var a = n + "mark",
							i = e ? 0 : (L._data(t, a) || 1) - 1;
						i ? L._data(t, a, i) : (L.removeData(t, a, !0), S(t, n, "mark"))
					}
				},
				queue: function(e, t, n) {
					var a;
					return e ? (t = (t || "fx") + "queue", a = L._data(e, t), n && (!a || L.isArray(n) ? a = L._data(e, t, L.makeArray(n)) : a.push(n)), a || []) : void 0
				},
				dequeue: function(e, t) {
					t = t || "fx";
					var n = L.queue(e, t),
						a = n.shift(),
						i = {};
					"inprogress" === a && (a = n.shift()), a && ("fx" === t && n.unshift("inprogress"), L._data(e, t + ".run", i), a.call(e, function() {
						L.dequeue(e, t)
					}, i)), n.length || (L.removeData(e, t + "queue " + t + ".run", !0), S(e, t, "queue"))
				}
			}), L.fn.extend({
				queue: function(e, n) {
					return "string" != typeof e && (n = e, e = "fx"), n === t ? L.queue(this[0], e) : this.each(function() {
						var t = L.queue(this, e, n);
						"fx" === e && "inprogress" !== t[0] && L.dequeue(this, e)
					})
				},
				dequeue: function(e) {
					return this.each(function() {
						L.dequeue(this, e)
					})
				},
				delay: function(e, t) {
					return e = L.fx ? L.fx.speeds[e] || e : e, t = t || "fx", this.queue(t, function(t, n) {
						var a = setTimeout(t, e);
						n.stop = function() {
							clearTimeout(a)
						}
					})
				},
				clearQueue: function(e) {
					return this.queue(e || "fx", [])
				},
				promise: function(e, n) {
					function a() {
						--l || o.resolveWith(r, [r])
					}
					"string" != typeof e && (n = e, e = t), e = e || "fx";
					for (var i, o = L.Deferred(), r = this, s = r.length, l = 1, c = e + "defer", p = e + "queue", u = e + "mark"; s--;)(i = L.data(r[s], c, t, !0) || (L.data(r[s], p, t, !0) || L.data(r[s], u, t, !0)) && L.data(r[s], c, L.Callbacks("once memory"), !0)) && (l++, i.add(a));
					return a(), o.promise()
				}
			});
			var M, B, F, H = /[\n\t\r]/g,
				j = /\s+/,
				G = /\r/g,
				q = /^(?:button|input)$/i,
				X = /^(?:button|input|object|select|textarea)$/i,
				Y = /^a(?:rea)?$/i,
				Z = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
				K = L.support.getSetAttribute;
			L.fn.extend({
				attr: function(e, t) {
					return L.access(this, e, t, !0, L.attr)
				},
				removeAttr: function(e) {
					return this.each(function() {
						L.removeAttr(this, e)
					})
				},
				prop: function(e, t) {
					return L.access(this, e, t, !0, L.prop)
				},
				removeProp: function(e) {
					return e = L.propFix[e] || e, this.each(function() {
						try {
							this[e] = t, delete this[e]
						} catch (n) {}
					})
				},
				addClass: function(e) {
					var t, n, a, i, o, r, s;
					if (L.isFunction(e)) return this.each(function(t) {
						L(this).addClass(e.call(this, t, this.className))
					});
					if (e && "string" == typeof e)
						for (t = e.split(j), n = 0, a = this.length; a > n; n++)
							if (i = this[n], 1 === i.nodeType)
								if (i.className || 1 !== t.length) {
									for (o = " " + i.className + " ", r = 0, s = t.length; s > r; r++) ~o.indexOf(" " + t[r] + " ") || (o += t[r] + " ");
									i.className = L.trim(o)
								} else i.className = e;
					return this
				},
				removeClass: function(e) {
					var n, a, i, o, r, s, l;
					if (L.isFunction(e)) return this.each(function(t) {
						L(this).removeClass(e.call(this, t, this.className))
					});
					if (e && "string" == typeof e || e === t)
						for (n = (e || "").split(j), a = 0, i = this.length; i > a; a++)
							if (o = this[a], 1 === o.nodeType && o.className)
								if (e) {
									for (r = (" " + o.className + " ").replace(H, " "), s = 0, l = n.length; l > s; s++) r = r.replace(" " + n[s] + " ", " ");
									o.className = L.trim(r)
								} else o.className = "";
					return this
				},
				toggleClass: function(e, t) {
					var n = typeof e,
						a = "boolean" == typeof t;
					return this.each(L.isFunction(e) ? function(n) {
						L(this).toggleClass(e.call(this, n, this.className, t), t)
					} : function() {
						if ("string" === n)
							for (var i, o = 0, r = L(this), s = t, l = e.split(j); i = l[o++];) s = a ? s : !r.hasClass(i), r[s ? "addClass" : "removeClass"](i);
						else("undefined" === n || "boolean" === n) && (this.className && L._data(this, "__className__", this.className), this.className = this.className || e === !1 ? "" : L._data(this, "__className__") || "")
					})
				},
				hasClass: function(e) {
					for (var t = " " + e + " ", n = 0, a = this.length; a > n; n++)
						if (1 === this[n].nodeType && (" " + this[n].className + " ").replace(H, " ").indexOf(t) > -1) return !0;
					return !1
				},
				val: function(e) {
					var n, a, i, o = this[0];
					return arguments.length ? (i = L.isFunction(e), this.each(function(a) {
						var o, r = L(this);
						1 === this.nodeType && (o = i ? e.call(this, a, r.val()) : e, null == o ? o = "" : "number" == typeof o ? o += "" : L.isArray(o) && (o = L.map(o, function(e) {
							return null == e ? "" : e + ""
						})), n = L.valHooks[this.nodeName.toLowerCase()] || L.valHooks[this.type], n && "set" in n && n.set(this, o, "value") !== t || (this.value = o))
					})) : o ? (n = L.valHooks[o.nodeName.toLowerCase()] || L.valHooks[o.type], n && "get" in n && (a = n.get(o, "value")) !== t ? a : (a = o.value, "string" == typeof a ? a.replace(G, "") : null == a ? "" : a)) : void 0
				}
			}), L.extend({
				valHooks: {
					option: {
						get: function(e) {
							var t = e.attributes.value;
							return !t || t.specified ? e.value : e.text
						}
					},
					select: {
						get: function(e) {
							var t, n, a, i, o = e.selectedIndex,
								r = [],
								s = e.options,
								l = "select-one" === e.type;
							if (0 > o) return null;
							for (n = l ? o : 0, a = l ? o + 1 : s.length; a > n; n++)
								if (i = s[n], !(!i.selected || (L.support.optDisabled ? i.disabled : null !== i.getAttribute("disabled")) || i.parentNode.disabled && L.nodeName(i.parentNode, "optgroup"))) {
									if (t = L(i).val(), l) return t;
									r.push(t)
								}
							return l && !r.length && s.length ? L(s[o]).val() : r
						},
						set: function(e, t) {
							var n = L.makeArray(t);
							return L(e).find("option").each(function() {
								this.selected = L.inArray(L(this).val(), n) >= 0
							}), n.length || (e.selectedIndex = -1), n
						}
					}
				},
				attrFn: {
					val: !0,
					css: !0,
					html: !0,
					text: !0,
					data: !0,
					width: !0,
					height: !0,
					offset: !0
				},
				attr: function(e, n, a, i) {
					var o, r, s, l = e.nodeType;
					return e && 3 !== l && 8 !== l && 2 !== l ? i && n in L.attrFn ? L(e)[n](a) : "undefined" == typeof e.getAttribute ? L.prop(e, n, a) : (s = 1 !== l || !L.isXMLDoc(e), s && (n = n.toLowerCase(), r = L.attrHooks[n] || (Z.test(n) ? B : M)), a !== t ? null === a ? void L.removeAttr(e, n) : r && "set" in r && s && (o = r.set(e, a, n)) !== t ? o : (e.setAttribute(n, "" + a), a) : r && "get" in r && s && null !== (o = r.get(e, n)) ? o : (o = e.getAttribute(n), null === o ? t : o)) : void 0
				},
				removeAttr: function(e, t) {
					var n, a, i, o, r = 0;
					if (t && 1 === e.nodeType)
						for (a = t.toLowerCase().split(j), o = a.length; o > r; r++) i = a[r], i && (n = L.propFix[i] || i, L.attr(e, i, ""), e.removeAttribute(K ? i : n), Z.test(i) && n in e && (e[n] = !1))
				},
				attrHooks: {
					type: {
						set: function(e, t) {
							if (q.test(e.nodeName) && e.parentNode) L.error("type property can't be changed");
							else if (!L.support.radioValue && "radio" === t && L.nodeName(e, "input")) {
								var n = e.value;
								return e.setAttribute("type", t), n && (e.value = n), t
							}
						}
					},
					value: {
						get: function(e, t) {
							return M && L.nodeName(e, "button") ? M.get(e, t) : t in e ? e.value : null
						},
						set: function(e, t, n) {
							return M && L.nodeName(e, "button") ? M.set(e, t, n) : void(e.value = t)
						}
					}
				},
				propFix: {
					tabindex: "tabIndex",
					readonly: "readOnly",
					"for": "htmlFor",
					"class": "className",
					maxlength: "maxLength",
					cellspacing: "cellSpacing",
					cellpadding: "cellPadding",
					rowspan: "rowSpan",
					colspan: "colSpan",
					usemap: "useMap",
					frameborder: "frameBorder",
					contenteditable: "contentEditable"
				},
				prop: function(e, n, a) {
					var i, o, r, s = e.nodeType;
					return e && 3 !== s && 8 !== s && 2 !== s ? (r = 1 !== s || !L.isXMLDoc(e), r && (n = L.propFix[n] || n, o = L.propHooks[n]), a !== t ? o && "set" in o && (i = o.set(e, a, n)) !== t ? i : e[n] = a : o && "get" in o && null !== (i = o.get(e, n)) ? i : e[n]) : void 0
				},
				propHooks: {
					tabIndex: {
						get: function(e) {
							var n = e.getAttributeNode("tabindex");
							return n && n.specified ? parseInt(n.value, 10) : X.test(e.nodeName) || Y.test(e.nodeName) && e.href ? 0 : t
						}
					}
				}
			}), L.attrHooks.tabindex = L.propHooks.tabIndex, B = {
				get: function(e, n) {
					var a, i = L.prop(e, n);
					return i === !0 || "boolean" != typeof i && (a = e.getAttributeNode(n)) && a.nodeValue !== !1 ? n.toLowerCase() : t
				},
				set: function(e, t, n) {
					var a;
					return t === !1 ? L.removeAttr(e, n) : (a = L.propFix[n] || n, a in e && (e[a] = !0), e.setAttribute(n, n.toLowerCase())), n
				}
			}, K || (F = {
				name: !0,
				id: !0
			}, M = L.valHooks.button = {
				get: function(e, n) {
					var a;
					return a = e.getAttributeNode(n), a && (F[n] ? "" !== a.nodeValue : a.specified) ? a.nodeValue : t
				},
				set: function(e, t, n) {
					var a = e.getAttributeNode(n);
					return a || (a = N.createAttribute(n), e.setAttributeNode(a)), a.nodeValue = t + ""
				}
			}, L.attrHooks.tabindex.set = M.set, L.each(["width", "height"], function(e, t) {
				L.attrHooks[t] = L.extend(L.attrHooks[t], {
					set: function(e, n) {
						return "" === n ? (e.setAttribute(t, "auto"), n) : void 0
					}
				})
			}), L.attrHooks.contenteditable = {
				get: M.get,
				set: function(e, t, n) {
					"" === t && (t = "false"), M.set(e, t, n)
				}
			}), L.support.hrefNormalized || L.each(["href", "src", "width", "height"], function(e, n) {
				L.attrHooks[n] = L.extend(L.attrHooks[n], {
					get: function(e) {
						var a = e.getAttribute(n, 2);
						return null === a ? t : a
					}
				})
			}), L.support.style || (L.attrHooks.style = {
				get: function(e) {
					return e.style.cssText.toLowerCase() || t
				},
				set: function(e, t) {
					return e.style.cssText = "" + t
				}
			}), L.support.optSelected || (L.propHooks.selected = L.extend(L.propHooks.selected, {
				get: function(e) {
					var t = e.parentNode;
					return t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex), null
				}
			})), L.support.enctype || (L.propFix.enctype = "encoding"), L.support.checkOn || L.each(["radio", "checkbox"], function() {
				L.valHooks[this] = {
					get: function(e) {
						return null === e.getAttribute("value") ? "on" : e.value
					}
				}
			}), L.each(["radio", "checkbox"], function() {
				L.valHooks[this] = L.extend(L.valHooks[this], {
					set: function(e, t) {
						return L.isArray(t) ? e.checked = L.inArray(L(e).val(), t) >= 0 : void 0
					}
				})
			});
			var Q = /^(?:textarea|input|select)$/i,
				J = /^([^\.]*)?(?:\.(.+))?$/,
				ee = /\bhover(\.\S+)?\b/,
				te = /^key/,
				ne = /^(?:mouse|contextmenu)|click/,
				ae = /^(?:focusinfocus|focusoutblur)$/,
				ie = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
				oe = function(e) {
					var t = ie.exec(e);
					return t && (t[1] = (t[1] || "").toLowerCase(), t[3] = t[3] && new RegExp("(?:^|\\s)" + t[3] + "(?:\\s|$)")), t
				},
				re = function(e, t) {
					var n = e.attributes || {};
					return !(t[1] && e.nodeName.toLowerCase() !== t[1] || t[2] && (n.id || {}).value !== t[2] || t[3] && !t[3].test((n["class"] || {}).value));

				},
				se = function(e) {
					return L.event.special.hover ? e : e.replace(ee, "mouseenter$1 mouseleave$1")
				};
			L.event = {
					add: function(e, n, a, i, o) {
						var r, s, l, c, p, u, d, v, _, f, h;
						if (3 !== e.nodeType && 8 !== e.nodeType && n && a && (r = L._data(e))) {
							for (a.handler && (_ = a, a = _.handler), a.guid || (a.guid = L.guid++), l = r.events, l || (r.events = l = {}), s = r.handle, s || (r.handle = s = function(e) {
									return "undefined" == typeof L || e && L.event.triggered === e.type ? t : L.event.dispatch.apply(s.elem, arguments)
								}, s.elem = e), n = L.trim(se(n)).split(" "), c = 0; c < n.length; c++) p = J.exec(n[c]) || [], u = p[1], d = (p[2] || "").split(".").sort(), h = L.event.special[u] || {}, u = (o ? h.delegateType : h.bindType) || u, h = L.event.special[u] || {}, v = L.extend({
								type: u,
								origType: p[1],
								data: i,
								handler: a,
								guid: a.guid,
								selector: o,
								quick: oe(o),
								namespace: d.join(".")
							}, _), f = l[u], f || (f = l[u] = [], f.delegateCount = 0, h.setup && h.setup.call(e, i, d, s) !== !1 || (e.addEventListener ? e.addEventListener(u, s, !1) : e.attachEvent && e.attachEvent("on" + u, s))), h.add && (h.add.call(e, v), v.handler.guid || (v.handler.guid = a.guid)), o ? f.splice(f.delegateCount++, 0, v) : f.push(v), L.event.global[u] = !0;
							e = null
						}
					},
					global: {},
					remove: function(e, t, n, a, i) {
						var o, r, s, l, c, p, u, d, v, _, f, h, w = L.hasData(e) && L._data(e);
						if (w && (d = w.events)) {
							for (t = L.trim(se(t || "")).split(" "), o = 0; o < t.length; o++)
								if (r = J.exec(t[o]) || [], s = l = r[1], c = r[2], s) {
									for (v = L.event.special[s] || {}, s = (a ? v.delegateType : v.bindType) || s, f = d[s] || [], p = f.length, c = c ? new RegExp("(^|\\.)" + c.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null, u = 0; u < f.length; u++) h = f[u], !(!i && l !== h.origType || n && n.guid !== h.guid || c && !c.test(h.namespace) || a && a !== h.selector && ("**" !== a || !h.selector) || (f.splice(u--, 1), h.selector && f.delegateCount--, !v.remove || !v.remove.call(e, h)));
									0 === f.length && p !== f.length && ((!v.teardown || v.teardown.call(e, c) === !1) && L.removeEvent(e, s, w.handle), delete d[s])
								} else
									for (s in d) L.event.remove(e, s + t[o], n, a, !0);
							L.isEmptyObject(d) && (_ = w.handle, _ && (_.elem = null), L.removeData(e, ["events", "handle"], !0))
						}
					},
					customEvent: {
						getData: !0,
						setData: !0,
						changeData: !0
					},
					trigger: function(n, a, i, o) {
						if (!i || 3 !== i.nodeType && 8 !== i.nodeType) {
							var r, s, l, c, p, u, d, v, _, f, h = n.type || n,
								w = [];
							if (ae.test(h + L.event.triggered)) return;
							if (h.indexOf("!") >= 0 && (h = h.slice(0, -1), s = !0), h.indexOf(".") >= 0 && (w = h.split("."), h = w.shift(), w.sort()), (!i || L.event.customEvent[h]) && !L.event.global[h]) return;
							if (n = "object" == typeof n ? n[L.expando] ? n : new L.Event(h, n) : new L.Event(h), n.type = h, n.isTrigger = !0, n.exclusive = s, n.namespace = w.join("."), n.namespace_re = n.namespace ? new RegExp("(^|\\.)" + w.join("\\.(?:.*\\.)?") + "(\\.|$)") : null, u = h.indexOf(":") < 0 ? "on" + h : "", !i) {
								r = L.cache;
								for (l in r) r[l].events && r[l].events[h] && L.event.trigger(n, a, r[l].handle.elem, !0);
								return
							}
							if (n.result = t, n.target || (n.target = i), a = null != a ? L.makeArray(a) : [], a.unshift(n), d = L.event.special[h] || {}, d.trigger && d.trigger.apply(i, a) === !1) return;
							if (_ = [
									[i, d.bindType || h]
								], !o && !d.noBubble && !L.isWindow(i)) {
								for (f = d.delegateType || h, c = ae.test(f + h) ? i : i.parentNode, p = null; c; c = c.parentNode) _.push([c, f]), p = c;
								p && p === i.ownerDocument && _.push([p.defaultView || p.parentWindow || e, f])
							}
							for (l = 0; l < _.length && !n.isPropagationStopped(); l++) c = _[l][0], n.type = _[l][1], v = (L._data(c, "events") || {})[n.type] && L._data(c, "handle"), v && v.apply(c, a), v = u && c[u], v && L.acceptData(c) && v.apply(c, a) === !1 && n.preventDefault();
							return n.type = h, !(o || n.isDefaultPrevented() || d._default && d._default.apply(i.ownerDocument, a) !== !1 || "click" === h && L.nodeName(i, "a") || !L.acceptData(i) || !u || !i[h] || ("focus" === h || "blur" === h) && 0 === n.target.offsetWidth || L.isWindow(i) || (p = i[u], p && (i[u] = null), L.event.triggered = h, i[h](), L.event.triggered = t, !p || !(i[u] = p))), n.result
						}
					},
					dispatch: function(n) {
						n = L.event.fix(n || e.event);
						var a, i, o, r, s, l, c, p, u, d, v = (L._data(this, "events") || {})[n.type] || [],
							_ = v.delegateCount,
							f = [].slice.call(arguments, 0),
							h = !n.exclusive && !n.namespace,
							w = [];
						if (f[0] = n, n.delegateTarget = this, _ && !n.target.disabled && (!n.button || "click" !== n.type))
							for (r = L(this), r.context = this.ownerDocument || this, o = n.target; o != this; o = o.parentNode || this) {
								for (l = {}, p = [], r[0] = o, a = 0; _ > a; a++) u = v[a], d = u.selector, l[d] === t && (l[d] = u.quick ? re(o, u.quick) : r.is(d)), l[d] && p.push(u);
								p.length && w.push({
									elem: o,
									matches: p
								})
							}
						for (v.length > _ && w.push({
								elem: this,
								matches: v.slice(_)
							}), a = 0; a < w.length && !n.isPropagationStopped(); a++)
							for (c = w[a], n.currentTarget = c.elem, i = 0; i < c.matches.length && !n.isImmediatePropagationStopped(); i++) u = c.matches[i], (h || !n.namespace && !u.namespace || n.namespace_re && n.namespace_re.test(u.namespace)) && (n.data = u.data, n.handleObj = u, s = ((L.event.special[u.origType] || {}).handle || u.handler).apply(c.elem, f), s !== t && (n.result = s, s === !1 && (n.preventDefault(), n.stopPropagation())));
						return n.result
					},
					props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
					fixHooks: {},
					keyHooks: {
						props: "char charCode key keyCode".split(" "),
						filter: function(e, t) {
							return null == e.which && (e.which = null != t.charCode ? t.charCode : t.keyCode), e
						}
					},
					mouseHooks: {
						props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
						filter: function(e, n) {
							var a, i, o, r = n.button,
								s = n.fromElement;
							return null == e.pageX && null != n.clientX && (a = e.target.ownerDocument || N, i = a.documentElement, o = a.body, e.pageX = n.clientX + (i && i.scrollLeft || o && o.scrollLeft || 0) - (i && i.clientLeft || o && o.clientLeft || 0), e.pageY = n.clientY + (i && i.scrollTop || o && o.scrollTop || 0) - (i && i.clientTop || o && o.clientTop || 0)), !e.relatedTarget && s && (e.relatedTarget = s === e.target ? n.toElement : s), !e.which && r !== t && (e.which = 1 & r ? 1 : 2 & r ? 3 : 4 & r ? 2 : 0), e
						}
					},
					fix: function(e) {
						if (e[L.expando]) return e;
						var n, a, i = e,
							o = L.event.fixHooks[e.type] || {},
							r = o.props ? this.props.concat(o.props) : this.props;
						for (e = L.Event(i), n = r.length; n;) a = r[--n], e[a] = i[a];
						return e.target || (e.target = i.srcElement || N), 3 === e.target.nodeType && (e.target = e.target.parentNode), e.metaKey === t && (e.metaKey = e.ctrlKey), o.filter ? o.filter(e, i) : e
					},
					special: {
						ready: {
							setup: L.bindReady
						},
						load: {
							noBubble: !0
						},
						focus: {
							delegateType: "focusin"
						},
						blur: {
							delegateType: "focusout"
						},
						beforeunload: {
							setup: function(e, t, n) {
								L.isWindow(this) && (this.onbeforeunload = n)
							},
							teardown: function(e, t) {
								this.onbeforeunload === t && (this.onbeforeunload = null)
							}
						}
					},
					simulate: function(e, t, n, a) {
						var i = L.extend(new L.Event, n, {
							type: e,
							isSimulated: !0,
							originalEvent: {}
						});
						a ? L.event.trigger(i, null, t) : L.event.dispatch.call(t, i), i.isDefaultPrevented() && n.preventDefault()
					}
				}, L.event.handle = L.event.dispatch, L.removeEvent = N.removeEventListener ? function(e, t, n) {
					e.removeEventListener && e.removeEventListener(t, n, !1)
				} : function(e, t, n) {
					e.detachEvent && e.detachEvent("on" + t, n)
				}, L.Event = function(e, t) {
					return this instanceof L.Event ? (e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || e.returnValue === !1 || e.getPreventDefault && e.getPreventDefault() ? k : V) : this.type = e, t && L.extend(this, t), this.timeStamp = e && e.timeStamp || L.now(), this[L.expando] = !0, void 0) : new L.Event(e, t)
				}, L.Event.prototype = {
					preventDefault: function() {
						this.isDefaultPrevented = k;
						var e = this.originalEvent;
						!e || (e.preventDefault ? e.preventDefault() : e.returnValue = !1)
					},
					stopPropagation: function() {
						this.isPropagationStopped = k;
						var e = this.originalEvent;
						!e || (e.stopPropagation && e.stopPropagation(), e.cancelBubble = !0)
					},
					stopImmediatePropagation: function() {
						this.isImmediatePropagationStopped = k, this.stopPropagation()
					},
					isDefaultPrevented: V,
					isPropagationStopped: V,
					isImmediatePropagationStopped: V
				}, L.each({
					mouseenter: "mouseover",
					mouseleave: "mouseout"
				}, function(e, t) {
					L.event.special[e] = {
						delegateType: t,
						bindType: t,
						handle: function(e) {
							{
								var n, a = this,
									i = e.relatedTarget,
									o = e.handleObj;
								o.selector
							}
							return (!i || i !== a && !L.contains(a, i)) && (e.type = o.origType, n = o.handler.apply(this, arguments), e.type = t), n
						}
					}
				}), L.support.submitBubbles || (L.event.special.submit = {
					setup: function() {
						return L.nodeName(this, "form") ? !1 : void L.event.add(this, "click._submit keypress._submit", function(e) {
							var n = e.target,
								a = L.nodeName(n, "input") || L.nodeName(n, "button") ? n.form : t;
							a && !a._submit_attached && (L.event.add(a, "submit._submit", function(e) {
								this.parentNode && !e.isTrigger && L.event.simulate("submit", this.parentNode, e, !0)
							}), a._submit_attached = !0)
						})
					},
					teardown: function() {
						return L.nodeName(this, "form") ? !1 : void L.event.remove(this, "._submit")
					}
				}), L.support.changeBubbles || (L.event.special.change = {
					setup: function() {
						return Q.test(this.nodeName) ? (("checkbox" === this.type || "radio" === this.type) && (L.event.add(this, "propertychange._change", function(e) {
							"checked" === e.originalEvent.propertyName && (this._just_changed = !0)
						}), L.event.add(this, "click._change", function(e) {
							this._just_changed && !e.isTrigger && (this._just_changed = !1, L.event.simulate("change", this, e, !0))
						})), !1) : void L.event.add(this, "beforeactivate._change", function(e) {
							var t = e.target;
							Q.test(t.nodeName) && !t._change_attached && (L.event.add(t, "change._change", function(e) {
								this.parentNode && !e.isSimulated && !e.isTrigger && L.event.simulate("change", this.parentNode, e, !0)
							}), t._change_attached = !0)
						})
					},
					handle: function(e) {
						var t = e.target;
						return this !== t || e.isSimulated || e.isTrigger || "radio" !== t.type && "checkbox" !== t.type ? e.handleObj.handler.apply(this, arguments) : void 0
					},
					teardown: function() {
						return L.event.remove(this, "._change"), Q.test(this.nodeName)
					}
				}), L.support.focusinBubbles || L.each({
					focus: "focusin",
					blur: "focusout"
				}, function(e, t) {
					var n = 0,
						a = function(e) {
							L.event.simulate(t, e.target, L.event.fix(e), !0)
						};
					L.event.special[t] = {
						setup: function() {
							0 === n++ && N.addEventListener(e, a, !0)
						},
						teardown: function() {
							0 === --n && N.removeEventListener(e, a, !0)
						}
					}
				}), L.fn.extend({
					on: function(e, n, a, i, o) {
						var r, s;
						if ("object" == typeof e) {
							"string" != typeof n && (a = n, n = t);
							for (s in e) this.on(s, n, a, e[s], o);
							return this
						}
						if (null == a && null == i ? (i = n, a = n = t) : null == i && ("string" == typeof n ? (i = a, a = t) : (i = a, a = n, n = t)), i === !1) i = V;
						else if (!i) return this;
						return 1 === o && (r = i, i = function(e) {
							return L().off(e), r.apply(this, arguments)
						}, i.guid = r.guid || (r.guid = L.guid++)), this.each(function() {
							L.event.add(this, e, i, a, n)
						})
					},
					one: function(e, t, n, a) {
						return this.on.call(this, e, t, n, a, 1)
					},
					off: function(e, n, a) {
						if (e && e.preventDefault && e.handleObj) {
							var i = e.handleObj;
							return L(e.delegateTarget).off(i.namespace ? i.type + "." + i.namespace : i.type, i.selector, i.handler), this
						}
						if ("object" == typeof e) {
							for (var o in e) this.off(o, n, e[o]);
							return this
						}
						return (n === !1 || "function" == typeof n) && (a = n, n = t), a === !1 && (a = V), this.each(function() {
							L.event.remove(this, e, a, n)
						})
					},
					bind: function(e, t, n) {
						return this.on(e, null, t, n)
					},
					unbind: function(e, t) {
						return this.off(e, null, t)
					},
					live: function(e, t, n) {
						return L(this.context).on(e, this.selector, t, n), this
					},
					die: function(e, t) {
						return L(this.context).off(e, this.selector || "**", t), this
					},
					delegate: function(e, t, n, a) {
						return this.on(t, e, n, a)
					},
					undelegate: function(e, t, n) {
						return 1 == arguments.length ? this.off(e, "**") : this.off(t, e, n)
					},
					trigger: function(e, t) {
						return this.each(function() {
							L.event.trigger(e, t, this)
						})
					},
					triggerHandler: function(e, t) {
						return this[0] ? L.event.trigger(e, t, this[0], !0) : void 0
					},
					toggle: function(e) {
						var t = arguments,
							n = e.guid || L.guid++,
							a = 0,
							i = function(n) {
								var i = (L._data(this, "lastToggle" + e.guid) || 0) % a;
								return L._data(this, "lastToggle" + e.guid, i + 1), n.preventDefault(), t[i].apply(this, arguments) || !1
							};
						for (i.guid = n; a < t.length;) t[a++].guid = n;
						return this.click(i)
					},
					hover: function(e, t) {
						return this.mouseenter(e).mouseleave(t || e)
					}
				}), L.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function(e, t) {
					L.fn[t] = function(e, n) {
						return null == n && (n = e, e = null), arguments.length > 0 ? this.on(t, null, e, n) : this.trigger(t)
					}, L.attrFn && (L.attrFn[t] = !0), te.test(t) && (L.event.fixHooks[t] = L.event.keyHooks), ne.test(t) && (L.event.fixHooks[t] = L.event.mouseHooks)
				}),
				function() {
					function e(e, t, n, a, o, r) {
						for (var s = 0, l = a.length; l > s; s++) {
							var c = a[s];
							if (c) {
								var p = !1;
								for (c = c[e]; c;) {
									if (c[i] === n) {
										p = a[c.sizset];
										break
									}
									if (1 === c.nodeType)
										if (r || (c[i] = n, c.sizset = s), "string" != typeof t) {
											if (c === t) {
												p = !0;
												break
											}
										} else if (d.filter(t, [c]).length > 0) {
										p = c;
										break
									}
									c = c[e]
								}
								a[s] = p
							}
						}
					}

					function n(e, t, n, a, o, r) {
						for (var s = 0, l = a.length; l > s; s++) {
							var c = a[s];
							if (c) {
								var p = !1;
								for (c = c[e]; c;) {
									if (c[i] === n) {
										p = a[c.sizset];
										break
									}
									if (1 === c.nodeType && !r && (c[i] = n, c.sizset = s), c.nodeName.toLowerCase() === t) {
										p = c;
										break
									}
									c = c[e]
								}
								a[s] = p
							}
						}
					}
					var a = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
						i = "sizcache" + (Math.random() + "").replace(".", ""),
						o = 0,
						r = Object.prototype.toString,
						s = !1,
						l = !0,
						c = /\\/g,
						p = /\r\n/g,
						u = /\W/;
					[0, 0].sort(function() {
						return l = !1, 0
					});
					var d = function(e, t, n, i) {
						n = n || [], t = t || N;
						var o = t;
						if (1 !== t.nodeType && 9 !== t.nodeType) return [];
						if (!e || "string" != typeof e) return n;
						var s, l, c, p, u, v, h, w, m = !0,
							b = d.isXML(t),
							y = [],
							A = e;
						do
							if (a.exec(""), s = a.exec(A), s && (A = s[3], y.push(s[1]), s[2])) {
								p = s[3];
								break
							}
						while (s);
						if (y.length > 1 && f.exec(e))
							if (2 === y.length && _.relative[y[0]]) l = C(y[0] + y[1], t, i);
							else
								for (l = _.relative[y[0]] ? [t] : d(y.shift(), t); y.length;) e = y.shift(), _.relative[e] && (e += y.shift()), l = C(e, l, i);
						else if (!i && y.length > 1 && 9 === t.nodeType && !b && _.match.ID.test(y[0]) && !_.match.ID.test(y[y.length - 1]) && (u = d.find(y.shift(), t, b), t = u.expr ? d.filter(u.expr, u.set)[0] : u.set[0]), t)
							for (u = i ? {
									expr: y.pop(),
									set: g(i)
								} : d.find(y.pop(), 1 !== y.length || "~" !== y[0] && "+" !== y[0] || !t.parentNode ? t : t.parentNode, b), l = u.expr ? d.filter(u.expr, u.set) : u.set, y.length > 0 ? c = g(l) : m = !1; y.length;) v = y.pop(), h = v, _.relative[v] ? h = y.pop() : v = "", null == h && (h = t), _.relative[v](c, h, b);
						else c = y = [];
						if (c || (c = l), c || d.error(v || e), "[object Array]" === r.call(c))
							if (m)
								if (t && 1 === t.nodeType)
									for (w = 0; null != c[w]; w++) c[w] && (c[w] === !0 || 1 === c[w].nodeType && d.contains(t, c[w])) && n.push(l[w]);
								else
									for (w = 0; null != c[w]; w++) c[w] && 1 === c[w].nodeType && n.push(l[w]);
						else n.push.apply(n, c);
						else g(c, n);
						return p && (d(p, o, n, i), d.uniqueSort(n)), n
					};
					d.uniqueSort = function(e) {
						if (b && (s = l, e.sort(b), s))
							for (var t = 1; t < e.length; t++) e[t] === e[t - 1] && e.splice(t--, 1);
						return e
					}, d.matches = function(e, t) {
						return d(e, null, null, t)
					}, d.matchesSelector = function(e, t) {
						return d(t, null, null, [e]).length > 0
					}, d.find = function(e, t, n) {
						var a, i, o, r, s, l;
						if (!e) return [];
						for (i = 0, o = _.order.length; o > i; i++)
							if (s = _.order[i], (r = _.leftMatch[s].exec(e)) && (l = r[1], r.splice(1, 1), "\\" !== l.substr(l.length - 1) && (r[1] = (r[1] || "").replace(c, ""), a = _.find[s](r, t, n), null != a))) {
								e = e.replace(_.match[s], "");
								break
							}
						return a || (a = "undefined" != typeof t.getElementsByTagName ? t.getElementsByTagName("*") : []), {
							set: a,
							expr: e
						}
					}, d.filter = function(e, n, a, i) {
						for (var o, r, s, l, c, p, u, v, f, h = e, w = [], g = n, m = n && n[0] && d.isXML(n[0]); e && n.length;) {
							for (s in _.filter)
								if (null != (o = _.leftMatch[s].exec(e)) && o[2]) {
									if (p = _.filter[s], u = o[1], r = !1, o.splice(1, 1), "\\" === u.substr(u.length - 1)) continue;
									if (g === w && (w = []), _.preFilter[s])
										if (o = _.preFilter[s](o, g, a, w, i, m)) {
											if (o === !0) continue
										} else r = l = !0;
									if (o)
										for (v = 0; null != (c = g[v]); v++) c && (l = p(c, o, v, g), f = i ^ l, a && null != l ? f ? r = !0 : g[v] = !1 : f && (w.push(c), r = !0));
									if (l !== t) {
										if (a || (g = w), e = e.replace(_.match[s], ""), !r) return [];
										break
									}
								}
							if (e === h) {
								if (null != r) break;
								d.error(e)
							}
							h = e
						}
						return g
					}, d.error = function(e) {
						throw new Error("Syntax error, unrecognized expression: " + e)
					};
					var v = d.getText = function(e) {
							var t, n, a = e.nodeType,
								i = "";
							if (a) {
								if (1 === a || 9 === a) {
									if ("string" == typeof e.textContent) return e.textContent;
									if ("string" == typeof e.innerText) return e.innerText.replace(p, "");
									for (e = e.firstChild; e; e = e.nextSibling) i += v(e)
								} else if (3 === a || 4 === a) return e.nodeValue
							} else
								for (t = 0; n = e[t]; t++) 8 !== n.nodeType && (i += v(n));
							return i
						},
						_ = d.selectors = {
							order: ["ID", "NAME", "TAG"],
							match: {
								ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
								CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
								NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
								ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
								TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
								CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
								POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
								PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
							},
							leftMatch: {},
							attrMap: {
								"class": "className",
								"for": "htmlFor"
							},
							attrHandle: {
								href: function(e) {
									return e.getAttribute("href")
								},
								type: function(e) {
									return e.getAttribute("type")
								}
							},
							relative: {
								"+": function(e, t) {
									var n = "string" == typeof t,
										a = n && !u.test(t),
										i = n && !a;
									a && (t = t.toLowerCase());
									for (var o, r = 0, s = e.length; s > r; r++)
										if (o = e[r]) {
											for (;
												(o = o.previousSibling) && 1 !== o.nodeType;);
											e[r] = i || o && o.nodeName.toLowerCase() === t ? o || !1 : o === t
										}
									i && d.filter(t, e, !0)
								},
								">": function(e, t) {
									var n, a = "string" == typeof t,
										i = 0,
										o = e.length;
									if (a && !u.test(t)) {
										for (t = t.toLowerCase(); o > i; i++)
											if (n = e[i]) {
												var r = n.parentNode;
												e[i] = r.nodeName.toLowerCase() === t ? r : !1
											}
									} else {
										for (; o > i; i++) n = e[i], n && (e[i] = a ? n.parentNode : n.parentNode === t);
										a && d.filter(t, e, !0)
									}
								},
								"": function(t, a, i) {
									var r, s = o++,
										l = e;
									"string" == typeof a && !u.test(a) && (a = a.toLowerCase(), r = a, l = n), l("parentNode", a, s, t, r, i)
								},
								"~": function(t, a, i) {
									var r, s = o++,
										l = e;
									"string" == typeof a && !u.test(a) && (a = a.toLowerCase(), r = a, l = n), l("previousSibling", a, s, t, r, i)
								}
							},
							find: {
								ID: function(e, t, n) {
									if ("undefined" != typeof t.getElementById && !n) {
										var a = t.getElementById(e[1]);
										return a && a.parentNode ? [a] : []
									}
								},
								NAME: function(e, t) {
									if ("undefined" != typeof t.getElementsByName) {
										for (var n = [], a = t.getElementsByName(e[1]), i = 0, o = a.length; o > i; i++) a[i].getAttribute("name") === e[1] && n.push(a[i]);
										return 0 === n.length ? null : n
									}
								},
								TAG: function(e, t) {
									return "undefined" != typeof t.getElementsByTagName ? t.getElementsByTagName(e[1]) : void 0
								}
							},
							preFilter: {
								CLASS: function(e, t, n, a, i, o) {
									if (e = " " + e[1].replace(c, "") + " ", o) return e;
									for (var r, s = 0; null != (r = t[s]); s++) r && (i ^ (r.className && (" " + r.className + " ").replace(/[\t\n\r]/g, " ").indexOf(e) >= 0) ? n || a.push(r) : n && (t[s] = !1));
									return !1
								},
								ID: function(e) {
									return e[1].replace(c, "")
								},
								TAG: function(e, t) {
									return e[1].replace(c, "").toLowerCase()
								},
								CHILD: function(e) {
									if ("nth" === e[1]) {
										e[2] || d.error(e[0]), e[2] = e[2].replace(/^\+|\s*/g, "");
										var t = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even" === e[2] && "2n" || "odd" === e[2] && "2n+1" || !/\D/.test(e[2]) && "0n+" + e[2] || e[2]);
										e[2] = t[1] + (t[2] || 1) - 0, e[3] = t[3] - 0
									} else e[2] && d.error(e[0]);
									return e[0] = o++, e
								},
								ATTR: function(e, t, n, a, i, o) {
									var r = e[1] = e[1].replace(c, "");
									return !o && _.attrMap[r] && (e[1] = _.attrMap[r]), e[4] = (e[4] || e[5] || "").replace(c, ""), "~=" === e[2] && (e[4] = " " + e[4] + " "), e
								},
								PSEUDO: function(e, t, n, i, o) {
									if ("not" === e[1]) {
										if (!((a.exec(e[3]) || "").length > 1 || /^\w/.test(e[3]))) {
											var r = d.filter(e[3], t, n, !0 ^ o);
											return n || i.push.apply(i, r), !1
										}
										e[3] = d(e[3], null, null, t)
									} else if (_.match.POS.test(e[0]) || _.match.CHILD.test(e[0])) return !0;
									return e
								},
								POS: function(e) {
									return e.unshift(!0), e
								}
							},
							filters: {
								enabled: function(e) {
									return e.disabled === !1 && "hidden" !== e.type
								},
								disabled: function(e) {
									return e.disabled === !0
								},
								checked: function(e) {
									return e.checked === !0
								},
								selected: function(e) {
									return e.parentNode && e.parentNode.selectedIndex, e.selected === !0
								},
								parent: function(e) {
									return !!e.firstChild
								},
								empty: function(e) {
									return !e.firstChild
								},
								has: function(e, t, n) {
									return !!d(n[3], e).length
								},
								header: function(e) {
									return /h\d/i.test(e.nodeName)
								},
								text: function(e) {
									var t = e.getAttribute("type"),
										n = e.type;
									return "input" === e.nodeName.toLowerCase() && "text" === n && (t === n || null === t)
								},
								radio: function(e) {
									return "input" === e.nodeName.toLowerCase() && "radio" === e.type
								},
								checkbox: function(e) {
									return "input" === e.nodeName.toLowerCase() && "checkbox" === e.type
								},
								file: function(e) {
									return "input" === e.nodeName.toLowerCase() && "file" === e.type
								},
								password: function(e) {
									return "input" === e.nodeName.toLowerCase() && "password" === e.type
								},
								submit: function(e) {
									var t = e.nodeName.toLowerCase();
									return ("input" === t || "button" === t) && "submit" === e.type
								},
								image: function(e) {
									return "input" === e.nodeName.toLowerCase() && "image" === e.type
								},
								reset: function(e) {
									var t = e.nodeName.toLowerCase();
									return ("input" === t || "button" === t) && "reset" === e.type
								},
								button: function(e) {
									var t = e.nodeName.toLowerCase();
									return "input" === t && "button" === e.type || "button" === t
								},
								input: function(e) {
									return /input|select|textarea|button/i.test(e.nodeName)
								},
								focus: function(e) {
									return e === e.ownerDocument.activeElement
								}
							},
							setFilters: {
								first: function(e, t) {
									return 0 === t
								},
								last: function(e, t, n, a) {
									return t === a.length - 1
								},
								even: function(e, t) {
									return t % 2 === 0
								},
								odd: function(e, t) {
									return t % 2 === 1
								},
								lt: function(e, t, n) {
									return t < n[3] - 0
								},
								gt: function(e, t, n) {
									return t > n[3] - 0
								},
								nth: function(e, t, n) {
									return n[3] - 0 === t
								},
								eq: function(e, t, n) {
									return n[3] - 0 === t
								}
							},
							filter: {
								PSEUDO: function(e, t, n, a) {
									var i = t[1],
										o = _.filters[i];
									if (o) return o(e, n, t, a);
									if ("contains" === i) return (e.textContent || e.innerText || v([e]) || "").indexOf(t[3]) >= 0;
									if ("not" === i) {
										for (var r = t[3], s = 0, l = r.length; l > s; s++)
											if (r[s] === e) return !1;
										return !0
									}
									d.error(i)
								},
								CHILD: function(e, t) {
									var n, a, o, r, s, l, c = t[1],
										p = e;
									switch (c) {
										case "only":
										case "first":
											for (; p = p.previousSibling;)
												if (1 === p.nodeType) return !1;
											if ("first" === c) return !0;
											p = e;
										case "last":
											for (; p = p.nextSibling;)
												if (1 === p.nodeType) return !1;
											return !0;
										case "nth":
											if (n = t[2], a = t[3], 1 === n && 0 === a) return !0;
											if (o = t[0], r = e.parentNode, r && (r[i] !== o || !e.nodeIndex)) {
												for (s = 0, p = r.firstChild; p; p = p.nextSibling) 1 === p.nodeType && (p.nodeIndex = ++s);
												r[i] = o
											}
											return l = e.nodeIndex - a, 0 === n ? 0 === l : l % n === 0 && l / n >= 0
									}
								},
								ID: function(e, t) {
									return 1 === e.nodeType && e.getAttribute("id") === t
								},
								TAG: function(e, t) {
									return "*" === t && 1 === e.nodeType || !!e.nodeName && e.nodeName.toLowerCase() === t
								},
								CLASS: function(e, t) {
									return (" " + (e.className || e.getAttribute("class")) + " ").indexOf(t) > -1
								},
								ATTR: function(e, t) {
									var n = t[1],
										a = d.attr ? d.attr(e, n) : _.attrHandle[n] ? _.attrHandle[n](e) : null != e[n] ? e[n] : e.getAttribute(n),
										i = a + "",
										o = t[2],
										r = t[4];
									return null == a ? "!=" === o : !o && d.attr ? null != a : "=" === o ? i === r : "*=" === o ? i.indexOf(r) >= 0 : "~=" === o ? (" " + i + " ").indexOf(r) >= 0 : r ? "!=" === o ? i !== r : "^=" === o ? 0 === i.indexOf(r) : "$=" === o ? i.substr(i.length - r.length) === r : "|=" === o ? i === r || i.substr(0, r.length + 1) === r + "-" : !1 : i && a !== !1
								},
								POS: function(e, t, n, a) {
									var i = t[2],
										o = _.setFilters[i];
									return o ? o(e, n, t, a) : void 0
								}
							}
						},
						f = _.match.POS,
						h = function(e, t) {
							return "\\" + (t - 0 + 1)
						};
					for (var w in _.match) _.match[w] = new RegExp(_.match[w].source + /(?![^\[]*\])(?![^\(]*\))/.source), _.leftMatch[w] = new RegExp(/(^(?:.|\r|\n)*?)/.source + _.match[w].source.replace(/\\(\d+)/g, h));
					var g = function(e, t) {
						return e = Array.prototype.slice.call(e, 0), t ? (t.push.apply(t, e), t) : e
					};
					try {
						Array.prototype.slice.call(N.documentElement.childNodes, 0)[0].nodeType
					} catch (m) {
						g = function(e, t) {
							var n = 0,
								a = t || [];
							if ("[object Array]" === r.call(e)) Array.prototype.push.apply(a, e);
							else if ("number" == typeof e.length)
								for (var i = e.length; i > n; n++) a.push(e[n]);
							else
								for (; e[n]; n++) a.push(e[n]);
							return a
						}
					}
					var b, y;
					N.documentElement.compareDocumentPosition ? b = function(e, t) {
							return e === t ? (s = !0, 0) : e.compareDocumentPosition && t.compareDocumentPosition ? 4 & e.compareDocumentPosition(t) ? -1 : 1 : e.compareDocumentPosition ? -1 : 1
						} : (b = function(e, t) {
							if (e === t) return s = !0, 0;
							if (e.sourceIndex && t.sourceIndex) return e.sourceIndex - t.sourceIndex;
							var n, a, i = [],
								o = [],
								r = e.parentNode,
								l = t.parentNode,
								c = r;
							if (r === l) return y(e, t);
							if (!r) return -1;
							if (!l) return 1;
							for (; c;) i.unshift(c), c = c.parentNode;
							for (c = l; c;) o.unshift(c), c = c.parentNode;
							n = i.length, a = o.length;
							for (var p = 0; n > p && a > p; p++)
								if (i[p] !== o[p]) return y(i[p], o[p]);
							return p === n ? y(e, o[p], -1) : y(i[p], t, 1)
						}, y = function(e, t, n) {
							if (e === t) return n;
							for (var a = e.nextSibling; a;) {
								if (a === t) return -1;
								a = a.nextSibling
							}
							return 1
						}),
						function() {
							var e = N.createElement("div"),
								n = "script" + (new Date).getTime(),
								a = N.documentElement;
							e.innerHTML = "<a name='" + n + "'/>", a.insertBefore(e, a.firstChild), N.getElementById(n) && (_.find.ID = function(e, n, a) {
								if ("undefined" != typeof n.getElementById && !a) {
									var i = n.getElementById(e[1]);
									return i ? i.id === e[1] || "undefined" != typeof i.getAttributeNode && i.getAttributeNode("id").nodeValue === e[1] ? [i] : t : []
								}
							}, _.filter.ID = function(e, t) {
								var n = "undefined" != typeof e.getAttributeNode && e.getAttributeNode("id");
								return 1 === e.nodeType && n && n.nodeValue === t
							}), a.removeChild(e), a = e = null
						}(),
						function() {
							var e = N.createElement("div");
							e.appendChild(N.createComment("")), e.getElementsByTagName("*").length > 0 && (_.find.TAG = function(e, t) {
								var n = t.getElementsByTagName(e[1]);
								if ("*" === e[1]) {
									for (var a = [], i = 0; n[i]; i++) 1 === n[i].nodeType && a.push(n[i]);
									n = a
								}
								return n
							}), e.innerHTML = "<a href='#'></a>", e.firstChild && "undefined" != typeof e.firstChild.getAttribute && "#" !== e.firstChild.getAttribute("href") && (_.attrHandle.href = function(e) {
								return e.getAttribute("href", 2)
							}), e = null
						}(), N.querySelectorAll && function() {
							var e = d,
								t = N.createElement("div"),
								n = "__sizzle__";
							if (t.innerHTML = "<p class='TEST'></p>", !t.querySelectorAll || 0 !== t.querySelectorAll(".TEST").length) {
								d = function(t, a, i, o) {
									if (a = a || N, !o && !d.isXML(a)) {
										var r = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(t);
										if (r && (1 === a.nodeType || 9 === a.nodeType)) {
											if (r[1]) return g(a.getElementsByTagName(t), i);
											if (r[2] && _.find.CLASS && a.getElementsByClassName) return g(a.getElementsByClassName(r[2]), i)
										}
										if (9 === a.nodeType) {
											if ("body" === t && a.body) return g([a.body], i);
											if (r && r[3]) {
												var s = a.getElementById(r[3]);
												if (!s || !s.parentNode) return g([], i);
												if (s.id === r[3]) return g([s], i)
											}
											try {
												return g(a.querySelectorAll(t), i)
											} catch (l) {}
										} else if (1 === a.nodeType && "object" !== a.nodeName.toLowerCase()) {
											var c = a,
												p = a.getAttribute("id"),
												u = p || n,
												v = a.parentNode,
												f = /^\s*[+~]/.test(t);
											p ? u = u.replace(/'/g, "\\$&") : a.setAttribute("id", u), f && v && (a = a.parentNode);
											try {
												if (!f || v) return g(a.querySelectorAll("[id='" + u + "'] " + t), i)
											} catch (h) {} finally {
												p || c.removeAttribute("id")
											}
										}
									}
									return e(t, a, i, o)
								};
								for (var a in e) d[a] = e[a];
								t = null
							}
						}(),
						function() {
							var e = N.documentElement,
								t = e.matchesSelector || e.mozMatchesSelector || e.webkitMatchesSelector || e.msMatchesSelector;
							if (t) {
								var n = !t.call(N.createElement("div"), "div"),
									a = !1;
								try {
									t.call(N.documentElement, "[test!='']:sizzle")
								} catch (i) {
									a = !0
								}
								d.matchesSelector = function(e, i) {
									if (i = i.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"), !d.isXML(e)) try {
										if (a || !_.match.PSEUDO.test(i) && !/!=/.test(i)) {
											var o = t.call(e, i);
											if (o || !n || e.document && 11 !== e.document.nodeType) return o
										}
									} catch (r) {}
									return d(i, null, null, [e]).length > 0
								}
							}
						}(),
						function() {
							var e = N.createElement("div");
							if (e.innerHTML = "<div class='test e'></div><div class='test'></div>", e.getElementsByClassName && 0 !== e.getElementsByClassName("e").length) {
								if (e.lastChild.className = "e", 1 === e.getElementsByClassName("e").length) return;
								_.order.splice(1, 0, "CLASS"), _.find.CLASS = function(e, t, n) {
									return "undefined" == typeof t.getElementsByClassName || n ? void 0 : t.getElementsByClassName(e[1])
								}, e = null
							}
						}(), d.contains = N.documentElement.contains ? function(e, t) {
							return e !== t && (e.contains ? e.contains(t) : !0)
						} : N.documentElement.compareDocumentPosition ? function(e, t) {
							return !!(16 & e.compareDocumentPosition(t))
						} : function() {
							return !1
						}, d.isXML = function(e) {
							var t = (e ? e.ownerDocument || e : 0).documentElement;
							return t ? "HTML" !== t.nodeName : !1
						};
					var C = function(e, t, n) {
						for (var a, i = [], o = "", r = t.nodeType ? [t] : t; a = _.match.PSEUDO.exec(e);) o += a[0], e = e.replace(_.match.PSEUDO, "");
						e = _.relative[e] ? e + "*" : e;
						for (var s = 0, l = r.length; l > s; s++) d(e, r[s], i, n);
						return d.filter(o, i)
					};
					d.attr = L.attr, d.selectors.attrMap = {}, L.find = d, L.expr = d.selectors, L.expr[":"] = L.expr.filters, L.unique = d.uniqueSort, L.text = d.getText, L.isXMLDoc = d.isXML, L.contains = d.contains
				}();
			var le = /Until$/,
				ce = /^(?:parents|prevUntil|prevAll)/,
				pe = /,/,
				ue = /^.[^:#\[\.,]*$/,
				de = Array.prototype.slice,
				ve = L.expr.match.POS,
				_e = {
					children: !0,
					contents: !0,
					next: !0,
					prev: !0
				};
			L.fn.extend({
				find: function(e) {
					var t, n, a = this;
					if ("string" != typeof e) return L(e).filter(function() {
						for (t = 0, n = a.length; n > t; t++)
							if (L.contains(a[t], this)) return !0
					});
					var i, o, r, s = this.pushStack("", "find", e);
					for (t = 0, n = this.length; n > t; t++)
						if (i = s.length, L.find(e, this[t], s), t > 0)
							for (o = i; o < s.length; o++)
								for (r = 0; i > r; r++)
									if (s[r] === s[o]) {
										s.splice(o--, 1);
										break
									}
					return s
				},
				has: function(e) {
					var t = L(e);
					return this.filter(function() {
						for (var e = 0, n = t.length; n > e; e++)
							if (L.contains(this, t[e])) return !0
					})
				},
				not: function(e) {
					return this.pushStack(I(this, e, !1), "not", e)
				},
				filter: function(e) {
					return this.pushStack(I(this, e, !0), "filter", e)
				},
				is: function(e) {
					return !!e && ("string" == typeof e ? ve.test(e) ? L(e, this.context).index(this[0]) >= 0 : L.filter(e, this).length > 0 : this.filter(e).length > 0)
				},
				closest: function(e, t) {
					var n, a, i = [],
						o = this[0];
					if (L.isArray(e)) {
						for (var r = 1; o && o.ownerDocument && o !== t;) {
							for (n = 0; n < e.length; n++) L(o).is(e[n]) && i.push({
								selector: e[n],
								elem: o,
								level: r
							});
							o = o.parentNode, r++
						}
						return i
					}
					var s = ve.test(e) || "string" != typeof e ? L(e, t || this.context) : 0;
					for (n = 0, a = this.length; a > n; n++)
						for (o = this[n]; o;) {
							if (s ? s.index(o) > -1 : L.find.matchesSelector(o, e)) {
								i.push(o);
								break
							}
							if (o = o.parentNode, !o || !o.ownerDocument || o === t || 11 === o.nodeType) break
						}
					return i = i.length > 1 ? L.unique(i) : i, this.pushStack(i, "closest", e)
				},
				index: function(e) {
					return e ? "string" == typeof e ? L.inArray(this[0], L(e)) : L.inArray(e.jquery ? e[0] : e, this) : this[0] && this[0].parentNode ? this.prevAll().length : -1
				},
				add: function(e, t) {
					var n = "string" == typeof e ? L(e, t) : L.makeArray(e && e.nodeType ? [e] : e),
						a = L.merge(this.get(), n);
					return this.pushStack(T(n[0]) || T(a[0]) ? a : L.unique(a))
				},
				andSelf: function() {
					return this.add(this.prevObject)
				}
			}), L.each({
				parent: function(e) {
					var t = e.parentNode;
					return t && 11 !== t.nodeType ? t : null
				},
				parents: function(e) {
					return L.dir(e, "parentNode")
				},
				parentsUntil: function(e, t, n) {
					return L.dir(e, "parentNode", n)
				},
				next: function(e) {
					return L.nth(e, 2, "nextSibling")
				},
				prev: function(e) {
					return L.nth(e, 2, "previousSibling")
				},
				nextAll: function(e) {
					return L.dir(e, "nextSibling")
				},
				prevAll: function(e) {
					return L.dir(e, "previousSibling")
				},
				nextUntil: function(e, t, n) {
					return L.dir(e, "nextSibling", n)
				},
				prevUntil: function(e, t, n) {
					return L.dir(e, "previousSibling", n)
				},
				siblings: function(e) {
					return L.sibling(e.parentNode.firstChild, e)
				},
				children: function(e) {
					return L.sibling(e.firstChild)
				},
				contents: function(e) {
					return L.nodeName(e, "iframe") ? e.contentDocument || e.contentWindow.document : L.makeArray(e.childNodes)
				}
			}, function(e, t) {
				L.fn[e] = function(n, a) {
					var i = L.map(this, t, n);
					return le.test(e) || (a = n), a && "string" == typeof a && (i = L.filter(a, i)), i = this.length > 1 && !_e[e] ? L.unique(i) : i, (this.length > 1 || pe.test(a)) && ce.test(e) && (i = i.reverse()), this.pushStack(i, e, de.call(arguments).join(","))
				}
			}), L.extend({
				filter: function(e, t, n) {
					return n && (e = ":not(" + e + ")"), 1 === t.length ? L.find.matchesSelector(t[0], e) ? [t[0]] : [] : L.find.matches(e, t)
				},
				dir: function(e, n, a) {
					for (var i = [], o = e[n]; o && 9 !== o.nodeType && (a === t || 1 !== o.nodeType || !L(o).is(a));) 1 === o.nodeType && i.push(o), o = o[n];
					return i
				},
				nth: function(e, t, n, a) {
					t = t || 1;
					for (var i = 0; e && (1 !== e.nodeType || ++i !== t); e = e[n]);
					return e
				},
				sibling: function(e, t) {
					for (var n = []; e; e = e.nextSibling) 1 === e.nodeType && e !== t && n.push(e);
					return n
				}
			});
			var fe = "abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
				he = / jQuery\d+="(?:\d+|null)"/g,
				we = /^\s+/,
				ge = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
				me = /<([\w:]+)/,
				be = /<tbody/i,
				ye = /<|&#?\w+;/,
				Ce = /<(?:script|style)/i,
				Ae = /<(?:script|object|embed|option|style)/i,
				xe = new RegExp("<(?:" + fe + ")", "i"),
				Ie = /checked\s*(?:[^=]|=\s*.checked.)/i,
				Te = /\/(java|ecma)script/i,
				ke = /^\s*<!(?:\[CDATA\[|\-\-)/,
				Ve = {
					option: [1, "<select multiple='multiple'>", "</select>"],
					legend: [1, "<fieldset>", "</fieldset>"],
					thead: [1, "<table>", "</table>"],
					tr: [2, "<table><tbody>", "</tbody></table>"],
					td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
					col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
					area: [1, "<map>", "</map>"],
					_default: [0, "", ""]
				},
				Se = x(N);
			Ve.optgroup = Ve.option, Ve.tbody = Ve.tfoot = Ve.colgroup = Ve.caption = Ve.thead, Ve.th = Ve.td, L.support.htmlSerialize || (Ve._default = [1, "div<div>", "</div>"]), L.fn.extend({
				text: function(e) {
					return L.isFunction(e) ? this.each(function(t) {
						var n = L(this);
						n.text(e.call(this, t, n.text()))
					}) : "object" != typeof e && e !== t ? this.empty().append((this[0] && this[0].ownerDocument || N).createTextNode(e)) : L.text(this)
				},
				wrapAll: function(e) {
					if (L.isFunction(e)) return this.each(function(t) {
						L(this).wrapAll(e.call(this, t))
					});
					if (this[0]) {
						var t = L(e, this[0].ownerDocument).eq(0).clone(!0);
						this[0].parentNode && t.insertBefore(this[0]), t.map(function() {
							for (var e = this; e.firstChild && 1 === e.firstChild.nodeType;) e = e.firstChild;
							return e
						}).append(this)
					}
					return this
				},
				wrapInner: function(e) {
					return this.each(L.isFunction(e) ? function(t) {
						L(this).wrapInner(e.call(this, t))
					} : function() {
						var t = L(this),
							n = t.contents();
						n.length ? n.wrapAll(e) : t.append(e)
					})
				},
				wrap: function(e) {
					var t = L.isFunction(e);
					return this.each(function(n) {
						L(this).wrapAll(t ? e.call(this, n) : e)
					})
				},
				unwrap: function() {
					return this.parent().each(function() {
						L.nodeName(this, "body") || L(this).replaceWith(this.childNodes)
					}).end()
				},
				append: function() {
					return this.domManip(arguments, !0, function(e) {
						1 === this.nodeType && this.appendChild(e)
					})
				},
				prepend: function() {
					return this.domManip(arguments, !0, function(e) {
						1 === this.nodeType && this.insertBefore(e, this.firstChild)
					})
				},
				before: function() {
					if (this[0] && this[0].parentNode) return this.domManip(arguments, !1, function(e) {
						this.parentNode.insertBefore(e, this)
					});
					if (arguments.length) {
						var e = L.clean(arguments);
						return e.push.apply(e, this.toArray()), this.pushStack(e, "before", arguments)
					}
				},
				after: function() {
					if (this[0] && this[0].parentNode) return this.domManip(arguments, !1, function(e) {
						this.parentNode.insertBefore(e, this.nextSibling)
					});
					if (arguments.length) {
						var e = this.pushStack(this, "after", arguments);
						return e.push.apply(e, L.clean(arguments)), e
					}
				},
				remove: function(e, t) {
					for (var n, a = 0; null != (n = this[a]); a++)(!e || L.filter(e, [n]).length) && (!t && 1 === n.nodeType && (L.cleanData(n.getElementsByTagName("*")), L.cleanData([n])), n.parentNode && n.parentNode.removeChild(n));
					return this
				},
				empty: function() {
					for (var e, t = 0; null != (e = this[t]); t++)
						for (1 === e.nodeType && L.cleanData(e.getElementsByTagName("*")); e.firstChild;) e.removeChild(e.firstChild);
					return this
				},
				clone: function(e, t) {
					return e = null == e ? !1 : e, t = null == t ? e : t, this.map(function() {
						return L.clone(this, e, t)
					})
				},
				html: function(e) {
					if (e === t) return this[0] && 1 === this[0].nodeType ? this[0].innerHTML.replace(he, "") : null;
					if ("string" != typeof e || Ce.test(e) || !L.support.leadingWhitespace && we.test(e) || Ve[(me.exec(e) || ["", ""])[1].toLowerCase()]) L.isFunction(e) ? this.each(function(t) {
						var n = L(this);
						n.html(e.call(this, t, n.html()))
					}) : this.empty().append(e);
					else {
						e = e.replace(ge, "<$1></$2>");
						try {
							for (var n = 0, a = this.length; a > n; n++) 1 === this[n].nodeType && (L.cleanData(this[n].getElementsByTagName("*")), this[n].innerHTML = e)
						} catch (i) {
							this.empty().append(e)
						}
					}
					return this
				},
				replaceWith: function(e) {
					return this[0] && this[0].parentNode ? L.isFunction(e) ? this.each(function(t) {
						var n = L(this),
							a = n.html();
						n.replaceWith(e.call(this, t, a))
					}) : ("string" != typeof e && (e = L(e).detach()), this.each(function() {
						var t = this.nextSibling,
							n = this.parentNode;
						L(this).remove(), t ? L(t).before(e) : L(n).append(e)
					})) : this.length ? this.pushStack(L(L.isFunction(e) ? e() : e), "replaceWith", e) : this
				},
				detach: function(e) {
					return this.remove(e, !0)
				},
				domManip: function(e, n, a) {
					var i, o, r, s, l = e[0],
						c = [];
					if (!L.support.checkClone && 3 === arguments.length && "string" == typeof l && Ie.test(l)) return this.each(function() {
						L(this).domManip(e, n, a, !0)
					});
					if (L.isFunction(l)) return this.each(function(i) {
						var o = L(this);
						e[0] = l.call(this, i, n ? o.html() : t), o.domManip(e, n, a)
					});
					if (this[0]) {
						if (s = l && l.parentNode, i = L.support.parentNode && s && 11 === s.nodeType && s.childNodes.length === this.length ? {
								fragment: s
							} : L.buildFragment(e, this, c), r = i.fragment, o = 1 === r.childNodes.length ? r = r.firstChild : r.firstChild, o) {
							n = n && L.nodeName(o, "tr");
							for (var p = 0, u = this.length, d = u - 1; u > p; p++) a.call(n ? A(this[p], o) : this[p], i.cacheable || u > 1 && d > p ? L.clone(r, !0, !0) : r)
						}
						c.length && L.each(c, h)
					}
					return this
				}
			}), L.buildFragment = function(e, t, n) {
				var a, i, o, r, s = e[0];
				return t && t[0] && (r = t[0].ownerDocument || t[0]), r.createDocumentFragment || (r = N), 1 === e.length && "string" == typeof s && s.length < 512 && r === N && "<" === s.charAt(0) && !Ae.test(s) && (L.support.checkClone || !Ie.test(s)) && (L.support.html5Clone || !xe.test(s)) && (i = !0, o = L.fragments[s], o && 1 !== o && (a = o)), a || (a = r.createDocumentFragment(), L.clean(e, r, a, n)), i && (L.fragments[s] = o ? a : 1), {
					fragment: a,
					cacheable: i
				}
			}, L.fragments = {}, L.each({
				appendTo: "append",
				prependTo: "prepend",
				insertBefore: "before",
				insertAfter: "after",
				replaceAll: "replaceWith"
			}, function(e, t) {
				L.fn[e] = function(n) {
					var a = [],
						i = L(n),
						o = 1 === this.length && this[0].parentNode;
					if (o && 11 === o.nodeType && 1 === o.childNodes.length && 1 === i.length) return i[t](this[0]), this;
					for (var r = 0, s = i.length; s > r; r++) {
						var l = (r > 0 ? this.clone(!0) : this).get();
						L(i[r])[t](l), a = a.concat(l)
					}
					return this.pushStack(a, e, i.selector)
				}
			}), L.extend({
				clone: function(e, t, n) {
					var a, i, o, r = L.support.html5Clone || !xe.test("<" + e.nodeName) ? e.cloneNode(!0) : w(e);
					if (!(L.support.noCloneEvent && L.support.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || L.isXMLDoc(e)))
						for (y(e, r), a = b(e), i = b(r), o = 0; a[o]; ++o) i[o] && y(a[o], i[o]);
					if (t && (C(e, r), n))
						for (a = b(e), i = b(r), o = 0; a[o]; ++o) C(a[o], i[o]);
					return a = i = null, r
				},
				clean: function(e, t, n, a) {
					var i;
					t = t || N, "undefined" == typeof t.createElement && (t = t.ownerDocument || t[0] && t[0].ownerDocument || N);
					for (var o, r, s = [], l = 0; null != (r = e[l]); l++)
						if ("number" == typeof r && (r += ""), r) {
							if ("string" == typeof r)
								if (ye.test(r)) {
									r = r.replace(ge, "<$1></$2>");
									var c = (me.exec(r) || ["", ""])[1].toLowerCase(),
										p = Ve[c] || Ve._default,
										u = p[0],
										d = t.createElement("div");
									for (t === N ? Se.appendChild(d) : x(t).appendChild(d), d.innerHTML = p[1] + r + p[2]; u--;) d = d.lastChild;
									if (!L.support.tbody) {
										var v = be.test(r),
											_ = "table" !== c || v ? "<table>" !== p[1] || v ? [] : d.childNodes : d.firstChild && d.firstChild.childNodes;
										for (o = _.length - 1; o >= 0; --o) L.nodeName(_[o], "tbody") && !_[o].childNodes.length && _[o].parentNode.removeChild(_[o])
									}!L.support.leadingWhitespace && we.test(r) && d.insertBefore(t.createTextNode(we.exec(r)[0]), d.firstChild), r = d.childNodes
								} else r = t.createTextNode(r);
							var f;
							if (!L.support.appendChecked)
								if (r[0] && "number" == typeof(f = r.length))
									for (o = 0; f > o; o++) g(r[o]);
								else g(r);
							r.nodeType ? s.push(r) : s = L.merge(s, r)
						}
					if (n)
						for (i = function(e) {
								return !e.type || Te.test(e.type)
							}, l = 0; s[l]; l++)
							if (!a || !L.nodeName(s[l], "script") || s[l].type && "text/javascript" !== s[l].type.toLowerCase()) {
								if (1 === s[l].nodeType) {
									var h = L.grep(s[l].getElementsByTagName("script"), i);
									s.splice.apply(s, [l + 1, 0].concat(h))
								}
								n.appendChild(s[l])
							} else a.push(s[l].parentNode ? s[l].parentNode.removeChild(s[l]) : s[l]);
					return s
				},
				cleanData: function(e) {
					for (var t, n, a, i = L.cache, o = L.event.special, r = L.support.deleteExpando, s = 0; null != (a = e[s]); s++)
						if ((!a.nodeName || !L.noData[a.nodeName.toLowerCase()]) && (n = a[L.expando])) {
							if (t = i[n], t && t.events) {
								for (var l in t.events) o[l] ? L.event.remove(a, l) : L.removeEvent(a, l, t.handle);
								t.handle && (t.handle.elem = null)
							}
							r ? delete a[L.expando] : a.removeAttribute && a.removeAttribute(L.expando), delete i[n]
						}
				}
			});
			var We, De, Ee, Ne = /alpha\([^)]*\)/i,
				Pe = /opacity=([^)]*)/,
				$e = /([A-Z]|^ms)/g,
				Le = /^-?\d+(?:px)?$/i,
				Oe = /^-?\d/,
				Ue = /^([\-+])=([\-+.\de]+)/,
				ze = {
					position: "absolute",
					visibility: "hidden",
					display: "block"
				},
				Re = ["Left", "Right"],
				Me = ["Top", "Bottom"];
			L.fn.css = function(e, n) {
				return 2 === arguments.length && n === t ? this : L.access(this, e, n, !0, function(e, n, a) {
					return a !== t ? L.style(e, n, a) : L.css(e, n)
				})
			}, L.extend({
				cssHooks: {
					opacity: {
						get: function(e, t) {
							if (t) {
								var n = We(e, "opacity", "opacity");
								return "" === n ? "1" : n
							}
							return e.style.opacity
						}
					}
				},
				cssNumber: {
					fillOpacity: !0,
					fontWeight: !0,
					lineHeight: !0,
					opacity: !0,
					orphans: !0,
					widows: !0,
					zIndex: !0,
					zoom: !0
				},
				cssProps: {
					"float": L.support.cssFloat ? "cssFloat" : "styleFloat"
				},
				style: function(e, n, a, i) {
					if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) {
						var o, r, s = L.camelCase(n),
							l = e.style,
							c = L.cssHooks[s];
						if (n = L.cssProps[s] || s, a === t) return c && "get" in c && (o = c.get(e, !1, i)) !== t ? o : l[n];
						if (r = typeof a, "string" === r && (o = Ue.exec(a)) && (a = +(o[1] + 1) * +o[2] + parseFloat(L.css(e, n)), r = "number"), null == a || "number" === r && isNaN(a)) return;
						if ("number" === r && !L.cssNumber[s] && (a += "px"), !(c && "set" in c && (a = c.set(e, a)) === t)) try {
							l[n] = a
						} catch (p) {}
					}
				},
				css: function(e, n, a) {
					var i, o;
					return n = L.camelCase(n), o = L.cssHooks[n], n = L.cssProps[n] || n, "cssFloat" === n && (n = "float"), o && "get" in o && (i = o.get(e, !0, a)) !== t ? i : We ? We(e, n) : void 0
				},
				swap: function(e, t, n) {
					var a = {};
					for (var i in t) a[i] = e.style[i], e.style[i] = t[i];
					n.call(e);
					for (i in t) e.style[i] = a[i]
				}
			}), L.curCSS = L.css, L.each(["height", "width"], function(e, t) {
				L.cssHooks[t] = {
					get: function(e, n, a) {
						var i;
						return n ? 0 !== e.offsetWidth ? f(e, t, a) : (L.swap(e, ze, function() {
							i = f(e, t, a)
						}), i) : void 0
					},
					set: function(e, t) {
						return Le.test(t) ? (t = parseFloat(t), t >= 0 ? t + "px" : void 0) : t
					}
				}
			}), L.support.opacity || (L.cssHooks.opacity = {
				get: function(e, t) {
					return Pe.test((t && e.currentStyle ? e.currentStyle.filter : e.style.filter) || "") ? parseFloat(RegExp.$1) / 100 + "" : t ? "1" : ""
				},
				set: function(e, t) {
					var n = e.style,
						a = e.currentStyle,
						i = L.isNumeric(t) ? "alpha(opacity=" + 100 * t + ")" : "",
						o = a && a.filter || n.filter || "";
					n.zoom = 1, t >= 1 && "" === L.trim(o.replace(Ne, "")) && (n.removeAttribute("filter"), a && !a.filter) || (n.filter = Ne.test(o) ? o.replace(Ne, i) : o + " " + i)
				}
			}), L(function() {
				L.support.reliableMarginRight || (L.cssHooks.marginRight = {
					get: function(e, t) {
						var n;
						return L.swap(e, {
							display: "inline-block"
						}, function() {
							n = t ? We(e, "margin-right", "marginRight") : e.style.marginRight
						}), n
					}
				})
			}), N.defaultView && N.defaultView.getComputedStyle && (De = function(e, t) {
				var n, a, i;
				return t = t.replace($e, "-$1").toLowerCase(), (a = e.ownerDocument.defaultView) && (i = a.getComputedStyle(e, null)) && (n = i.getPropertyValue(t), "" === n && !L.contains(e.ownerDocument.documentElement, e) && (n = L.style(e, t))), n
			}), N.documentElement.currentStyle && (Ee = function(e, t) {
				var n, a, i, o = e.currentStyle && e.currentStyle[t],
					r = e.style;
				return null === o && r && (i = r[t]) && (o = i), !Le.test(o) && Oe.test(o) && (n = r.left, a = e.runtimeStyle && e.runtimeStyle.left, a && (e.runtimeStyle.left = e.currentStyle.left), r.left = "fontSize" === t ? "1em" : o || 0, o = r.pixelLeft + "px", r.left = n, a && (e.runtimeStyle.left = a)), "" === o ? "auto" : o
			}), We = De || Ee, L.expr && L.expr.filters && (L.expr.filters.hidden = function(e) {
				var t = e.offsetWidth,
					n = e.offsetHeight;
				return 0 === t && 0 === n || !L.support.reliableHiddenOffsets && "none" === (e.style && e.style.display || L.css(e, "display"))
			}, L.expr.filters.visible = function(e) {
				return !L.expr.filters.hidden(e)
			});
			var Be, Fe, He = /%20/g,
				je = /\[\]$/,
				Ge = /\r?\n/g,
				qe = /#.*$/,
				Xe = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm,
				Ye = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
				Ze = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
				Ke = /^(?:GET|HEAD)$/,
				Qe = /^\/\//,
				Je = /\?/,
				et = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
				tt = /^(?:select|textarea)/i,
				nt = /\s+/,
				at = /([?&])_=[^&]*/,
				it = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
				ot = L.fn.load,
				rt = {},
				st = {},
				lt = ["*/"] + ["*"];
			try {
				Be = $.href
			} catch (ct) {
				Be = N.createElement("a"), Be.href = "", Be = Be.href
			}
			Fe = it.exec(Be.toLowerCase()) || [], L.fn.extend({
				load: function(e, n, a) {
					if ("string" != typeof e && ot) return ot.apply(this, arguments);
					if (!this.length) return this;
					var i = e.indexOf(" ");
					if (i >= 0) {
						var o = e.slice(i, e.length);
						e = e.slice(0, i)
					}
					var r = "GET";
					n && (L.isFunction(n) ? (a = n, n = t) : "object" == typeof n && (n = L.param(n, L.ajaxSettings.traditional), r = "POST"));
					var s = this;
					return L.ajax({
						url: e,
						type: r,
						dataType: "html",
						data: n,
						complete: function(e, t, n) {
							n = e.responseText, e.isResolved() && (e.done(function(e) {
								n = e
							}), s.html(o ? L("<div>").append(n.replace(et, "")).find(o) : n)), a && s.each(a, [n, t, e])
						}
					}), this
				},
				serialize: function() {
					return L.param(this.serializeArray())
				},
				serializeArray: function() {
					return this.map(function() {
						return this.elements ? L.makeArray(this.elements) : this
					}).filter(function() {
						return this.name && !this.disabled && (this.checked || tt.test(this.nodeName) || Ye.test(this.type))
					}).map(function(e, t) {
						var n = L(this).val();
						return null == n ? null : L.isArray(n) ? L.map(n, function(e, n) {
							return {
								name: t.name,
								value: e.replace(Ge, "\r\n")
							}
						}) : {
							name: t.name,
							value: n.replace(Ge, "\r\n")
						}
					}).get()
				}
			}), L.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function(e, t) {
				L.fn[t] = function(e) {
					return this.on(t, e)
				}
			}), L.each(["get", "post"], function(e, n) {
				L[n] = function(e, a, i, o) {
					return L.isFunction(a) && (o = o || i, i = a, a = t), L.ajax({
						type: n,
						url: e,
						data: a,
						success: i,
						dataType: o
					})
				}
			}), L.extend({
				getScript: function(e, n) {
					return L.get(e, t, n, "script")
				},
				getJSON: function(e, t, n) {
					return L.get(e, t, n, "json")
				},
				ajaxSetup: function(e, t) {
					return t ? d(e, L.ajaxSettings) : (t = e, e = L.ajaxSettings), d(e, t), e
				},
				ajaxSettings: {
					url: Be,
					isLocal: Ze.test(Fe[1]),
					global: !0,
					type: "GET",
					contentType: "application/x-www-form-urlencoded",
					processData: !0,
					async: !0,
					accepts: {
						xml: "application/xml, text/xml",
						html: "text/html",
						text: "text/plain",
						json: "application/json, text/javascript",
						"*": lt
					},
					contents: {
						xml: /xml/,
						html: /html/,
						json: /json/
					},
					responseFields: {
						xml: "responseXML",
						text: "responseText"
					},
					converters: {
						"* text": e.String,
						"text html": !0,
						"text json": L.parseJSON,
						"text xml": L.parseXML
					},
					flatOptions: {
						context: !0,
						url: !0
					}
				},
				ajaxPrefilter: _(rt),
				ajaxTransport: _(st),
				ajax: function(e, n) {
					function a(e, n, a, r) {
						if (2 !== A) {
							A = 2, l && clearTimeout(l), s = t, o = r || "", x.readyState = e > 0 ? 4 : 0;
							var u, v, _, y, C, I = n,
								T = a ? p(f, x, a) : t;
							if (e >= 200 && 300 > e || 304 === e)
								if (f.ifModified && ((y = x.getResponseHeader("Last-Modified")) && (L.lastModified[i] = y), (C = x.getResponseHeader("Etag")) && (L.etag[i] = C)), 304 === e) I = "notmodified", u = !0;
								else try {
									v = c(f, T), I = "success", u = !0
								} catch (k) {
									I = "parsererror", _ = k
								} else _ = I, (!I || e) && (I = "error", 0 > e && (e = 0));
							x.status = e, x.statusText = "" + (n || I), u ? g.resolveWith(h, [v, I, x]) : g.rejectWith(h, [x, I, _]), x.statusCode(b), b = t, d && w.trigger("ajax" + (u ? "Success" : "Error"), [x, f, u ? v : _]), m.fireWith(h, [x, I]), d && (w.trigger("ajaxComplete", [x, f]), --L.active || L.event.trigger("ajaxStop"))
						}
					}
					"object" == typeof e && (n = e, e = t), n = n || {};
					var i, o, r, s, l, u, d, _, f = L.ajaxSetup({}, n),
						h = f.context || f,
						w = h !== f && (h.nodeType || h instanceof L) ? L(h) : L.event,
						g = L.Deferred(),
						m = L.Callbacks("once memory"),
						b = f.statusCode || {},
						y = {},
						C = {},
						A = 0,
						x = {
							readyState: 0,
							setRequestHeader: function(e, t) {
								if (!A) {
									var n = e.toLowerCase();
									e = C[n] = C[n] || e, y[e] = t
								}
								return this
							},
							getAllResponseHeaders: function() {
								return 2 === A ? o : null
							},
							getResponseHeader: function(e) {
								var n;
								if (2 === A) {
									if (!r)
										for (r = {}; n = Xe.exec(o);) r[n[1].toLowerCase()] = n[2];
									n = r[e.toLowerCase()]
								}
								return n === t ? null : n
							},
							overrideMimeType: function(e) {
								return A || (f.mimeType = e), this
							},
							abort: function(e) {
								return e = e || "abort", s && s.abort(e), a(0, e), this
							}
						};
					if (g.promise(x), x.success = x.done, x.error = x.fail, x.complete = m.add, x.statusCode = function(e) {
							if (e) {
								var t;
								if (2 > A)
									for (t in e) b[t] = [b[t], e[t]];
								else t = e[x.status], x.then(t, t)
							}
							return this
						}, f.url = ((e || f.url) + "").replace(qe, "").replace(Qe, Fe[1] + "//"), f.dataTypes = L.trim(f.dataType || "*").toLowerCase().split(nt), null == f.crossDomain && (u = it.exec(f.url.toLowerCase()), f.crossDomain = !(!u || u[1] == Fe[1] && u[2] == Fe[2] && (u[3] || ("http:" === u[1] ? 80 : 443)) == (Fe[3] || ("http:" === Fe[1] ? 80 : 443)))), f.data && f.processData && "string" != typeof f.data && (f.data = L.param(f.data, f.traditional)), v(rt, f, n, x), 2 === A) return !1;
					if (d = f.global, f.type = f.type.toUpperCase(), f.hasContent = !Ke.test(f.type), d && 0 === L.active++ && L.event.trigger("ajaxStart"), !f.hasContent && (f.data && (f.url += (Je.test(f.url) ? "&" : "?") + f.data, delete f.data), i = f.url, f.cache === !1)) {
						var I = L.now(),
							T = f.url.replace(at, "$1_=" + I);
						f.url = T + (T === f.url ? (Je.test(f.url) ? "&" : "?") + "_=" + I : "")
					}(f.data && f.hasContent && f.contentType !== !1 || n.contentType) && x.setRequestHeader("Content-Type", f.contentType), f.ifModified && (i = i || f.url, L.lastModified[i] && x.setRequestHeader("If-Modified-Since", L.lastModified[i]), L.etag[i] && x.setRequestHeader("If-None-Match", L.etag[i])), x.setRequestHeader("Accept", f.dataTypes[0] && f.accepts[f.dataTypes[0]] ? f.accepts[f.dataTypes[0]] + ("*" !== f.dataTypes[0] ? ", " + lt + "; q=0.01" : "") : f.accepts["*"]);
					for (_ in f.headers) x.setRequestHeader(_, f.headers[_]);
					if (f.beforeSend && (f.beforeSend.call(h, x, f) === !1 || 2 === A)) return x.abort(), !1;
					for (_ in {
							success: 1,
							error: 1,
							complete: 1
						}) x[_](f[_]);
					if (s = v(st, f, n, x)) {
						x.readyState = 1, d && w.trigger("ajaxSend", [x, f]), f.async && f.timeout > 0 && (l = setTimeout(function() {
							x.abort("timeout")
						}, f.timeout));
						try {
							A = 1, s.send(y, a)
						} catch (k) {
							if (!(2 > A)) throw k;
							a(-1, k)
						}
					} else a(-1, "No Transport");
					return x
				},
				param: function(e, n) {
					var a = [],
						i = function(e, t) {
							t = L.isFunction(t) ? t() : t, a[a.length] = encodeURIComponent(e) + "=" + encodeURIComponent(t)
						};
					if (n === t && (n = L.ajaxSettings.traditional), L.isArray(e) || e.jquery && !L.isPlainObject(e)) L.each(e, function() {
						i(this.name, this.value)
					});
					else
						for (var o in e) u(o, e[o], n, i);
					return a.join("&").replace(He, "+")
				}
			}), L.extend({
				active: 0,
				lastModified: {},
				etag: {}
			});
			var pt = L.now(),
				ut = /(\=)\?(&|$)|\?\?/i;
			L.ajaxSetup({
				jsonp: "callback",
				jsonpCallback: function() {
					return L.expando + "_" + pt++
				}
			}), L.ajaxPrefilter("json jsonp", function(t, n, a) {
				var i = "application/x-www-form-urlencoded" === t.contentType && "string" == typeof t.data;
				if ("jsonp" === t.dataTypes[0] || t.jsonp !== !1 && (ut.test(t.url) || i && ut.test(t.data))) {
					var o, r = t.jsonpCallback = L.isFunction(t.jsonpCallback) ? t.jsonpCallback() : t.jsonpCallback,
						s = e[r],
						l = t.url,
						c = t.data,
						p = "$1" + r + "$2";
					return t.jsonp !== !1 && (l = l.replace(ut, p), t.url === l && (i && (c = c.replace(ut, p)), t.data === c && (l += (/\?/.test(l) ? "&" : "?") + t.jsonp + "=" + r))), t.url = l, t.data = c, e[r] = function(e) {
						o = [e]
					}, a.always(function() {
						e[r] = s, o && L.isFunction(s) && e[r](o[0])
					}), t.converters["script json"] = function() {
						return o || L.error(r + " was not called"), o[0]
					}, t.dataTypes[0] = "json", "script"
				}
			}), L.ajaxSetup({
				accepts: {
					script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
				},
				contents: {
					script: /javascript|ecmascript/
				},
				converters: {
					"text script": function(e) {
						return L.globalEval(e), e
					}
				}
			}), L.ajaxPrefilter("script", function(e) {
				e.cache === t && (e.cache = !1), e.crossDomain && (e.type = "GET", e.global = !1)
			}), L.ajaxTransport("script", function(e) {
				if (e.crossDomain) {
					var n, a = N.head || N.getElementsByTagName("head")[0] || N.documentElement;
					return {
						send: function(i, o) {
							n = N.createElement("script"), n.async = "async", e.scriptCharset && (n.charset = e.scriptCharset), n.src = e.url, n.onload = n.onreadystatechange = function(e, i) {
								(i || !n.readyState || /loaded|complete/.test(n.readyState)) && (n.onload = n.onreadystatechange = null, a && n.parentNode && a.removeChild(n), n = t, i || o(200, "success"))
							}, a.insertBefore(n, a.firstChild)
						},
						abort: function() {
							n && n.onload(0, 1)
						}
					}
				}
			});
			var dt, vt = e.ActiveXObject ? function() {
					for (var e in dt) dt[e](0, 1)
				} : !1,
				_t = 0;
			L.ajaxSettings.xhr = e.ActiveXObject ? function() {
					return !this.isLocal && l() || s()
				} : l,
				function(e) {
					L.extend(L.support, {
						ajax: !!e,
						cors: !!e && "withCredentials" in e
					})
				}(L.ajaxSettings.xhr()), L.support.ajax && L.ajaxTransport(function(n) {
					if (!n.crossDomain || L.support.cors) {
						var a;
						return {
							send: function(i, o) {
								var r, s, l = n.xhr();
								if (n.username ? l.open(n.type, n.url, n.async, n.username, n.password) : l.open(n.type, n.url, n.async), n.xhrFields)
									for (s in n.xhrFields) l[s] = n.xhrFields[s];
								n.mimeType && l.overrideMimeType && l.overrideMimeType(n.mimeType), !n.crossDomain && !i["X-Requested-With"] && (i["X-Requested-With"] = "XMLHttpRequest");
								try {
									for (s in i) l.setRequestHeader(s, i[s])
								} catch (c) {}
								l.send(n.hasContent && n.data || null), a = function(e, i) {
									var s, c, p, u, d;
									try {
										if (a && (i || 4 === l.readyState))
											if (a = t, r && (l.onreadystatechange = L.noop, vt && delete dt[r]), i) 4 !== l.readyState && l.abort();
											else {
												s = l.status, p = l.getAllResponseHeaders(), u = {}, d = l.responseXML, d && d.documentElement && (u.xml = d), u.text = l.responseText;
												try {
													c = l.statusText
												} catch (v) {
													c = ""
												}
												s || !n.isLocal || n.crossDomain ? 1223 === s && (s = 204) : s = u.text ? 200 : 404
											}
									} catch (_) {
										i || o(-1, _)
									}
									u && o(s, c, u, p)
								}, n.async && 4 !== l.readyState ? (r = ++_t, vt && (dt || (dt = {}, L(e).unload(vt)), dt[r] = a), l.onreadystatechange = a) : a()
							},
							abort: function() {
								a && a(0, 1)
							}
						}
					}
				});
			var ft, ht, wt, gt, mt = {},
				bt = /^(?:toggle|show|hide)$/,
				yt = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
				Ct = [
					["height", "marginTop", "marginBottom", "paddingTop", "paddingBottom"],
					["width", "marginLeft", "marginRight", "paddingLeft", "paddingRight"],
					["opacity"]
				];
			L.fn.extend({
				show: function(e, t, n) {
					var o, r;
					if (e || 0 === e) return this.animate(i("show", 3), e, t, n);
					for (var s = 0, l = this.length; l > s; s++) o = this[s], o.style && (r = o.style.display, !L._data(o, "olddisplay") && "none" === r && (r = o.style.display = ""), "" === r && "none" === L.css(o, "display") && L._data(o, "olddisplay", a(o.nodeName)));
					for (s = 0; l > s; s++) o = this[s], o.style && (r = o.style.display, ("" === r || "none" === r) && (o.style.display = L._data(o, "olddisplay") || ""));
					return this
				},
				hide: function(e, t, n) {
					if (e || 0 === e) return this.animate(i("hide", 3), e, t, n);
					for (var a, o, r = 0, s = this.length; s > r; r++) a = this[r], a.style && (o = L.css(a, "display"), "none" !== o && !L._data(a, "olddisplay") && L._data(a, "olddisplay", o));
					for (r = 0; s > r; r++) this[r].style && (this[r].style.display = "none");
					return this
				},
				_toggle: L.fn.toggle,
				toggle: function(e, t, n) {
					var a = "boolean" == typeof e;
					return L.isFunction(e) && L.isFunction(t) ? this._toggle.apply(this, arguments) : null == e || a ? this.each(function() {
						var t = a ? e : L(this).is(":hidden");
						L(this)[t ? "show" : "hide"]()
					}) : this.animate(i("toggle", 3), e, t, n), this
				},
				fadeTo: function(e, t, n, a) {
					return this.filter(":hidden").css("opacity", 0).show().end().animate({
						opacity: t
					}, e, n, a)
				},
				animate: function(e, t, n, i) {
					function o() {
						r.queue === !1 && L._mark(this);
						var t, n, i, o, s, l, c, p, u, d = L.extend({}, r),
							v = 1 === this.nodeType,
							_ = v && L(this).is(":hidden");
						d.animatedProperties = {};
						for (i in e) {
							if (t = L.camelCase(i), i !== t && (e[t] = e[i], delete e[i]), n = e[t], L.isArray(n) ? (d.animatedProperties[t] = n[1], n = e[t] = n[0]) : d.animatedProperties[t] = d.specialEasing && d.specialEasing[t] || d.easing || "swing", "hide" === n && _ || "show" === n && !_) return d.complete.call(this);
							v && ("height" === t || "width" === t) && (d.overflow = [this.style.overflow, this.style.overflowX, this.style.overflowY], "inline" === L.css(this, "display") && "none" === L.css(this, "float") && (L.support.inlineBlockNeedsLayout && "inline" !== a(this.nodeName) ? this.style.zoom = 1 : this.style.display = "inline-block"))
						}
						null != d.overflow && (this.style.overflow = "hidden");
						for (i in e) o = new L.fx(this, d, i), n = e[i], bt.test(n) ? (u = L._data(this, "toggle" + i) || ("toggle" === n ? _ ? "show" : "hide" : 0), u ? (L._data(this, "toggle" + i, "show" === u ? "hide" : "show"), o[u]()) : o[n]()) : (s = yt.exec(n), l = o.cur(), s ? (c = parseFloat(s[2]), p = s[3] || (L.cssNumber[i] ? "" : "px"), "px" !== p && (L.style(this, i, (c || 1) + p), l = (c || 1) / o.cur() * l, L.style(this, i, l + p)), s[1] && (c = ("-=" === s[1] ? -1 : 1) * c + l), o.custom(l, c, p)) : o.custom(l, n, ""));
						return !0
					}
					var r = L.speed(t, n, i);
					return L.isEmptyObject(e) ? this.each(r.complete, [!1]) : (e = L.extend({}, e), r.queue === !1 ? this.each(o) : this.queue(r.queue, o))
				},
				stop: function(e, n, a) {
					return "string" != typeof e && (a = n, n = e, e = t), n && e !== !1 && this.queue(e || "fx", []), this.each(function() {
						function t(e, t, n) {
							var i = t[n];
							L.removeData(e, n, !0), i.stop(a)
						}
						var n, i = !1,
							o = L.timers,
							r = L._data(this);
						if (a || L._unmark(!0, this), null == e)
							for (n in r) r[n] && r[n].stop && n.indexOf(".run") === n.length - 4 && t(this, r, n);
						else r[n = e + ".run"] && r[n].stop && t(this, r, n);
						for (n = o.length; n--;) o[n].elem === this && (null == e || o[n].queue === e) && (a ? o[n](!0) : o[n].saveState(), i = !0, o.splice(n, 1));
						(!a || !i) && L.dequeue(this, e)
					})
				}
			}), L.each({
				slideDown: i("show", 1),
				slideUp: i("hide", 1),
				slideToggle: i("toggle", 1),
				fadeIn: {
					opacity: "show"
				},
				fadeOut: {
					opacity: "hide"
				},
				fadeToggle: {
					opacity: "toggle"
				}
			}, function(e, t) {
				L.fn[e] = function(e, n, a) {
					return this.animate(t, e, n, a)
				}
			}), L.extend({
				speed: function(e, t, n) {
					var a = e && "object" == typeof e ? L.extend({}, e) : {
						complete: n || !n && t || L.isFunction(e) && e,
						duration: e,
						easing: n && t || t && !L.isFunction(t) && t
					};
					return a.duration = L.fx.off ? 0 : "number" == typeof a.duration ? a.duration : a.duration in L.fx.speeds ? L.fx.speeds[a.duration] : L.fx.speeds._default, (null == a.queue || a.queue === !0) && (a.queue = "fx"), a.old = a.complete, a.complete = function(e) {
						L.isFunction(a.old) && a.old.call(this), a.queue ? L.dequeue(this, a.queue) : e !== !1 && L._unmark(this)
					}, a
				},
				easing: {
					linear: function(e, t, n, a) {
						return n + a * e
					},
					swing: function(e, t, n, a) {
						return (-Math.cos(e * Math.PI) / 2 + .5) * a + n
					}
				},
				timers: [],
				fx: function(e, t, n) {
					this.options = t, this.elem = e, this.prop = n, t.orig = t.orig || {}
				}
			}), L.fx.prototype = {
				update: function() {
					this.options.step && this.options.step.call(this.elem, this.now, this), (L.fx.step[this.prop] || L.fx.step._default)(this)
				},
				cur: function() {
					if (null != this.elem[this.prop] && (!this.elem.style || null == this.elem.style[this.prop])) return this.elem[this.prop];
					var e, t = L.css(this.elem, this.prop);
					return isNaN(e = parseFloat(t)) ? t && "auto" !== t ? t : 0 : e
				},
				custom: function(e, n, a) {
					function i(e) {
						return o.step(e)
					}
					var o = this,
						s = L.fx;
					this.startTime = gt || r(), this.end = n, this.now = this.start = e, this.pos = this.state = 0, this.unit = a || this.unit || (L.cssNumber[this.prop] ? "" : "px"), i.queue = this.options.queue, i.elem = this.elem, i.saveState = function() {
						o.options.hide && L._data(o.elem, "fxshow" + o.prop) === t && L._data(o.elem, "fxshow" + o.prop, o.start)
					}, i() && L.timers.push(i) && !wt && (wt = setInterval(s.tick, s.interval))
				},
				show: function() {
					var e = L._data(this.elem, "fxshow" + this.prop);
					this.options.orig[this.prop] = e || L.style(this.elem, this.prop), this.options.show = !0, e !== t ? this.custom(this.cur(), e) : this.custom("width" === this.prop || "height" === this.prop ? 1 : 0, this.cur()), L(this.elem).show()
				},
				hide: function() {
					this.options.orig[this.prop] = L._data(this.elem, "fxshow" + this.prop) || L.style(this.elem, this.prop), this.options.hide = !0, this.custom(this.cur(), 0)
				},
				step: function(e) {
					var t, n, a, i = gt || r(),
						o = !0,
						s = this.elem,
						l = this.options;
					if (e || i >= l.duration + this.startTime) {
						this.now = this.end, this.pos = this.state = 1, this.update(), l.animatedProperties[this.prop] = !0;
						for (t in l.animatedProperties) l.animatedProperties[t] !== !0 && (o = !1);
						if (o) {
							if (null != l.overflow && !L.support.shrinkWrapBlocks && L.each(["", "X", "Y"], function(e, t) {
									s.style["overflow" + t] = l.overflow[e]
								}), l.hide && L(s).hide(), l.hide || l.show)
								for (t in l.animatedProperties) L.style(s, t, l.orig[t]), L.removeData(s, "fxshow" + t, !0), L.removeData(s, "toggle" + t, !0);
							a = l.complete, a && (l.complete = !1, a.call(s))
						}
						return !1
					}
					return l.duration == 1 / 0 ? this.now = i : (n = i - this.startTime, this.state = n / l.duration, this.pos = L.easing[l.animatedProperties[this.prop]](this.state, n, 0, 1, l.duration), this.now = this.start + (this.end - this.start) * this.pos), this.update(), !0
				}
			}, L.extend(L.fx, {
				tick: function() {
					for (var e, t = L.timers, n = 0; n < t.length; n++) e = t[n], !e() && t[n] === e && t.splice(n--, 1);
					t.length || L.fx.stop()
				},
				interval: 13,
				stop: function() {
					clearInterval(wt), wt = null
				},
				speeds: {
					slow: 600,
					fast: 200,
					_default: 400
				},
				step: {
					opacity: function(e) {
						L.style(e.elem, "opacity", e.now)
					},
					_default: function(e) {
						e.elem.style && null != e.elem.style[e.prop] ? e.elem.style[e.prop] = e.now + e.unit : e.elem[e.prop] = e.now
					}
				}
			}), L.each(["width", "height"], function(e, t) {
				L.fx.step[t] = function(e) {
					L.style(e.elem, t, Math.max(0, e.now) + e.unit)
				}
			}), L.expr && L.expr.filters && (L.expr.filters.animated = function(e) {
				return L.grep(L.timers, function(t) {
					return e === t.elem
				}).length
			});
			var At = /^t(?:able|d|h)$/i,
				xt = /^(?:body|html)$/i;
			L.fn.offset = "getBoundingClientRect" in N.documentElement ? function(e) {
				var t, a = this[0];
				if (e) return this.each(function(t) {
					L.offset.setOffset(this, e, t)
				});
				if (!a || !a.ownerDocument) return null;
				if (a === a.ownerDocument.body) return L.offset.bodyOffset(a);
				try {
					t = a.getBoundingClientRect()
				} catch (i) {}
				var o = a.ownerDocument,
					r = o.documentElement;
				if (!t || !L.contains(r, a)) return t ? {
					top: t.top,
					left: t.left
				} : {
					top: 0,
					left: 0
				};
				var s = o.body,
					l = n(o),
					c = r.clientTop || s.clientTop || 0,
					p = r.clientLeft || s.clientLeft || 0,
					u = l.pageYOffset || L.support.boxModel && r.scrollTop || s.scrollTop,
					d = l.pageXOffset || L.support.boxModel && r.scrollLeft || s.scrollLeft,
					v = t.top + u - c,
					_ = t.left + d - p;
				return {
					top: v,
					left: _
				}
			} : function(e) {
				var t = this[0];
				if (e) return this.each(function(t) {
					L.offset.setOffset(this, e, t)
				});
				if (!t || !t.ownerDocument) return null;
				if (t === t.ownerDocument.body) return L.offset.bodyOffset(t);
				for (var n, a = t.offsetParent, i = t, o = t.ownerDocument, r = o.documentElement, s = o.body, l = o.defaultView, c = l ? l.getComputedStyle(t, null) : t.currentStyle, p = t.offsetTop, u = t.offsetLeft;
					(t = t.parentNode) && t !== s && t !== r && (!L.support.fixedPosition || "fixed" !== c.position);) n = l ? l.getComputedStyle(t, null) : t.currentStyle, p -= t.scrollTop, u -= t.scrollLeft, t === a && (p += t.offsetTop, u += t.offsetLeft, L.support.doesNotAddBorder && (!L.support.doesAddBorderForTableAndCells || !At.test(t.nodeName)) && (p += parseFloat(n.borderTopWidth) || 0, u += parseFloat(n.borderLeftWidth) || 0), i = a, a = t.offsetParent), L.support.subtractsBorderForOverflowNotVisible && "visible" !== n.overflow && (p += parseFloat(n.borderTopWidth) || 0, u += parseFloat(n.borderLeftWidth) || 0), c = n;
				return ("relative" === c.position || "static" === c.position) && (p += s.offsetTop, u += s.offsetLeft), L.support.fixedPosition && "fixed" === c.position && (p += Math.max(r.scrollTop, s.scrollTop), u += Math.max(r.scrollLeft, s.scrollLeft)), {
					top: p,
					left: u
				}
			}, L.offset = {
				bodyOffset: function(e) {
					var t = e.offsetTop,
						n = e.offsetLeft;
					return L.support.doesNotIncludeMarginInBodyOffset && (t += parseFloat(L.css(e, "marginTop")) || 0, n += parseFloat(L.css(e, "marginLeft")) || 0), {
						top: t,
						left: n
					}
				},
				setOffset: function(e, t, n) {
					var a = L.css(e, "position");
					"static" === a && (e.style.position = "relative");
					var i, o, r = L(e),
						s = r.offset(),
						l = L.css(e, "top"),
						c = L.css(e, "left"),
						p = ("absolute" === a || "fixed" === a) && L.inArray("auto", [l, c]) > -1,
						u = {},
						d = {};
					p ? (d = r.position(), i = d.top, o = d.left) : (i = parseFloat(l) || 0, o = parseFloat(c) || 0), L.isFunction(t) && (t = t.call(e, n, s)), null != t.top && (u.top = t.top - s.top + i), null != t.left && (u.left = t.left - s.left + o), "using" in t ? t.using.call(e, u) : r.css(u)
				}
			}, L.fn.extend({
				position: function() {
					if (!this[0]) return null;
					var e = this[0],
						t = this.offsetParent(),
						n = this.offset(),
						a = xt.test(t[0].nodeName) ? {
							top: 0,
							left: 0
						} : t.offset();
					return n.top -= parseFloat(L.css(e, "marginTop")) || 0, n.left -= parseFloat(L.css(e, "marginLeft")) || 0, a.top += parseFloat(L.css(t[0], "borderTopWidth")) || 0, a.left += parseFloat(L.css(t[0], "borderLeftWidth")) || 0, {
						top: n.top - a.top,
						left: n.left - a.left
					}
				},
				offsetParent: function() {
					return this.map(function() {
						for (var e = this.offsetParent || N.body; e && !xt.test(e.nodeName) && "static" === L.css(e, "position");) e = e.offsetParent;
						return e
					})
				}
			}), L.each(["Left", "Top"], function(e, a) {
				var i = "scroll" + a;
				L.fn[i] = function(a) {
					var o, r;
					return a === t ? (o = this[0]) ? (r = n(o), r ? "pageXOffset" in r ? r[e ? "pageYOffset" : "pageXOffset"] : L.support.boxModel && r.document.documentElement[i] || r.document.body[i] : o[i]) : null : this.each(function() {
						r = n(this), r ? r.scrollTo(e ? L(r).scrollLeft() : a, e ? a : L(r).scrollTop()) : this[i] = a
					})
				}
			}), L.each(["Height", "Width"], function(e, n) {
				var a = n.toLowerCase();
				L.fn["inner" + n] = function() {
					var e = this[0];
					return e ? e.style ? parseFloat(L.css(e, a, "padding")) : this[a]() : null
				}, L.fn["outer" + n] = function(e) {
					var t = this[0];
					return t ? t.style ? parseFloat(L.css(t, a, e ? "margin" : "border")) : this[a]() : null
				}, L.fn[a] = function(e) {
					var i = this[0];
					if (!i) return null == e ? null : this;
					if (L.isFunction(e)) return this.each(function(t) {
						var n = L(this);
						n[a](e.call(this, t, n[a]()))
					});
					if (L.isWindow(i)) {
						var o = i.document.documentElement["client" + n],
							r = i.document.body;
						return "CSS1Compat" === i.document.compatMode && o || r && r["client" + n] || o
					}
					if (9 === i.nodeType) return Math.max(i.documentElement["client" + n], i.body["scroll" + n], i.documentElement["scroll" + n], i.body["offset" + n], i.documentElement["offset" + n]);
					if (e === t) {
						var s = L.css(i, a),
							l = parseFloat(s);
						return L.isNumeric(l) ? l : s
					}
					return this.css(a, "string" == typeof e ? e : e + "px")
				}
			}), e.avpw_jQuery = e.avpw$ = L, "function" == typeof define && define.amd && define.amd.jQuery && define("jquery", [], function() {
				return L
			})
		}(window),
		function(e) {
			e.miniColors = function(t) {
				var n = this,
					a = function(t) {
						var n = e('<div style="display: none;" class="miniColors-selector"></div>');
						return n.append('<div class="miniColors-colors" style="background-color: #FFF;"><div class="miniColors-colorPicker"><div class="miniColors-colorPicker-inner"></div></div></div>').append('<div class="miniColors-hues"><div class="miniColors-huePicker"></div></div>'), n.find(".miniColors-colors").css("backgroundColor", "#" + _({
							h: t.h,
							s: 100,
							b: 100
						})), l(n, t), n.bind("selectstart", function() {
							return !1
						}), n.data("hsb", t), n
					},
					i = function(t) {
						var n, a = !1;
						e(document).bind("mousedown.miniColors touchstart.miniColors", function(i) {
							a = !0;
							var o = e(i.target).parents().andSelf();
							return o.hasClass("miniColors-colors") && (i.preventDefault(), n = "colors", r(t, i)), o.hasClass("miniColors-hues") && (i.preventDefault(), n = "hues", s(t, i)), o.hasClass("miniColors-selector") ? void i.preventDefault() : void(o.hasClass("miniColors") || t.trigger("clickOutsideBounds"))
						}), e(document).bind("mouseup.miniColors touchend.miniColors", function(e) {
							e.preventDefault(), a = !1, n = void 0
						}).bind("mousemove.miniColors touchmove.miniColors", function(e) {
							e.preventDefault(), a && ("colors" === n && r(t, e), "hues" === n && s(t, e))
						})
					},
					o = function() {
						e(document).unbind(".miniColors")
					},
					r = function(e, t) {
						var n = {
								x: t.pageX,
								y: t.pageY
							},
							a = e.find(".miniColors-colors").offset();
						t.originalEvent.changedTouches && (n.x = t.originalEvent.changedTouches[0].pageX, n.y = t.originalEvent.changedTouches[0].pageY), n.x = n.x - a.left - 5, n.y = n.y - a.top - 5, n.x <= -5 && (n.x = -5), n.x >= 144 && (n.x = 144), n.y <= -5 && (n.y = -5), n.y >= 144 && (n.y = 144);
						var i = Math.round(.67 * (n.x + 5));
						0 > i && (i = 0), i > 100 && (i = 100);
						var o = 100 - Math.round(.67 * (n.y + 5));
						0 > o && (o = 0), o > 100 && (o = 100);
						var r = e.data("hsb");
						r.s = i, r.b = o, c(e, r, !0)
					},
					s = function(e, t) {
						var n = {
								y: t.pageY
							},
							a = e.find(".miniColors-colors").offset();
						t.originalEvent.changedTouches && (n.y = t.originalEvent.changedTouches[0].pageY), n.y = n.y - a.top - 1, n.y <= -1 && (n.y = -1), n.y >= 149 && (n.y = 149);
						var i = Math.round(2.4 * (150 - n.y - 1));
						0 > i && (i = 0), i > 360 && (i = 360);
						var o = e.data("hsb");
						o.h = i, c(e, o, !0)
					},
					l = function(e, t) {
						var n = p(t),
							a = e.find(".miniColors-colorPicker");
						a.css("top", n.y + "px").css("left", n.x + "px").show();
						var i = u(t),
							o = e.find(".miniColors-huePicker");
						o.css("top", i.y + "px").show()
					},
					c = function(e, t, n) {
						l(e, t), e.data("hsb", t);
						var a = _(t);
						n && e.trigger("updateInput", {
							hex: a
						}), e.find(".miniColors-colors").css("backgroundColor", "#" + _({
							h: t.h,
							s: 100,
							b: 100
						})), e.trigger("setColor", {
							hex: a
						})
					},
					p = function(e) {
						var t = Math.ceil(e.s / .67);
						0 > t && (t = 0), t > 150 && (t = 150);
						var n = 150 - Math.ceil(e.b / .67);
						return 0 > n && (n = 0), n > 150 && (n = 150), {
							x: t - 5,
							y: n - 5
						}
					},
					u = function(e) {
						var t = 150 - e.h / 2.4;
						return 0 > t && (h = 0), t > 150 && (h = 150), {
							y: t - 1
						}
					},
					d = function(e) {
						var t = {},
							n = Math.round(e.h),
							a = Math.round(255 * e.s / 100),
							i = Math.round(255 * e.b / 100);
						if (0 === a) t.r = t.g = t.b = i;
						else {
							var o = i,
								r = (255 - a) * i / 255,
								s = (o - r) * (n % 60) / 60;
							360 === n && (n = 0), 60 > n ? (t.r = o, t.b = r, t.g = r + s) : 120 > n ? (t.g = o, t.b = r, t.r = o - s) : 180 > n ? (t.g = o, t.r = r, t.b = r + s) : 240 > n ? (t.b = o, t.r = r, t.g = o - s) : 300 > n ? (t.b = o,
								t.g = r, t.r = r + s) : 360 > n ? (t.r = o, t.g = r, t.b = o - s) : (t.r = 0, t.g = 0, t.b = 0)
						}
						return {
							r: Math.round(t.r),
							g: Math.round(t.g),
							b: Math.round(t.b)
						}
					},
					v = function(e) {
						var t, n, a = [e.r.toString(16), e.g.toString(16), e.b.toString(16)],
							i = a.length;
						for (t = 0; i > t; t++) n = a[t], 1 === n.length && (a[t] = "0" + n);
						return a.join("")
					},
					_ = function(e) {
						return v(d(e))
					};
				return n.setSelectorColor = c, n.buildSelector = a, n.bindSelectorEvents = i, n.unBindSelectorEvents = o, n.forceClose = function() {
					selector && selector.trigger("clickOutsideBounds")
				}, n
			}
		}(avpw_jQuery), ! function(e, t, n) {
			function a(e, n) {
				var a, i = t.createElement(e || "div");
				for (a in n) i[a] = n[a];
				return i
			}

			function i(e) {
				for (var t = 1, n = arguments.length; n > t; t++) e.appendChild(arguments[t]);
				return e
			}

			function o(e, t, n, a) {
				var i = ["opacity", t, ~~(100 * e), n, a].join("-"),
					o = .01 + n / a * 100,
					r = Math.max(1 - (1 - e) / t * (100 - o), e),
					s = u.substring(0, u.indexOf("Animation")).toLowerCase(),
					l = s && "-" + s + "-" || "";
				return v[i] || (_.insertRule("@" + l + "keyframes " + i + "{0%{opacity:" + r + "}" + o + "%{opacity:" + e + "}" + (o + .01) + "%{opacity:1}" + (o + t) % 100 + "%{opacity:" + e + "}100%{opacity:" + r + "}}", _.cssRules.length), v[i] = 1), i
			}

			function r(e, t) {
				var a, i, o = e.style;
				if (o[t] !== n) return t;
				for (t = t.charAt(0).toUpperCase() + t.slice(1), i = 0; i < d.length; i++)
					if (a = d[i] + t, o[a] !== n) return a
			}

			function s(e, t) {
				for (var n in t) e.style[r(e, n) || n] = t[n];
				return e
			}

			function l(e) {
				for (var t = 1; t < arguments.length; t++) {
					var a = arguments[t];
					for (var i in a) e[i] === n && (e[i] = a[i])
				}
				return e
			}

			function c(e) {
				for (var t = {
						x: e.offsetLeft,
						y: e.offsetTop
					}; e = e.offsetParent;) t.x += e.offsetLeft, t.y += e.offsetTop;
				return t
			}

			function p(e) {
				return this.spin ? void(this.opts = l(e || {}, p.defaults, f)) : new p(e)
			}
			var u, d = ["webkit", "Moz", "ms", "O"],
				v = {},
				_ = function() {
					var e = a("style", {
						type: "text/css"
					});
					return i(t.getElementsByTagName("head")[0], e), e.sheet || e.styleSheet
				}(),
				f = {
					lines: 12,
					length: 7,
					width: 5,
					radius: 10,
					rotate: 0,
					corners: 1,
					color: "#000",
					speed: 1,
					trail: 100,
					opacity: .25,
					fps: 20,
					zIndex: 2e9,
					className: "spinner",
					top: "auto",
					left: "auto",
					position: "relative"
				};
			p.defaults = {}, l(p.prototype, {
					spin: function(e) {
						this.stop(); {
							var t, n, i = this,
								o = i.opts,
								r = i.el = s(a(0, {
									className: o.className
								}), {
									width: 0,
									zIndex: o.zIndex
								});
							o.radius + o.length + o.width
						}
						if (e && (e.insertBefore(r, e.firstChild || null), n = c(e), t = c(r)), r.setAttribute("aria-role", "progressbar"), i.lines(r, i.opts), !u) {
							var l = 0,
								p = o.fps,
								d = p / o.speed,
								v = (1 - o.opacity) / (d * o.trail / 100),
								_ = d / o.lines;
							! function f() {
								l++;
								for (var e = o.lines; e; e--) {
									var t = Math.max(1 - (l + e * _) % d * v, o.opacity);
									i.opacity(r, o.lines - e, t, o)
								}
								i.timeout = i.el && setTimeout(f, ~~(1e3 / p))
							}()
						}
						return i
					},
					stop: function() {
						var e = this.el;
						return e && (clearTimeout(this.timeout), e.parentNode && e.parentNode.removeChild(e), this.el = n), this
					},
					lines: function(e, t) {
						function n(e, n) {
							return s(a(), {
								position: "absolute",
								width: t.length + t.width + "px",
								height: t.width + "px",
								background: e,
								boxShadow: n,
								transformOrigin: "left",
								transform: "rotate(" + ~~(360 / t.lines * l + t.rotate) + "deg) translate(" + t.radius + "px,0)",
								borderRadius: (t.corners * t.width >> 1) + "px"
							})
						}
						for (var r, l = 0; l < t.lines; l++) r = s(a(), {
							position: "absolute",
							top: 1 + ~(t.width / 2) + "px",
							transform: t.hwaccel ? "translate3d(0,0,0)" : "",
							opacity: t.opacity,
							animation: u && o(t.opacity, t.trail, l, t.lines) + " " + 1 / t.speed + "s linear infinite"
						}), t.shadow && i(r, s(n("#000", "0 0 4px #000"), {
							top: "2px"
						})), i(e, i(r, n(t.color, "0 0 1px rgba(0,0,0,.1)")));
						return e
					},
					opacity: function(e, t, n) {
						t < e.childNodes.length && (e.childNodes[t].style.opacity = n)
					}
				}),
				function() {
					function e(e, t) {
						return a("<" + e + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', t)
					}
					var t = s(a("group"), {
						behavior: "url(#default#VML)"
					});
					!r(t, "transform") && t.adj ? (_.addRule(".spin-vml", "behavior:url(#default#VML)"), p.prototype.lines = function(t, n) {
						function a() {
							return s(e("group", {
								coordsize: c + " " + c,
								coordorigin: -l + " " + -l
							}), {
								width: c,
								height: c
							})
						}

						function o(t, o, r) {
							i(u, i(s(a(), {
								rotation: 360 / n.lines * t + "deg",
								left: ~~o
							}), i(s(e("roundrect", {
								arcsize: n.corners
							}), {
								width: l,
								height: n.width,
								left: n.radius,
								top: -n.width >> 1,
								filter: r
							}), e("fill", {
								color: n.color,
								opacity: n.opacity
							}), e("stroke", {
								opacity: 0
							}))))
						}
						var r, l = n.length + n.width,
							c = 2 * l,
							p = 2 * -(n.width + n.length) + "px",
							u = s(a(), {
								position: "absolute",
								top: p,
								left: p
							});
						if (n.shadow)
							for (r = 1; r <= n.lines; r++) o(r, -2, "progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");
						for (r = 1; r <= n.lines; r++) o(r);
						return i(t, u)
					}, p.prototype.opacity = function(e, t, n, a) {
						var i = e.firstChild;
						a = a.shadow && a.lines || 0, i && t + a < i.childNodes.length && (i = i.childNodes[t + a], i = i && i.firstChild, i = i && i.firstChild, i && (i.opacity = n))
					}) : u = r(t, "animation")
				}(), AV.Spinner = p
		}(window, document), "undefined" == typeof AV && (AV = {}),
		function(e) {
			var t = e.desktop = {};
			t.saveBlock = function() {
				return ['<div class="avpw_mode_action avpw_mode_action_right">', '<a id="avpw_save_button" href="javascript:void(0)" class="avpw_button avpw_primary_button">' + AV.getLocalizedString("Save") + "</a>", "</div>"].join("")
			}, t.closeButton = function(e) {
				return ["<div " + (e.id ? 'id="' + e.id + '" ' : "") + 'title="' + e.text + '">', "<div " + (e.id ? 'id="' + e.id + '_inner" ' : "") + 'class="avpw_close_button ' + (e.className || "") + '">', '<div class="avpw_close_inner">', "&times;", "</div>", "</div>", "</div>"].join("")
			}, t.cancelButton = function(e) {
				return ['<a href="javascript:void(0)" id="' + e.id + '" class="avpw_button avpw_back_button">', AV.getLocalizedString(e.label), "</a>"].join("")
			}, t.inAppPurchaseFrame = function(e) {
				return ['<iframe width="100%" height="170" class="avpw_popup_frame" id="avpw_purchase_frame" name="avpw_purchase_frame" src="' + e.src + '" style="display: none;"></iframe>'].join("")
			}, t.contentPagerInner = function(e) {
				return ['<div class="avpw_content_packs avpw_tool_scroll">', '<a class="avpw_prev avpw_bookend">', '<span class="avpw_arrow_icon"></span>', "</a>", '<div class="avpw_clip">', '<div class="avpw_scroll_strip">', "</div>", '<div class="avpw_shadowbar avpw_shadowbar_n"></div>', "</div>", '<a class="avpw_next avpw_bookend">', '<span class="avpw_arrow_icon"></span>', "</a>", "</div>", '<div class="avpw_content_items avpw_tool_scroll">', '<div class="avpw_back_to_packs"></div>', '<a class="avpw_prev avpw_bookend">', '<span class="avpw_arrow_icon"></span>', "</a>", '<div class="avpw_clip">', '<div class="avpw_scroll_strip">', "</div>", '<div class="avpw_shadowbar avpw_shadowbar_n"></div>', "</div>", '<a class="avpw_next avpw_bookend">', '<span class="avpw_arrow_icon"></span>', "</a>", "</div>"].join("")
			}, t.controls = function(e) {
				return ['<div id="avpw_fullscreen_bg" style="display: none;"></div>', '<div style="display:none;" id="avpw_controls" class="avpw avpw_main_mode">', "", '<div id="avpw_tool_content_header">', '<span id="avpw_breadcrumb_header" class="avpw_label">', AV.getLocalizedString("Photo Editor"), "</span>", '<span class="avpw_label" id="avpw_breadcrumb_sep" style="display: none;"> : </span>', '<span class="avpw_label" id="avpw_breadcrumb_toolname"></span>', t.closeButton({
					id: "avpw_control_cancel_pane",
					text: AV.getLocalizedString("Cancel"),
					className: "avpw_main_close"
				}), "</div>", "", '<div id="avpw_tool_content_wrapper">', "", '<div id="avpw_tool_main_container" class="avpw_tool_pager">', "", '<a id="avpw_lftArrow" class="avpw_prev avpw_bookend">', '<span class="avpw_arrow_icon"></span>', "</a>", '<div id="avpw_control_main_scroll_panel" class="avpw_clip">', '<div id="avpw_control_main_scrolling_region" class="avpw_scroll_strip">', "</div>", '<div id="avpw_tools_pager">', "<ul>", "</ul>", "</div>", "</div>", "", "", '<a id="avpw_rghtArrow" class="avpw_next avpw_bookend">', '<span class="avpw_arrow_icon"></span>', "</a>", "", e.internalSaveBlock, "", "</div>", "", '<div id="avpw_tool_options_container" style="display:none;">', '<div id="avpw_tool_container">', '<div id="avpw_controlpanel_vignette" class="avpw_controlpanel avpw_tool_fixed avpw_tool_slider">', t.slider({
					id: "avpw_vignette_slider",
					divider: !0
				}), "</div>", '<div id="avpw_controlpanel_lighting" class="avpw_controlpanel_adjustments avpw_controlpanel avpw_tool_fixed avpw_tool_slider">', '<div class="avpw_inset_button_group avpw_inset_group">', '<div data-mode="brightness" class="avpw_inset_button avpw_inset_button_first">', '<div class="avpw_label">', AV.getLocalizedString("Brightness"), "</div>", "</div>", '<div data-mode="contrast" class="avpw_inset_button">', '<div class="avpw_label">', AV.getLocalizedString("Contrast"), "</div>", "</div>", '<div data-mode="highlights" class="avpw_inset_button">', '<div class="avpw_label">', AV.getLocalizedString("Highlights"), "</div>", "</div>", '<div data-mode="shadows" class="avpw_inset_button avpw_inset_button_last">', '<div class="avpw_label">', AV.getLocalizedString("Shadows"), "</div>", "</div>", "</div>", t.slider({
					id: "avpw_lighting_slider",
					divider: !0
				}), "</div>", '<div id="avpw_controlpanel_color" class="avpw_controlpanel_adjustments avpw_controlpanel avpw_tool_fixed avpw_tool_slider">', '<div class="avpw_inset_button_group avpw_inset_group">', '<div data-mode="saturation" class="avpw_inset_button avpw_inset_button_first">', '<div class="avpw_label">', AV.getLocalizedString("Saturation"), "</div>", "</div>", '<div data-mode="warmth" class="avpw_inset_button">', '<div class="avpw_label">', AV.getLocalizedString("Warmth"), "</div>", "</div>", '<div data-mode="tint" class="avpw_inset_button">', '<div class="avpw_label">', AV.getLocalizedString("Tint"), "</div>", "</div>", '<div data-mode="fade" class="avpw_inset_button avpw_inset_button_last">', '<div class="avpw_label">', AV.getLocalizedString("Fade"), "</div>", "</div>", "</div>", t.slider({
					id: "avpw_color_slider",
					divider: !0
				}), "</div>", '<div id="avpw_controlpanel_brightness" class="avpw_controlpanel avpw_tool_fixed avpw_tool_slider">', t.slider({
					id: "avpw_brightness_slider",
					divider: !0
				}), "</div>", "", '<div id="avpw_controlpanel_contrast" class="avpw_controlpanel avpw_tool_fixed avpw_tool_slider">', t.slider({
					id: "avpw_contrast_slider",
					divider: !0
				}), "</div>", "", '<div id="avpw_controlpanel_saturation" class="avpw_controlpanel avpw_tool_fixed avpw_tool_slider">', t.slider({
					id: "avpw_saturation_slider",
					divider: !0
				}), "</div>", "", '<div id="avpw_controlpanel_warmth" class="avpw_controlpanel avpw_tool_fixed avpw_tool_slider">', t.slider({
					id: "avpw_warmth_slider",
					divider: !0
				}), "</div>", "", '<div id="avpw_controlpanel_sharpness" class="avpw_controlpanel avpw_tool_fixed avpw_tool_slider">', t.slider({
					id: "avpw_sharpness_slider",
					divider: !0
				}), "</div>", "", '<div id="avpw_controlpanel_forcecrop" class="avpw_controlpanel avpw_tool_fixed">', '<div id="avpw_force_crop_sub_text">Crop your photo to:</div>', '<div id="avpw_force_crop_label"></div>', "</div>", "", '<div id="avpw_controlpanel_orientation" class="avpw_controlpanel">', '<div class="avpw_tool_cutout_centered_orientation">', '<div class="avpw_inset_button_group avpw_inset_group">', '<div id="avpw_rotate_left" class="avpw_inset_button avpw_inset_button_first">', '<div class="avpw_orientation_button_inner">', "</div>", "</div>", '<div id="avpw_rotate_right" class="avpw_inset_button avpw_inset_button_last">', '<div class="avpw_orientation_button_inner">', "</div>", "</div>", "</div>", '<div class="avpw_inset_group avpw_inset_group_spacer"></div>', '<div class="avpw_inset_button_group avpw_inset_group">', '<div id="avpw_flip_h" class="avpw_inset_button avpw_inset_button_first">', '<div class="avpw_orientation_button_inner">', "</div>", "</div>", '<div id="avpw_flip_v" class="avpw_inset_button avpw_inset_button_last">', '<div class="avpw_orientation_button_inner">', "</div>", "</div>", "</div>", '<div class="avpw_inset_button_label avpw_inset_button_label_2 avpw_label avpw_inset_group">', AV.getLocalizedString("Rotate"), "</div>", '<div class="avpw_inset_group avpw_inset_group_spacer"></div>', '<div class="avpw_inset_button_label avpw_inset_button_label_2 avpw_label avpw_inset_group">', AV.getLocalizedString("Mirror"), "</div>", "</div>", "</div>", "", '<div id="avpw_controlpanel_crop" class="avpw_controlpanel avpw_tool_stretch">', '<div class="avpw_tool_scroll">', '<a id="avpw_crop_presets_lftArrow" class="avpw_prev avpw_bookend">', '<span class="avpw_arrow_icon"></span>', "</a>", '<div id="avpw_crop_presets_scroll_window" class="avpw_clip">', '<div id="avpw_crop_presets_scroll_region" class="avpw_scroll_strip">', "</div>", '<div class="avpw_shadowbar avpw_shadowbar_n"></div>', "</div>", '<a id="avpw_crop_presets_rghtArrow" class="avpw_next avpw_bookend">', '<span class="avpw_arrow_icon"></span>', "</a>", "</div>", "</div>", "", '<div id="avpw_controlpanel_resize" class="avpw_controlpanel">', '<div class="avpw_tool_cutout_centered_resize">', '<div class="avpw_resize_form_block avpw_resize_width">', '<input class="avpw_text_input avpw_number_input" id="avpw_resize_width" type="text" value="640" maxlength="5"/>', '<div class="avpw_label">', AV.getLocalizedString("Width"), "</div>", "</div>", '<div class="avpw_resize_form_block avpw_resize_constrain">', '<div  class="avpw_inset_group avpw_inset_button_group avpw_checkmark_button">', '<div id="avpw_constrain_prop" class="avpw_inset_button avpw_inset_button_first avpw_inset_button_last" title="' + AV.getLocalizedString("Maintain proportions") + '">', '<div class="avpw_lock_icon">', '<div class="avpw_lock_icon_top">', '<div class="avpw_lock_icon_top_inner"></div>', "</div>", '<div class="avpw_lock_icon_sep"></div>', '<div class="avpw_lock_icon_bottom"></div>', "</div>", "</div>", "</div>", "</div>", '<div class="avpw_resize_form_block avpw_resize_height">', '<input class="avpw_text_input avpw_number_input" id="avpw_resize_height" type="text" value="480" maxlength="5"/>', '<div class="avpw_label">', AV.getLocalizedString("Height"), "</div>", "</div>", "</div>", "</div>", "", '<div id="avpw_controlpanel_redeye" class="avpw_controlpanel">', '<div class="avpw_tool_cutout_centered_spot_tool">', "</div>", "</div>", "", '<div id="avpw_controlpanel_whiten" class="avpw_controlpanel avpw_tool_stretch">', '<div class="avpw_tool_cutout_centered_spot_tool">', "</div>", "</div>", "", '<div id="avpw_controlpanel_blemish" class="avpw_controlpanel avpw_tool_stretch">', '<div class="avpw_tool_cutout_centered_spot_tool">', "</div>", "</div>", "", '<div id="avpw_controlpanel_effects" class="avpw_controlpanel avpw_tool_stretch">', '<div id="avpw_effects_effects">', '<div id="avpw_effects_scroller" class="avpw_content_wrapper">', t.contentPagerInner(), "</div>", "</div>", t.intensitySlider(), "</div>", "", '<div id="avpw_controlpanel_enhance" class="avpw_controlpanel">', '<div class="avpw_tool_cutout_centered_enhance">', '<div class="avpw_inset_button_group avpw_inset_group">', '<div class="avpw_inset_button avpw_inset_button_first">', '<div id="avpw_enhance_icon_hd" class="avpw_enhance_button_inner"></div>', "</div>", '<div class="avpw_inset_button">', '<div id="avpw_enhance_icon_scenery" class="avpw_enhance_button_inner"></div>', "</div>", '<div class="avpw_inset_button">', '<div id="avpw_enhance_icon_food" class="avpw_enhance_button_inner"></div>', "</div>", '<div class="avpw_inset_button">', '<div id="avpw_enhance_icon_portrait" class="avpw_enhance_button_inner"></div>', "</div>", '<div class="avpw_inset_button avpw_inset_button_last">', '<div id="avpw_enhance_icon_night" class="avpw_enhance_button_inner"></div>', "</div>", "</div>", '<div class="avpw_inset_group">', '<div class="avpw_inset_button_label avpw_label">', AV.getLocalizedString("Hi-Def"), "</div>", '<div class="avpw_inset_button_label avpw_label">', AV.getLocalizedString("Scenery"), "</div>", '<div class="avpw_inset_button_label avpw_label">', AV.getLocalizedString("Food"), "</div>", '<div class="avpw_inset_button_label avpw_label">', AV.getLocalizedString("Portrait"), "</div>", '<div class="avpw_inset_button_label avpw_label">', AV.getLocalizedString("Night"), "</div>", "</div>", "</div>", "</div>", "", '<div id="avpw_controlpanel_drawing" class="avpw_controlpanel avpw_tool_stretch">', '<div class="avpw_tool_cutout_centered_drawing">', '<div class="avpw_outer-center">', '<div class="avpw_inner-center">', '<div class="avpw_inset_color_widget avpw_inset_group avpw_inset_button_group">', t.colorPickerIcon(), '<div id="avpw_drawing_colors" class="avpw_inset_color_choices avpw_inset_button avpw_inset_button_last avpw_inset_button_down">', "</div>", "</div>", '<div class="avpw_inset_group avpw_inset_group_mini_spacer"></div>', '<div class="avpw_inset_button_group avpw_inset_group">', '<div class="avpw_inset_button avpw_inset_button_first avpw_inset_button_last avpw_colorsplash_eraser">', '<div class="avpw_colorsplash_eraser_icon avpw_colorsplash_inner_icon">', "</div>", "</div>", "</div>", '<div class="avpw_inset_group avpw_inset_group_mini_spacer"></div>', t.brushSizesSet({
					id: "avpw_drawing_brushes",
					sizes: [8, 13, 18, 21, 25],
					hideLabel: !0
				}), '<div class="avpw_inset_group avpw_clear">', '<div class="avpw_inset_button_label avpw_inset_color_widget_label avpw_label">', AV.getLocalizedString("Color Picker"), "</div>", "</div>", '<div class="avpw_inset_group avpw_inset_group_mini_spacer"></div>', '<div class="avpw_inset_group avpw_inset_button_label avpw_label">', AV.getLocalizedString("Eraser"), "</div>", '<div class="avpw_inset_group avpw_inset_group_mini_spacer"></div>', '<div class="avpw_inset_group avpw_inset_button_label avpw_inset_button_label_mini_5 avpw_label">', AV.getLocalizedString("Brush Size"), "</div>", "</div>", "</div>", "</div>", "</div>", "", '<div id="avpw_controlpanel_overlay" class="avpw_controlpanel avpw_tool_stretch">', '<div id="avpw_overlay_scroller" class="avpw_content_wrapper">', t.contentPagerInner(), "</div>", "</div>", '<div id="avpw_controlpanel_overlays" class="avpw_controlpanel avpw_tool_stretch">', '<div id="avpw_overlays_scroller" class="avpw_content_wrapper">', t.contentPagerInner(), "</div>", "</div>", "", '<div id="avpw_controlpanel_frames" class="avpw_controlpanel avpw_tool_stretch">', '<div id="avpw_frames_scroller" class="avpw_content_wrapper">', t.contentPagerInner(), "</div>", "</div>", "", '<div id="avpw_controlpanel_text" class="avpw_controlpanel avpw_tool_stretch">', '<div class="avpw_tool_half_height">', '<div class="avpw_inset_color_widget avpw_inset_group avpw_inset_button_group">', t.colorPickerIcon(), '<div id="avpw_text_colors" class="avpw_inset_color_choices avpw_inset_button avpw_inset_button_last avpw_inset_button_down">', "</div>", "</div>", "</div>", '<div class="avpw_tool_half_height">', '<button id="avpw_add_text" class="avpw_button">', AV.getLocalizedString("Add Text"), "</button>", '<input type="text" id="avpw_text_area" name="avpw_text_area" class="avpw_text_input" />', '<input type="hidden" id="avpw_text_font" value="sans-serif" />', '<input type="hidden" id="avpw_text_font_size" value="60" />', "</div>", "</div>", "", '<div id="avpw_controlpanel_meme" class="avpw_controlpanel avpw_tool_stretch avpw_tool_cutout">', '<div class="avpw_tool_cutout_inner avpw_inset_background">', '<div class="avpw_tool_cutout_centered_meme">', '<input id="avpw_text_area_meme" class="avpw_text_input avpw_meme_input" placeholder="' + AV.getLocalizedString("Enter top text") + '"/>', '<input id="avpw_text_area_meme2" class="avpw_text_input avpw_meme_input" placeholder="' + AV.getLocalizedString("Enter bottom text") + '"/>', "</div>", "</div>", "</div>", '<div id="avpw_controlpanel_textwithfont" class="avpw_controlpanel avpw_tool_stretch">', '<div class="avpw_tool_cutout_fixed">', '<div class="avpw_outer-center">', '<div class="avpw_inner-center">', '<div class="avpw_inset_color_widget avpw_inset_group avpw_inset_button_group">', t.colorPickerIcon(), '<div id="avpw_textwithfont_colors" class="avpw_inset_color_choices avpw_inset_button avpw_inset_button_last avpw_inset_button_down">', "</div>", "</div>", '<div class="avpw_inset_group avpw_inset_group_mini_spacer"></div>', '<div id="avpw_font_browser" class="avpw_inset_button_group avpw_inset_group">', '<div class="avpw_inset_button avpw_inset_button_first avpw_inset_button_last">', '<div class="avpw_dropdown_icon">', '<div class="avpw_dropdown_icon_inner"></div>', "</div>", '<div id="avpw_font_browser_preview" class="avpw_font_label avpw_label avpw_isa_dropdown_display">', "</div>", "</div>", "</div>", '<div class="avpw_inset_group avpw_inset_group_mini_spacer"></div>', '<div id="avpw_textwithfont_addtext" class="avpw_inset_button_group avpw_inset_group">', '<div class="avpw_inset_button_with_plus avpw_inset_button avpw_inset_button_first avpw_inset_button_last">', '<div class="avpw_plus_icon"></div>', AV.getLocalizedString("Add Text"), "</div>", "</div>", "</div>", "</div>", "</div>", "</div>", "", '<div id="avpw_controlpanel_colorsplash" class="avpw_controlpanel">', '<div class="avpw_outer-center">', '<div class="avpw_inner-center avpw_tool_cutout_centered_colorsplash">', '<div class="avpw_inset_button_group avpw_inset_group">', '<div class="avpw_inset_button avpw_inset_button_first avpw_colorsplash_freebrush">', '<div class="avpw_colorsplash_freebrush_icon avpw_colorsplash_inner_icon">', AV.getLocalizedString("Free Color"), "</div>", "</div>", '<div class="avpw_inset_button avpw_inset_button_last avpw_colorsplash_smartbrush avpw_inset_button_down">', '<div class="avpw_colorsplash_smartbrush_icon avpw_colorsplash_inner_icon">', AV.getLocalizedString("Smart Color"), "</div>", "</div>", "</div>", '<div class="avpw_inset_group avpw_inset_group_mini_spacer"></div>', '<div class="avpw_inset_button_group avpw_inset_group">', '<div class="avpw_inset_button avpw_inset_button_first avpw_inset_button_last avpw_colorsplash_eraser">', '<div class="avpw_colorsplash_eraser_icon avpw_colorsplash_inner_icon">', AV.getLocalizedString("Eraser"), "</div>", "</div>", "</div>", '<div class="avpw_inset_group avpw_inset_group_mini_spacer"></div>', t.brushSizesSet({
					id: "avpw_colorsplash_brushes",
					sizes: [8, 13, 18, 21, 25],
					hideLabel: !0
				}), '<div class="avpw_inset_group avpw_clear">', '<div class="avpw_inset_button_label avpw_label">', AV.getLocalizedString("Free Color"), "</div>", '<div class="avpw_inset_button_label avpw_label">', AV.getLocalizedString("Smart Color"), "</div>", "</div>", '<div class="avpw_inset_group avpw_inset_group_mini_spacer"></div>', '<div class="avpw_inset_group avpw_inset_button_label avpw_label">', AV.getLocalizedString("Eraser"), "</div>", '<div class="avpw_inset_group avpw_inset_group_mini_spacer"></div>', '<div class="avpw_inset_group avpw_inset_button_label avpw_inset_button_label_mini_5 avpw_label">', AV.getLocalizedString("Brush Size"), "</div>", "</div>", "</div>", "</div>", "", '<div id="avpw_controlpanel_focus" class="avpw_controlpanel">', '<div class="avpw_tool_cutout_centered_tiltshift">', '<div class="avpw_inset_button_group avpw_inset_group">', '<div class="avpw_inset_button avpw_inset_button_first avpw_tiltshift_circle_button">', '<div class="avpw_tiltshift_circle_icon avpw_tiltshift_inner_icon">', "</div>", "</div>", '<div class="avpw_inset_button avpw_inset_button_last avpw_tiltshift_rectangle_button">', '<div class="avpw_tiltshift_rectangle_icon avpw_tiltshift_inner_icon">', "</div>", "</div>", "</div>", '<div class="avpw_inset_button_label avpw_inset_button_label_2 avpw_label avpw_inset_group">', AV.getLocalizedString("Shape"), "</div>", "</div>", "</div>", "", "</div>", '<div class="avpw_mode_action avpw_mode_action_left">', t.cancelButton({
					id: "avpw_all_effects",
					label: "Cancel"
				}), t.cancelButton({
					id: "avpw_up_one_level",
					label: "Back"
				}), "</div>", '<div class="avpw_mode_action avpw_mode_action_right">', '<a href="javascript:void(0)" id="avpw_apply_container" class="avpw_button avpw_primary_button">', AV.getLocalizedString("Apply"), "</a>", "</div>", "", "</div>", "</div>", "", '<div id="avpw_canvas_embed" class="avpw_canvas_background"></div>', "", '<div id="avpw_footer">', '<div id="avpw_history">', '<div id="avpw_history_undo" class="avpw_button avpw_history_button avpw_history_button_first avpw_history_disabled">', '<span class="avpw_history_icon">', "Undo", "</span>", "</div>", '<div id="avpw_history_redo" class="avpw_button avpw_history_button avpw_history_button_last avpw_history_disabled">', '<span class="avpw_history_icon">', "Redo", "</span>", "</div>", '<div id="avpw_history_undo_blocker" class="avpw_history_blocker avpw_history_blocker_first"></div>', '<div id="avpw_history_redo_blocker" class="avpw_history_blocker avpw_history_blocker_last"></div>', "</div>", '<p class="avpw_footer_text" id="avpw_size_indicator"></p>', '<p id="avpw_powered_branding" class="avpw_footer_text avpw_powered_text">', "</p>", "</div>", "", '<div id="avpw_messaging" style="display: none;">', '<div id="avpw_messaging_inner">', "</div>", '<div id="avpw_messages" style="display: none;">', t.aviaryAppPopups(), "</div>", "</div>", "", "</div>"].join("")
			}, t.eggIcon = function(e) {
				return ['<div class="avpw_icon avpw_tool_icon" id="avpw_main_' + e.optionName + '" data-header="' + e.capOptionName + '" data-toolname="' + e.optionName + '">', '<div class="avpw_icon_image avpw_tool_icon_image">', '<div class="avpw_tool_icon_inner"></div>', "</div>", '<div class="avpw_icon_waiter avpw_center_contents">', "</div>", '<span class="avpw_icon_label avpw_label">' + e.capOptionName + "</span>", "</div>"].join("")
			}, t.emptyEggIcon = function() {
				return ""
			}, t.genericScrollPanel = function(e) {
				return ['<div style="width: ' + e.panelWidth + 'px;" class="avpw_scroll_page ' + e.panelClass + '">\n', '<span class="avpw_scroll_page_inner">\n', e.panelHTML, "</span>\n", "</div>\n"].join("")
			}, t.aviaryScrollPanel = function(e) {
				return ['<div style="width: ' + e.panelWidth + 'px;" class="avpw_scroll_page ' + e.panelClass + '">\n', '<span class="avpw_scroll_page_inner">\n', '<div class="avpw_info">', '<a href="' + AV.launchData.getWidgetURL + '" target="_blank" class="avpw_button avpw_info_right">' + AV.getLocalizedString("Get this editor") + "</a>\n", '<a href="' + AV.launchData.giveFeedbackURL + '" target="_blank" class="avpw_button avpw_info_left">' + AV.getLocalizedString("Give feedback") + "</a>\n", '<div class="avpw_info_inner">', '<a id="avpw_logo_large" href="http://www.aviary.com/" target="_blank">', "Aviary", "</a>", '<p class="avpw_version_text">', "v" + AV.build.version, "</p>", "</div>", "</div>", "</span>", "</div>"].join("")
			}, t.poweredByFooterLogo = function(e) {
				return ['<a class="avpw_cursor">', '<span id="avpw_logo">', "&nbsp;", "</span>", "</a>"].join("")
			}, t.aviaryAppPopups = function() {
				return ['<div id="avpw_aviary_beensaved" class="avpw_app_popup">\n', '<p class="avpw_message_text">' + AV.getLocalizedString("Your work was saved!") + "</p>", '<div class="avpw_message_buttons">\n', '<a id="avpw_resume_aftersave" class="avpw_button" href="#Resume">' + AV.getLocalizedString("Resume") + "</a>\n", '<a id="avpw_close_aftersave" class="avpw_button avpw_primary_button" href="#Close">' + AV.getLocalizedString("Close") + "</a>", "</div>\n", "</div>\n", '<div id="avpw_resize_invalid" class="avpw_app_popup">\n', '<p class="avpw_message_text">', AV.getLocalizedString("Width and height must be greater than zero and less than the maximum ({max}px)").replace("{max}", '<span id="avpw_resize_invalid_max_size"></span>'), "</p>", '<div class="avpw_message_buttons">\n', '<a id="avpw_resize_invalid_confirm" class="avpw_button" href="#Confirm">' + AV.getLocalizedString("OK") + "</a>\n", "</div>\n", "</div>\n", '<div id="avpw_purchase_pack" class="avpw_app_popup">\n', t.closeButton({
					id: "avpw_purchase_pack_close",
					text: AV.getLocalizedString("Cancel")
				}), '<div id="avpw_purchase_pack_contents">\n', "</div>\n", "</div>\n", '<div id="avpw_resize_unlocked" class="avpw_app_popup">\n', '<p class="avpw_message_text">', AV.getLocalizedString("Are you sure? This can distort your image") + ".", "</p>", '<div class="avpw_message_buttons">\n', '<a id="avpw_resize_unlocked_confirm" class="avpw_button" href="#Confirm">' + AV.getLocalizedString("OK") + "</a>\n", '<a id="avpw_resize_unlocked_cancel" class="avpw_button" href="#Confirm">' + AV.getLocalizedString("Cancel") + "</a>\n", "</div>\n", "</div>\n", '<div id="avpw_aviary_quitareyousure" class="avpw_app_popup">', '<p class="avpw_message_text">' + AV.getLocalizedString("Wait! You didn't save your work. Are you certain that you want to close this editor?") + "</p>", '<div class="avpw_message_buttons avpw_center_contents">\n', '<a id="avpw_resume_editing" class="avpw_button" href="#Resume">' + AV.getLocalizedString("Resume") + "</a>\n", '<a id="avpw_close_nosave" class="avpw_button" href="#Close">' + AV.getLocalizedString("Close") + "</a>\n", '<a id="avpw_close_save" class="avpw_button avpw_primary_button" href="#Save">' + AV.getLocalizedString("Save") + "</a>", "</div>", "</div>", '<div id="avpw_aviary_aviaryfeedback" class="avpw_app_popup">', '<div class="avpw_popup_split_box">', '<h2 class="avpw_mode_warning">', AV.getLocalizedString("Help / Support"), "</h2>", "<p>", AV.getLocalizedString("Have a suggestion to improve this photo editor? Let us know."), "</p>", '<a href="' + AV.launchData.giveFeedbackURL + '" target="_blank" class="avpw_button avpw_primary_button">' + AV.getLocalizedString("Send Feedback") + "</a>", "</div>", '<div class="avpw_vertical_separator"></div>', '<div class="avpw_popup_split_box">', '<h2 class="avpw_mode_warning">', AV.getLocalizedString("About this editor"), "</h2>", "<p>", AV.getLocalizedString("Aviary is the world's leading photo editing platform. Developers: learn how to add it to your app in minutes."), "</p>", '<a href="' + AV.launchData.getWidgetURL + '" target="_blank" class="avpw_button avpw_primary_button">' + AV.getLocalizedString("Visit Aviary.com") + "</a>", "</div>", '<div class="avpw_horizontal_separator"></div>', '<div class="avpw_clear">', '<div class="avpw_message_buttons avpw_center_contents">', '<div id="avpw_close_feedbackok" class="avpw_button">', AV.getLocalizedString("Close"), "</div>", "</div>", "</div>", "</div>", '<div id="avpw_aviary_unsupported" class="avpw_app_popup">', '<p class="avpw_message_text">', AV.getLocalizedString("Please install {Adobe Flash Player} (version {min} or higher), or use a supported browser: {Chrome}, {Firefox}, {Safari}, {Opera}, or {Internet Explorer} (version 9 or higher).").replace("{Adobe Flash Player}", '<a href="http://get.adobe.com/flashplayer/" target="_blank">Adobe Flash Player</a>').replace("{min}", AV.build.MINIMUM_FLASH_PLAYER_VERSION).replace("{Chrome}", '<a href="http://www.google.com/chrome/" target="_blank">Chrome</a>').replace("{Firefox}", '<a href="http://www.mozilla.org/firefox/" target="_blank">Firefox</a>').replace("{Safari}", '<a href="http://www.apple.com/safari/" target="_blank">Safari</a>').replace("{Opera}", '<a href="http://www.opera.com/" target="_blank">Opera</a>').replace("{Internet Explorer}", '<a href="http://www.beautyoftheweb.com/" target="_blank">Internet Explorer</a>'), "</p>", '<div class="avpw_message_buttons avpw_center_contents">\n', '<a id="avpw_close_unsupported" class="avpw_button" href="#Close">' + AV.getLocalizedString("Close") + "</a>\n", "</div>", "</div>", '<div id="avpw_aviary_crop_invalid_dimensions" class="avpw_app_popup">', '<p class="avpw_message_text">', AV.getLocalizedString("Your photo is smaller than the required size. Please choose a new one to proceed."), "</p>", '<div class="avpw_message_buttons avpw_center_contents">\n', '<a id="avpw_close_forcecrop_close" class="avpw_button" href="#Close">' + AV.getLocalizedString("Close") + "</a>\n", "</div>", "</div>"].join("")
			}, t.scrollPanelPip = function(e) {
				return '<li class="avpw_page avpw_is_navpip" pagenum="' + e.i + '" id="avpw_navpip_' + e.i + '">&bull;</li>\n'
			}, t.slider = function(e) {
				return ['<div class="avpw_slider_container avpw_isa_slider_container">', '<div class="avpw_slider_bookend avpw_slider_bookend_left avpw_slider_label">', "-", "</div>", '<div class="avpw_slider_outer_bg_outline_circle"></div>', '<div class="avpw_slider_positioned" id="' + e.id + '">', '<div class="avpw_slider_outer_bg_circle"></div>', '<div class="avpw_slider_inner_bg_outline_circle"></div>', '<div class="avpw_slider_positioned_inner">', '<div class="avpw_slider_inner_bg_circle"></div>', '<div class="avpw_slider_bounds" >', '<div class="avpw_slider_goo"></div>', e.divider ? '<div class="avpw_slider_divider"></div>' : "", '<a class="avpw_slider_handle"></a>', "</div>", "</div>", "</div>", '<div class="avpw_slider_bookend avpw_slider_bookend_right avpw_slider_label">', "+", "</div>", "</div>"].join("")
			}, t.zoomModeOverlay = function() {
				return ['<div id="avpw_zoom_mode_overlay">', '<div id="avpw_zoom_mode_text">', '<h2 class="avpw_mode_warning">', AV.getLocalizedString("Zoom Mode"), "</h2>", AV.getLocalizedString("Click to release"), "</div>", "</div>"].join("")
			}, t.zoomControls = function() {
				return ['<div id="avpw_zoom_container">', '<div id="avpw_zoom_button">', '<div id="avpw_zoom_icon"></div>', "</div>", '<div class="avpw_zoom_slider_container avpw_isa_slider_container">', '<div class="avpw_slider_bookend avpw_slider_bookend_left">-</div>', '<div id="avpw_zoom_inner"></div>', '<div id="avpw_zoom_slider">', '<a id="avpw_zoom_handle"></a>', "</div>", '<div class="avpw_slider_bookend avpw_slider_bookend_right">+</div>', "</div>", "</div>"].join("");

			}, t.presetIndicator = function() {
				return ['<div class="avpw_preset_indicator_outer">', '<div class="avpw_preset_indicator">', "</div>", "</div>"].join("")
			}, t.cropCustomControl = function(e) {
				return ['<div class="avpw_crop_custom_control avpw_isa_preset_crop" data-crop="Custom">', '<div class="avpw_crop_custom_control_left">', '<div class="avpw_crop_preset_visual"></div>', '<div class="avpw_preset_label avpw_label">', AV.getLocalizedString("Custom"), "</div>", "</div>", '<div class="avpw_crop_custom_control_right">', '<input id="avpw_crop_custom_width" class="avpw_text_input avpw_number_input" type="text" placeholder="' + AV.getLocalizedString("Width").toLowerCase() + '" maxlength="5"  />', '<input id="avpw_crop_custom_height" class="avpw_text_input avpw_number_input" type="text" placeholder="' + AV.getLocalizedString("Height").toLowerCase() + '" maxlength="5" />', '<div class="avpw_crop_lock_group"><input id="avpw_crop_custom_lock_dims" type="checkbox" /> <span>' + AV.getLocalizedString("Lock Dimensions") + "</span> </div>", "</div>", "</div>"].join("")
			}, t.cropPreset = function(e) {
				var n, a = 20,
					i = -3,
					o = (e.label.split(":"), 30),
					r = 30,
					s = 30,
					l = e.width,
					c = e.height;
				l === c ? s = r = o : l > c ? (r = o, n = o / l, s = c * n) : (s = o, n = o / c, r = l * n);
				var p = "width:" + r + "px;height:" + s + "px;margin-left:" + (-r / 2 + i) + "px;margin-top:" + -(s - a) / 2 + "px";
				return ['<div class="avpw_preset_crop_icon avpw_preset_icon avpw_icon avpw_with_indicator avpw_isa_preset_crop" data-crop="' + e.label + '">', e.strict || e.labeled ? "" : t.cropPresetFlippedIndicator(), '<div class="avpw_crop_preset_visual" style="' + p + '"></div>', '<div class="avpw_preset_label avpw_label">', e.label, "</div>", t.presetIndicator(), "</div>"].join("")
			}, t.cropPresetFlippedIndicator = function(e) {
				return ['<div class="avpw_crop_preset_flipped_indicator_shadow">', '<div class="avpw_crop_preset_flipped_indicator_left"></div>', '<div class="avpw_crop_preset_flipped_indicator_right"></div>', "</div>", '<div class="avpw_crop_preset_flipped_indicator">', '<div class="avpw_crop_preset_flipped_indicator_left"></div>', '<div class="avpw_crop_preset_flipped_indicator_right"></div>', "</div>"].join("")
			}, t.brushIcon = function(e) {
				var t = "avpw_inset_button avpw_inset_button_mini avpw_isa_preset_brush";
				return e.isFirst ? t += " avpw_inset_button_first" : e.isLast && (t += " avpw_inset_button_last"), ['<div class="' + t + '" data-size="' + e.size + '">', '<div class="avpw_icon_image avpw_brush_size avpw_brush_size_' + e.size + '">', "</div>", "</div>"].join("")
			}, t.brushIconLarge = function(e) {
				return ['<div class="avpw_preset_icon avpw_icon avpw_with_indicator avpw_isa_preset_brush" data-size="' + e.size + '">', '<div class="avpw_icon_image avpw_brush_size avpw_brush_size_' + e.size + '">', "</div>", t.presetIndicator(), "</div>"].join("")
			}, t.brushColorIcon = function(e) {
				return ['<div class="avpw_brush_color_icon avpw_icon avpw_isa_preset_color" data-color="' + e.color + '">', '<div class="avpw_preset_color_image" style="background: ' + e.color + ';">', "</div>", e.extra ? e.extra : "", "</div>"].join("")
			}, t.brushSizesSet = function(e) {
				e || (e = {}), e.sizes || (e.sizes = AV.brushWidths);
				var t = "";
				return e.id && "" != e.id && (t = 'id="' + e.id + '"'), ["<div " + t + ' class="avpw_inset_button_group avpw_inset_group">', '<div class="avpw_inset_button avpw_inset_button_mini avpw_isa_preset_brush avpw_inset_button_first" data-size="' + e.sizes[0] + '">', '<div class="avpw_icon_image avpw_brush_size avpw_brush_size_1"></div>', "</div>", '<div class="avpw_inset_button avpw_inset_button_mini avpw_isa_preset_brush avpw_collapsible" data-size="' + e.sizes[1] + '">', '<div class="avpw_icon_image avpw_brush_size avpw_brush_size_2"></div>', "</div>", '<div class="avpw_inset_button avpw_inset_button_mini avpw_isa_preset_brush" data-size="' + e.sizes[2] + '">', '<div class="avpw_icon_image avpw_brush_size avpw_brush_size_3"></div>', "</div>", '<div class="avpw_inset_button avpw_inset_button_mini avpw_isa_preset_brush avpw_collapsible" data-size="' + e.sizes[3] + '">', '<div class="avpw_icon_image avpw_brush_size avpw_brush_size_4"></div>', "</div>", '<div class="avpw_inset_button avpw_inset_button_mini avpw_isa_preset_brush avpw_inset_button_last" data-size="' + e.sizes[4] + '">', '<div class="avpw_icon_image avpw_brush_size avpw_brush_size_5"></div>', "</div>", "</div>", e.hideLabel ? "" : '<div class="avpw_inset_group avpw_inset_button_label avpw_inset_button_label_mini_5 avpw_label">' + AV.getLocalizedString("Brush Size") + "</div>"].join("")
			}, t.colorPickerIcon = function(e) {
				return ['<div class="avpw_inset_color_picker avpw_inset_button avpw_inset_button_first avpw_isa_color_picker" data-color="">', '<div class="avpw_preset_icon avpw_icon">', '<div class="avpw_preset_color_image avpw_custom_color_image avpw_isa_color_feedback">', "</div>", '<div class="avpw_dropdown_icon">', '<div class="avpw_dropdown_icon_inner">', "</div>", "</div>", "</div>", "</div>"].join("")
			}, t.colorPickerContainer = function(e) {
				return ['<div class="avpw_dropdown_popup avpw_color_picker_dropdown_popup">', '<div class="avpw_dropdown_tail"></div>', '<div class="avpw_color_picker_background"></div>', '<div class="avpw_color_picker_preview avpw_isa_color_feedback">', "</div>", '<a class="avpw_button avpw_color_picker_confirm">', AV.getLocalizedString("Set Color"), "</a>", "</div>"].join("")
			}, t.brushPreviewOverlay = function(e) {
				return ['<div id="avpw_brush_preview_container" class="avpw_brush_preview avpw_selection_overlay_selected">', '<canvas height="100" width="100" class="avpw_brush_preview_display"></canvas>', "</div>"].join("")
			}, t.cropLayer = function(e) {
				return ['<div class="avpw_crop_layer">', '<div class="avpw_crop_outside avpw_crop_outside_n"></div>', '<div class="avpw_crop_outside avpw_crop_outside_s"></div>', '<div class="avpw_crop_outside avpw_crop_outside_e"></div>', '<div class="avpw_crop_outside avpw_crop_outside_w"></div>', t.alignmentGrid({
					numLines: 3,
					lineWidth: 2
				}), '<div class="avpw_crop_handle avpw_crop_handle_tl"></div>', '<div class="avpw_crop_handle avpw_crop_handle_tr"></div>', '<div class="avpw_crop_handle avpw_crop_handle_bl"></div>', '<div class="avpw_crop_handle avpw_crop_handle_br"></div>', t.cropLayerToolTip(), "</div>"].join("")
			}, t.cropLayerToolTip = function(e) {
				return ['<div id="avpw_crop_tooltip">', 'w: <span id="avpw_crop_tooltip_w">800</span><br/>', 'h: <span id="avpw_crop_tooltip_h">600</span>', "</div>"].join("")
			}, t.frameThicknessIcon = function(e) {
				var t = e.thickness + "px",
					n = 24 - 2 * e.thickness,
					a = n + "px";
				return ['<div class="avpw_preset_icon avpw_icon avpw_isa_preset_thickness" data-thickness="' + e.thickness + '">', '<div class="avpw_preset_thickness_image" ', 'style="border-width: ' + t + ";", "width: " + a + ";", "height: " + a + ';"', ">", "</div>", "</div>"].join("")
			}, t.fontGroupPopup = function(e) {
				return ['<div id="avpw_font_popup" class="avpw_dropdown_popup" style="display: none;">', '<div class="avpw_dropdown_tail"></div>', '<div class="avpw_dropdown_popup_inner">', '<ul class="avpw_dropdown_popup_list">', "</ul>", "</div>", "</div>"].join("")
			}, t.fontGroupPopupItem = function(e) {
				var t = "";
				return e.label && e.label.toLowerCase && (t = "avpw_font_" + e.label.toLowerCase().replace(/\ /g, ""), e.custom && (t += " avpw_font_custom_image")), ['<li class="avpw_preset_font avpw_dropdown_popup_list_item avpw_isa_dropdown_item" data-value="' + e.label + '">', '<div class="avpw_font_image ' + t + '">', e.label, "</div>", "</li>"].join("")
			}, t.fontSizePopup = function(e) {
				return ['<div id="avpw_font_size_popup" class="avpw_dropdown_popup" style="display: none;">', '<div class="avpw_dropdown_tail"></div>', '<div class="avpw_dropdown_popup_inner">', '<ul class="avpw_dropdown_popup_list">', "</ul>", "</div>", "</div>"].join("")
			}, t.fontSizePopupItem = function(e) {
				return ['<li class="avpw_preset_font_size avpw_dropdown_popup_list_item avpw_isa_dropdown_item" data-value="' + e.value + '">', e.label, "</li>"].join("")
			}, t.selectionOverlay = function(e) {
				return ['<div id="' + (e.id ? e.id : "") + '" style="z-index:' + e.zIndex + ';" class="avpw_selection_overlay">', e.body ? e.body : "", '<div class="avpw_selection_overlay_size_handle"></div>', t.closeButton({
					className: "avpw_selection_overlay_close_button",
					text: AV.getLocalizedString("Remove")
				}), "</div>"].join("")
			}, t.imageOverlayBody = function(e) {
				return ['<img class="avpw_selection_overlay_image" src="' + (e.src || "") + '"></img>'].join("")
			}, t.textEntryOverlayBody = function(e) {
				return ['<canvas class="avpw_textwithfont_writer"></canvas>', '<textarea class="avpw_textwithfont_entry" cols="20" rows="1" wrap="soft" spellcheck="false">', "</textarea>"].join("")
			}, t.textEntryOverlayProxy = function(e) {
				return ['<pre class="avpw_textwithfont_overlay_proxy">', '<span class="avpw_proxy_get_height"> </span>', "</pre>"].join("")
			}, t.textEntryOutlineStyle = function(e) {
				var t = .707,
					n = .383,
					a = .924,
					i = e.size ? e.size / 2 : 1;
				return ["-" + i + "px 0 " + e.color + ",", "-" + a * i + "px -" + n * i + "px " + e.color + ",", "-" + t * i + "px -" + t * i + "px " + e.color + ",", "-" + n * i + "px -" + a * i + "px " + e.color + ",", "0 -" + i + "px " + e.color + ",", n * i + "px " + a * i + "px " + e.color + ",", t * i + "px -" + t * i + "px " + e.color + ",", a * i + "px " + n * i + "px " + e.color + ",", i + "px 0 " + e.color + ",", a * i + "px " + n * i + "px " + e.color + ",", t * i + "px " + t * i + "px " + e.color + ",", n * i + "px " + a * i + "px " + e.color + ",", "0 " + i + "px " + e.color + ",", "-" + n * i + "px " + a * i + "px " + e.color + ",", "-" + t * i + "px " + t * i + "px " + e.color + ",", "-" + a * i + "px " + n * i + "px " + e.color].join("")
			}, t.blankPreset = function() {
				return ['<div class="avpw_preset_icon avpw_icon avpw_preset_icon_disabled">', "</div>"].join("")
			}, t.blankCropPreset = function() {
				return ['<div class="avpw_preset_crop_icon avpw_preset_icon avpw_icon avpw_preset_icon_disabled">', "</div>"].join("")
			}, t.stickerThumbnail = function(e) {
				return ['<div class="avpw_icon avpw_overlay_icon avpw_isa_control_selector_overlay" thumburl="' + e.thumburl + '" fullimageurl="' + e.url + '">', '<div class="avpw_icon_image avpw_overlay_image avpw_header_inline_center">', '<img draggable="false" src="' + e.thumburl + '" fullimageurl="' + e.url + '"></img>', "</div>", '<div class="avpw_icon_waiter avpw_center_contents avpw_isa_overlay_waiter">', "</div>", "</div>"].join("")
			}, t.stickerRollInner = function(e) {
				return ['<img draggable="false" height="60" width="60" class="avpw_stickerpack_image" ', 'src="' + e.thumburl + '"></img>', '<span class="avpw_icon_label avpw_label">' + e.label + "</span>"].join("")
			}, t.stickerRoll = function(e) {
				return ['<div class="avpw_pack_icon avpw_icon avpw_isa_control_selector_filterpack avpw_pack_icon avpw_filterpack_icon avpw_isa_control_selector_stickerpack"  data-pack-index="' + e.packIndex + '">', '<div class="avpw_tile_container">', '<div class="avpw_pack_tile"></div>', '<div class="avpw_pack_tile"></div>', '<div class="avpw_pack_tile"></div>', '<img draggable="false" height="60" width="60" class="avpw_filterpack_image" src="' + e.thumburl + '" />', "</div>", '<span class="avpw_icon_label avpw_label">' + e.label + "</span>", "</div>"].join("")
			}, t.stickerRollDisabled = function(e) {
				return ['<div class="avpw_icon avpw_pack_icon avpw_pack_icon_selected avpw_stickerpack_icon avpw_isa_control_selector_stickerinfo">', t.stickerRollInner(e), '<div class="avpw_icon_waiter avpw_center_contents"></div>', "</div>"].join("")
			}, t.filterThumbnail = function(e) {
				var n = e.thumburl ? '<img draggable="false" height="63" width="63" class="avpw_filter_icon_image" src="' + e.thumburl + '"></img>' : '<canvas draggable="false" height="63" width="63" class="avpw_filter_icon_image avpw_isa_previewcanvas"></canvas>';
				return ['<div class="avpw_icon avpw_filter_icon avpw_isa_control_selector_filter" data-frame="' + (e.frame || "") + '" data-filtername="' + e.id + '">', t.presetIndicator(), n, '<span class="avpw_icon_label avpw_label">' + e.label + "</span>", '<div class="avpw_icon_waiter avpw_center_contents"></div>', "</div>"].join("")
			}, t.filterCanisterInner = function(e) {
				return ['<img draggable="false" class="avpw_filterpack_image" ', 'src="' + e.thumburl + '"></img>', '<span class="avpw_icon_label avpw_label">' + e.label + "</span>"].join("")
			}, t.filterCanister = function(e) {
				return ['<div class="avpw_pack_icon avpw_icon avpw_isa_control_selector_filterpack avpw_pack_icon avpw_filterpack_icon"  data-pack-index="' + e.packIndex + '">', '<div class="avpw_tile_container">', '<div class="avpw_pack_tile"></div>', '<div class="avpw_pack_tile"></div>', '<div class="avpw_pack_tile"></div>', '<img draggable="false" height="60" width="60" class="avpw_filterpack_image" src="' + e.thumburl + '" />', "</div>", '<span class="avpw_icon_label avpw_label">' + e.label + "</span>", "</div>"].join("")
			}, t.intensitySlider = function() {
				return ['<div id="avpw_tool_container" class="avpw_intensity_container">', t.slider({
					id: "avpw_intensity_slider",
					divider: !1
				}), '<a class="avpw_button avpw_intensity_back_button">', AV.getLocalizedString("Back"), "</a>", "</div>"].join("")
			}, t.filterCanisterDisabled = function(e) {
				return ['<div class="avpw_icon avpw_pack_icon avpw_pack_icon_selected avpw_filterpack_icon avpw_isa_control_selector_filterinfo">', t.filterCanisterInner(e), '<img draggable="false" height="75" width="54" class="avpw_filterpack_tag_image" src="' + e.tagurl + '"></img>', '<div class="avpw_icon_waiter avpw_center_contents"></div>', "</div>"].join("")
			}, t.frameThumbnail = function(e) {
				return ['<div class="avpw_filter_icon avpw_icon avpw_isa_control_selector_frame" data-framename="' + (e.frameName ? e.frameName : 0) + '">', t.presetIndicator(), '<div class="avpw_filter_icon_image">', '<canvas height="63" width="63" style="background-image: url(' + AV.build.feather_baseURL + 'images/border_thumb.jpg);"></canvas>', '<img draggable="false" width=63 height=63 src="' + e.assetImage + '"></img>', "</div>", '<span class="avpw_icon_label avpw_label">' + e.label + "</span>", "</div>"].join("")
			}, t.straightenSlider = function() {
				return ['<div class="avpw_straighten_ui avpw_straighten_ui_animate" id="avpw_straighten_container">', '<div class="avpw_straighten_ui_grid avpw_straighten_ui_grid_animate" id="avpw_straighten_grid"></div>', '<a id="avpw_straighten_handle">', "</a>", "</div>"].join("")
			}, t.alignmentGridBox = function(e) {
				return ['<div class="avpw_ui_grid_box ' + e.classes + '" style="' + e.styles + '">', '<div class="avpw_ui_grid_box_inner avpw_ui_grid_box_inner_n" style="' + e.northStyles + '"></div>', '<div class="avpw_ui_grid_box_inner avpw_ui_grid_box_inner_w" style="' + e.westStyles + '"></div>', "</div>"].join("")
			}, t.alignmentGrid = function(e) {
				var n, a, i, o, r, s, l, c, p = e.numLines || 3,
					u = e.lineWidth || 1,
					d = 100 / p,
					v = '<div style="border-right-width: ' + u + "px; border-bottom-width: " + u + 'px;" class="avpw_ui_grid">';
				for (n = 0; p > n; n++)
					for (a = 0; p > a; a++) o = 100 * n / p, i = 100 * a / p, r = ["left: " + i + "%;", "top: " + o + "%;", "width: " + d + "%;", "height: " + d + "%;"].join(""), l = ["left: " + u + "px;", "height: " + u + "px;"].join(""), c = ["width: " + u + "px;"].join(""), s = "", n === p / 2 && (s += "avpw_ui_middle_grid ", l = ["left: 0;", "height: " + u + "px;"].join("")), a === p / 2 && (s += "avpw_ui_center_grid "), v += t.alignmentGridBox({
						classes: s,
						styles: r,
						northStyles: l,
						westStyles: c
					});
				return v += "</div>"
			}, t.canvasControls = function() {
				return ['<div class="avpw_canvas_controls" id="avpw_canvas_controls_layer">', "</div>"].join("")
			}, t.flashCanvasBox = function(e) {
				return ['<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">', '<tr><td width="100%" height="100%" valign="middle" align="center">', '<div id="' + e.id + '"></div>', "</td></tr>", "</table>"].join("")
			}, t.advancedToolsSplitter = function() {
				return ['<div class="avpw_advanced_splitter">', '<div class="avpw_advanced_splitter_inner">', '<div class="avpw_advanced_splitter_control">', '<div class="avpw_advanced_splitter_bottom_shadow"></div>', '<div class="avpw_advanced_splitter_bottom"></div>', '<div class="avpw_advanced_splitter_middle">', '<a class="avpw_advanced_splitter_up_arrow"></a>', '<a class="avpw_advanced_splitter_down_arrow"></a>', "</div>", "</div>", "</div>", "</div>"].join("")
			}
		}(AV.template = AV.template || {}), AV.Pager = function(e) {
			var t, n = this,
				a = 0,
				i = 0,
				o = parseInt((e.itemCount - 1) / e.itemsPerPage, 10) + 1,
				r = 0,
				s = function() {
					var t, n, a, i = "";
					for (e.firstPageTemplate && (i += e.firstPageTemplate.apply(this, [e.firstPageContents])), n = t = 0; o > n; n++) {
						var s = "";
						for (a = 0; a < e.itemsPerPage && t < e.itemCount; a++) s += e.itemBuilder.apply(this, [t]), t++;
						i += e.pageTemplate ? e.pageTemplate({
							panelHTML: s,
							panelWidth: e.pageWidth,
							panelClass: a === e.itemsPerPage ? "avpw_scroll_page_complete" : "avpw_scroll_page_incomplete"
						}) : s
					}
					e.lastPageTemplate && (i += e.lastPageTemplate.apply(this, [e.lastPageContents]));
					var l, c, p, u, d, v = 0,
						_ = 0,
						f = 0;
					if ((e.firstPageTemplate || e.lastPageTemplate) && (e.firstPageTemplate && (e.firstPageWidth ? v += e.firstPageWidth * (e.itemsPerPage / e.pageWidth) : o++), e.lastPageTemplate && (e.lastPageWidth ? v += e.lastPageWidth * (e.itemsPerPage / e.pageWidth) : o++), _ = e.itemCount % e.itemsPerPage, v && (r = e.pageWidth / e.itemsPerPage - e.firstPageWidth % (e.pageWidth / e.itemsPerPage) | 0, f = r * (e.itemsPerPage / e.pageWidth), _ > 0 ? _ + v + f > e.itemsPerPage && o++ : o++)), !e.pageTemplate && e.fillRemainingSpace && (p = (e.itemCount + v + f) % e.itemsPerPage))
						if (l = e.itemsPerPage - p, 1 === o && e.centerContents) {
							for (c = l / 2 | 0, u = "", d = 0; c > d; d++) u += e.fillRemainingSpace.apply(this);
							for (i = u + i, d = 0; c > d; d++) i += e.fillRemainingSpace.apply(this)
						} else
							for (d = 0; l > d; d++) i += e.fillRemainingSpace.apply(this);
					return i
				},
				l = function() {
					t.removeClass("avpw_page_selected"), t.filter('[pagenum="' + a + '"]').addClass("avpw_page_selected")
				},
				c = function() {
					0 === a ? avpw$(e.leftArrow).removeClass("avpw_prev_enabled").addClass("avpw_prev_disabled") : avpw$(e.leftArrow).removeClass("avpw_prev_disabled").addClass("avpw_prev_enabled"), a == o - 1 ? avpw$(e.rightArrow).removeClass("avpw_next_enabled").addClass("avpw_next_disabled") : avpw$(e.rightArrow).removeClass("avpw_next_disabled").addClass("avpw_next_enabled")
				},
				p = function(t) {
					t = t || 0;
					var n = t * e.pageWidth;
					return 0 !== t && (n -= r), n
				},
				u = function(n, i) {
					var r, s = e.pageContainer;
					if (0 > a) return void(a = 0);
					if (a > o - 1) return void(a = o - 1);
					r = p(a);
					var u = AV.support.getVendorProperty("transform");
					if (u) {
						var d;
						d = a > 0 ? "translateX(-" + r + "px)" : "translateX(0)", s[0].style[u] = d
					} else s[0].style.left = a > 0 ? "-" + r + "px" : "0";
					c(), e.onPageChange && e.onPageChange.apply(this, [a]), t && l()
				},
				d = function() {
					return i = a, a += -1, u.call(this), !1
				},
				v = function() {
					return i = a, a += 1, u.call(this), !1
				},
				_ = function() {
					var t = e.longPressDuration || 200,
						n = !1,
						o = null,
						r = this,
						s = function(e) {
							o = window.setInterval(function() {
								n && e ? (i = a, a += e, u.call(r)) : (window.clearInterval(o), o = null)
							}, t)
						},
						l = function() {
							window.clearInterval(o), o = null, d.call(this), n = !0, s.call(this, -1)
						},
						c = function() {
							window.clearInterval(o), o = null, v.call(this), n = !0, s.call(this, 1)
						},
						p = function() {
							n = !1
						};
					return {
						bindEvents: function() {
							avpw$(e.leftArrow).bind("mousedown", l).bind("mouseup", p), avpw$(e.rightArrow).bind("mousedown", c).bind("mouseup", p)
						},
						unbindEvents: function() {
							avpw$(e.leftArrow).unbind("mousedown", l).unbind("mouseup", p), avpw$(e.rightArrow).unbind("mousedown", c).unbind("mouseup", p)
						}
					}
				}(),
				f = function(e, t, n) {
					var a, i, o, r, s = 30,
						l = 60;
					e.length && (e = e[0]), e.ontouchstart = function(e) {
						var t = AV.util.getTouch(e);
						t && (a = t.pageX, o = t.pageY)
					}, e.ontouchmove = function(e) {
						var t = AV.util.getTouch(e);
						return t && (i = t.pageX, r = t.pageY), !1
					}, e.ontouchend = function(e) {
						var c = i - a,
							p = r - o;
						Math.abs(c) > s && Math.abs(p) < l && (c > s ? t() : n()), i = a = void 0
					}
				},
				h = function(e) {
					e.length && (e = e[0]), e.ontouchstart = e.ontouchmove = e.ontouchend = null
				},
				w = function(t) {
					if (e.itemsPerPage && !e.pageTemplate) {
						var n = t.currentTarget,
							i = e.pageContainer.offset().left,
							o = avpw$(n).offset().left - i;
						o >= p(a + 1) ? (a++, u()) : o < p(a) && (a--, u())
					}
				},
				g = function() {
					1 !== o && (e.bindLongPress ? _.bindEvents() : (avpw$(e.leftArrow).bind("click", function() {
						return d.call(this)
					}), avpw$(e.rightArrow).bind("click", function() {
						return v.call(this)
					})), f(e.pageContainer, d, v), t && t.bind("click", function(e) {
						var t = e.currentTarget,
							n = avpw$(t).attr("pagenum");
						return i = a, a = parseInt(n), u(), !1
					}), e.pageContainer.delegate(".avpw_icon", "click", w))
				},
				m = function() {
					1 !== o && (e.bindLongPress ? _.unbindEvents() : (avpw$(e.leftArrow).unbind("click"), avpw$(e.rightArrow).unbind("click")), h(e.pageContainer), t && t.unbind("click"), e.pageContainer.undelegate(".avpw_icon", "click"))
				},
				b = function() {
					e.pageContainer.html(s()), e.onPageBuilt && e.onPageBuilt.call(this), 1 === o ? (avpw$(e.leftArrow).hide(), avpw$(e.rightArrow).hide(), e.centerContents && (e.pageContainer.css("width", "auto"), e.pageContainer.addClass("avpw_scroll_strip_centered"))) : (avpw$(e.leftArrow).show(), avpw$(e.rightArrow).show(), e.pageContainer.removeClass("avpw_scroll_strip_centered")), g()
				};
			return n.shutdown = function() {
				m(), e.pageContainer.html(""), e.pageContainer.attr("style", ""), t && e.pipContainer.html("")
			}, n.changePage = u, n.pageLeft = d, n.pageRight = v, n.setCurrentPage = function(e) {
				i = a, a = e
			}, n.getCurrentPage = function() {
				return a
			}, n.getLastPage = function() {
				return o - 1
			}, n.getPageCount = function() {
				return o
			}, n.setPageCount = function(e) {
				o = e
			}, b(), n
		};
	var mediator = AV.Events,
		attachSmartClickHandler = function(e, t) {
			var n = function(e) {
					var t = avpw$(this);
					t.unbind("mouseup mouseout touchend")
				},
				a = function(e) {
					var t = avpw$(this);
					return t.bind("mouseup touchend", i), t.bind("mouseout", n), e.stopPropagation(), !1
				},
				i = function(e) {
					var n = avpw$(this);
					return n.unbind("mouseup mouseout touchend", i), e.stopPropagation(), t ? (AV.util.nextFrame(t), !1) : !0
				};
			e.bind("mousedown touchstart", a), e.click(function(e) {
				e.preventDefault()
			})
		};
	AV.colorChoices = ["#000000", "#ffffff", "rgb(255, 0, 0)", "rgb(255, 132, 0)", "rgb(255,240,0)", "rgb(0,255,0)", "rgb(0,0,255)", "rgb(198,0,255)"], AV.brushWidths = [5, 15, 30, 45, 70], AV.buildBlankPreset = function() {
			return AV.template[AV.launchData.layout].blankPreset()
		}, AV.buildBlankCropPreset = function() {
			return AV.template[AV.launchData.layout].blankCropPreset()
		}, AV.toolDefaults = {
			redeye: {
				presets: AV.brushWidths,
				files: [AV.build.feather_baseURL + "redeye.swf"]
			},
			whiten: {
				initialvalue: 10,
				presets: AV.brushWidths,
				files: [AV.build.feather_baseURL + "redeye.swf"]
			},
			blemish: {
				initialvalue: 5,
				presets: AV.brushWidths,
				files: [AV.build.feather_baseURL + "blemish.swf"]
			},
			bulge: {
				radius: 100,
				maxradius: 200,
				power: 50
			},
			pinch: {
				radius: 100,
				maxradius: 200,
				power: 50
			},
			drawing: {
				initialColor: AV.colorChoices[7],
				presetsWidth: AV.brushWidths,
				presetsColor: AV.colorChoices,
				files: [AV.build.feather_baseURL + "drawing.swf"]
			},
			text: {
				presetsColor: AV.colorChoices,
				files: [AV.build.feather_baseURL + "text.swf"]
			},
			textwithfont: {
				presetsColor: AV.colorChoices,
				presetsFont: [{
					label: "Abril Fatface",
					value: "Abril Fatface"
				}, {
					label: "Acme",
					value: "Acme"
				}, {
					label: "Anton",
					value: "Anton"
				}, {
					label: "Arial Black",
					value: "Arial Black",
					system: !0
				}, {
					label: "Bangers",
					value: "Bangers"
				}, {
					label: "Bevan",
					value: "Bevan"
				}, {
					label: "Black Ops One",
					value: "Black Ops One"
				}, {
					label: "Butterfly Kids",
					value: "Butterfly Kids"
				}, {
					label: "Cabin Sketch",
					value: "Cabin Sketch"
				}, {
					label: "Cardo",
					value: "Cardo"
				}, {
					label: "Chelsea Market",
					value: "Chelsea Market"
				}, {
					label: "Chewy",
					value: "Chewy"
				}, {
					label: "Covered By Your Grace",
					value: "Covered By Your Grace"
				}, {
					label: "Dawning of a New Day",
					value: "Dawning of a New Day"
				}, {
					label: "Delius Unicase",
					value: "Delius Unicase"
				}, {
					label: "Didact Gothic",
					value: "Didact Gothic"
				}, {
					label: "Doppio One",
					value: "Doppio One"
				}, {
					label: "Droid Serif",
					value: "Droid Serif"
				}, {
					label: "EB Garamond",
					value: "EB Garamond"
				}, {
					label: "Economica",
					value: "Economica",
					familyStyle: "bolditalic",
					style: "italic"
				}, {
					label: "Francois One",
					value: "Francois One"
				}, {
					label: "Fredoka One",
					value: "Fredoka One"
				}, {
					label: "Georgia",
					value: "Georgia",
					system: !0
				}, {
					label: "Give You Glory",
					value: "Give You Glory"
				}, {
					label: "IM Fell English",
					value: "IM Fell English"
				}, {
					label: "Italiana",
					value: "Italiana"
				}, {
					label: "Kranky",
					value: "Kranky"
				}, {
					label: "La Belle Aurore",
					value: "La Belle Aurore"
				}, {
					label: "Ledger",
					value: "Ledger"
				}, {
					label: "Lobster Two",
					value: "Lobster Two"
				}, {
					label: "Luckiest Guy",
					value: "Luckiest Guy"
				}, {
					label: "Mr Dafoe",
					value: "Mr Dafoe"
				}, {
					label: "Mystery Quest",
					value: "Mystery Quest"
				}, {
					label: "Oswald",
					value: "Oswald",
					familyStyle: "bold"
				}, {
					label: "Overlock",
					value: "Overlock"
				}, {
					label: "Patua One",
					value: "Patua One"
				}, {
					label: "Playball",
					value: "Playball"
				}, {
					label: "Princess Sofia",
					value: "Princess Sofia"
				}, {
					label: "PT Mono",
					value: "PT Mono"
				}, {
					label: "PT Sans Narrow",
					value: "PT Sans Narrow",
					familyStyle: "bold"
				}, {
					label: "PT Serif Caption",
					value: "PT Serif Caption"
				}, {
					label: "Quicksand",
					value: "Quicksand"
				}, {
					label: "Rochester",
					value: "Rochester"
				}, {
					label: "Rokkitt",
					value: "Rokkitt"
				}, {
					label: "Sansita One",
					value: "Sansita One"
				}, {
					label: "Schoolbell",
					value: "Schoolbell"
				}, {
					label: "Shadows Into Light Two",
					value: "Shadows Into Light Two"
				}, {
					label: "Shojumaru",
					value: "Shojumaru"
				}, {
					label: "Special Elite",
					value: "Special Elite"
				}, {
					label: "Stint Ultra Expanded",
					value: "Stint Ultra Expanded"
				}, {
					label: "Tahoma",
					value: "Tahoma",
					system: !0
				}, {
					label: "Times New Roman",
					value: "Times New Roman",
					system: !0
				}, {
					label: "Trebuchet MS",
					value: "Trebuchet MS",
					system: !0
				}, {
					label: "Ultra",
					value: "Ultra"
				}, {
					label: "Varela Round",
					value: "Varela Round"
				}, {
					label: "Verdana",
					value: "Verdana",
					system: !0
				}, {
					label: "Voltaire",
					value: "Voltaire"
				}, {
					label: "Zeyada",
					value: "Zeyada"
				}]
			},
			sharpness: {
				presets: [-100, -33, 33, 100],
				files: [AV.build.feather_baseURL + "blur.swf", AV.build.feather_baseURL + "sharpen.swf"]
			},
			saturation: {
				presets: [-100, -33, 33, 100],
				presetsFlash: [{
					value: 0
				}, {
					value: .66
				}, {
					value: 1.33
				}, {
					value: 2
				}],
				files: [AV.build.feather_baseURL + "saturation.swf"]
			},
			warmth: {
				presets: [-100, -33, 33, 100]
			},
			brightness: {
				presets: [-100, -33, 33, 100],
				presetsFlash: [{
					brightnessvalue: .33,
					contrastvalue: 1
				}, {
					brightnessvalue: .77,
					contrastvalue: 1
				}, {
					brightnessvalue: 1.22,
					contrastvalue: 1
				}, {
					brightnessvalue: 1.66,
					contrastvalue: 1
				}],
				files: [AV.build.feather_baseURL + "brightness.swf"]
			},
			contrast: {
				presets: [-100, -33, 33, 100],
				presetsFlash: [{
					contrastvalue: .33,
					brightnessvalue: 1
				}, {
					contrastvalue: .77,
					brightnessvalue: 1
				}, {
					contrastvalue: 1.22,
					brightnessvalue: 1
				}, {
					contrastvalue: 1.66,
					brightnessvalue: 1
				}],
				files: [AV.build.feather_baseURL + "contrast.swf"]
			},
			colors: {
				min: -133,
				max: 67,
				initialValue: -33,
				files: [AV.build.feather_baseURL + "colors.swf"]
			},
			orientation: {
				presetsFlash: [{
					vertical: !1,
					horizontal: !1
				}, {
					vertical: !1,
					horizontal: !0
				}, {
					vertical: !0,
					horizontal: !1
				}, {
					vertical: !0,
					horizontal: !0
				}],
				files: [AV.build.feather_baseURL + "flip.swf", AV.build.feather_baseURL + "rotate90.swf"]
			},
			crop: {
				files: [AV.build.feather_baseURL + "crop.swf", AV.build.feather_baseURL + "resize.swf"]
			},
			resize: {
				files: [AV.build.feather_baseURL + "resize.swf"]
			},
			overlay: {
				files: [AV.build.feather_baseURL + "overlay.swf"]
			},
			effects: {
				files: [AV.build.feather_baseURL + "effects.swf"],
				optionalFrame: ["singe", "sancarmen", "purple", "thresh", "aqua", "andy", "edgewood", "joecool"]
			},
			enhance: {
				presets: ["hidef", "scenery", "food", "portrait", "night"],
				files: [AV.build.feather_baseURL + "effects.swf"]
			},
			frames: {
				presetsThickness: [1, 2, 3, 4, 5, 6]
			},
			colorsplash: {
				presets: AV.brushWidths
			}
		}, AV.buildColorPicker = function(e, t, n, a) {
			var i, o = 74,
				r = avpw$(t).data("color"),
				s = null,
				l = null,
				c = function(e) {
					var t = {
							h: 0,
							s: 0,
							b: 0
						},
						n = Math.min(e.r, e.g, e.b),
						a = Math.max(e.r, e.g, e.b),
						i = a - n;
					return t.b = a, t.s = 0 !== a ? 255 * i / a : 0, t.h = 0 !== t.s ? e.r === a ? (e.g - e.b) / i : e.g === a ? 2 + (e.b - e.r) / i : 4 + (e.r - e.g) / i : -1, t.h *= 60, t.h < 0 && (t.h += 360), t.s *= 100 / 255, t.b *= 100 / 255, t
				},
				p = function(e) {
					return e = parseInt(e.indexOf("#") > -1 ? e.substring(1) : e, 16), {
						r: e >> 16,
						g: (65280 & e) >> 8,
						b: 255 & e
					}
				},
				u = function(e) {
					var t = c(p(e));
					return 0 === t.s && (t.h = 360), t
				},
				d = function() {
					return avpw$(t).data("color")
				},
				v = function(e) {
					avpw$(t).data("color", e)
				},
				_ = function(e) {
					e = e || d();
					var n = avpw$(t).find(".avpw_isa_color_feedback");
					e ? n.css("background-color", e).addClass("avpw_custom_color_image_with_preview") : n.removeClass("avpw_custom_color_image_with_preview")
				},
				f = function(e) {
					e = e || d(), l.find(".avpw_isa_color_feedback").css("background-color", e)
				},
				h = function() {
					var e = avpw$(t).offset(),
						n = avpw$("#avpw_controls").offset();
					e.left += avpw$(t).width() / 2, e.left -= l.width() / 2, e.left -= n.left, e.top -= n.top, l.css({
						left: e.left + "px",
						top: e.top + o + "px"
					})
				},
				w = function() {
					l && (AV.miniColors.unBindSelectorEvents(), l.undelegate(".avpw_color_picker_confirm", "mousedown touchstart"), s.unbind(), l.hide().remove(), l = s = null, AV.featherUseFlash && AV.FlashAPI.showCanvas())
				};
			return AV.miniColors ? (r = r || e || "#ffffff", i = u(r), s = AV.miniColors.buildSelector(i), l = avpw$(".avpw_color_picker_dropdown_popup"), l && l.length ? (l.unbind(), l.detach()) : l = avpw$(AV.template[AV.launchData.layout].colorPickerContainer()), AV.miniColors.bindSelectorEvents(s), avpw$("#avpw_controls").append(l.append(s)), l.delegate(".avpw_color_picker_confirm", "mousedown touchstart", function(e) {
				e.stopPropagation(), e.preventDefault(), n && n.apply(this, [r]), v(r), _(r), w()
			}), s.bind("clickOutsideBounds", function(e) {
				_(""), w(), a && a.call(this)
			}).bind("setColor", function(e, t) {
				r = "#" + t.hex, f(r), n && n.apply(this, [r, !0])
			}).show(), f(r), h(), AV.featherUseFlash && AV.FlashAPI.hideCanvas(), {
				hideColorPicker: w
			}) : void 0
		}, AV.ControlsWidget.prototype.populateCropPresets = function(e) {
			var t, n, a, i, o, r, s, l, c, p, u = AV.launchData.cropPresetsStrict,
				d = this.imageSizeTracker.isUsingHiResDimensions(AV.launchData);
			AV.featherUseFlash || d ? (p = this.paintWidget.getScaledSize(), l = p.hiresWidth || p.width, c = p.hiresHeight || p.height) : (l = this.paintWidget.width, c = this.paintWidget.height), t = l / c > 1;
			for (var v = [], _ = 0; _ < e.length; _++) {
				var f, h, w, g = e[_] instanceof Array;
				if (h = g ? e[_][1] : e[_], w = g ? e[_][0] : e[_], "custom" === w.toLowerCase()) g = !0, f = {
					label: w,
					width: .85 * l,
					height: .75 * c,
					constrain: !1,
					resize: !1
				};
				else if ("original" === w.toLowerCase()) g = !0, f = {
					label: w,
					width: l,
					height: c,
					constrain: !0,
					resize: !1
				};
				else if (n = h.toLowerCase().indexOf("x"), -1 != n) {
					if (a = h.substr(0, n), i = h.substr(n + 1), o = parseInt(a, 10), r = parseInt(i, 10), o > l || r > c) continue;
					if (!u && (r > l || o > c)) continue;
					g || u || !(t && 1 > o / r || !t && o / r > 1) || (w = r + (h.charAt(n) || "x") + o, s = o, o = r, r = s), f = {
						label: w,
						width: o,
						height: r,
						constrain: !0,
						resize: !0
					}
				} else {
					if (n = h.indexOf(":"), -1 == n && "" !== avpw$.trim(h)) continue;
					a = h.substr(0, n), i = h.substr(n + 1), o = parseInt(a, 10), r = parseInt(i, 10), g || u || !(t && 1 > o / r || !t && o / r > 1) || (w = r + ":" + o, s = o, o = r, r = s), f = {
						label: w,
						width: o,
						height: r,
						constrain: !0,
						resize: !1
					}
				}
				f && (f.strict = u, f.labeled = g, v.push(f))
			}
			return v
		}, AV.Dropdown = function(e) {
			var t, n, a = 74,
				i = "avpw_dropdown_open",
				o = "avpw_dropdown_popup_list_item_selected",
				r = e.updateElement,
				s = e.popupElement,
				l = e.defaultValue,
				c = e.preventClose || !1,
				p = e.disableReposition || !1,
				u = e.disableClick || !1,
				d = e.onShow,
				v = e.onHide,
				_ = function(e, t) {
					e = e || l, n && n.length && n.html(e), s && s.length && (s.find(".avpw_isa_dropdown_item").removeClass(o), t = t || s.find('[data-value="' + e + '"]'), t && t.length && t.addClass(o))
				},
				f = function(t) {
					var n = t.currentTarget,
						a = avpw$(n);
					value = a.data("value"), _(value, n), c && (t.stopPropagation(), t.preventDefault()), e.onItemClicked && !u && e.onItemClicked.apply(this, [value])
				},
				h = function() {
					e.popupParent && e.popupParent.length && e.popupParent.append(s)
				},
				w = function() {
					if (!p) {
						var e = r.offset(),
							t = avpw$("#avpw_controls").offset();
						e.left += r.width() / 2, e.left -= s.width() / 2, e.left -= t.left, e.top -= t.top, s.css({
							left: e.left + "px",
							top: e.top + a + "px"
						})
					}
				},
				g = function(e, n) {
					if (s) {
						var a, i, o = document.createDocumentFragment();
						for (a = 0; a < e.length; a++) i = avpw$(n(e[a])), o.appendChild(i[0]);
						t && t.length ? t.html(o) : s.html(o)
					}
				},
				m = function() {
					r.bind("click", x)
				},
				b = function() {
					r.unbind("click", x)
				},
				y = function() {
					s && s.length && s.remove()
				},
				C = function() {
					s && s.length && (T(), s.slideDown(50), r.addClass(i), d && d.call(this))
				},
				A = function() {
					s && s.length && (r.removeClass(i), s.slideUp(50), k(), v && v.call(this))
				},
				x = function(e) {
					e.preventDefault(), e.stopPropagation(), s && s.is(":visible") ? A() : C()
				},
				I = function() {
					t = s.find(".avpw_dropdown_popup_list"), n = r.find(".avpw_isa_dropdown_display"), h(), m(), e.items && e.itemTemplate && g(e.items, e.itemTemplate), _()
				},
				T = function() {
					s && s.delegate(".avpw_isa_dropdown_item", "click", f), avpw$(window).bind("click", A), mediator.on("layout:resize", w)
				},
				k = function() {
					s && s.undelegate(".avpw_isa_dropdown_item", "click"), avpw$(window).unbind("click", A), mediator.off("layout:resize", w)
				},
				V = this;
			return V.position = w, V.getPopupElement = function() {
				return s
			}, V.show = C, V.hide = A, V.update = _, V.shutdown = function() {
				k(), b(), y(), t = void 0, n = void 0, l = void 0, r = void 0, s = void 0
			}, I(), V
		}, AV.ContentBrowser = function(e) {
			e || (e = {});
			var t, n, a = e.container || null,
				i = e.packsInOrder || [],
				o = e.packsById || {},
				r = e.buildPackUI,
				s = e.buildItem,
				l = (e.itemWidth, e.arrowWidth || 62, {}),
				c = a.find(".avpw_content_packs"),
				p = a.find(".avpw_content_items");
			a.delegate(".avpw_pack_icon", "click", function(e) {
				if (e.stopPropagation(), e.preventDefault(), !avpw$(this).hasClass("avpw_selected_pack")) {
					var t = avpw$(this).data("packIndex");
					l.openPackItemsByIndex(t)
				}
			}), avpw$("#avpw_tool_options_container").delegate("#avpw_up_one_level", "click", function(e) {
				e.stopPropagation(), e.preventDefault(), w()
			});
			var u, d, v;
			l.build = function() {
				v = avpw$("#avpw_breadcrumb_toolname").html();
				var n = c.find(".avpw_scroll_strip"),
					a = AV.controlsWidgetInstance.layoutNotify(AV.launchData.openType, "getDims"),
					s = e.packWidth || 90,
					l = a.INNER_BROWSER_WIDTH / s | 0,
					p = s * l;
				n.css({
					width: i.length * s + "px",
					paddingRight: p + "px"
				}), t = new AV.Pager({
					leftArrow: c.find(".avpw_prev"),
					rightArrow: c.find(".avpw_next"),
					itemCount: i.length,
					itemsPerPage: l,
					pageWidth: p,
					pageContainer: n,
					itemBuilder: function(e) {
						return r(o[i[e].identifier], e)
					}
				}), w(!1, null, !0)
			};
			var _, f = function() {
					u && u.removeClass("avpw_selected_pack");

				},
				h = 300,
				w = function(a, i, o) {
					window.clearTimeout(_), o || avpw$("#avpw_controls").addClass("avpw_content_transition"), _ = window.setTimeout(function() {
						o || avpw$("#avpw_controls").removeClass("avpw_content_transition"), a ? (n.changePage(), avpw$("#avpw_tool_options_container").find("#avpw_all_effects").hide(), avpw$("#avpw_tool_options_container").find("#avpw_up_one_level").show(), avpw$("#avpw_controls").addClass("avpw_content_items_mode")) : (e && e.onBackButtonClicked && e.onBackButtonClicked.call(this), avpw$("#avpw_breadcrumb_toolname").html(v), t.changePage(), avpw$("#avpw_controls").removeClass("avpw_content_items_mode"), avpw$("#avpw_tool_options_container").find("#avpw_all_effects").show(), avpw$("#avpw_tool_options_container").find("#avpw_up_one_level").hide(), f()), i && i.call(this)
					}, o ? 0 : h)
				},
				g = function(t) {
					if (d = t) {
						var a = d.title || d.displayName;
						avpw$("#avpw_breadcrumb_toolname").html(a)
					}
					var i = e.itemWidth || 81,
						o = e.itemsPerPage,
						r = i * o,
						l = t.items.length,
						c = p.find(".avpw_scroll_strip");
					c.css({
						width: l * i + "px",
						paddingRight: r + "px"
					}), c.removeClass("avpw_page_mode_built"), n = new AV.Pager({
						leftArrow: p.find(".avpw_prev"),
						rightArrow: p.find(".avpw_next"),
						itemCount: l,
						itemsPerPage: o,
						pageWidth: r,
						pageContainer: c,
						itemBuilder: function(e) {
							var n = t.items[e];
							return s(n, e, AV.util.getSafeAssetBaseURL(t.assetsBaseURL))
						},
						onPageBuilt: function() {
							e.onItemsOpen && e.onItemsOpen.call(this), window.setTimeout(function() {
								c.addClass("avpw_page_mode_built")
							}, h)
						}
					})
				};
			return l.openPackItemsByIndex = function(e) {
				f(), u = c.find(".avpw_scroll_strip").children().eq(e);
				var t = o[i[e].identifier];
				g(t), u.addClass("avpw_selected_pack"), u.css({
					left: 0
				}), w(!0)
			}, l.getCurrentPackId = function() {
				return "undefined" != typeof d ? d.identifier : null
			}, l.destroy = function() {
				n && n.shutdown(), t && t.shutdown(), avpw$("#avpw_tool_options_container").find("#avpw_all_effects").show(), avpw$("#avpw_tool_options_container").find("#avpw_up_one_level").hide(), d = null, a.undelegate(".avpw_pack_icon", "click"), a.undelegate(".avpw_selected_pack", "click"), mediator.off("layout:resize", l.build), avpw$("#avpw_tool_options_container").undelegate("#avpw_up_one_level", "click")
			}, mediator.on("layout:resize", l.build), l
		}, AV.PacksAndItems = function(e) {
			var t = e.browser,
				n = e.packBrowser,
				a = e.pager,
				i = e.packPager,
				o = e.buildPacksHTML,
				r = e.buildPackItemsHTML,
				s = e.currentPack,
				l = AV.support.getVendorProperty("transition"),
				c = this,
				p = function(e, t) {
					var n = "avpw_back_button_hidden",
						a = 100,
						i = avpw$("#avpw_all_effects"),
						o = avpw$("#avpw_up_one_level"),
						r = function(r) {
							e ? (o.text(e), t && o.bind("click", t), i.hide(), r ? o.show() : (o.addClass(n), o.show(), window.setTimeout(function() {
								o.removeClass(n)
							}, a))) : (o.unbind("click"), o.hide(), r ? i.show() : (i.addClass(n), i.show(), window.setTimeout(function() {
								i.removeClass(n)
							}, a)))
						};
					i.is(":visible") ? (i.addClass(n), window.setTimeout(function() {
						r(), i.removeClass("hidden")
					}, a)) : o.is(":visible") ? (o.addClass(n), window.setTimeout(function() {
						r(), o.removeClass(n)
					}, a)) : r(!0)
				},
				u = function(e) {
					s !== e && (s = e || s)
				},
				d = function(e) {
					if (n.find(".avpw_pack_icon_selected").removeClass("avpw_pack_icon_selected"), avpw$(e).addClass("avpw_pack_icon_selected"), l) {
						var a = AV.support.getVendorProperty("transform"),
							o = AV.controlsWidgetInstance.layoutNotify(AV.launchData.openType, "getDims"),
							s = o.INNER_BROWSER_WIDTH + "px";
						t[0].style[a] = "translateX(" + s + ")", t.addClass("avpw_transition_to_pack_contents"), t.show(), window.setTimeout(function() {
							var a = AV.support.getVendorProperty("transform");
							e.style[a] = "translateX(" + s + ")", avpw$(e).removeClass("avpw_pack_icon_selected"), window.setTimeout(function() {
								n.hide(), i && (i.shutdown(), i = null), r && r(), window.setTimeout(function() {
									t.removeClass("avpw_transition_to_pack_contents")
								}, 200)
							}, 600)
						}, 100)
					} else n.hide(), i && (i.shutdown(), i = null), r && r(), t.show()
				},
				v = function() {
					if (l) {
						var e = AV.support.getVendorProperty("transform"),
							i = AV.controlsWidgetInstance.layoutNotify(AV.launchData.openType, "getDims"),
							r = i.INNER_BROWSER_WIDTH + "px";
						t[0].style[e] = "translateX(" + r + ")", window.setTimeout(function() {
							a && (a.shutdown(), a = null), p(), o && o(), n.show()
						}, 400)
					} else a && (a.shutdown(), a = null), p(), o && o(), n.show()
				},
				_ = function(e) {
					return c.onBackButtonClicked(), v(), !1
				};
			return c.onPackClicked = function(e) {
				var t = e.currentTarget,
					n = avpw$(t).data("pack");
				return u(n), p(AV.getLocalizedString("Back"), _), d(t), !1
			}, c.onPackInfoClicked = function(e) {
				var t = e.currentTarget;
				_packOfInterest = t;
				var n = avpw$(t).data("pack");
				return AV.controlsWidgetInstance.assetManager.showAssetPurchaseView(n, c.onPurchaseButtonClicked), !1
			}, c.onBackButtonClicked = function() {}, c.onPurchaseButtonClicked = function(e) {}, c.getCurrentPack = function() {
				return s
			}, c.setCurrentPack = function(e) {
				u(e)
			}, c.getPackOfInterest = function() {
				return _packOfInterest
			}, c.updateCancelButton = p, c
		},
		function(e) {
			e.fn.slider = function(t) {
				t = AV.util.extend({
					max: 100,
					min: 0,
					value: 50
				}, t);
				var n, a = 0,
					i = a,
					o = 0,
					r = null,
					s = null,
					l = !1,
					c = null,
					p = this,
					u = null,
					d = 0,
					v = null,
					_ = function(e) {
						var t = o !== a ? (e - a) / (o - a) : 0;
						return t
					},
					f = function(e) {
						var t = a + e * (o - a);
						return parseFloat(t.toFixed(5))
					},
					h = function(e) {
						var t;
						e ? (n = n || p.outerWidth() || 1, t = e - p.offset().left, t /= n, t = t > 1 ? 1 : t, t = 0 > t ? 0 : t, i = f(t)) : t = _(i), s.length && s.css(l ? t > .5 ? {
							left: "50%",
							width: 100 * (t - .5) + "%"
						} : {
							left: 100 * t + "%",
							width: 100 * (.5 - t) + "%"
						} : {
							left: "0",
							width: 100 * t + "%"
						}), r.css("left", 100 * t + "%")
					},
					w = function(e, t) {
						switch (e) {
							case "value":
								if (arguments.length < 1) return i;
								i = t, h();
								break;
							case "destroy":
								k()
						}
					},
					g = function(e) {
						p.trigger("slidestart", [e]), d && (v = null, u = window.setInterval(function() {
							v && (p.trigger("slide", [v]), v = null)
						}, d))
					},
					m = function(e) {
						p.trigger("slidechange", [e]), d && window.clearInterval(u)
					},
					b = function(t) {
						return e(document).bind("mousemove", y).bind("mouseup blur", C), g({
							value: i
						}), !1
					},
					y = function(e) {
						var t = AV.util.getTouch(e);
						h(t ? t.pageX : e.pageX);
						var n = {
							value: i
						};
						d ? v = n : p.trigger("slide", [n])
					},
					C = function(t) {
						return e(document).unbind("mousemove", y).unbind("mouseup blur", C), m({
							value: i
						}), !1
					},
					A = function(e) {
						return r.parent().bind("touchmove", y).bind("touchend", x), g({
							value: i
						}), !1
					},
					x = function(e) {
						return r.parent().unbind("touchmove", y).unbind("touchend", x), m({
							value: i
						}), !1
					},
					I = function(e) {
						var t = AV.util.getTouch(e);
						h(t ? t.pageX : e.pageX);
						var n = {
							value: i
						};
						p.trigger("slidechange", [n])
					},
					T = function() {
						i = t.value, a = t.min, o = t.max, s = p.find(".avpw_slider_goo").eq(0), l = !!p.find(".avpw_slider_divider").length, r = p.find("a").eq(0), c = p.parents(".avpw_isa_slider_container"), t.delay && (d = t.delay), c.length && (c.bind("mousedown", b), d ? c.bind("mousedown", I) : c.bind("click", I), e.support.touch && (c.bind("touchstart", A), d && c.bind("touchstart", I))), e.support.touch && r.bind("touchstart", A), r.bind("mousedown", b)
					},
					k = function() {
						r.unbind("mousedown mouseup blur touchstart"), c.length && (c.unbind("mousedown", I).unbind("mousedown", b).unbind("touchstart", I).unbind("touchstart", A).unbind("click", I), c = null), s = null, r = null, window.clearInterval(u), u = null, d = 0, v = null
					};
				return T(), p.slider = w, p
			}
		}(avpw_jQuery),
		function(e, t) {
			e.fn.pressed = function(t) {
				var n = function(n) {
						var i = e(this);
						return i.addClass(t), i.bind("mouseup mouseout touchend", a), !0
					},
					a = function(n) {
						var i = e(this);
						return i.removeClass(t), i.unbind("mouseup mouseout touchend", a), !0
					};
				return this.bind("mousedown touchstart", n), this
			}
		}(avpw_jQuery, window),
		function(e, t) {
			var n, a;
			! function() {
				for (var e = 0, t = ["webkit", "moz"], i = 0; i < t.length && !n; ++i) n = window[t[i] + "RequestAnimationFrame"], a = window[t[i] + "CancelAnimationFrame"] || window[t[i] + "CancelRequestAnimationFrame"];
				n || (n = function(t, n) {
					var a = (new Date).getTime(),
						i = Math.max(0, 16 - (a - e)),
						o = window.setTimeout(function() {
							t(a + i)
						}, i);
					return e = a + i, o
				}), a || (a = function(e) {
					clearTimeout(e)
				})
			}(n, a)
		}(avpw_jQuery, window), AV.ControlsWidget.prototype.layout.aviary = function() {
			var e, t, n, a, i, o, r, s, l, c, p = "fullscreen",
				u = !1,
				d = {
					TITLE_HEIGHT: 30,
					HEADER_HEIGHT: 108,
					FOOTER_HEIGHT: 35,
					MINIMUM_WIDGET_HEIGHT: 396,
					MODE_ACTION_WIDTH: 119,
					BOOKEND_WIDTH: 48,
					INNER_BOOKEND_WIDTH: 40,
					CANVAS_MARGIN: 0,
					CANVAS_PADDING: 10,
					MINIMUM_WIDGET_WIDTH: 712,
					TOOL_ICON_WIDTH: 70,
					PRESET_ICON_WIDTH: 54,
					PRESET_CROP_ICON_WIDTH: 82,
					GENERIC_LEAD_IN_WIDTH: 10,
					BORDER_ICON_WIDTH: 85,
					STICKER_ICON_WIDTH: 80,
					STICKER_ROLL_WIDTH: 80,
					FILTER_IMAGE_WIDTH: 81,
					FILTER_CANISTER_WIDTH: 63,
					FILTER_LEAD_IN_WIDTH: 93,
					TEXT_ADD_TEXT_BUTTON_WIDTH: 121,
					CANVAS_HEIGHT: void 0,
					CANVAS_WIDTH: void 0,
					TOOLS_BROWSER_WIDTH: void 0,
					INNER_BROWSER_WIDTH: void 0,
					TOOL_CONTAINER_WIDTH: void 0
				},
				v = {},
				_ = function() {
					var e = avpw$("#avpw_controls"),
						t = e.width(),
						n = e.height();
					(!t || t < d.MINIMUM_WIDGET_WIDTH) && (t = d.MINIMUM_WIDGET_WIDTH), (!n || n < d.MINIMUM_WIDGET_HEIGHT) && (n = d.MINIMUM_WIDGET_HEIGHT), d.CANVAS_HEIGHT = n - (d.TITLE_HEIGHT + d.HEADER_HEIGHT + d.FOOTER_HEIGHT), d.CANVAS_WIDTH = t - 2 * d.CANVAS_MARGIN, d.TOOL_CONTAINER_WIDTH = t - 2 * d.MODE_ACTION_WIDTH, d.TOOLS_BROWSER_WIDTH = t - (2 * d.BOOKEND_WIDTH + d.MODE_ACTION_WIDTH), d.INNER_BROWSER_WIDTH = d.TOOL_CONTAINER_WIDTH - (2 * d.INNER_BOOKEND_WIDTH + 2 + d.GENERIC_LEAD_IN_WIDTH)
				},
				f = function() {
					var e = v.getEmbedElement(),
						a = AV.support.getVendorProperty("transform");
					a && (t = avpw$(AV.template[AV.launchData.layout].zoomControls()), e.append(t), t.delegate("#avpw_zoom_button", "mousedown", function() {
						return t.hasClass("avpw_zoom_open") ? v.disableZoomMode() : v.enableZoomMode(), !1
					}), n = avpw$(AV.template[AV.launchData.layout].zoomModeOverlay()), avpw$("#avpw_tool_content_wrapper").append(n).bind("click", v.disableZoomMode), n.bind("click", v.disableZoomMode), v.showZoomButton()), e.append(AV.template[AV.launchData.layout].canvasControls())
				},
				h = function(e) {
					var t;
					e ? (t = AV.util.getUserFriendlyToolName(e), t = AV.getLocalizedString(t), avpw$("#avpw_breadcrumb_header").hide(), avpw$("#avpw_breadcrumb_toolname").html(t), AV.controlsWidgetInstance && AV.controlsWidgetInstance.layoutNotify(AV.launchData.openType, "updateUndoRedo", [!1, !1]), u = !0) : (avpw$("#avpw_breadcrumb_header").show(), avpw$("#avpw_breadcrumb_toolname").html(""), u = !1, AV.controlsWidgetInstance && AV.controlsWidgetInstance.layoutNotify(AV.launchData.openType, "updateUndoRedo", [AV.paintWidgetInstance.actions.canUndo(), AV.paintWidgetInstance.actions.canRedo()]))
				},
				w = function(e) {
					e && v.getCanvasControlsElement().css({
						top: e.y0 + d.CANVAS_PADDING + "px",
						left: e.x0 + d.CANVAS_PADDING + "px",
						width: e.w + "px",
						height: e.h + "px"
					})
				};
			return v.getDims = function() {
				return d
			}, v.onClose = function(e) {
				var t = AV.launchData.closeDelay;
				"fullscreen" === p && (e || 0 === t ? avpw$("#avpw_fullscreen_bg").hide() : avpw$("#avpw_fullscreen_bg").fadeOut(t)), AV.launchData.noCloseButton || (e || 0 === t ? avpw$("#avpw_control_cancel_pane").hide() : avpw$("#avpw_control_cancel_pane").fadeOut(t))
			}, v.onShutdown = function() {
				mediator.off("layout:resize", _), mediator.off("layout:resize", v.scaleCanvas), mediator.off("tool:open", h), mediator.off("tool:close", h), e && (e.shutdown(), e = null), t && (t.undelegate().detach().remove(), t = null), n && (n.unbind().detach().remove(), n = null), avpw$("#avpw_tool_content_wrapper").unbind("click", v.disableZoomMode);
				var a = v.getEmbedElement();
				avpw$(a).children().remove(), avpw$(a).hide(), o = r = void 0, s = l = void 0, c = void 0
			}, v.getToolsPerPage = function() {
				return d.TOOLS_BROWSER_WIDTH / d.TOOL_ICON_WIDTH | 0
			}, v.getPresetsPerPage = function() {
				return d.INNER_BROWSER_WIDTH / d.PRESET_ICON_WIDTH | 0
			}, v.getCropPresetsPerPage = function() {
				return d.INNER_BROWSER_WIDTH / d.PRESET_CROP_ICON_WIDTH | 0
			}, v.getBordersPerPage = function() {
				return d.INNER_BROWSER_WIDTH / d.BORDER_ICON_WIDTH | 0
			}, v.getStickersPerPage = function() {
				return d.INNER_BROWSER_WIDTH / d.STICKER_ICON_WIDTH | 0
			}, v.getStickerPacksPerPage = function() {
				return d.INNER_BROWSER_WIDTH / d.STICKER_ROLL_WIDTH | 0
			}, v.getFiltersPerPage = function() {
				return d.INNER_BROWSER_WIDTH / d.FILTER_IMAGE_WIDTH | 0
			}, v.getFilterPacksPerPage = function() {
				return d.INNER_BROWSER_WIDTH / d.FILTER_CANISTER_WIDTH | 0
			}, v.getEmbedElement = function(e) {
				return avpw$("#avpw_canvas_embed")
			}, v.getCanvasControlsElement = function() {
				return c = c || avpw$("#avpw_canvas_controls_layer")
			}, v.getMaxDims = function() {
				return {
					width: d.CANVAS_WIDTH - 2 * d.CANVAS_PADDING,
					height: d.CANVAS_HEIGHT - 2 * d.CANVAS_PADDING
				}
			}, v.getScaledImageDims = function(e) {
				var t, n, a, i = v.getMaxDims();
				return e && (t = AV.util.getScaledDims(e.width, e.height, i.width, i.height), n = t.width, a = t.height, avpw$(e).css({
					width: n + "px",
					height: a + "px",
					marginLeft: "-" + (n / 2 | 0) + "px",
					marginTop: "-" + (a / 2 | 0) + "px"
				})), t || i
			}, v.getScaledImageDims_Flash = function(e) {
				var t = d.CANVAS_HEIGHT < d.CANVAS_WIDTH ? d.CANVAS_HEIGHT : d.CANVAS_WIDTH;
				t -= 2 * d.CANVAS_PADDING;
				var n = AV.util.getScaledDims(e.width, e.height, t);
				return n
			}, v.placeControls = function(e) {
				var t = AV.launchData.closeDelay;
				p = e ? "embed" : "fullscreen";
				var n = avpw$("#avpw_holder");
				n.addClass("avpw_is_" + p), "embed" === p ? (n.detach(), e = AV.util.getImageElem(e), n.appendTo(e)) : 0 === t ? avpw$("#avpw_fullscreen_bg").show() : avpw$("#avpw_fullscreen_bg").fadeIn(t), _(), AV.launchData.noCloseButton || (0 === t ? avpw$("#avpw_control_cancel_pane").show() : avpw$("#avpw_control_cancel_pane").fadeIn(t)), avpw$("#avpw_up_one_level").hide(), f()
			}, v.showCanvasControlsElement = function() {
				v.getCanvasControlsElement().addClass("avpw_canvas_controls_ready")
			}, v.hideCanvasControlsElement = function() {
				v.getCanvasControlsElement().removeClass("avpw_canvas_controls_ready")
			}, v.placeControls_Flash = v.placeControls, v.launchStage2_Flash = function() {}, v.disableControls = function(e) {
				AV.featherUseFlash && AV.FlashAPI.hideCanvas();
				var t = avpw$("#avpw_messaging");
				e ? t.show() : window.setTimeout(function() {
					t.show()
				}, 400), AV.util.nextFrame(function() {
					t.addClass("avpw_messaging_confirmation"), avpw$("#avpw_tool_content_wrapper").addClass("avpw_disabled_outer_container")
				})
			}, v.enableControls = function(e) {
				AV.featherUseFlash && AV.FlashAPI.showCanvas();
				var t = avpw$("#avpw_messaging");
				t.removeClass("avpw_messaging_confirmation"), avpw$("#avpw_tool_content_wrapper").removeClass("avpw_disabled_outer_container"), window.setTimeout(function() {
					t.hide()
				}, 400)
			}, v.scaleCanvas = function(e, t) {
				var n = v.getMaxDims();
				e = e || n.width, t = t || n.height, AV.featherUseFlash || AV.controlsWidgetInstance.canvasUI && AV.controlsWidgetInstance.canvasUI.viewport.fitLayout(e, t), v.setZoom()
			}, v.updateImageScaledIndicator = function() {
				var e;
				AV.paintWidgetInstance ? AV.controlsWidgetInstance.imageSizeTracker.isDisplayingImageSize(AV.launchData) && (e = AV.paintWidgetInstance.getScaledSize(), avpw$("#avpw_size_indicator").html((e.hiresWidth || e.width) + " x " + (e.hiresHeight || e.height))) : avpw$("#avpw_size_indicator").html("")
			}, v.setZoom = function() {
				var t, n = AV.support.getVendorProperty("transform");
				n && (t = AV.controlsWidgetInstance.canvasUI ? 1 / AV.controlsWidgetInstance.canvasUI.viewport.getRatio() : 1, e && (e.shutdown(), e = null), e = new AV.controlsWidgetInstance.Slider({
					element: document.getElementById("avpw_zoom_slider"),
					min: t,
					max: 1.5,
					defaultValue: t,
					onslide: function(e, t) {
						AV.controlsWidgetInstance.canvasUI.viewport.zoomByRatio(t.value)
					},
					onchange: function(e, t) {
						AV.controlsWidgetInstance.canvasUI.viewport.zoomByRatio(t.value)
					}
				}), e.reset(), e.addListeners())
			}, v.enableZoomMode = function() {
				var e = AV.controlsWidgetInstance;
				if (t) {
					t.addClass("avpw_zoom_open"), e.canvasUI && e.canvasUI.enablePan();
					var a = e.toolManager.notify(e.toolManager.getActiveTool(), "onEnableZoomMode");
					a || n.addClass("avpw_zoom_open")
				}
			}, v.disableZoomMode = function(e) {
				var a = AV.controlsWidgetInstance;
				t && (t.removeClass("avpw_zoom_open"), a.toolManager.notify(a.toolManager.getActiveTool(), "onDisableZoomMode"), n.removeClass("avpw_zoom_open"))
			}, v.showZoomButton = function() {
				t && (i && (window.clearTimeout(i), i = null), t.show(), a = window.setTimeout(function() {
					t.addClass("avpw_zoom_visible")
				}, 100))
			}, v.hideZoomButton = function() {
				t && (a && (window.clearTimeout(a), a = null), t.removeClass("avpw_zoom_visible"), i = window.setTimeout(function() {
					t.hide()
				}, 200))
			}, v.updateUndoRedo = function(e, t) {
				u || (o = o || avpw$("#avpw_history_undo"), r = r || avpw$("#avpw_history_redo"), s = s || avpw$("#avpw_history_undo_blocker"), l = l || avpw$("#avpw_history_redo_blocker"), e ? (o.removeClass("avpw_history_disabled"), s.hide()) : (o.addClass("avpw_history_disabled"), s.show()), t ? (r.removeClass("avpw_history_disabled"), l.hide()) : (r.addClass("avpw_history_disabled"), l.show()))
			}, v.showView = function(e, t) {
				var n;
				return function(a, i) {
					var o = 200,
						r = t.getElementById("avpw_tool_main_container"),
						s = t.getElementById("avpw_tool_options_container"),
						l = avpw$("#avpw_controls");
					switch (n && (e.clearTimeout(n), n = void 0), a) {
						case "editpanel":
							l.removeClass("avpw_main_mode"), n = e.setTimeout(function() {
								r.style.display = "none", s.style.display = "block", l.addClass("avpw_editpanel_mode")
							}, o);
							break;
						case "main":
							l.removeClass("avpw_editpanel_mode"), n = e.setTimeout(function() {
								s.style.display = "none", r.style.display = "block", l.addClass("avpw_main_mode")
							}, o)
					}
				}
			}(window, document), v.bindEvents = function() {
				mediator.on("layout:resize", _), mediator.on("layout:resize", v.scaleCanvas), mediator.on("canvas:resize", w), mediator.on("tool:open", h), mediator.on("tool:close", h)
			}, v.bindEvents(), v
		}(), AV.ControlsWidget.prototype.bindControls = function() {
			var e = this;
			avpw$(window).bind("resize", this.windowResized), avpw$("#avpw_controls").bind("mousedown", function(e) {
				var t = e.target.tagName.toLowerCase();
				"input" != t && "textarea" != t && "object" != t && e.preventDefault()
			}), AV.launchData.debug && avpw$("#avpw_logo").click(function() {
				return !1
			}.AV_bindInst(this)), avpw$(".avpw_button").pressed("avpw_button_down"), avpw$(".avpw_tool_icon").pressed("avpw_tool_icon_down"), avpw$(".avpw_checkmark_button .avpw_inset_button").pressed("avpw_inset_button_down"), attachSmartClickHandler(avpw$("#avpw_save_button", "#avpw_tool_main_container"), this.onSaveButtonClicked.AV_bindInst(this)), avpw$("#avpw_control_cancel_pane_inner").click(this.cancel.AV_bindInst(this)), avpw$("#avpw_control_main_scrolling_region").delegate(".avpw_tool_icon", "click", function() {
				return mediator.trigger("tool:open", avpw$(this).data("toolname"), this), !1
			}), avpw$("#avpw_resume_editing").click(function() {
				return e.messager.hide("avpw_aviary_quitareyousure"), !1
			}), avpw$("#avpw_close_feedbackok").click(function() {
				return mediator.trigger("modal:hide", "avpw_aviary_aviaryfeedback"), !1
			}), avpw$("#avpw_resume_aftersave").click(function() {
				return e.messager.hide("avpw_aviary_beensaved"), !1
			}), avpw$("#avpw_close_aftersave").click(function() {
				return e.cancel.AV_bindInst(e)(), e.messager.hide("avpw_aviary_beensaved"), !1
			});
			var t = function() {
				return e.toolsPager.changePage(!0), mediator.trigger("tool:close"), !1
			};
			attachSmartClickHandler(avpw$("#avpw_all_effects", "#avpw_tool_options_container"), function() {
				return e.paintWidget.actions.truncate(), mediator.trigger("tool:cancel"), t()
			}), mediator.on("tool:commitDone", t), attachSmartClickHandler(avpw$("#avpw_apply_container"), function() {
				return AV.util.nextFrame(function() {
					mediator.trigger("tool:commit")
				}), !1
			}), avpw$("#avpw_close_save").click(function() {
				return e.messager.hide("avpw_aviary_quitareyousure", e.onSaveButtonClicked.AV_bindInst(e)), !1
			}), avpw$("#avpw_close_nosave").click(function() {
				return AV.paintWidgetCloser(), !1
			}), avpw$("#avpw_close_unsupported").click(function() {
				return AV.paintWidgetCloser(), !1
			}), avpw$("#avpw_close_forcecrop_close").click(function() {
				return AV.paintWidgetCloser(), !1
			}), avpw$("#avpw_history_undo").click(function() {
				mediator.trigger("tool:undo")
			}), avpw$("#avpw_history_redo").click(function() {
				mediator.trigger("tool:redo")
			}), avpw$(".avpw_prev").bind("mousedown", function() {
				avpw$(this).addClass("avpw_prev_down")
			}).bind("mouseup mouseout", function() {
				avpw$(this).removeClass("avpw_prev_down")
			}), avpw$(".avpw_next").bind("mousedown", function() {
				avpw$(this).addClass("avpw_next_down")
			}).bind("mouseup mouseout", function() {
				avpw$(this).removeClass("avpw_next_down")
			}), mediator.on("showWaitThrobber", this.showWaitThrobber.AV_bindInst(this))
		}, AV.ControlsWidget.prototype.unbindControls = function() {
			mediator.off("showWaitThrobber"), mediator.trigger("showWaitThrobber"), AV.BrushCursor.shutdown(), avpw$(window).unbind("resize", this.windowResized), avpw$("#avpw_controls").unbind("mousedown"), AV.launchData.debug && avpw$("#avpw_logo").unbind(), avpw$(".avpw_button").unbind("mousedown"), avpw$(".avpw_tool_icon").unbind("mousedown"), avpw$(".avpw_checkmark_button .avpw_inset_button").unbind("mousedown"), avpw$("#avpw_save_button").unbind("click"), avpw$("#avpw_control_cancel_pane_inner").unbind("click"), avpw$("#avpw_control_main_scrolling_region").undelegate(".avpw_tool_icon", "click"), avpw$("#avpw_resume_editing").unbind(), avpw$("#avpw_tool_options_container").undelegate("#avpw_all_effects", "click"), mediator.off("tool:commitDone"), avpw$("#avpw_changes_resume").unbind("click"), avpw$("#avpw_changes_discard").unbind("click"), avpw$("#avpw_close_nosave").unbind(), avpw$("#avpw_close_save").unbind(), avpw$("#avpw_close_unsupported").unbind(), avpw$("#avpw_close_forcecrop_close").unbind(), avpw$("#avpw_resume_aftersave").unbind("click"), avpw$("#avpw_close_aftersave").unbind("click"), avpw$("#avpw_history_undo").unbind("click"), avpw$("#avpw_history_redo").unbind("click"), avpw$(".avpw_prev").unbind("mousedown").unbind("mouseup"), avpw$(".avpw_next").unbind("mousedown").unbind("mouseup"), this.brushPreview && this.brushPreview.destroy()
		}, AV.ControlsWidget.prototype.brushPreview = function(e) {
			var t, n, a, i, o = 100,
				r = 1e3,
				s = 400,
				l = {},
				c = function() {
					t = avpw$(AV.template[AV.launchData.layout].brushPreviewOverlay()), n = t.find(".avpw_brush_preview_display"), avpw$("#avpw_controls").append(t)
				};
			return l.show = function(l, p) {
				AV.featherUseFlash || (t && t.length || c(), p ? AV.controlsWidgetInstance._drawUICircle(n, l, p, p) : AV.controlsWidgetInstance._drawUICircle(n, l, "#fff"), t.removeClass("avpw_brush_preview_visible"), t.removeClass("avpw_brush_preview_fadeout"), t.show(), e.clearTimeout(a), e.clearTimeout(i), AV.util.nextFrame(function() {
					t.addClass("avpw_brush_preview_visible"), a = e.setTimeout(function() {
						t.removeClass("avpw_brush_preview_visible"), t.addClass("avpw_brush_preview_fadeout")
					}, o + r), i = e.setTimeout(function() {
						t.hide()
					}, o + r + s)
				}))
			}, l.destroy = function() {
				e.clearTimeout(a), e.clearTimeout(i), t && t.length && t.remove(), t = null, n = null, a = i = null
			}, l
		}(window), AdjustmentsPanel.prototype.init = function(e) {
			this.controls = e
		}, AdjustmentsPanel.prototype.panelWillOpen = function() {
			this.settings = AV.util.extend({}, this.config.defaultSettings), this.currentMode = Object.keys(this.config.defaultSettings)[0], this.$container = avpw$(this.config.containerID), this.paintModule = this.controls.paintWidget.module[this.config.paintWidgetModuleName];
			var e = {
				element: this.$container.find(this.config.sliderID),
				min: -100,
				max: 100,
				defaultValue: 0,
				onchange: this.onSliderChange.AV_bindInst(this)
			};
			AV.featherGLEnabled && (e.onslide = this.onSliderChange.AV_bindInst(this)), this.slider = new this.controls.Slider(e), this.slider.setValue(this.settings[this.currentMode]), this.addListeners(), this.$container.find(".avpw_inset_button_down").removeClass("avpw_inset_button_down"), this.$container.find(".avpw_inset_button").first().addClass("avpw_inset_button_down")
		}, AdjustmentsPanel.prototype.addListeners = function() {
			avpw$(".avpw_inset_button", this.$container).on("click", this.onModeChange.AV_bindInst(this)), this.slider && this.slider.addListeners()
		}, AdjustmentsPanel.prototype.removeListeners = function() {
			avpw$(".avpw_inset_button", this.$container).off("click"), this.slider && this.slider.removeListeners()
		}, AdjustmentsPanel.prototype.panelDidOpen = function() {}, AdjustmentsPanel.prototype.panelWillClose = function() {
			this.removeListeners()
		}, AdjustmentsPanel.prototype.shutdown = function() {
			this.removeListeners()
		}, AdjustmentsPanel.prototype.onSliderChange = function(e, t) {
			this.settings[this.currentMode] = t.value, this.applyPreview()
		}, AdjustmentsPanel.prototype.onModeChange = function(e) {
			var t = avpw$(e.currentTarget);
			this.$container.find(".avpw_inset_button_down").removeClass("avpw_inset_button_down"), t.addClass("avpw_inset_button_down"), this.currentMode = t.data("mode"), "undefined" == typeof this.settings[this.currentMode], this.slider.setValue(this.settings[this.currentMode])
		}, AdjustmentsPanel.prototype.commit = function() {
			this.paintModule.commit()
		};
	var lightingPanel = new AdjustmentsPanel({
		paintWidgetModuleName: "lighting",
		containerID: "#avpw_controlpanel_lighting",
		sliderID: "#avpw_lighting_slider",
		defaultSettings: {
			brightness: 0,
			contrast: 0,
			highlights: 0,
			shadows: 0,
			alpha: 1,
			blendMode: "normal"
		}
	});
	lightingPanel.applyPreview = function() {
		this.paintModule.applyPreview(this.settings.brightness, this.settings.contrast, this.settings.highlights, this.settings.shadows)
	};
	var colorPanel = new AdjustmentsPanel({
		paintWidgetModuleName: "color",
		containerID: "#avpw_controlpanel_color",
		sliderID: "#avpw_color_slider",
		defaultSettings: {
			saturation: 0,
			warmth: 0,
			tint: 0,
			fade: 0,
			alpha: 1,
			blendMode: "normal"
		}
	});
	colorPanel.applyPreview = function() {
		this.paintModule.applyPreview(this.settings.saturation, this.settings.warmth, this.settings.fade, this.settings.tint)
	}, AV.ControlsWidget.prototype.tool.lighting = lightingPanel, AV.ControlsWidget.prototype.tool.color = colorPanel, AV.ControlsWidget.prototype.tool.brightness = function() {
		var e, t, n, a, i = AV.toolDefaults.brightness.presets,
			o = !1,
			r = {},
			s = function(t, n) {
				a = n.value;
				var i = a / 100;
				AV.featherUseFlash && (i = .6 * i / 100 + 1), e.paintWidget.module.brightness.applyPreview(i, !0)
			};
		return r.init = function(a) {
			n = 0;
			var o = {
				element: document.getElementById("avpw_brightness_slider"),
				min: 100 * i[0],
				max: 100 * i[3],
				defaultValue: n,
				onslide: s,
				onchange: s
			};
			AV.featherGLEnabled || (o.delay = 100), e = a, t = new e.Slider(o)
		}, r.cancel = function() {
			o = !0
		}, r.panelWillOpen = function() {
			a = n
		}, r.panelDidOpen = function() {
			t.addListeners()
		}, r.panelWillClose = function() {
			t.removeListeners()
		}, r.panelDidClose = function() {
			o && (r.resetUI(), o = !1)
		}, r.onUndo = function(t) {
			t || r.resetUI(), e.paintWidget.module.brightness.resetBacking()
		}, r.onRedo = function(e) {
			!e && t && t.setValue(a)
		}, r.resetUI = function() {
			t.reset()
		}, r.commit = function() {
			e.paintWidget.module.brightness.commit()
		}, r.shutdown = function() {
			t && (t.shutdown(), t = void 0), a = n = void 0, e = null
		}, r
	}(), AV.ControlsWidget.prototype.tool.colorsplash = function() {
		"use strict";
		var e, t, n, a, i, o, r, s, l, c = (AV.toolDefaults.colorsplash.presets, {}),
			p = 18,
			u = 3,
			d = p,
			v = p * u,
			_ = "free",
			f = 0,
			h = 7,
			w = v + 2 * h,
			g = {
				smart: {
					IS_FREE_HAND: !1,
					SIGMA_COLOR: 10,
					REVERSE: 0
				},
				free: {
					IS_FREE_HAND: !0,
					SIGMA_COLOR: 99999999,
					REVERSE: 0
				},
				erase: {
					IS_FREE_HAND: !0,
					SIGMA_COLOR: 99999999,
					REVERSE: 1
				}
			},
			m = function() {
				s = document.createElement("div"), s.className = "avpw_colorsplash_brush", l = document.createElement("canvas"), w = v + 2 * h, l.width = 150, l.height = 150, s.appendChild(l), e.layoutNotify(AV.launchData.openType, "getCanvasControlsElement").append(s), avpw$(l).css({
					marginTop: -(w / 2) + "px",
					marginLeft: -(w / 2) + "px"
				})
			},
			b = function() {
				if (!AV.featherGLEnabled) {
					var t = e.paintWidget.canvas,
						n = avpw$(t).clone(),
						a = t.getContext("2d").getImageData(0, 0, t.width, t.height);
					n[0].getContext("2d").putImageData(a, 0, 0), n.css({
						"z-index": 1,
						position: "absolute"
					}), avpw$(t).after(n), avpw$(n).fadeOut(800, function() {
						avpw$(this).remove()
					})
				}
			},
			y = function() {
				avpw$(s).fadeOut(function() {
					avpw$(this).remove()
				})
			},
			C = function(e) {
				if (l) {
					l.width = l.width;
					var n = l.getContext("2d"),
						a = Math.round(v / 2);
					n.shadowColor = "white", n.shadowOffsetX = 0, n.shadowOffsetY = 0, n.shadowBlur = 1, n.lineWidth = 5, n.strokeStyle = "rgba(" + e[0] + "," + e[1] + "," + e[2] + ",1)", n.beginPath(), n.arc(a + h, a + h, a - 2, Math.PI, 0, !1), n.stroke(), n.lineWidth = 2, n.strokeStyle = "white", n.beginPath(), n.arc(a + h, a + h, a + 2, 0, 2 * Math.PI, !1), n.stroke(), n.lineWidth = 2, n.strokeStyle = "white", n.beginPath(), n.arc(a + h, a + h, a - 5, 0, 2 * Math.PI, !1), n.stroke();
					var i = t ? .35 : .7;
					n.shadowBlur = 0, n.lineWidth = 2, n.strokeStyle = "rgba(0,0,0," + i + ")", n.beginPath(), n.arc(a + h, a + h, a - 4, 0, 2 * Math.PI, !1), n.stroke(), n.lineWidth = 2, n.strokeStyle = "rgba(0,0,0," + i + ")", n.beginPath(), n.arc(a + h, a + h, a + 1, 0, 2 * Math.PI, !1), n.stroke()
				}
			},
			A = function() {
				avpw$(this).addClass("avpw_inset_button_down").siblings().removeClass("avpw_inset_button_down");
				var t = avpw$(this).data("size");
				v = t * u, d = t, f = p > d ? 5 : 0, avpw$(l).css({
					marginTop: -((v + 2 * h) / 2) + "px",
					marginLeft: -((v + 2 * h) / 2) + "px"
				}), w = v + 2 * h, e.brushPreview.show(1.3 * d), C([0, 0, 0, 0])
			},
			x = function() {
				avpw$(".avpw_colorsplash_freebrush,.avpw_colorsplash_smartbrush,.avpw_colorsplash_eraser").not(this).removeClass("avpw_inset_button_down"), avpw$(this).addClass("avpw_inset_button_down");
				var e;
				avpw$(this).hasClass("avpw_colorsplash_freebrush") ? (_ = "free", mediator.trigger("usage:interact", "colorsplash", "FreeBrushClicked")) : avpw$(this).hasClass("avpw_colorsplash_smartbrush") ? (_ = "smart", mediator.trigger("usage:interact", "colorsplash", "SmartBrushClicked")) : avpw$(this).hasClass("avpw_colorsplash_eraser") && (_ = "erase", mediator.trigger("usage:interact", "colorsplash", "EraserBrushClicked")), e = I(_), i = e.IS_FREE_HAND, o = e.SIGMA_COLOR, r = e.REVERSE
			};
		c.init = function(t) {
			e = t;
			var n = avpw$("#avpw_controlpanel_colorsplash");
			n.delegate(".avpw_isa_preset_brush", "mousedown", A), n.delegate(".avpw_colorsplash_freebrush,.avpw_colorsplash_smartbrush,.avpw_colorsplash_eraser", "mousedown", x)
		}, c.cancel = function() {
			e.paintWidget.module.colorsplash.reset()
		}, c.panelWillOpen = function() {
			e.canvasUI && (e.canvasUI.subscribe(c), e.canvasUI.setMouseCursor("none"), avpw$(".avpw_canvas_background").css("cursor", "none")), t = !1
		}, c.panelDidOpen = function() {
			avpw$(".avpw_colorsplash_smartbrush,.avpw_colorsplash_eraser").removeClass("avpw_inset_button_down"), avpw$(".avpw_colorsplash_freebrush").addClass("avpw_inset_button_down");
			var t;
			_ = "free", t = I(_), i = t.IS_FREE_HAND, o = t.SIGMA_COLOR, r = t.REVERSE, avpw$("#avpw_zoom_container").css("cursor", "default"), e.layoutNotify(AV.launchData.openType, "showCanvasControlsElement"), m(), b(), e.paintWidget.module.colorsplash.preview(), avpw$(s).hide().fadeIn(), avpw$("#avpw_controlpanel_colorsplash").find(".avpw_isa_preset_brush").eq(2).trigger("mousedown")
		}, c.panelWillClose = function() {
			e.canvasUI && e.canvasUI.unsubscribe(c), y(), avpw$(".avpw_canvas_background").css("cursor", "default"), e.layoutNotify(AV.launchData.openType, "hideCanvasControlsElement")
		}, c.mouseDownEvent = function(i, o, r) {
			if (r) {
				t = !0;
				var s = AV.controlsWidgetInstance.canvasUI.viewport.getRatio(),
					l = i.canvasControlsX * s + .5 | 0,
					c = i.canvasControlsY * s + .5 | 0,
					p = d * s;
				if (n = l, a = c, !(0 > l || l > e.paintWidget.width - 1 || 0 > c || c > e.paintWidget.height - 1 || 0 > n || n > e.paintWidget.width - 1 || 0 > a || a > e.paintWidget.height - 1)) return e.paintWidget.module.colorsplash.createStroke(p, _), e.paintWidget.module.colorsplash.addPoints(l, c), e.paintWidget.module.colorsplash.preview(), !1
			}
		}, c.mouseMoveEvent = function(o, r) {
			var l = AV.controlsWidgetInstance.canvasUI.viewport.getRatio(),
				c = o.canvasControlsX * l + .5 | 0,
				p = o.canvasControlsY * l + .5 | 0;
			s && (avpw$(s).css({
				top: o.canvasControlsY + "px",
				left: o.canvasControlsX + "px"
			}), t && (i && (n = c, a = p), e.paintWidget.module.colorsplash.addPoints(c, p), e.paintWidget.module.colorsplash.preview())), (i || !t) && C(e.paintWidget.module.colorsplash.getColorAtPosition(c, p))
		}, c.mouseUpEvent = function(n, a) {
			var i = AV.controlsWidgetInstance.canvasUI.viewport.getRatio(),
				o = n.canvasControlsX * i,
				r = n.canvasControlsY * i;
			C(e.paintWidget.module.colorsplash.getColorAtPosition(o, r));
			return t && (e.paintWidget.module.colorsplash.finishStroke(), t = !1), C(e.paintWidget.module.colorsplash.getColorAtPosition(o, r)), !1
		}, c.mouseOutEvent = function(e, t, n) {
			return !1
		}, c.onEnableZoomMode = function() {
			return e.canvasUI && (e.canvasUI.unsubscribe(c), avpw$(s).fadeOut(), avpw$(".avpw_canvas_background").css("cursor", "default")), !1
		}, c.onDisableZoomMode = function() {
			e.canvasUI && (e.canvasUI.subscribe(c), avpw$(s).fadeIn(), avpw$(".avpw_canvas_background").css("cursor", "none"))
		}, c.commit = function() {
			e.paintWidget.module.colorsplash.commitDrawState()
		}, c.shutdown = function() {
			avpw$("#avpw_controlpanel_colorsplash").undelegate(), y(), e = null
		}, c.onUndoComplete = function(e) {}, c.onRedoComplete = function(e) {};
		var I = function(e) {
			return g[e]
		};
		return c
	}(), AV.ControlsWidget.prototype.tool.contrast = function() {
		var e, t, n, a, i = AV.toolDefaults.contrast.presets,
			o = !1,
			r = {},
			s = function(t, n) {
				a = n.value;
				var i = a / 100;
				AV.featherUseFlash && (i = .6 * i / 100 + 1), e.paintWidget.module.contrast.applyPreview(i, !0)
			};
		return r.init = function(a) {
			n = 0;
			var o = {
				element: document.getElementById("avpw_contrast_slider"),
				min: 100 * i[0],
				max: 100 * i[3],
				defaultValue: n,
				onslide: s,
				onchange: s
			};
			AV.featherGLEnabled || (o.delay = 100), e = a, t = new e.Slider(o)
		}, r.cancel = function() {
			o = !0
		}, r.panelWillOpen = function() {
			a = n
		}, r.panelDidOpen = function() {
			t.addListeners()
		}, r.panelWillClose = function() {
			t.removeListeners()
		}, r.panelDidClose = function() {
			o && (r.resetUI(), o = !1)
		}, r.onUndo = function(t) {
			t || r.resetUI(), e.paintWidget.module.contrast.resetBacking()
		}, r.onRedo = function(e) {
			!e && t && t.setValue(a)
		}, r.resetUI = function() {
			t.reset()
		}, r.commit = function() {
			e.paintWidget.module.contrast.commit()
		}, r.shutdown = function() {
			t && (t.shutdown(), t = void 0), e = null
		}, r
	}(), AV.ControlsWidget.prototype.tool.crop = function() {
		var e, t, n, a, i, o, r, s = null,
			l = !1,
			c = {},
			p = !1,
			u = function(e) {
				var n = t[e];
				return n ? "Custom" === n.label ? (p = !0, "") : (n.label = AV.getLocalizedString(n.label), AV.template[AV.launchData.layout].cropPreset(n)) : ""
			},
			d = function(e) {
				return e.hasClass("avpw_preset_icon_active")
			},
			v = function(e) {
				e.siblings().removeClass("avpw_preset_icon_active avpw_crop_preset_flipped"), e.addClass("avpw_preset_icon_active")
			},
			_ = function() {
				var t = e.paintWidget.getScaledSize();
				e.paintWidget.module.crop.initialDims = t;
				var n = r.getCropSettings();
				s ? e.paintWidget.module.crop.applyCropAndResize(n.topLeft, n.normWidth, n.aspectRatio, [s.width, s.height]) : e.paintWidget.module.crop.applyPreview(n.topLeft, n.normWidth, n.aspectRatio), e.paintWidget.module.crop.commit()
			},
			f = function(e) {
				avpw$("#avpw_crop_presets_scroll_region").toggleClass("avpw_crop_all_flipped"), e.parent().children().not(".avpw_preset_icon_disabled").each(function(e, n) {
					if (!avpw$(n).hasClass(".avpw_crop_custom_control")) {
						var a = t[e];
						if (a) {
							var i, o, r, s, l, c = a.label,
								p = a.labeled,
								u = avpw$(n).find(".avpw_label"),
								d = u.html(),
								v = a.resize ? "x" : ":";
							p || (d === c ? (i = c.toLowerCase().indexOf(v), -1 != i && (o = c.substr(0, i), r = c.substr(i + 1), s = parseInt(o, 10), l = parseInt(r, 10), d = l + (c.charAt(i) || v) + s)) : d = c, u.html(d), a.flipped = !a.flipped)
						}
					}
				})
			},
			h = !1,
			w = function(n) {
				var a, i, l, c = avpw$(this),
					p = AV.util.findItemByKeyValueFromArray("label", c.data("crop"), t);
				return c.hasClass("avpw_crop_custom_control") ? void m.enableMode(!0) : (m.enableMode(!1), AV.util.nextFrame(function() {
					s = null, p && (p.labeled || p.strict || !d(c) || f(c), p.flipped ? (c.addClass("avpw_crop_preset_flipped"), i = p.height, l = p.width) : (c.removeClass("avpw_crop_preset_flipped"), i = p.width, l = p.height), p.resize ? (s = {
						width: i,
						height: l
					}, a = e.paintWidget.a2c(i, l, !0), m.enableTooltip(!0), r.setInitialSelectionTo(a.width, a.height), m.enableTooltip(!1)) : i && l && (m.enableTooltip(!0), r.setInitialSelectionByRatio(i / l)), r.forceAspect(p.constrain), h = p.constrain, o = p.label), v(c)
				}), !1)
			},
			g = function() {
				i && i.shutdown(), t = e.populateCropPresets(n);
				var a = e.layoutNotify(AV.launchData.openType, "getDims"),
					o = a.PRESET_CROP_ICON_WIDTH,
					r = e.layoutNotify(AV.launchData.openType, "getCropPresetsPerPage"),
					s = o * r,
					l = t.length + 1,
					c = avpw$("#avpw_crop_presets_scroll_region");
				c.css({
					width: (l + r) * o + "px"
				}), i = new AV.Pager({
					leftArrow: avpw$("#avpw_crop_presets_lftArrow"),
					rightArrow: avpw$("#avpw_crop_presets_rghtArrow"),
					itemCount: l,
					itemsPerPage: r,
					pageWidth: s,
					itemBuilder: u,
					pageContainer: c
				}), i.changePage(), p && m.init(c)
			},
			m = function() {
				var t, n, a, i, o, s, l, c, p, u, d = {},
					_ = !1,
					f = !1,
					w = !1,
					g = function(e) {
						return AV.util.keyDownHandlerNumber.apply(this, [e, function(e) {
							AV.util.nextFrame(function() {
								if ("" === e.currentTarget.value) return "width" === e.data.currentProp ? t = a.width : n = a.height, b(!0), void x(t, n);
								p = !0;
								var i = parseInt(e.currentTarget.value);
								"width" === e.data.currentProp ? i > a.width || 1 > i ? p = !1 : t = i : i > a.height || 1 > i ? p = !1 : n = i, p ? (_ && mediator.on("tool:crop:change", x), b(!0), _ && mediator.off("tool:crop:change", x), avpw$(e.currentTarget).removeClass("avpw_invalid_input")) : avpw$(e.currentTarget).addClass("avpw_invalid_input")
							})
						}])
					},
					m = !1,
					b = function(i, o) {
						i && (m = !0);
						var s, l = t || a.width,
							c = n || a.height;
						s = o ? {
							width: l,
							height: c
						} : e.paintWidget.a2c(l, c, !0), r.setInitialSelectionTo(s.width, s.height), r.forceAspect(_), h = _, m = !1, i || mediator.trigger("tool:crop:change", t, n, i), u && (u = {
							width: l,
							height: c
						})
					};
				d.resetInputs = function() {}, d.triggerValidation = function(e) {
					(!p || e) && (o.trigger("keydown"), s.trigger("keydown"))
				};
				var y = function(e) {
						i = avpw$(AV.template[AV.launchData.layout].cropCustomControl({})), e.prepend(i), o = e.find("#avpw_crop_custom_width"), s = e.find("#avpw_crop_custom_height"), l = e.find("#avpw_crop_custom_lock_dims"), c = e.find(".avpw_crop_lock_group").find("span"), _ = !1, o.bind("keydown", {
							currentProp: "width"
						}, g).bind("focus", function() {
							return d.enableMode(!0), !1
						}).bind("blur", function() {
							d.resetInputs(), d.triggerValidation()
						}), s.bind("keydown", {
							currentProp: "height"
						}, g).bind("focus", function() {
							return d.enableMode(!0), !1
						}).bind("blur", function() {
							d.resetInputs(), d.triggerValidation()
						}), l.change(function() {
							C(avpw$(this).is(":checked"))
						}), c.bind("click", function() {
							l.click()
						})
					},
					C = function(e) {
						_ = e, _ ? (mediator.off("tool:crop:change", A), mediator.off("tool:crop:change", x), t || n ? o.hasClass("avpw_invalid_input") || s.hasClass("avpw_invalid_input") || (u = {
							width: t,
							height: n
						}) : u = {
							width: a.hiresWidth || a.width,
							height: a.hiresHeight || a.height
						}, b(!0, !1)) : (mediator.on("tool:crop:change", A), mediator.on("tool:crop:change", x), b(!0, !1), u = null)
					};
				d.getFixedSize = function() {
					if (!f) return null;
					if (u) return u;
					var a = t,
						i = n;
					if (w) {
						var o = e.paintWidget.a2c(a, i, !0);
						a = o.hiresWidth, i = o.hiresHeight
					}
					return {
						width: a,
						height: i
					}
				};
				var m, A = function(a, i, r) {
						if (!m) {
							if (w) {
								var l = e.paintWidget.c2a(a, i, !0);
								a = l.hiresWidth, i = l.hiresHeight
							}
							o.val(a), t = a, s.val(i), n = i, p || d.triggerValidation()
						}
					},
					x = function(a, i) {
						if (w)
							if (f) AV.util.nextFrame(function() {
								r.setToolTipValues(t, n)
							});
							else {
								var o = e.paintWidget.c2a(a, i, !1);
								r.setToolTipValues(Math.floor(o.hiresWidth), Math.floor(o.hiresHeight))
							} else r.setToolTipValues(a, i)
					};
				return d.init = function(e) {
					y(e), mediator.on("tool:crop:change", x), u = null, t = n = void 0
				}, d.enableMode = function(t) {
					t !== f && (f = t, a = e.paintWidget.getScaledSize(), a.hiresWidth && a.hiresHeight ? (w = !0, a.width = a.hiresWidth, a.height = a.hiresHeight) : w = !1, f ? (v(i), b(!0), _ || mediator.on("tool:crop:change", A), d.triggerValidation(!0)) : (mediator.off("tool:crop:change", A), mediator.off("tool:crop:change", x), mediator.on("tool:crop:change", x), o && s && (o.blur(), s.blur()), u = null))
				}, d.enableTooltip = function(e) {
					mediator.off("tool:crop:change", x), e && mediator.on("tool:crop:change", x)
				}, d.focusIn = function() {
					o.focus()
				}, d.unbindEvents = function() {
					o && s && (o.unbind(), s.unbind())
				}, d.shutdown = function() {
					d.enableMode(!1), mediator.off("tool:crop:change", A), mediator.off("tool:crop:change", x)
				}, d
			}(),
			b = function() {
				g(), r.setInitialSelection()
			};
		c.resetUI = function() {
			e.layoutNotify(AV.launchData.openType, "scaleCanvas"), AV.util.nextFrame(function() {
				var e;
				e = avpw$("#avpw_crop_presets_scroll_region").find(a ? '.avpw_isa_preset_crop[data-crop="' + a + '"]' : '.avpw_isa_preset_crop[data-crop="Custom"]'), e.length ? e.trigger("click") : avpw$("#avpw_crop_presets_scroll_region").find(".avpw_isa_preset_crop").eq(0).trigger("click")
			})
		}, c.init = function(t) {
			e = t, n = AV.launchData.cropPresets, "string" == typeof presetsFromConfig && (n = n.split(",")), a = AV.launchData.cropPresetDefault, r = new AV.CropController(t, t.paintWidget, !0)
		}, c.shutdown = function() {
			C(), avpw$("#avpw_controls").removeClass("avpw_crop_mode"), m.enableMode(!1), i && (i.shutdown(), i = null), s = null, e = null, r = null
		}, c.onRedoComplete = function() {
			c.resetUI()
		}, c.onUndoComplete = function() {
			c.resetUI()
		}, c.panelWillOpen = function() {
			p = !1, s = null, l = !1, e.canvasUI && e.canvasUI.subscribe(c), e.layoutNotify(AV.launchData.openType, "hideZoomButton"), mediator.on("layout:resize", b), o = void 0, e.canvasUI && e.canvasUI.viewport.setPadding(25)
		}, c.panelDidOpen = function() {
			g(), i && (i.setCurrentPage(0), i.changePage()), r.activate(mediator), c.resetUI(), avpw$("#avpw_controls").addClass("avpw_crop_mode"), y()
		};
		var y = function() {
				avpw$("#avpw_crop_presets_scroll_region").delegate(".avpw_isa_preset_crop,.avpw_crop_custom_control", "click", w), avpw$("#avpw_controls").delegate("#avpw_crop_flip_button", "click", function() {
					f(avpw$("#avpw_crop_presets_scroll_region").find("#avpw_preset_crop_icon").first()), r.flipIt(), r.forceAspect(h)
				})
			},
			C = function() {
				m.unbindEvents(), avpw$("#avpw_crop_presets_scroll_region").undelegate(".avpw_isa_preset_crop,.avpw_crop_custom_control", "click"), avpw$("#avpw_controls").undelegate("#avpw_crop_flip_button", "click")
			};
		return c.panelWillClose = function() {
			C(), e.canvasUI && e.canvasUI.viewport.setPadding(0), mediator.trigger("layout:resize"), avpw$("#avpw_controls").removeClass("avpw_crop_mode"), m.enableMode(!1), m.shutdown(), e.canvasUI && e.canvasUI.unsubscribe(c), r && r.deactivate(), avpw$("#avpw_crop_presets_scroll_region").undelegate(".avpw_isa_preset_crop", "click"), i && (i.shutdown(), i = null), e.layoutNotify(AV.launchData.openType, "showZoomButton"), mediator.off("layout:resize", b)
		}, c.mouseDownEvent = function(e) {
			var t = r.updateUIDown(e.canvasX, e.canvasY);
			return t && (l = !0), !1
		}, c.mouseMoveEvent = function(e) {
			return l ? (r.updateUIMove(e.canvasX, e.canvasY), !1) : void 0
		}, c.mouseUpEvent = function(t) {
			return l ? (e.canvasUI.setMouseCursor(), r.apply(t.canvasX, t.canvasY), l = !1, !1) : void 0
		}, c.commit = function() {
			return r.isValidCrop() ? (s = m.getFixedSize() || s || null, m.enableMode(!1), _(), o) : (m.triggerValidation(!0), m.enableMode(!0), mediator.trigger("tool:crop:change"), !1)
		}, c.onEnableZoomMode = function() {
			return e.canvasUI && e.canvasUI.unsubscribe(c), !1
		}, c.onDisableZoomMode = function() {
			e.canvasUI && e.canvasUI.subscribe(c)
		}, c
	}(), AV.ControlsWidget.prototype.tool.drawing = function() {
		var e, t, n, a, i = AV.toolDefaults.drawing.presetsColor,
			o = !1,
			r = {},
			s = !1,
			l = "#ffffff",
			c = function() {
				var t = 1;
				e.canvasUI && (t = e.canvasUI.viewport.getRatio());
				var t = AV.controlsWidgetInstance.canvasUI.viewport.getRatio(),
					n = e.paintWidget.module.drawing.getRadius();
				e.brushPreview && e.brushPreview.show(n, s)
			},
			p = function() {
				avpw$(".avpw_inset_color_widget .avpw_preset_icon_active").removeClass("avpw_preset_icon_active")
			},
			u = function() {
				s = !1, avpw$(".avpw_colorsplash_eraser").removeClass("avpw_inset_button_down")
			},
			d = function(e) {
				p(), u(), e.addClass("avpw_inset_button_down")
			},
			v = function(e) {
				e.preventDefault();
				var t = avpw$(this);
				avpw$("#avpw_drawing_brushes .avpw_inset_button_down").removeClass("avpw_inset_button_down"), t.addClass("avpw_inset_button_down");
				var n = t.data("size");
				a = n, _(n), c()
			},
			_ = function(t) {
				var t = t;
				e.paintWidget.module.drawing.setRadius(t), mediator.trigger("canvas:setBrushSize", t)
			},
			f = function(e) {
				var t, n, a = [e.r.toString(16), e.g.toString(16), e.b.toString(16)],
					i = a.length;
				for (t = 0; i > t; t++) n = a[t], 1 === n.length && (a[t] = "0" + n);
				return a.join("")
			},
			h = function(e) {
				return e = parseInt(e.indexOf("#") > -1 ? e.substring(1) : e, 16), {
					r: e >> 16,
					g: (65280 & e) >> 8,
					b: 255 & e,
					a: 255
				}
			},
			w = function(e) {
				if (u(), e && e.indexOf && 0 === e.indexOf("#")) n = h(e);
				else {
					var t = e.substring(4, e.length - 1).replace(/ /g, "").split(",");
					n = {
						r: parseInt(t[0]),
						g: parseInt(t[1]),
						b: parseInt(t[2]),
						a: 255
					}
				}
			},
			g = function(e) {
				e.preventDefault();
				var t = avpw$(this);
				w(t.data("color")), p(), t.addClass("avpw_preset_icon_active"), c()
			},
			m = function(a) {
				a.preventDefault(), a.stopPropagation();
				var i = a.currentTarget;
				p(), avpw$(".avpw_color_picker_dropdown_popup").length && t.hideColorPicker(), e.layoutNotify(AV.launchData.openType, "hideZoomButton"), I(!1), t = AV.buildColorPicker(f(n), i, function(e, t) {
					w(e), t || c()
				}, function() {
					e.canvasUI && e.canvasUI.subscribe(r), I(!0), e.layoutNotify(AV.launchData.openType, "showZoomButton")
				}), e.canvasUI && e.canvasUI.unsubscribe(r)
			},
			b = function(e) {
				e.preventDefault(), d(avpw$(this)), s = !0, c()
			},
			y = function() {
				avpw$(".avpw_isa_preset_brush", "#avpw_drawing_brushes").on("mousedown touchstart", v), avpw$(".avpw_isa_preset_color", "#avpw_drawing_colors").on("mousedown touchstart", g), avpw$(".avpw_colorsplash_eraser", "#avpw_controlpanel_drawing").on("mousedown touchstart", b), avpw$(".avpw_isa_color_picker", "#avpw_controlpanel_drawing").on("click", m)
			},
			C = function() {
				mediator.off("canvas:resize", x), avpw$(".avpw_isa_preset_brush", "#avpw_drawing_brushes").off("mousedown touchstart", v), avpw$(".avpw_isa_preset_color", "#avpw_drawing_colors").off("mousedown touchstart", g), avpw$(".avpw_colorsplash_eraser", "#avpw_controlpanel_drawing").off("mousedown touchstart", b), avpw$(".avpw_isa_color_picker", "#avpw_controlpanel_drawing").off("mousedown touchstart", m)
			},
			A = function() {
				var e, t, n = i.length,
					a = "";
				for (e = 0; n > e; e++) t = {
					color: i[e]
				}, a += AV.template[AV.launchData.layout].brushColorIcon(t);
				avpw$("#avpw_drawing_colors").html(a)
			};
		r.init = function(t) {
			e = t
		};
		var x = function() {
			_(a)
		};
		r.panelWillOpen = function() {
			mediator.on("canvas:resize", x), n = h(l), s = !1, I(!0), o = !1, A(), y(), e.canvasUI && (e.canvasUI.subscribe(r), e.canvasUI.setMouseCursor("none")), avpw$.miniColors && (AV.miniColors = new avpw$.miniColors)
		}, r.panelDidOpen = function() {
			AV.util.nextFrame(function() {
				avpw$("#avpw_drawing_brushes").find(".avpw_isa_preset_brush").eq(2).trigger("mousedown"), avpw$("#avpw_drawing_brushes").find(".avpw_isa_preset_brush").eq(2).trigger("touchdown"), avpw$("#avpw_drawing_colors").find(".avpw_isa_preset_color").eq(0).trigger("mousedown"), avpw$("#avpw_drawing_colors").find(".avpw_isa_preset_color").eq(0).trigger("touchdown")
			})
		};
		var I = function(e) {
			e ? avpw$("#avpw_canvas_controls_layer").addClass("avpw_legacy_draw_mode") : avpw$("#avpw_canvas_controls_layer").removeClass("avpw_legacy_draw_mode")
		};
		r.panelWillClose = function() {
			I(!1), C(), e.canvasUI && (e.canvasUI.unsubscribe(r), e.canvasUI.setMouseCursor()), t && t.hideColorPicker(), t = null, AV.miniColors = null
		}, r.shutdown = function() {
			C(), e = null
		}, r.commit = function() {
			e.paintWidget.module.drawing.commitDrawState()
		}, r.cancel = function() {
			r.reset()
		}, r.reset = function() {
			e.paintWidget.module.drawing.reset(), mediator.trigger("canvas:hideBrushCursor")
		};
		var T = !1,
			k = function() {
				T ? (AV.controlsWidgetInstance.layoutNotify(AV.launchData.openType, "showCanvasControlsElement"), mediator.trigger("canvas:showBrushCursor"), T = !1) : (AV.controlsWidgetInstance.layoutNotify(AV.launchData.openType, "hideCanvasControlsElement"), mediator.trigger("canvas:hideBrushCursor"))
			};
		return r.mouseDownEvent = function(t, a, i) {
			if (!o && i) {
				o = !0;
				var r = AV.controlsWidgetInstance.canvasUI.viewport.getRatio(),
					l = e.paintWidget.module.drawing.getRadius() * r,
					c = t.canvasX,
					p = t.canvasY;
				return e.paintWidget.module.drawing.createStroke(l, n, s ? "erase" : "free", 1), e.paintWidget.module.drawing.addPoints(c, p), e.paintWidget.module.drawing.preview(), !1
			}
		}, r.mouseMoveEvent = function(t) {
			var n = AV.controlsWidgetInstance.canvasUI.viewport.getRatio(),
				a = (e.paintWidget.module.drawing.getRadius() * n, t.canvasX),
				i = t.canvasY;
			return mediator.trigger("canvas:setBrushPosition", a, i), T = !0, k(), o && (e.paintWidget.module.drawing.addPoints(a, i), e.paintWidget.module.drawing.preview()), !1
		}, r.mouseUpEvent = function(t) {
			o && (o = !1, e.paintWidget.module.drawing.finishStroke(), e.paintWidget.module.drawing.preview())
		}, r.onEnableZoomMode = function() {
			return e.canvasUI && (e.canvasUI.unsubscribe(r), e.canvasUI.setMouseCursor(), mediator.trigger("canvas:hideBrushCursor"), I(!1)), !1
		}, r.onDisableZoomMode = function() {
			e.canvasUI && (e.canvasUI.subscribe(r), e.canvasUI.setMouseCursor(), mediator.trigger("canvas:showBrushCursor"), I(!0))
		}, r
	}(), AV.ControlsWidget.prototype.tool.effects = function() {
		"use strict";
		var e, t, n, a, i, o, r, s, l, c, p = "avpw_isa_control_selector_filter",
			u = "avpw_preset_icon_active",
			d = (Math.floor(4294967295 * Math.random()), 1),
			v = {},
			_ = function(e) {
				avpw$("." + p).removeClass(u), e && e.length && e.addClass(u)
			},
			f = function() {
				e.showWaitThrobber(!AV.featherGLEnabled);
				var t;
				if (i) {
					t = i.data("filtername");
					var n = e.paintWidget.filterManager.getEffectById(t),
						a = {
							pack: n.packIdentifier,
							item: n.identifier
						};
					e.paintWidget.resourceProvider.saveResource(a.pack, a.item, n.processors), AV.util.nextFrame(function() {
						e.paintWidget.module.effects.applyPreview(a, d), e.showWaitThrobber(!1)
					})
				}
			},
			h = function() {
				if (AV.featherGLEnabled) {
					var n = AV.util.moaLite.copyProcessor;
					t.find(".avpw_isa_previewcanvas").each(function(t, a) {
						var i = n.copy(s),
							o = avpw$(a).parent().data("filtername");
						e.paintWidget.module.effects.makeThumb(o, a, i)
					})
				} else t.find(".avpw_isa_previewcanvas").each(function(t, n) {
					var a = avpw$(n).parent().data("filtername");
					e.paintWidget.module.effects.makeThumb(a, n, l)
				})
			},
			w = function(e) {
				d = 1;
				var t = avpw$(e.currentTarget),
					n = t.data("filtername");
				if ("original" === n) v.cancel(), _();
				else {
					var a = !1;
					t && i && t[0] === i[0] && (g(t.find(".avpw_label").html()), a = !0), i = t, _(t), a || f()
				}
				return !1
			},
			g = function(e) {
				c = avpw$("#avpw_breadcrumb_toolname").html(), avpw$("#avpw_breadcrumb_toolname").html(e), d = 1, r.setValue(d), o.fadeIn(100)
			},
			m = function(e) {
				var t = e.displayName,
					n = e.identifier,
					a = AV.featherUseFlash ? AV.build.feather_baseURL + "images/filters/original.jpg" : "";
				return AV.template[AV.launchData.layout].filterThumbnail({
					label: AV.getLocalizedString(t),
					id: n,
					thumburl: a
				})
			},
			b = function(e, t) {
				var n = e.identifier,
					a = e.displayName,
					i = e.purchased || !e.needsPurchase,
					o = AV.template[AV.launchData.layout][i ? "filterCanister" : "filterCanisterDisabled"];
				return o({
					label: AV.getLocalizedString(a),
					id: n,
					packIndex: t,
					thumburl: AV.util.getSafeAssetBaseURL(e.assetsBaseURL) + e.iconImage
				})
			},
			y = function() {},
			C = function() {
				var i = e.layoutNotify(AV.launchData.openType, "getDims"),
					o = i.FILTER_IMAGE_WIDTH,
					r = a,
					s = e.paintWidget.filterManager.getPacksById();
				n = AV.ContentBrowser({
					container: t,
					packsInOrder: r,
					packsById: s,
					buildPackUI: b,
					buildItem: m,
					itemWidth: o,
					onItemsOpen: h,
					itemsPerPage: e.layoutNotify(AV.launchData.openType, "getFiltersPerPage")
				}), n.build(), t.fadeIn(200)
			};
		v.resetUI = function() {}, v.init = function(n) {
			e = n, t = avpw$("#avpw_effects_scroller"), t.delegate("." + p, "click", w)
		}, v.panelWillOpen = function() {
			y(), t && t.hide(), i = null, o = avpw$("#avpw_controlpanel_effects").find(".avpw_intensity_container"), o.hide(), d = 1;
			var n = {
				element: o.find("#avpw_intensity_slider"),
				min: 0,
				max: 1,
				defaultValue: 1,
				onchange: function(e, t) {
					d = t.value, f()
				}
			};
			AV.featherGLEnabled && (n.onslide = function(e, t) {
				d = t.value, f()
			}), r = new e.Slider(n), r.addListeners();
			var a = avpw$(".avpw_intensity_back_button", "#avpw_controlpanel_effects");
			a.pressed("avpw_button_down").bind("click", A)
		};
		var A = function() {
			avpw$("#avpw_breadcrumb_toolname").html(c), o.fadeOut(100)
		};
		return v.panelDidOpen = function() {
			l = document.createElement("canvas"), l.width = 63, l.height = 63, e.paintWidget.makeThumbFlat(l);
			var t = l.getContext("2d");
			AV.featherGLEnabled && (s = t.getImageData(0, 0, l.width, l.height)), e.assetManager.getAssets("EFFECT", function(e) {
				a = e, C()
			})
		}, v.panelWillClose = function() {
			n.destroy(), s = null, l = null, avpw$(".avpw_intensity_back_button", "#avpw_controlpanel_effects").unbind("click"), r.removeListeners(), r = null, o.hide()
		}, v.panelDidClose = function() {}, v.cancel = function() {
			v.resetUI()
		}, v.commit = function() {
			return e.paintWidget.module.effects.commit && e.paintWidget.module.effects.commit(), i && i.length ? i.data("filtername") : void 0
		}, v.onUndo = function(e) {
			e || v.resetUI()
		}, v.onRedo = function(e) {
			e || i && i.length && _(i)
		}, v.shutdown = function() {
			y(), t && t.length && t.undelegate("." + p, "click"), e = null, t = null
		}, v
	}(), AV.ControlsWidget.prototype.tool.enhance = function() {
		var e, t, n = AV.toolDefaults.enhance.presets,
			a = {},
			i = function(e) {
				e.siblings().removeClass("avpw_inset_button_down"), e.addClass("avpw_inset_button_down")
			},
			o = function(o) {
				var r, s;
				return s = avpw$(this), s.hasClass("avpw_inset_button_down") ? (s.removeClass("avpw_inset_button_down"), a.cancel()) : (i(s), r = n[s.index()], e.showWaitThrobber(!0, function() {
					e.paintWidget.module.enhance.applyPreview(r, !0), e.showWaitThrobber(!1)
				}), t = s), !1
			},
			r = function() {
				avpw$("#avpw_controlpanel_enhance").find(".avpw_inset_button").bind("mousedown touchstart", o)
			},
			s = function() {
				avpw$("#avpw_controlpanel_enhance").find(".avpw_inset_button").unbind("mousedown touchstart").removeClass("avpw_inset_button_down")
			};
		return a.resetUI = function() {
			avpw$("#avpw_controlpanel_enhance").find(".avpw_inset_button").removeClass("avpw_inset_button_down"), mediator.trigger("actions:clear_uncommited_changes")
		}, a.init = function(t) {
			e = t
		}, a.panelWillOpen = function() {
			t = null
		}, a.panelDidOpen = function() {
			r()
		}, a.panelWillClose = function() {
			s()
		}, a.cancel = function() {
			a.resetUI()
		}, a.commit = function() {
			return e.paintWidget.module.enhance.commit && e.paintWidget.module.enhance.commit(), t && t.length ? n[t.index()] : void 0
		}, a.onUndo = function(e) {
			e || a.resetUI()
		}, a.onRedo = function(e) {
			!e && t && t.length && i(t)
		}, a.shutdown = function() {
			e = null
		}, a
	}(), AV.ControlsWidget.prototype.tool.forcecrop = function() {
		var e, t, n, a, i, o, r, s = null,
			l = !1,
			c = {},
			p = function() {
				var t = e.paintWidget.getScaledSize();
				e.paintWidget.module.crop.initialDims = t;
				var n = r.getCropSettings();
				s ? e.paintWidget.module.crop.applyCropAndResize(n.topLeft, n.normWidth, n.aspectRatio, [s.width, s.height]) : e.paintWidget.module.crop.applyPreview(n.topLeft, n.normWidth, n.aspectRatio), e.paintWidget.module.crop.commit(), e.paintWidget.actions.setPreventUndoCheckpoint()
			},
			u = !1,
			d = function(t) {
				s = null, t && (w = t.width, h = t.height, t.resize ? (s = {
					width: w,
					height: h
				}, f(w, h), mediator.off("tool:crop:change", f), canvasDims = e.paintWidget.a2c(w, h, !0), r.setInitialSelectionTo(canvasDims.width, canvasDims.height)) : (mediator.on("tool:crop:change", f), w && h && r.setInitialSelectionByRatio(w / h)), r.forceAspect(t.constrain), u = t.constrain, o = t.label)
			},
			v = function() {
				g()
			};
		c.resetUI = function() {
			e.layoutNotify(AV.launchData.openType, "scaleCanvas")
		}, c.init = function(t) {
			e = t, n = AV.launchData.cropPresets, "string" == typeof presetsFromConfig && (n = n.split(",")), a = AV.launchData.cropPresetDefault, r = new AV.CropController(t, t.paintWidget)
		}, c.shutdown = function() {
			i && (i.shutdown(), i = null), mediator.off("layout:resize", v), avpw$("#avpw_controls").removeClass("avpw_crop_mode avpw_force_crop_mode"), s = null, e = null, r = null
		}, c.onRedoComplete = function() {
			c.resetUI()
		}, c.onUndoComplete = function() {
			c.resetUI()
		}, c.panelWillOpen = function() {
			s = null, l = !1, e.paintWidget.module.crop.activate(e.paintWidget), e.canvasUI && e.canvasUI.subscribe(c), r.activate(mediator), e.layoutNotify(AV.launchData.openType, "hideZoomButton"), mediator.on("layout:resize", v), avpw$("#avpw_controls").addClass("avpw_crop_mode avpw_force_crop_mode"), o = void 0
		};
		var _;
		c.panelDidOpen = function() {
			if (c.resetUI(), t = e.populateCropPresets(AV.launchData.forceCropPreset), _ = t[0], !_) return void e.messager.show("avpw_aviary_crop_invalid_dimensions", !0);
			var n = AV.launchData.forceCropMessage || AV.getLocalizedString("Please crop your photo to");
			avpw$("#avpw_force_crop_sub_text").html(n), avpw$("#avpw_force_crop_label").html(t[0].label), mediator.on("tool:crop:change", f), g()
		};
		var f = function(e, t) {
				r.setToolTipValues(e, t)
			},
			g = function() {
				d(_)
			};
		return c.panelWillClose = function() {
			mediator.off("tool:crop:change", f), avpw$("#avpw_controls").removeClass("avpw_crop_mode avpw_force_crop_mode"), e.canvasUI && e.canvasUI.unsubscribe(c), r && r.deactivate(), e.layoutNotify(AV.launchData.openType, "showZoomButton"), mediator.off("layout:resize", v)
		}, c.mouseDownEvent = function(e) {
			var t = r.updateUIDown(e.canvasX, e.canvasY);
			return t && (l = !0), !1
		}, c.mouseMoveEvent = function(e) {
			return l ? (r.updateUIMove(e.canvasX, e.canvasY), !1) : void 0
		}, c.mouseUpEvent = function(t) {
			return l ? (e.canvasUI.setMouseCursor(), r.apply(t.canvasX, t.canvasY), l = !1, !1) : void 0
		}, c.commit = function() {
			return p(), o
		}, c.onEnableZoomMode = function() {
			return e.canvasUI && e.canvasUI.unsubscribe(c), !1
		}, c.onDisableZoomMode = function() {
			e.canvasUI && e.canvasUI.subscribe(c)
		}, c
	}(), AV.ControlsWidget.prototype.tool.frames = function() {
		"use strict";
		var e, t, n, a, i, o, r = "avpw_isa_control_selector_frame",
			s = "avpw_preset_icon_active",
			l = null,
			c = {},
			p = {},
			u = function() {
				if (i) {
					var t = i.data("framename"),
						n = e.paintWidget.imageBorderManager.getEffectById(t),
						a = {
							pack: n.packIdentifier,
							item: n.identifier
						},
						r = n.images.width;
					p[a.pack + a.item] && (r = p[a.pack + a.item]), e.paintWidget.resourceProvider.doesResourceExist(a.pack, a.item) ? e.paintWidget.module.frames.applyPreview(a, r) : (o = !0, e.paintWidget.imageBorderManager.loadFrameResources(t, function(t) {
						if (p[a.pack + a.item]) r = p[a.pack + a.item];
						else {
							var n = {
									width: e.paintWidget.width,
									height: e.paintWidget.height
								},
								i = {
									left: {
										width: t.l.width,
										height: t.l.height
									},
									right: {
										width: t.r.width,
										height: t.r.height
									},
									top: {
										width: t.t.width,
										height: t.t.height
									},
									bottom: {
										width: t.b.width,
										height: t.b.height
									}
								};
							r = AV.util.moaLite.MoaFrame.getOptimalWidth(n, i, r), p[a.pack + a.item] = r
						}
						e.paintWidget.resourceProvider.saveResource(a.pack, a.item, t), e.paintWidget.module.frames.applyPreview(a, r), o = !1
					}, !1))
				}
			},
			d = function(e) {
				avpw$("." + r).removeClass(s), e && 0 !== e.length && e.addClass(s)
			},
			v = function(e) {
				e.preventDefault(); {
					var t = e.currentTarget;
					avpw$(t).attr("data-framename")
				}
				i && t === i[0] ? (i = null, c.cancel()) : (i = avpw$(t), d(i), u())
			},
			_ = function(e, t) {
				var n = e.identifier,
					a = e.displayName,
					i = e.purchased || !e.needsPurchase,
					o = AV.template[AV.launchData.layout][i ? "filterCanister" : "filterCanisterDisabled"];
				return o({
					label: AV.getLocalizedString(a),
					id: n,
					packIndex: t,
					thumburl: AV.util.getSafeAssetBaseURL(e.assetsBaseURL) + e.iconImage
				})
			},
			f = function(e, t, n) {
				n = AV.util.getSafeAssetBaseURL(n);
				var a = e.displayName,
					i = e.identifier;
				return AV.template[AV.launchData.layout].frameThumbnail({
					label: a,
					frameName: i,
					assetImage: n + e.images.iconImage
				})
			},
			h = function() {
				AV.util.nextFrame(function() {
					c.resetUI()
				})
			},
			w = function() {
				l && (l.shutdown(), l = null), t && t.length && t.hide()
			},
			g = function() {
				var i = e.layoutNotify(AV.launchData.openType, "getDims"),
					o = i.BORDER_ICON_WIDTH,
					i = e.layoutNotify(AV.launchData.openType, "getDims"),
					o = i.FILTER_IMAGE_WIDTH,
					r = a,
					s = e.paintWidget.imageBorderManager.getPacksById();
				n = AV.ContentBrowser({
					container: t,
					packsInOrder: r,
					packsById: s,
					buildPackUI: _,
					buildItem: f,
					itemWidth: o,
					itemsPerPage: e.layoutNotify(AV.launchData.openType, "getFiltersPerPage"),
					backMessageText: AV.getLocalizedString("More Frames")
				}), n.build(), t.fadeIn(200)
			};
		return c.init = function(t) {
			e = t
		}, c.panelWillOpen = function() {
			i = null, o = !1, mediator.on("layout:resize", h), t = avpw$("#avpw_frames_scroller"), t.hide(), t.delegate("." + r, "mouseup", v), e.layoutNotify(AV.launchData.openType, "hideZoomButton")
		}, c.panelDidOpen = function() {
			e.assetManager.getAssets("IMAGEBORDER", function(e) {
				a = e, t.show(), g(), l && l.changePage(!0)
			})
		}, c.panelDidClose = function() {
			e.layoutNotify(AV.launchData.openType, "showZoomButton"), mediator.off("layout:resize", h), t && t.length && t.undelegate()
		}, c.resetUI = function() {
			d(), e.layoutNotify(AV.launchData.openType, "scaleCanvas")
		}, c.cancel = function() {
			c.resetUI(), mediator.trigger("actions:clear_uncommited_changes")
		}, c.commit = function() {
			return o ? !1 : (e.paintWidget.module.frames.commit(), i && i.length ? i.data("framename") : void 0)
		}, c.onUndo = function(e) {
			e || c.resetUI()
		}, c.onRedo = function(e) {
			e || i && i.length && d(i)
		}, c.shutdown = function() {
			w(), t && t.length && t.undelegate(), e = null, t = null
		}, c
	}(), AV.ControlsWidget.prototype.tool.meme = function() {
		var e, t, n, a = {},
			i = !1;
		a.init = function(t) {
			e = t
		};
		var o, r = function() {
			i && (clearTimeout(o), o = setTimeout(function() {
				var a = t.val(),
					i = n.val();
				a = a.toUpperCase(), i = i.toUpperCase();
				var o = {
						r: 0,
						g: 0,
						b: 0,
						a: 255
					},
					r = {
						r: 255,
						g: 255,
						b: 255,
						a: 255
					};
				e.paintWidget.module.meme.applyPreview(a, i, r, o)
			}, AV.featherGLEnabled ? 0 : 40))
		};
		return a.panelWillOpen = function() {
			e.showWaitThrobber(!0), e.paintWidget.resourceProvider.utils.TextProvider.loadFont({
				label: "LeagueGothic-Regular",
				value: "LeagueGothic-Regular",
				custom: !0,
				url: "https://dme0ih8comzn4.cloudfront.net/fonts/league-gothic-webfont/stylesheet.css"
			}, {
				active: function() {
					e.showWaitThrobber(!1), i = !0
				}
			}), t = avpw$("#avpw_text_area_meme"), n = avpw$("#avpw_text_area_meme2"), t.val(""), n.val("")
		}, a.panelDidOpen = function() {
			t.bind("keydown", r), n.bind("keydown", r)
		}, a.panelWillClose = function() {
			t.unbind("keydown"), n.unbind("keydown")
		}, a.cancel = function() {
			e.paintWidget.module.meme.reset()
		}, a.commit = function() {
			e.paintWidget.module.meme.commit()
		}, a
	}(), AV.ControlsWidget.prototype.tool.orientation = function() {
		var e, t, n, a, i, o, r, s, l, c = 10,
			p = 240,
			u = 45,
			d = null,
			v = null,
			_ = null,
			f = null,
			h = !1,
			w = !1,
			g = 0,
			m = !1,
			b = !1,
			y = 0,
			C = {},
			A = function() {
				return e && (h || w) && !(h && w)
			},
			x = function() {
				var t = n.layoutNotify(AV.launchData.openType, "getMaxDims"),
					a = t.height < t.width ? t.height : t.width;
				a -= c, a = a < AV.launchData.maxSize ? a : AV.launchData.maxSize, n.canvasUI && (n.canvasUI.viewport.resize(a, a), e ? window.setTimeout(n.canvasUI.resetOffset, p) : n.canvasUI.resetOffset())
			},
			I = function() {
				n.layoutNotify(AV.launchData.openType, "scaleCanvas")
			},
			T = function() {
				x(), W(), r && (o.setValue(r), N(null, {
					value: r
				}))
			},
			k = function(e, t, a) {
				a && 0 !== a && (a % 90 !== 0 ? i.addClass("avpw_shadow_overlay") : i.removeClass("avpw_shadow_overlay")), n.canvasUI && n.canvasUI.viewport.rotate(e, t, a)
			},
			V = function() {
				k(0, 0, 0)
			},
			S = function(e) {
				avpw$("#avpw_straighten_grid").html(avpw$(AV.template[AV.launchData.layout].alignmentGrid({
					numLines: e
				})))
			},
			W = function() {
				if (n.canvasUI && t) {
					var e = n.canvasUI.viewport.getRatio(),
						a = s / e,
						r = l / e;
					if (n.canvasUI.viewport.rotateBoundsBy90(g)) {
						var c = a;
						a = r, r = c
					}
					o && (o.shutdown(), o = void 0), o = new n.Slider({
						element: i,
						min: -.5,
						max: .5,
						defaultValue: 0,
						onstart: D,
						onchange: E,
						onslide: N
					}), o.addListeners(), avpw$("#avpw_straighten_handle").css({
						left: "50%"
					}), _ = null, f = null, d = a, v = r, S(8), i.addClass("avpw_straighten_ui_ready")
				}
			},
			D = function(e, t) {
				n.canvasUI && n.canvasUI.addCanvasClass("avpw_ready_for_straighten"), avpw$("#avpw_straighten_grid").addClass("avpw_straighten_ui_grid_ready"), n.paintWidget.setMode("orientation"), n.paintWidget.module.orientation.set(_, s, l)
			},
			E = function(e, t) {
				n.canvasUI && n.canvasUI.removeCanvasClass("avpw_ready_for_straighten"), avpw$("#avpw_straighten_grid").removeClass("avpw_straighten_ui_grid_ready"), n.layoutNotify(AV.launchData.openType, "updateUndoRedo", [!0, !1])
			},
			N = function(a, i) {
				var o, c, p, m, b = i.value;
				r = b, t && (o = AV.math.sign(b), f = (1 - Math.cos(b * Math.PI)) * u * o, _ = f * Math.PI / 180, f = h ? -f : f, f = w ? -f : f, f += g, e ? (p = w ? 180 : 0, m = h ? 180 : 0, k(p, m, f)) : k(f), c = n.paintWidget.module.orientation.set(_, s, l), n.canvasUI && d && v && n.canvasUI.viewport.resizeFake(d * c, v * c))
			},
			P = function(n, a) {
				if (e && !AV.featherUseFlash) {
					n && n.call(this), i.removeClass("avpw_straighten_ui_animate"), i.removeClass("avpw_straighten_ui_ready"), window.setTimeout(function() {
						T(), i.addClass("avpw_straighten_ui_animate")
					}, p);
					var o = w ? 180 : 0,
						r = h ? 180 : 0;
					k(o, r, g)
				} else t && !AV.featherUseFlash ? (i.removeClass("avpw_straighten_ui_ready"), V(), a && a.call(this), T()) : a && a.call(this)
			},
			$ = function() {
				b = m = !1, y = 0
			},
			L = function() {
				w = h = !1, g = 0, _ = null, f = null, $()
			},
			O = function() {
				n.canvasUI && e && !AV.featherUseFlash ? (n.canvasUI.removeCanvasClass("avpw_ready_for_orient"), i.removeClass("avpw_straighten_ui_animate"), i.removeClass("avpw_straighten_ui_ready"), window.setTimeout(function() {
					n.canvasUI.addCanvasClass("avpw_ready_for_orient"), i.addClass("avpw_straighten_ui_animate"), T()
				}, p)) : (i.removeClass("avpw_straighten_ui_ready"), T())
			},
			U = function(n) {
				var a = 0,
					i = 0,
					o = 0;
				e && !AV.featherUseFlash ? ((y || b || m) && (a = b ? 180 : 0, i = m ? 180 : 0, o = y), k(a, i, o), window.setTimeout(function() {
					V(), n && n.call(this)
				}, p)) : t && !AV.featherUseFlash ? (V(), n && n.call(this)) : n && n.call(this)
			},
			z = function(e) {
				var t = avpw$(e.currentTarget);
				e.stopPropagation(), e.preventDefault(), U(function() {
					t.unbind("click").trigger("click")
				})
			},
			R = function() {
				avpw$("#avpw_flip_h").bind("click", function() {
					r = null, P(function() {
						h = !h
					}, function() {
						n.paintWidget.setMode("flip"), n.paintWidget.module.flip.flip(!0, !1, !0)
					}), n.layoutNotify(AV.launchData.openType, "updateUndoRedo", [!0, !1])
				}), avpw$("#avpw_flip_v").bind("click", function() {
					r = null, AV.featherUseFlash ? (n.paintWidget.setMode("flip"), n.paintWidget.module.flip.flip(!1, !0)) : P(function() {
						w = !w
					}, function() {
						n.paintWidget.setMode("flip"), n.paintWidget.module.flip.flip(!1, !0, !0)
					}), n.layoutNotify(AV.launchData.openType, "updateUndoRedo", [!0, !1])
				}), avpw$("#avpw_rotate_left").bind("click", function() {
					var e = l;
					l = s, s = e, r = null;
					var t = A() ? 90 : -90;
					P(function() {
						g += t
					}, function() {}), n.layoutNotify(AV.launchData.openType, "updateUndoRedo", [!0, !1])
				}), avpw$("#avpw_rotate_right").bind("click", function() {
					var e = l;
					l = s, s = e, r = null;
					var t = A() ? -90 : 90;
					P(function() {
						g += t
					}, function() {}), n.layoutNotify(AV.launchData.openType, "updateUndoRedo", [!0, !1])
				}), avpw$("#avpw_controlpanel_orientation").find(".avpw_inset_button").pressed("avpw_inset_button_down"), avpw$("#avpw_all_effects").bind("click", z)
			},
			M = function() {
				avpw$("#avpw_controlpanel_orientation").find(".avpw_inset_button").unbind(), avpw$("#avpw_all_effects").unbind("click", z)
			},
			B = function() {
				var e = (_ || 0) * (180 / Math.PI);
				if (g > 0) g %= 360;
				else
					for (; 0 > g;) g += 360;
				n.paintWidget.module.orientation.applyPreview(w, h, g, e), n.paintWidget.module.orientation.commit(), V(), x()
			};
		return C.init = function(o) {
			n = o, e = !AV.featherUseFlash && AV.support.getVendorProperty("transformStyle"), t = AV.support.getVendorProperty("transform"), i = avpw$(AV.template[AV.launchData.layout].straightenSlider()), a = !0
		}, C.panelWillOpen = function() {
			s = n.paintWidget.width, l = n.paintWidget.height, n.paintWidget.module.orientation && n.paintWidget.module.orientation.activate(n.paintWidget), L(), R(), n.canvasUI && n.canvasUI.disablePan(), mediator.on("layout:resize", T);
			var e = n.layoutNotify(AV.launchData.openType, "getCanvasControlsElement");
			e.append(i), n.layoutNotify(AV.launchData.openType, "hideZoomButton"), n.layoutNotify(AV.launchData.openType, "showCanvasControlsElement")
		}, C.panelDidOpen = function() {
			n.canvasUI && e && (n.canvasUI.addCanvasClass("avpw_ready_for_orient"), i.addClass("avpw_straighten_ui_animate")), T()
		}, C.panelWillClose = function() {
			M(), n.canvasUI && n.canvasUI.enablePan(), o && (o.shutdown(), o = void 0), I(), mediator.off("layout:resize", T), n.canvasUI && e ? (n.canvasUI.removeCanvasClass("avpw_ready_for_orient"), i.removeClass("avpw_straighten_ui_animate"), i.removeClass("avpw_straighten_ui_ready")) : t && i.removeClass("avpw_straighten_ui_ready"), i.detach(), n.layoutNotify(AV.launchData.openType, "showZoomButton"), n.layoutNotify(AV.launchData.openType, "hideCanvasControlsElement"), V(), r = null
		}, C.commit = function() {
			B()
		}, C.shutdown = function() {
			M(), n = null, o = void 0, i = null
		}, C.onUndo = function(e) {
			var t = !!(g % 360) || h || w || _ && 0 !== _;
			t && (B(), L()), O()
		}, C.onRedo = function(e) {
			O()
		}, C
	}(), AV.ControlsWidget.prototype.tool.overlays = function() {
		function e() {
			var e = t.layoutNotify(AV.launchData.openType, "getDims"),
				n = e.STICKER_ROLL_WIDTH;

			o = AV.ContentBrowser({
				container: r,
				packsInOrder: i,
				packsById: u,
				buildPackUI: w,
				buildItem: h,
				itemWidth: n,
				itemsPerPage: t.layoutNotify(AV.launchData.openType, "getStickerPacksPerPage"),
				backMessageText: AV.getLocalizedString("More Stickers")
			}), o.build(), r.fadeIn(200)
		}
		var t, n, a, i, o, r, s, l, c = null,
			p = !1,
			u = {},
			d = {},
			v = function() {
				t.showWaitThrobber(!0);
				var e = a.getCropSettings(),
					n = s.attr("src");
				return t.paintWidget.overlayRegistry.getElement(n, function(a) {
					var i = t.paintWidget.overlayRegistry.getAsset(n),
						o = {
							pack: i.packIdentifier,
							item: i.identifier
						};
					a.currentTarget && t.paintWidget.resourceProvider.saveResource(o.pack, o.item, a.currentTarget), t.paintWidget.module.overlays.applyPreview(o, e.topLeft, e.normWidth, e.aspectRatio), t.paintWidget.module.overlays.commit(), t.showWaitThrobber(!1), AV.util.nextFrame(function() {
						AV.Events.trigger("tool:commitDone")
					})
				}), !1
			},
			_ = function(e) {
				var t, n;
				c = null, e && (t = e.width, n = e.height, mediator.on("tool:crop:change", m), t && n && a.setInitialSelectionByRatio(t / n), a.forceAspect(e.constrain))
			},
			f = function() {
				b()
			};
		d.resetUI = function() {
			t.layoutNotify(AV.launchData.openType, "scaleCanvas")
		}, d.init = function(e) {
			t = e, a = new AV.CropController(e, e.paintWidget, !1)
		}, d.shutdown = function() {
			mediator.off("layout:resize", f), avpw$("#avpw_controls").removeClass("avpw_crop_mode avpw_force_crop_mode"), c = null, t = null, a = null
		}, d.onRedoComplete = function() {
			d.resetUI()
		}, d.onUndoComplete = function() {
			d.resetUI()
		};
		var h = function(e, n, a) {
				a = AV.util.getSafeAssetBaseURL(a);
				var i, r = a + e.images.overlay["path-1024"],
					s = a + e.images.barPreview["path-100"];
				return i = e.images.overlay["path-1024"] ? a + e.images.overlay["path-1024"] : a + e.images.overlay.path, e.packIdentifier = o.getCurrentPackId(), t.paintWidget.overlayRegistry.add(r, i, e), AV.template[AV.launchData.layout].stickerThumbnail({
					url: r,
					thumburl: s
				})
			},
			w = function(e, t) {
				var n, a = e.identifier,
					i = e.displayName || "Original",
					o = (e.purchased || !e.needsPurchase, u[a]),
					r = AV.template[AV.launchData.layout].stickerRoll;
				return o && o.iconAssetsV2.url && (n = AV.util.getSafeAssetBaseURL(e.assetsBaseURL) + o.iconAssetsV2.url), r({
					label: AV.getLocalizedString(i),
					id: a,
					packIndex: t,
					thumburl: n
				})
			};
		d.panelWillOpen = function() {
			c = null, p = !1, t.paintWidget.module.crop.activate(t.paintWidget), t.canvasUI && t.canvasUI.subscribe(d), t.layoutNotify(AV.launchData.openType, "hideZoomButton"), mediator.on("layout:resize", f), avpw$("#avpw_controls").addClass("avpw_crop_mode avpw_overlays_mode"), r = avpw$("#avpw_overlays_scroller"), l = !1, t.assetManager.gatherContentAssetsHelper("OVERLAYS", function(t, n) {
				u = t, i = n, e()
			}), r.delegate(".avpw_isa_control_selector_overlay", "click", g)
		};
		var g = function(e) {
			var t = e.currentTarget,
				n = avpw$(t).attr("fullimageurl");
			l || a.activate(mediator), l = !0, s.attr("src", n), s.remove(), avpw$(".avpw_crop_layer").addClass("avpw_crop_with_reticle").prepend(s), b()
		};
		d.panelDidOpen = function() {
			d.resetUI(), n = {
				constrain: !0,
				height: 1,
				label: "Square",
				labeled: !0,
				resize: !1,
				strict: !1,
				width: 1
			}, mediator.on("tool:crop:change", m);
			var e = new Image;
			AV.util.doesSupportImageCORS() && (e.crossOrigin = "Anonymous"), s = avpw$(e), s.css({
				position: "absolute",
				width: "100%",
				height: "100%",
				top: 0,
				left: 0
			})
		};
		var m = function(e, t) {
				a.setToolTipValues(e, t)
			},
			b = function() {
				_(n)
			};
		return d.panelWillClose = function() {
			mediator.off("tool:crop:change", m), avpw$("#avpw_controls").removeClass("avpw_crop_mode avpw_overlays_mode"), t.canvasUI && t.canvasUI.unsubscribe(d), a && l && a.deactivate(), o && o.destroy(), t.layoutNotify(AV.launchData.openType, "showZoomButton"), mediator.off("layout:resize", f)
		}, d.mouseDownEvent = function(e) {
			if (l) {
				var t = a.updateUIDown(e.canvasX, e.canvasY);
				return t && (p = !0), !1
			}
		}, d.mouseMoveEvent = function(e) {
			return p ? (a.updateUIMove(e.canvasX, e.canvasY), !1) : void 0
		}, d.mouseUpEvent = function(e) {
			return l && p ? (t.canvasUI.setMouseCursor(), a.apply(e.canvasX, e.canvasY), p = !1, !1) : void 0
		}, d.commit = function() {
			return l ? v() : void 0
		}, d.onEnableZoomMode = function() {
			return t.canvasUI && t.canvasUI.unsubscribe(d), !1
		}, d.onDisableZoomMode = function() {
			t.canvasUI && t.canvasUI.subscribe(d)
		}, d
	}(), AV.ControlsWidget.prototype.tool.resize = function() {
		var e, t, n, a, i, o, r, s, l, c = !1,
			p = !1,
			u = "avpw_inset_button_active",
			d = {},
			v = function(t) {
				if (t === !0 || t === !1) o = t;
				else {
					if (o && !p) return e.messager.show("avpw_resize_unlocked", !0), !1;
					o = !o
				}
				o ? (a.addClass(u), m()) : a.removeClass(u)
			},
			_ = function() {
				var a, i, o;
				c ? (o = e.paintWidget.getScaledSize(), a = o.hiresWidth || o.width, i = o.hiresHeight || o.height) : (a = e.paintWidget.width, i = e.paintWidget.height), t.val(a), n.val(i), r = a, s = i
			},
			f = function() {
				var a = t.val(),
					i = n.val(),
					o = e.paintWidget.width,
					r = e.paintWidget.height;
				return a !== o || i !== r
			},
			h = function() {
				var e = parseInt(t.val()),
					a = parseInt(n.val());
				!isNaN(e) && e > 0 && l >= e && !isNaN(a) && a > 0 && l >= a && (r = e, s = a)
			},
			w = function() {
				var a = parseInt(t.val()),
					i = parseInt(n.val());
				return a === r && i === s ? (g(a, i), !0) : (e.messager.show("avpw_resize_invalid", !0), !1)
			},
			g = function(t, n) {
				if (!isNaN(t) && !isNaN(n)) {
					{
						e.paintWidget.width, e.paintWidget.height
					}
					e.paintWidget.module.resize.applyPreview([t, n]), e.paintWidget.module.resize.commit()
				}
			},
			m = function() {
				var a, r, s;
				AV.util.nextFrame(function() {
					o && ("width" === i ? (r = parseInt(t.val()), (!r || isNaN(r)) && (r = e.paintWidget.width), a = r / e.paintWidget.width, s = e.paintWidget.height * a | 0, 1 > s && (s = 1), n.val(s)) : (s = parseInt(n.val()), (!s || isNaN(s)) && (s = e.paintWidget.height), a = s / e.paintWidget.height, r = e.paintWidget.width * a | 0, 1 > r && (r = 1), t.val(r))), h()
				})
			},
			b = function(e) {
				avpw$(this).addClass("avpw_text_input_focused").select()
			},
			y = function(e) {
				avpw$(this).removeClass("avpw_text_input_focused")
			},
			C = function(e) {
				return AV.util.keyDownHandlerNumber.apply(this, [e, function(e) {
					i = e.data.currentProp, m()
				}])
			};
		return d.init = function(i) {
			e = i, c = e.imageSizeTracker.isUsingHiResDimensions(AV.launchData), l = c ? AV.launchData.hiresMaxSize : AV.launchData.maxSize, t = t || avpw$("#avpw_resize_width"), t.bind("keydown", {
				currentProp: "width"
			}, C).bind("focus", b).bind("blur", y), n = n || avpw$("#avpw_resize_height"), n.bind("keydown", {
				currentProp: "height"
			}, C).bind("focus", b).bind("blur", y), a = a || avpw$("#avpw_constrain_prop"), a.click(v), avpw$("#avpw_constrain_prop_label").click(function() {
				a.trigger("click")
			}), avpw$("#avpw_resize_invalid_confirm").click(function() {
				return e.messager.hide("avpw_resize_invalid"), t.val(r), n.val(s), !1
			}), avpw$("#avpw_resize_unlocked_confirm").click(function() {
				return p = !0, e.messager.hide("avpw_resize_unlocked"), v(), !1
			}), avpw$("#avpw_resize_unlocked_cancel").click(function() {
				return p = !0, e.messager.hide("avpw_resize_unlocked"), !1
			}), avpw$("#avpw_resize_invalid_max_size").html(l)
		}, d.panelWillOpen = function() {
			_(), v(!0), p = !1, e.layoutNotify(AV.launchData.openType, "hideZoomButton")
		}, d.panelDidOpen = function() {
			t.trigger("focus"), e.layoutNotify(AV.launchData.openType, "scaleCanvas")
		}, d.panelWillClose = function() {
			e.layoutNotify(AV.launchData.openType, "showZoomButton")
		}, d.onRedoComplete = function() {
			_()
		}, d.onUndoComplete = function() {
			_()
		}, d.commit = function() {
			var e = !0;
			return f() && (e = w()), e && (e = r + "," + s), e
		}, d.shutdown = function() {
			t && t.unbind(), n && n.unbind(), a && a.unbind(), avpw$("avpw_constrain_prop_label").unbind("click"), avpw$("#avpw_resize_invalid_confirm").unbind("click"), avpw$("#avpw_resize_unlocked_confirm").unbind("click"), avpw$("#avpw_resize_unlocked_cancel").unbind("click"), e = null
		}, d
	}(), AV.ControlsWidget.prototype.tool.saturation = function() {
		var e, t, n, a, i = AV.toolDefaults.saturation.presets,
			o = !1,
			r = {},
			s = function(t, n) {
				a = n.value, e.paintWidget.module.saturation.applyPreview(a / 100, !0)
			};
		return r.init = function(a) {
			n = 0;
			var o = {
				element: document.getElementById("avpw_saturation_slider"),
				min: 100 * i[0],
				max: 100 * i[3],
				defaultValue: n,
				onslide: s,
				onchange: s
			};
			AV.featherGLEnabled || (o.delay = 100), e = a, t = new e.Slider(o)
		}, r.cancel = function() {
			o = !1
		}, r.panelWillOpen = function() {
			a = n
		}, r.panelDidOpen = function() {
			t.addListeners()
		}, r.panelWillClose = function() {
			t.removeListeners()
		}, r.panelDidClose = function() {
			o && (r.resetUI(), o = !1)
		}, r.onUndo = function(t) {
			t || r.resetUI(), e.paintWidget.module.saturation.resetBacking()
		}, r.onRedo = function(e) {
			!e && t && t.setValue(a)
		}, r.resetUI = function() {
			t.reset()
		}, r.commit = function() {
			e.paintWidget.module.saturation.commit()
		}, r.shutdown = function() {
			t && (t.shutdown(), t = void 0), e = null
		}, r
	}(), AV.ControlsWidget.prototype.tool.sharpness = function() {
		var e, t, n, a, i = AV.toolDefaults.sharpness.presets,
			o = !1,
			r = {},
			s = function(t, n) {
				a = n.value, e.showWaitThrobber(!0), setTimeout(function() {
					e.paintWidget.module.sharpness.applyPreview(a + .5 | 0, 1, "normal"), e.showWaitThrobber(!1)
				}, 30)
			};
		return r.init = function(a) {
			n = 0, e = a;
			var o = {
				element: document.getElementById("avpw_sharpness_slider"),
				min: i[0],
				max: i[3],
				defaultValue: n
			};
			AV.featherGLEnabled && (o.onslide = s), o.onchange = s, t = new e.Slider(o)
		}, r.cancel = function() {
			o = !1
		}, r.panelWillOpen = function() {
			a = n
		}, r.panelDidOpen = function() {
			t.addListeners()
		}, r.panelWillClose = function() {
			t.removeListeners()
		}, r.panelDidClose = function() {
			o && (r.resetUI(), o = !1)
		}, r.onUndo = function(t) {
			t || r.resetUI(), e.paintWidget.module.sharpness.resetBacking()
		}, r.onRedo = function(e) {
			!e && t && t.setValue(a)
		}, r.commit = function() {
			e.paintWidget.module.sharpness.commit()
		}, r.resetUI = function() {
			t.reset()
		}, r.shutdown = function() {
			t && (t.shutdown(), t = void 0), a = n = void 0, e = null
		}, r
	}(), AV.ControlsWidget.SpotTool = function(e) {
		var t, n, a, i = (AV.toolDefaults[e].presets, {}),
			o = !1,
			r = function() {
				var n = 1;
				t.canvasUI && (n = t.canvasUI.viewport.getRatio());
				var a = t.paintWidget.module[e].getRadius();
				t.brushPreview && t.brushPreview.show(a)
			},
			s = function() {
				o ? (mediator.trigger("canvas:showBrushCursor"), o = !1) : mediator.trigger("canvas:hideBrushCursor")
			},
			l = function(e) {
				e.siblings().removeClass("avpw_preset_icon_active"), e.addClass("avpw_preset_icon_active")
			},
			c = function(e) {
				e.preventDefault();
				var t = avpw$(this);
				l(t);
				var n = t.data("size") / 2;
				a = n, p(n), r()
			},
			p = function(n) {
				var n = n;
				t.paintWidget.module[e].setRadius(n), mediator.trigger("canvas:setBrushSize", n)
			},
			u = function() {
				avpw$("#avpw_controlpanel_" + e).on("mousedown touchstart", ".avpw_isa_preset_brush", c), t.canvasUI && t.canvasUI.subscribe(i)
			},
			d = function() {
				avpw$("#avpw_controlpanel_" + e).off(".avpw_isa_preset_brush", "mousedown touchstart"), t.canvasUI && t.canvasUI.unsubscribe(i)
			},
			v = function() {
				avpw$("#avpw_controlpanel_" + e + " .avpw_tool_cutout_centered_spot_tool").html(AV.template[AV.launchData.layout].brushSizesSet({
					sizes: [8, 13, 18, 21, 25]
				}))
			};
		i.init = function(e) {
			t = e
		}, i.commit = function() {
			t.paintWidget.module[e].commitDrawState()
		};
		var _ = function() {
			p(a)
		};
		i.panelWillOpen = function() {
			mediator.on("canvas:resize", _), v(), u(), t.canvasUI && t.canvasUI.setMouseCursor("none")
		}, i.panelDidOpen = function() {
			avpw$("#avpw_controlpanel_" + e).find(".avpw_isa_preset_brush").eq(2).trigger("mousedown"), o = !1, t.layoutNotify(AV.launchData.openType, "showCanvasControlsElement"), f()
		}, i.panelWillClose = function() {
			d(), mediator.off("canvas:resize", _), h(), mediator.trigger("canvas:hideBrushCursor")
		};
		var f = function() {
				avpw$(".avpw_canvas_background").css("cursor", "none"), avpw$("#avpw_zoom_container").css("cursor", "default")
			},
			h = function() {
				avpw$(".avpw_canvas_background").css("cursor", "default"), avpw$("#avpw_zoom_container").css("cursor", "default")
			};
		i.shutdown = function() {
			mediator.off("canvas:resize", _), t = null
		}, i.mouseDownEvent = function(a, i, o) {
			if (!n && o) {
				n = !0;
				var r = AV.controlsWidgetInstance.canvasUI.viewport.getRatio(),
					s = t.paintWidget.module[e].getRadius() * r,
					l = a.canvasX,
					c = a.canvasY;
				return t.paintWidget.module[e].createStroke(s), t.paintWidget.module[e].addPoints(l, c), t.paintWidget.module[e].preview(), !1
			}
		};
		var w;
		return i.mouseMoveEvent = function(a) {
			var i = AV.controlsWidgetInstance.canvasUI.viewport.getRatio(),
				r = (t.paintWidget.module[e].getRadius() * i, a.canvasX),
				l = a.canvasY;
			return mediator.trigger("canvas:setBrushPosition", r, l), o = !0, s(), n && (t.paintWidget.module[e].addPoints(r, l), w = setTimeout(function() {
				t.paintWidget.module[e].preview()
			}, AV.featherGLEnabled ? 0 : 50)), !1
		}, i.mouseUpEvent = function(a) {
			n && (n = !1, t.paintWidget.module[e].finishStroke())
		}, i.mouseOutEvent = function() {}, i.onEnableZoomMode = function() {
			return t.canvasUI && (t.canvasUI.unsubscribe(i), t.canvasUI.setMouseCursor()), h(), mediator.trigger("canvas:hideBrushCursor"), !1
		}, i.onDisableZoomMode = function() {
			t.canvasUI && (t.canvasUI.subscribe(i), t.canvasUI.setMouseCursor("none")), s(), f()
		}, i.onUndoComplete = function(n) {
			return n && n.global ? (t.paintWidget.module[e].reset(), !1) : void 0
		}, i.onRedoComplete = function(n) {
			return n && n.global ? (t.paintWidget.module[e].reset(), !1) : void 0
		}, i.cancel = function() {
			t.paintWidget.module[e].reset()
		}, i
	}, AV.ControlsWidget.prototype.tool.blemish = new AV.ControlsWidget.SpotTool("blemish"), AV.ControlsWidget.prototype.tool.whiten = new AV.ControlsWidget.SpotTool("whiten"), AV.ControlsWidget.prototype.tool.redeye = new AV.ControlsWidget.SpotTool("redeye"), AV.ControlsWidget.prototype.tool.overlay = function() {
		var e, t, n, a, i, o, r, s, l, c, p, u = 140,
			d = 10,
			v = .375,
			_ = 5,
			f = {
				OFF_STATE: 0,
				DRAG_STATE: 1
			},
			h = null,
			w = null,
			g = {},
			m = function(t) {
				return e.paintWidget.overlayRegistry.getAsset(t).identifier
			},
			b = function(e, n) {
				var a = AV.paintWidgetInstance.overlayRegistry.getElement(e, function(e) {
					t = !1, n && n.call(this)
				});
				return a ? !0 : (t = !0, !1)
			},
			C = function(t, n, a, i, o) {
				var r, s, c, p, v, _, f = Math.floor(4294967295 * Math.random()).toString(16),
					h = "text_overlay-" + f,
					w = avpw$(AV.template[AV.launchData.layout].selectionOverlay({
						id: h,
						body: AV.template[AV.launchData.layout].imageOverlayBody({
							src: t
						})
					}));
				c = 1, e.canvasUI && (c = e.canvasUI.viewport.getRatio()), p = u + 2 * d, r = n / c - p / 2, s = a / c - p / 2, v = {
					left: (r + .5 | 0) + "px",
					top: (s + .5 | 0) + "px",
					width: u + "px",
					height: u + "px"
				}, w.css(v), _ = {
					id: h,
					url: t,
					initialCoordsX: 0,
					initialCoordsY: 0,
					element: w
				}, l.newOverlay(_)
			},
			A = function(t) {
				var n, a, i, o;
				if (t.url) {
					n = t.id, a = t.url, o = AV.controlsWidgetInstance.canvasUI ? AV.controlsWidgetInstance.canvasUI.viewport.getRatio() : 1, i = (t.rotation || 0) * (180 / Math.PI), i > 0 ? i %= 360 : i = -(Math.abs(i) % 360);
					var r = e.paintWidget.overlayRegistry.getAsset(a),
						s = {
							pack: r.packIdentifier,
							item: r.identifier
						},
						l = e.paintWidget.width,
						c = e.paintWidget.height,
						p = t.width,
						u = (t.centerX - p / 2) * o,
						d = (t.centerY - p / 2) * o,
						v = [u / l, d / c, p * o / l, p * o / c];
					e.paintWidget.resourceProvider.saveResource(s.pack, s.item, e.paintWidget.overlayRegistry.getElement(a));
					var _ = e.paintWidget.module.overlay.generateAction(s, v, 1, i, !1);
					return _
				}
			},
			I = function(t, n, a, i) {
				if (AV.featherUseFlash) return void e.paintWidget.module.overlay.addOverlay("", t);
				var o = b(t, function() {
					C(t, a, i, v, v), o || e.onEggWaitThrobber.stop()
				});
				if (!o && n) {
					var r = avpw$(n).children(".avpw_isa_overlay_waiter");
					e.onEggWaitThrobber.spin(r[0])
				}
				mediator.trigger("usage:tool", "overlay", "stickerclicked", m(t))
			},
			T = function() {
				c = null, h = null, t = !1, p && p.length && p.detach().remove()
			},
			k = function(e) {
				if (p && p.length) {
					var t = AV.util.getTouch(e);
					t ? (x = t.pageX, y = t.pageY) : (x = e.originalEvent.pageX, y = e.originalEvent.pageY), p.css({
						left: x + "px",
						top: y + "px"
					})
				}
			},
			V = function(e) {
				var t, n, a, i;
				T(), i = avpw$(e.currentTarget), c = i.attr("fullimageurl"), AV.featherUseFlash || (a = AV.util.getTouch(e), a ? (t = a.pageX, n = a.pageY) : (t = e.originalEvent.pageX, n = e.originalEvent.pageY), h = {
					x: t,
					y: n
				}, avpw$(window).bind("mousemove", S).bind("touchmove", S).bind("mouseup", W).bind("touchend", W), p = i.clone())
			},
			S = function(e) {
				var t, n, a = 0,
					i = 0;
				h && (a = h.x, i = h.y);
				var o = AV.util.getTouch(e);
				o ? (t = o.pageX, n = o.pageY, avpw$(AV.paintWidgetInstance.canvas).trigger("touchstart")) : (t = e.originalEvent.pageX, n = e.originalEvent.pageY), (a - t > _ || t - a > _ || i - n > _ || n - i > _) && (avpw$(window).unbind("mousemove", S).unbind("touchmove", S).bind("mousemove", k).bind("touchmove", k), k(e), p.addClass("avpw_overlay_icon_dropped"), avpw$("body").append(p), b(c))
			},
			W = function(n) {
				avpw$(window).unbind("mousemove", S).unbind("touchmove", S).unbind("mousemove", k).unbind("touchmove", k).unbind("mouseup", W).unbind("touchend", W);
				var a = e.canvasUI.getCoordinatesFromEventWithinCanvasBounds(n);
				if (a)
					if (t) var i = window.setInterval(function() {
						t || (a && I(c, n.currentTarget, a.canvasX, a.canvasY), window.clearInterval(i), i = null, T())
					}, 100);
					else I(c, n.currentTarget, a.canvasX, a.canvasY), T();
				else p && p.length && (p.addClass("avpw_overlay_icon_return_ready"), AV.util.nextFrame(function() {
					p.addClass("avpw_overlay_icon_returned"), h && p.css({
						top: h.y + "px",
						left: h.x + "px"
					}), window.setTimeout(function() {
						T()
					}, 400)
				}))
			},
			D = function(n) {
				var a, i, o, r = n.currentTarget,
					s = avpw$(r).attr("fullimageurl");
				if (s && s === c)
					if (e && e.canvasUI && (a = e.canvasUI.getViewportCenter(), a && (i = a.canvasX, o = a.canvasY)), t) var l = window.setInterval(function() {
						t || (I(s, r, i, o), window.clearInterval(l), l = null)
					}, 100);
					else I(s, r, i, o);
				h = null, c = null, avpw$(window).unbind("mousemove", S).unbind("touchmove", S).unbind("mousemove", k).unbind("touchmove", k)
			},
			E = function(t, n, a) {
				a = AV.util.getSafeAssetBaseURL(a);
				var o = a + t.images.preview,
					r = a + t.images.iconImage,
					s = a + t.images.sticker;
				return t.packIdentifier = i.getCurrentPackId(), e.paintWidget.overlayRegistry.add(o, s, t), AV.template[AV.launchData.layout].stickerThumbnail({
					url: o,
					thumburl: r
				})
			},
			N = function(e, t) {
				var n, a = e.identifier,
					i = e.displayName || "Original",
					o = e.purchased || !e.needsPurchase,
					r = s[a],
					l = AV.template[AV.launchData.layout][o ? "stickerRoll" : "stickerRollDisabled"];
				return r && r.iconImage && (n = AV.util.getSafeAssetBaseURL(e.assetsBaseURL) + e.iconImage), l({
					label: AV.getLocalizedString(i),
					id: a,
					packIndex: t,
					thumburl: n
				})
			},
			P = function() {
				L(), w = null, c = null, p = null
			},
			$ = function() {
				var t = e.layoutNotify(AV.launchData.openType, "getDims"),
					a = t.STICKER_ROLL_WIDTH;
				i = AV.ContentBrowser({
					container: n,
					packsInOrder: r,
					packsById: s,
					buildPackUI: N,
					buildItem: E,
					itemWidth: a,
					itemsPerPage: e.layoutNotify(AV.launchData.openType, "getStickerPacksPerPage"),
					backMessageText: AV.getLocalizedString("More Stickers")
				}), i.build(), n.fadeIn(200)
			};
		g.init = function(t) {
			e = t, s || (s = {}), AV.OverlayController && (l = new AV.OverlayController(t, t.paintWidget, {
				modes: f,
				handlePosition: AV.OverlayController.HANDLE_POSITION.BOTTOM_RIGHT,
				aspectRatio: 1
			}))
		};
		g.panelWillOpen = function() {
			n = avpw$("#avpw_overlay_scroller"), n.hide(), e.canvasUI && e.canvasUI.subscribe(g), P(), e.assetManager.gatherContentAssetsHelper("STICKER", function(e, t) {
				s = e, r = t, $()
			}), n.delegate(".avpw_isa_control_selector_overlay", "mousedown touchstart", V).delegate(".avpw_isa_control_selector_overlay", "mouseup", D), l && l.activate()
		}, g.panelWillClose = function() {
			e.canvasUI && e.canvasUI.unsubscribe(g), i && i.destroy(), T(), L(), l && l.deactivate()
		};
		var L = function() {
			n && n.undelegate(".avpw_isa_control_selector_overlay", "mousedown touchstart", V).undelegate(".avpw_isa_control_selector_overlay", "mouseup", D)
		};
		return g.shutdown = function() {
			P(), T(), i && i.destroy(), e = null, a = null, n = null, o = null
		}, g.mouseDownEvent = function(e, t) {
			return l.updateUIDown(e, t, null, null, function(e) {
				e && e.url && mediator.trigger("usage:tool", "overlay", "stickerdeleted", m(e.url))
			})
		}, g.mouseMoveEvent = function(e) {
			return l.updateUIMove(e), !1
		}, g.mouseUpEvent = function(e, t) {
			l.apply(e, t)
		}, g.onEnableZoomMode = function() {
			return e.canvasUI && e.canvasUI.unsubscribe(g), !1
		}, g.onDisableZoomMode = function() {
			e.canvasUI && e.canvasUI.subscribe(g)
		}, g.commit = function() {
			var t = [];
			l && (l.commit(function(e) {
				var n = A(e);
				n && t.push(n)
			}), t && t.length && (e.paintWidget.module.overlay.applyMultiple(t, "sticker"), e.paintWidget.module.overlay.commit()))
		}, g
	}(), AV.ControlsWidget.prototype.tool.text = function() {
		var e, t, n, a, i = AV.toolDefaults.text.presetsColor,
			o = !1,
			r = !1,
			s = {},
			l = function() {
				avpw$(".avpw_inset_color_widget .avpw_preset_icon_active").removeClass("avpw_preset_icon_active")
			},
			c = function(e) {
				l(), e.addClass("avpw_preset_icon_active")
			},
			p = function(e) {
				var a, i;
				a = e && AV.util.color_is_light(e) ? "#000" : "#fff", i = AV.util.color_is_light(e) ? "#969696" : "#fff", t = e, n = a
			},
			u = function(e) {
				e.preventDefault();
				var t = avpw$(this);
				p(t.data("color")), c(t), o = !1
			},
			d = function(n) {
				n.preventDefault(), n.stopPropagation();
				var a = n.currentTarget;
				AV.buildColorPicker(t, a, function(t) {
					p(t), e.canvasUI && e.canvasUI.subscribe(s), c(avpw$(a))
				}, function() {
					e.canvasUI && e.canvasUI.subscribe(s)
				}), e.canvasUI && e.canvasUI.unsubscribe(s)
			},
			v = function(a, i) {
				if (!o) {
					var r, s, l, c, p = avpw$("#avpw_text_font_size").val(),
						u = t,
						d = n,
						v = avpw$("#avpw_text_font").val(),
						_ = avpw$("#avpw_text_area").val(),
						f = 60;
					e.canvasUI && (r = e.canvasUI.getViewportCenter(), r && (s = r.canvasX, l = r.canvasY)), "" == p && (p = avpw$("#avpw_text_font_size").attr("value")), "" == p && (p = "60"), "" == v && (v = avpw$("#avpw_text_font").attr("value")), "" == v && (v = "sans-serif"), "sans-serif" == v && (v = '"Arial", sans-serif'), c = parseFloat(p) / f, e.paintWidget.module.text.newText(_, v, f, u, d, s, l, c, c, 0), o = !0, avpw$("#avpw_text_area").trigger("blur")
				}
				return !1
			},
			_ = function(e) {
				e[0].value = "", a = !1, e.addClass("avpw_text_input_focused")
			},
			f = function(e) {
				e[0].value = AV.getLocalizedString("Enter text here"), a = !0, e.removeClass("avpw_text_input_focused")
			},
			h = function(e) {
				a && _(avpw$(this)), o = !1
			},
			w = function(e) {
				return 13 == e.which ? (avpw$("#avpw_add_text").trigger("click"), !1) : void 0
			},
			g = function() {
				avpw$("#avpw_controlpanel_text").delegate(".avpw_isa_preset_color", "click", u).delegate(".avpw_isa_color_picker", "click", d), avpw$("#avpw_text_area").bind("focus", h).bind("keydown", w), avpw$("#avpw_add_text").click(v)
			},
			m = function() {
				avpw$("#avpw_controlpanel_text").undelegate(".avpw_isa_preset_color", "click").undelegate(".avpw_isa_color_picker", "click"), avpw$("#avpw_text_area").unbind(), avpw$("#avpw_add_text").unbind("click")
			},
			b = function() {
				var t, n, a = i.length,
					o = "";
				for (t = 0; a > t; t++) n = {
					color: i[t]
				}, o += AV.template[AV.launchData.layout].brushColorIcon(n);
				avpw$("#avpw_text_colors").html(o);
				var r = e.layoutNotify(AV.launchData.openType, "getDims");
				avpw$("#avpw_text_area").css("width", r.INNER_BROWSER_WIDTH - r.TEXT_ADD_TEXT_BUTTON_WIDTH - 80 + "px")
			};
		return s.init = function(t) {
			e = t, b()
		}, s.panelWillOpen = function() {
			r = !1, o = !1, f(avpw$("#avpw_text_area")), g(), e.canvasUI && e.canvasUI.subscribe(s), avpw$.miniColors && (AV.miniColors = new avpw$.miniColors), mediator.on("layout:resize", b)
		}, s.panelDidOpen = function() {
			_addListeners()
		}, s.panelWillClose = function() {
			_removeListeners(), e.paintWidget.module.effects.deactivate()
		}, s.panelDidOpen = function() {
			avpw$("#avpw_text_colors").find(".avpw_isa_preset_color").eq(0).trigger("click")
		}, s.panelWillClose = function() {
			m(), e.canvasUI && e.canvasUI.unsubscribe(s), avpw$("#avpw_text_area").trigger("blur"), AV.miniColors = null, mediator.off("layout:resize", b)
		}, s.shutdown = function() {
			e = null
		}, s.mouseDownEvent = function(t) {
			if (!r) {
				var n = e.paintWidget.module.text.updateUIDown(t.canvasX, t.canvasY);
				return n !== !1 && (r = !0, "rotate" === n ? e.canvasUI.setMouseCursor("pointer") : "translate" === n && e.canvasUI.setMouseCursor("move")), !1
			}
		}, s.mouseMoveEvent = function(t) {
			return r ? (e.paintWidget.module.text.updateUIMove(t.canvasX, t.canvasY), !1) : void 0
		}, s.mouseUpEvent = function(t) {
			r && (o = !1, e.canvasUI.setMouseCursor(), e.paintWidget.module.text.apply(t.canvasX, t.canvasY), r = !1)
		}, s.onEnableZoomMode = function() {
			return e.canvasUI && e.canvasUI.unsubscribe(s), !1
		}, s.onDisableZoomMode = function() {
			e.canvasUI && e.canvasUI.subscribe(s)
		}, s
	}(), AV.ControlsWidget.prototype.tool.textwithfont = function() {
		var e, t, n, a, i, o, r, s, l = 1.17,
			c = AV.getLocalizedString("Enter text here"),
			p = {
				label: "Arial Black",
				value: "'Arial Black','Arial-BoldMT','ArialMT','Arial','Lucida Grande','Arial Unicode MS',sans-serif"
			},
			u = 24,
			d = "avpw_textwithfont_overlay_helptext",
			v = "avpw_selection_overlay_disable_user_select",
			_ = "avpw_inset_button_active",
			f = 60,
			h = 10,
			w = 1 / 12,
			g = AV.toolDefaults.textwithfont.presetsColor,
			m = AV.toolDefaults.textwithfont.presetsFont,
			b = null,
			y = {
				OFF_STATE: 0,
				DRAG_STATE: 1,
				EDIT_STATE: 2
			},
			C = 18,
			A = 4 * (C + 2 * u),
			x = !1,
			I = !1,
			T = p,
			k = u,
			V = g[0],
			S = 1,
			W = !1,
			D = {},
			E = function(e) {
				e = e || p, T = e, j(e), mediator.trigger("usage:interact", "textwithfont", "fontchanged", e.label);
				var n = t.currentOverlay();
				n && (Y(n, e), Z(e), ie(n), t.saveDimensions(), N())
			},
			N = function(e) {
				e = e || t.currentOverlay();
				var a, i, o, r;
				if (e && (a = e.element.find(".avpw_textwithfont_writer"), o = e.textSize, r = o / 2 + .5 | 0, i = a[0], i && e.text)) {
					var s = AV.util.color_to_array(e.textColor),
						c = {
							r: s[0],
							g: s[1],
							b: s[2],
							a: 255
						},
						p = {
							text: e.text,
							fontName: e.textFont.label,
							style: e.textFont.style || "normal",
							color: c,
							alignment: "center",
							fontSize: o
						},
						u = (e.text.split("\n"), n.getStringDimensions(e.text, 0, o, p, !0)),
						p = avpw$.extend(p, u),
						d = n.drawString(p, i, !0);
					a.css({
						"margin-top": "-" + d.yOffset + "px"
					}), e.element.find(".avpw_textwithfont_entry").css({
						"line-height": o * l + "px"
					})
				}
			},
			P = function(e, a) {
				t.hideCurrentOverlay(), avpw$("#avpw_font_browser_preview").hide();
				var i = b[e];
				n.loadFont(i, {
					loading: function() {
						AV.controlsWidgetInstance && AV.controlsWidgetInstance.showWaitThrobber(!0)
					},
					inactive: function() {
						AV.controlsWidgetInstance && AV.controlsWidgetInstance.showWaitThrobber(!1), AV.errorNotify("UNSUPPORTED_FONT", [e])
					},
					active: function() {
						return AV.controlsWidgetInstance && AV.controlsWidgetInstance.showWaitThrobber(!1), a ? void avpw$("#avpw_font_browser_preview").show() : (i = avpw$.extend(i, {
							value: i.value + ("," + p.value)
						}), E(i), avpw$("#avpw_font_browser_preview").show(), void AV.util.nextFrame(t.showCurrentOverlay))
					}
				})
			},
			$ = function() {
				se();
				var n, i, o, r, s = Math.floor(4294967295 * Math.random()).toString(16),
					l = "text_overlay-" + s,
					c = avpw$(AV.template[AV.launchData.layout].selectionOverlay({
						id: l,
						body: AV.template[AV.launchData.layout].textEntryOverlayBody()
					}));
				n = 1, e.canvasUI && (n = e.canvasUI.viewport.getRatio()), i = f + 2 * h, o = {
					left: (e.paintWidget.width / n - i) / 2 + "px",
					top: a + "px",
					width: f + "px"
				}, c.css(o), r = {
					id: l,
					helpTextShown: !1,
					initialCoordsX: 0,
					initialCoordsY: 0,
					element: c
				}, Y(r, T), Z(T), K(r, k || u), Q(k || u), J(r, V || g[0]), te(r, S || 1), t.newOverlay(r), se(), we(!0)
			},
			L = function() {
				o = avpw$(AV.template[AV.launchData.layout].textEntryOverlayProxy()), e.layoutNotify(AV.launchData.openType, "getCanvasControlsElement").append(o)
			},
			O = function() {
				o && o.length && o.remove()
			},
			U = function(a) {
				ie(a, !0), t.saveDimensions(a);
				var i, o, r, s, l, p, u, d, v, _;
				if (v = a.text, v && v !== c) {
					_ = AV.controlsWidgetInstance.canvasUI ? AV.controlsWidgetInstance.canvasUI.viewport.getRatio() : 1, r = a.textSize * _ + .5 | 0, l = a.textColor;
					var f = AV.util.color_to_array(l);
					a.textOutline && (p = AV.util.color_is_light(a.textColor) ? "#000000" : "#ffffff"), u = a.textOpacity, d = a.textFont, i = a.centerX * _, o = a.centerY * _;
					var h = parseInt(a.element.find(".avpw_textwithfont_writer").css("margin-top")) / 4;
					o += h, Q(a.textSize), Z(a.textFont), N(a), s = (a.rotation || 0) * (180 / Math.PI), s > 0 ? s %= 360 : s = -(Math.abs(s) % 360);
					var l = {
							r: f[0],
							g: f[1],
							b: f[2],
							a: 255
						},
						w = e.paintWidget.width,
						g = e.paintWidget.height,
						m = (n.getStringDimensions(v, 0, r, {
							fontName: a.textFont.label,
							color: l,
							alignment: "left",
							fontSize: r
						}, !0), [i / w, o / g]),
						b = e.paintWidget.module.textwithfont.generateAction(v, {
							fontSize: r / w,
							fontName: a.textFont.label,
							color: l,
							alignment: "center"
						}, 1, m, s);
					return b
				}
			},
			z = function() {
				avpw$(".avpw_inset_color_widget .avpw_preset_icon_active").removeClass("avpw_preset_icon_active")
			},
			R = function(e) {
				z(), e.addClass("avpw_preset_icon_active")
			},
			M = function(e) {
				var n, a;
				n = e && AV.util.color_is_light(e) ? "#000" : "#fff", a = AV.util.color_is_light(e) ? "#969696" : "#fff", V = e, J(t.currentOverlay(), e)
			},
			B = function(e) {
				e.preventDefault();
				var t = avpw$(this),
					n = t.data("color");
				M(n), R(t), mediator.trigger("usage:interact", "textwithfont", "colorchanged", n)
			},
			F = function(t) {
				t.preventDefault(), t.stopPropagation();
				var n = t.currentTarget;
				s = AV.buildColorPicker(V, n, function(t) {
					M(t), e.canvasUI && e.canvasUI.subscribe(D), z()
				}, function() {
					e.canvasUI && e.canvasUI.subscribe(D)
				}), e.canvasUI && e.canvasUI.unsubscribe(D)
			},
			H = function(e) {
				var t = avpw$("#avpw_textwithfont_outline_toggle");
				e ? t.addClass(_) : t.removeClass(_), ee(), W = e
			},
			j = function(e) {
				e = e || p, avpw$("#avpw_font_browser_preview").css({
					"font-family": e.value,
					"font-style": e.style || "normal"
				}), i && i.update(e.label)
			},
			G = function(e) {
				var t = avpw$("#avpw_textwithfont_colors").find(".avpw_isa_preset_color").filter('[data-color="' + e + '"]').eq(0);
				M(e), t && t.length ? R(t) : (t = avpw$("#avpw_controlpanel_textwithfont").find(".avpw_isa_color_picker"), R(t))
			},
			q = function(e) {
				e.preventDefault();
				var n = t.currentOverlay();
				n && n.element && n.element.find(".avpw_textwithfont_entry").trigger("blur"), $(), mediator.trigger("usage:interact", "textwithfont", "textadded")
			},
			X = function(e) {
				e && e.element && e.element.find(".avpw_textwithfont_entry").css({
					"font-family": e.textFont.value,
					"font-size": e.textSize + "px",
					"font-style": e.textFont.style || "normal"
				})
			},
			Y = function(e, n) {
				e = e || t.currentOverlay(), e && (e.textFont = n, N(), X(e))
			},
			Z = function(e) {
				e = e || p, o && o.length && o.css({
					"font-family": e.value,
					"font-style": e.style || "normal"
				})
			},
			K = function(e, n) {
				e = e || t.currentOverlay(), e && (e.textSize = n, X(e), N(), ee(e))
			},
			Q = function(e) {
				var t;
				o && o.length && (t = e / 2 + .5 | 0 || 0, o.css({
					"font-size": e,
					padding: "0 " + t + "px"
				}))
			},
			J = function(e, n) {
				e = e || t.currentOverlay(), e && (e.textColor = n, N(e), e.mode === y.EDIT_STATE && (ee(e, n), e.element.find(".avpw_textwithfont_entry").css("color", n)))
			},
			ee = function(e, n) {
				if (e = e || t.currentOverlay()) {
					n = n || e.textColor;
					var a = "";
					W ? (e.textOutline = !0, a = AV.template[AV.launchData.layout].textEntryOutlineStyle(n && AV.util.color_is_light(n) ? {
						size: w * e.textSize,
						color: "#000"
					} : {
						size: w * e.textSize,
						color: "#fff"
					})) : e.textOutline = !1, N(), e.mode === y.EDIT_STATE && (e.element.find(".avpw_textwithfont_entry")[0].style.textShadow = a)
				}
			},
			te = function(e, n) {
				e = e || t.currentOverlay(), e && (e.textOpacity = n)
			},
			ne = function(e) {
				var n, a = t.currentOverlay();
				a && r && (n = r * e | 0, K(a, n), Q(n))
			},
			ae = function(e) {
				o && o.length && (e = e.replace(/>/g, "&gt;").replace(/</g, "&lt;"), o.find(".avpw_proxy_get_height").html(" " + e + " "))
			},
			ie = function(e, t) {
				var n, a, i, r, s, l;
				e && e.element && o && o.length && (dims = oe(e, t), r = dims.width || 0, s = dims.height || 0, n = e.topLeftX, a = e.width, l = (a - r) / 2 + .5 | 0, i = n + l, e.element.css({
					width: r + "px",
					left: i + "px",
					height: s + "px"
				}))
			},
			oe = function(e, a) {
				if (t) {
					e = e || t.currentOverlay();
					var i = e.text || "",
						r = e.textSize,
						s = {
							text: i,
							fontName: e.textFont.label,
							style: e.textFont.style || "normal",
							color: {
								r: 0,
								g: 0,
								b: 0,
								a: 255
							},
							alignment: "center",
							fontSize: r
						},
						l = (i.split("\n"), n.getStringDimensions(i, 0, r, s, !0)),
						c = .1,
						p = o.outerWidth();
					return p += 2 * (c * s.maxLineWidth, s.fontSize), {
						width: p,
						height: l.totalHeight
					}
				}
			},
			re = function() {
				var e, n = t.currentOverlay();
				n && (e = n.element.find(".avpw_textwithfont_entry"), e && e.length && (e.val(""), ae(""), ie(n), n.helpTextShown = !1, n.element.removeClass(d)))
			},
			se = function() {
				var e, n = t.currentOverlay();
				n && (e = n.element.find(".avpw_textwithfont_entry"), e && e.length && (e.val() || (e.val(c), ae(c), ie(n), n.text = c, n.helpTextShown = !0, n.element.addClass(d), N())))
			},
			le = function() {
				var e = t.currentOverlay();
				J(e, V || g[0]), te(e, S || 1)
			},
			ce = function() {
				var e = t.currentOverlay();
				e && e.element.find(".avpw_textwithfont_entry").css({
					color: "transparent",
					"text-shadow": ""
				})
			},
			pe = function(e) {
				var n = t.currentOverlay();
				n && n.mode === y.EDIT_STATE ? n.helpTextShown && re() : e.target && avpw$(e.target).trigger("blur")
			},
			ue = function(e) {
				var n, a = t.currentOverlay();
				if (a) {
					if (a.helpTextShown && re(), n = a.element.find(".avpw_textwithfont_entry").eq(0).val(), a.text = n, ae(n), x || I) return;
					ie(a), t.saveDimensions()
				}
			},
			de = function() {
				var e = t.currentOverlay();
				e && ie(e)
			},
			ve = function() {
				avpw$("#avpw_controlpanel_textwithfont").delegate(".avpw_isa_preset_color", "click", B).delegate(".avpw_isa_color_picker", "click", F), avpw$("#avpw_textwithfont_addtext").bind("click", q), e.layoutNotify(AV.launchData.openType, "getCanvasControlsElement").delegate(".avpw_selection_overlay", "keydown", pe).delegate(".avpw_selection_overlay", "keyup", ue), avpw$("#avpw_controlpanel_textwithfont").find(".avpw_inset_button").pressed("avpw_inset_button_down")
			},
			_e = function() {
				avpw$("#avpw_controlpanel_textwithfont").undelegate(".avpw_isa_preset_color", "click").undelegate(".avpw_isa_color_picker", "click"), avpw$("#avpw_textwithfont_addtext").unbind("click", q), e.layoutNotify(AV.launchData.openType, "getCanvasControlsElement").undelegate(".avpw_selection_overlay", "keydown").undelegate(".avpw_selection_overlay", "keyup"), avpw$("#avpw_controlpanel_textwithfont").find(".avpw_inset_button").unbind()
			},
			fe = function() {
				var e, t, n;
				if (b = {}, m)
					for (t = m.length, e = 0; t > e; e++) n = m[e], b[m[e].label] = n
			},
			he = function() {
				var e, t, n = g.length,
					a = "";
				for (e = 0; n > e; e++) t = {
					color: g[e]
				}, a += AV.template[AV.launchData.layout].brushColorIcon(t);
				avpw$("#avpw_textwithfont_colors").html(a)
			},
			we = function(e) {
				var t = 2 * k + C;
				e ? a += t : a -= t, (a > A || 0 > a) && (a = C)
			};
		D.init = function(n) {
			e = n, AV.launchData.textColorPresets && (g = AV.launchData.textColorPresets), he(), fe(), i = new AV.Dropdown({
				defaultValue: p.label,
				updateElement: avpw$("#avpw_font_browser"),
				popupElement: avpw$(AV.template[AV.launchData.layout].fontGroupPopup()),
				popupParent: avpw$("#avpw_controls"),
				items: m,
				itemTemplate: AV.template[AV.launchData.layout].fontGroupPopupItem,
				onItemClicked: P
			}), e.layoutNotify(AV.launchData.openType, "subscribeToResize", ["buildTextWithFontPresets", function() {
				he(), i && i.position()
			}]), t = new AV.OverlayController(n, n.paintWidget, {
				modes: y,
				onModeChange: function(e, t) {
					e.text || se(), ce(), t === y.DRAG_STATE ? (N(), e.element.find(".avpw_textwithfont_entry").trigger("blur")) : t === y.EDIT_STATE && (e.element.find(".avpw_textwithfont_entry").removeClass(v), le())
				},
				handlePosition: AV.OverlayController.HANDLE_POSITION.BOTTOM_RIGHT
			})
		}, D.panelWillOpen = function() {
			n = e.paintWidget.resourceProvider.utils.TextProvider, se(), x = !1,
				I = !1, T = p, k = u, V = g[0], j(T), H(W), e.canvasUI && e.canvasUI.subscribe(D), ve(), avpw$.miniColors && (AV.miniColors = new avpw$.miniColors), L(), e.layoutNotify(AV.launchData.openType, "hideZoomButton"), e.layoutNotify(AV.launchData.openType, "showCanvasControlsElement"), e.layoutNotify(AV.launchData.openType, "scaleCanvas"), t.activate(), a = C
		}, D.panelDidOpen = function() {
			$(), G(V), i && (i.position(), i.update()), mediator.on("layout:resize", ge)
		};
		var ge = function() {
			i && i.position()
		};
		return D.panelWillClose = function() {
			O(), _e(), e.canvasUI && e.canvasUI.unsubscribe(D), s && (s.hideColorPicker(), s = null), AV.miniColors = null, i && i.hide(), e.layoutNotify(AV.launchData.openType, "showZoomButton"), e.layoutNotify(AV.launchData.openType, "hideCanvasControlsElement"), t.deactivate(), mediator.off("layout:resize", ge)
		}, D.shutdown = function() {
			e && e.layoutNotify(AV.launchData.openType, "unsubscribeToResize", ["buildTextWithFontPresets"]), i && (i.shutdown(), i = void 0), e = null, b = null
		}, D.mouseDownEvent = function(e, n) {
			return t.updateUIDown(e, n, function(e, t) {
				t && e.element.find(".avpw_textwithfont_entry").removeClass(v), se()
			}, function(e) {
				r = e.textSize
			}, function(e) {
				mediator.trigger("usage:interact", "textwithfont", "textremoved", e.text), t.isLastOverlayAdded(e) && we()
			})
		}, D.mouseMoveEvent = function(e, n) {
			return t.updateUIMove(e, n, function(e) {
				e.mode !== y.EDIT_STATE && e.element.find(".avpw_textwithfont_entry").addClass(v), e.wasMoved && e.element.find(".avpw_textwithfont_entry").trigger("blur")
			}, function(e, t) {
				t = t || 1, ne(t), N()
			}), !1
		}, D.mouseUpEvent = function(e, n) {
			t.apply(e, n, function(e, n, a) {
				n ? (G(e.textColor), Q(e.textSize), H(e.textOutline), j(e.textFont), Z(e.textFont), e.text ? ae(e.text) : se(), de(), a || e.wasMoved || !t.isLastOverlayAdded(e) || (e.wasMoved = !0, we())) : e && e.element.find(".avpw_textwithfont_entry").trigger("blur"), a && mediator.trigger("usage:interact", "textwithfont", "sizechanged", e ? e.textSize : "")
			})
		}, D.onEnableZoomMode = function() {
			return e.canvasUI && e.canvasUI.unsubscribe(D), !1
		}, D.onDisableZoomMode = function() {
			e.canvasUI && e.canvasUI.subscribe(D)
		}, D.commit = function() {
			var n = [];
			t.commit(function(e) {
				var t = U(e);
				t && n.push(t)
			}), n && n.length && (e.paintWidget.module.textwithfont.applyMultiple(n, "text"), e.paintWidget.module.textwithfont.commit())
		}, D
	}(), AV.ControlsWidget.prototype.tool.focus = function() {
		var e, t, n, a, i = 150,
			o = 10,
			r = {
				OFF_STATE: 0,
				DRAG_STATE: 1
			},
			s = {},
			l = "radial",
			c = 30,
			p = -1,
			u = -1,
			d = 80,
			v = function() {
				n.element.stop().animate({
					opacity: 1
				}, 100)
			},
			_ = function() {
				n.element.stop().animate({
					opacity: 0
				}, 300)
			},
			f = function() {
				avpw$(".avpw_tiltshift_circle_button").addClass("avpw_inset_button_down").siblings().removeClass("avpw_inset_button_down"), a.removeClass("avpw_tiltshift_rectangle").addClass("avpw_tiltshift_circle"), l = "radial", t.setHandlePosition(AV.OverlayController.HANDLE_POSITION.BOTTOM_CENTER), w(5.49778714), y(), mediator.trigger("usage:interact", "focus", "CircleClicked")
			},
			h = function() {
				avpw$(".avpw_tiltshift_rectangle_button").addClass("avpw_inset_button_down").siblings().removeClass("avpw_inset_button_down"), a.removeClass("avpw_tiltshift_circle").addClass("avpw_tiltshift_rectangle"), l = "linear", t.setHandlePosition(AV.OverlayController.HANDLE_POSITION.BOTTOM_CENTER), w(0), y(), mediator.trigger("usage:interact", "focus", "RectangleClicked")
			},
			w = function(a) {
				var o = AV.controlsWidgetInstance.canvasUI.viewport.getRatio();
				n.element.css({
					width: i,
					height: i,
					top: e.paintWidget.height / 2 / o - i / 2,
					left: e.paintWidget.width / 2 / o - i / 2
				}), t.setRotation(n, a), t.saveDimensions(n)
			},
			g = function(r, s, l, c) {
				var p, u, d, v, _, f, h = Math.floor(4294967295 * Math.random()).toString(16),
					w = "avpw_tiltshift_overlay-" + h;
				f = "minimum" === AV.launchData.theme && "Microsoft Internet Explorer" == navigator.appName ? '<div class="avpw_tiltshift_shape"><img class="avpw_ie_img_event_bubble"/></div>' : '<div class="avpw_tiltshift_shape"></div>', a = avpw$(AV.template[AV.launchData.layout].selectionOverlay({
					id: w,
					body: f
				})).addClass("avpw_tiltshift_overlay"), d = 1, e.canvasUI && (d = e.canvasUI.viewport.getRatio()), v = i + 2 * o, p = r / d - v / 2, u = s / d - v / 2, _ = {
					left: p + "px",
					top: u + "px",
					width: i + "px",
					height: i + "px"
				}, a.css(_), n = {
					id: w,
					initialCoordsX: 0,
					initialCoordsY: 0,
					element: a
				}, t.newOverlay(n)
			},
			m = function() {};
		s.init = function(n) {
			e = n, avpw$.support.touch && (v = _ = function() {}), c = .1 * e.paintWidget.width < e.paintWidget.height ? e.paintWidget.width : e.paintWidget.height, AV.OverlayController && (t = new AV.OverlayController(n, n.paintWidget, {
				modes: r,
				aspectRatio: 1,
				handlePosition: AV.OverlayController.HANDLE_POSITION.BOTTOM_CENTER,
				forceDragMode: !0,
				minimumOverlaySize: 40,
				maximumOverlaySize: c
			}))
		}, s.panelDidOpen = function() {
			f(), mediator.trigger("usage:interact", "focus", "Opened"), mediator.on("canvas:resize", C)
		}, s.panelWillOpen = function() {
			if (AV.featherGLEnabled && (d = 0), e.canvasUI && e.canvasUI.subscribe(s), avpw$("#avpw_controlpanel_focus").delegate(".avpw_tiltshift_circle_button", "mousedown", f).delegate(".avpw_tiltshift_rectangle_button", "mousedown", h), t) {
				t.activate();
				var n = Math.min(e.paintWidget.width, e.paintWidget.height);
				i > n && (i = .9 * n, 40 > i && (i = 40)), g(e.paintWidget.width / 2, e.paintWidget.height / 2, 100, 100)
			}
		}, s.panelWillClose = function() {
			e.canvasUI && e.canvasUI.unsubscribe(s), avpw$("#avpw_controlpanel_focus").undelegate(), t && t.deactivate(), mediator.trigger("usage:interact", "focus", "Closed"), mediator.off("canvas:resize", C)
		}, s.shutdown = function() {
			m(), e = null, mediator.off("canvas:resize", b)
		};
		var b = function() {
				for (var t = AV.controlsWidgetInstance.canvasUI.viewport.getRatio(), a = (n.element.position(), n.element[0]), i = a ? parseInt(a.style.width, 10) : 0, o = a ? avpw$(a).height() : 0, r = a ? parseInt(a.style.left, 10) : 0, s = a ? parseInt(a.style.top, 10) : 0, c = e.paintWidget.width, p = e.paintWidget.height, u = (r + i / 2) * t / c, d = (s + o / 2) * t / p, v = (i / 2 * t - 3) / c, _ = 180 - (n.rotation || 0) * (180 / Math.PI); 0 > _;) _ += 180;
				e.paintWidget.module.focus.applyPreview(l, [u, d], v, _)
			},
			y = function() {
				AV.msie || (window.clearTimeout(u), u = window.setTimeout(b, d))
			},
			C = function() {
				window.clearTimeout(u), u = window.setTimeout(b, 5)
			};
		return s.mouseDownEvent = function(e, n) {
			return v(), t.updateUIDown(e, n, function() {}, null, function(e) {}, function() {
				_()
			})
		}, s.mouseMoveEvent = function(e, a, i) {
			return n && (v(), window.clearTimeout(p), p = window.setTimeout(_, 900), t.updateUIMove(e, null, null, y, y)), !1
		}, s.mouseUpEvent = function(e, n) {
			AV.msie && b(), t.apply(e, n)
		}, s.onEnableZoomMode = function() {
			return e.canvasUI && (e.canvasUI.unsubscribe(s), _()), !1
		}, s.onDisableZoomMode = function() {
			e.canvasUI && (e.canvasUI.subscribe(s), v())
		}, s.cancel = function() {
			mediator.trigger("usage:interact", "focus", "Canceled")
		}, s.commit = function() {
			e.paintWidget.module.focus.commit(), mediator.trigger("usage:interact", "focus", "Applied", l)
		}, s.onUndoComplete = function(t) {
			return t && t.global ? (e.paintWidget.module.focus.resetImageData(), !1) : void 0
		}, s.onRedoComplete = function(t) {
			return t && t.global ? (e.paintWidget.module.focus.resetImageData(), !1) : void 0
		}, s
	}(), AV.ControlsWidget.prototype.tool.vignette = function() {
		var e, t, n, a, i, o, r, s, l = 150,
			c = 10,
			p = {
				OFF_STATE: 0,
				DRAG_STATE: 1
			},
			u = {},
			d = "circle",
			v = 100,
			_ = 40,
			f = function(i, o, r, s) {
				var p, u, d, v, _, f, h = (Math.floor(4294967295 * Math.random()).toString(16), "");
				f = "minimum" === AV.launchData.theme && "Microsoft Internet Explorer" == navigator.appName ? '<div class="avpw_tiltshift_shape"><img class="avpw_ie_img_event_bubble"/></div>' : '<div class="avpw_tiltshift_shape"></div>', a = avpw$(AV.template[AV.launchData.layout].selectionOverlay({
					id: h,
					body: f
				})).addClass("avpw_shape_overlay avpw_vignette_overlay"), a.append('<div class="avpw_skew_vertical avpw_crop_handle"></div>').append('<div class="avpw_skew_horizontal avpw_crop_handle"></div>'), d = 1, e.canvasUI && (d = e.canvasUI.viewport.getRatio()), v = l + 2 * c, p = i / d - v / 2, u = o / d - v / 2, _ = {
					left: p + "px",
					top: u + "px",
					width: l + "px",
					height: l + "px"
				}, a.css(_), n = {
					id: h,
					initialCoordsX: 0,
					initialCoordsY: 0,
					element: a
				}, t.newOverlay(n), AV.util.nextFrame(function() {
					a.css("opacity", 1).show().stop().animate({
						opacity: 0
					}, 1e3, function() {
						avpw$(this).css("opacity", "")
					})
				})
			},
			h = function() {};
		u.init = function(n) {
			e = n, i = .1 * e.paintWidget.width < e.paintWidget.height ? e.paintWidget.width : e.paintWidget.height, AV.OverlayController && (t = new AV.OverlayController(n, n.paintWidget, {
				modes: p,
				aspectRatio: 1,
				handlePosition: AV.OverlayController.HANDLE_POSITION.BOTTOM_RIGHT,
				forceDragMode: !0,
				minimumOverlaySize: 10,
				maximumOverlaySize: 999999,
				enableFreeAspectRatioMode: !0,
				disableRotation: !0
			})), r = new e.Slider({
				element: document.getElementById("avpw_vignette_slider"),
				min: -100,
				max: 100,
				defaultValue: v,
				onslide: w,
				onchange: w
			})
		};
		var w = function(e, t) {
			v = t.value, o = 0 > v ? "white" : "black", m()
		};
		u.panelDidOpen = function() {
			mediator.trigger("usage:interact", "vignette", "Opened"), mediator.on("canvas:resize", b)
		}, u.panelWillOpen = function() {
			if (AV.featherGLEnabled && (_ = 0), e.canvasUI && e.canvasUI.subscribe(u), t) {
				t.activate();
				var n = AV.controlsWidgetInstance.canvasUI.viewport.getRatio();
				l = e.paintWidget.height / n * .8;
				var a = Math.min(e.paintWidget.width, e.paintWidget.height);
				l > a && (l = .9 * a, 40 > l && (l = 40)), f(e.paintWidget.width / 2, e.paintWidget.height / 2, 100, 100)
			}
			o = "black", v = 100, r.reset(), r.addListeners(), m()
		}, u.panelWillClose = function() {
			e.canvasUI && e.canvasUI.unsubscribe(u), t && t.deactivate(), mediator.trigger("usage:interact", "vignette", "Closed"), mediator.off("canvas:resize", b)
		}, u.shutdown = function() {
			h(), e = null, mediator.off("canvas:resize", g)
		};
		var g = function() {
				var t = AV.controlsWidgetInstance.canvasUI.viewport.getRatio(),
					a = n.element[0],
					i = a ? parseInt(a.style.width, 10) : 0,
					o = a ? avpw$(a).height() : 0,
					r = a ? parseInt(a.style.left, 10) : 0,
					s = a ? parseInt(a.style.top, 10) : 0,
					l = v > 0 ? "black" : "white",
					c = e.paintWidget.width,
					p = e.paintWidget.height,
					u = [r * t / c, s * t / p, i * t / c, o * t / p];
				e.paintWidget.module.vignette.applyPreview(l, u, Math.abs(v) / 100, .75)
			},
			m = function() {
				AV.msie || (window.clearTimeout(s), s = window.setTimeout(g, _))
			},
			b = function() {
				window.clearTimeout(s), s = window.setTimeout(g, 5)
			},
			y = !1;
		return u.mouseDownEvent = function(e, n) {
			return y = !0, a.addClass("avpw_overlay_prevent_fade"), t.updateUIDown(e, n, function() {}, null, function(e) {}, function() {})
		}, u.mouseOutEvent = function() {
			a.removeClass("avpw_overlay_prevent_fade")
		}, u.mouseMoveEvent = function(e, i, o) {
			return n && t.updateUIMove(e, null, null, function() {
				a.addClass("avpw_overlay_show_indicator"), m()
			}, m), !1
		}, u.mouseUpEvent = function(e, n) {
			AV.msie && g(), t.apply(e, n), y = !1, a.removeClass("avpw_overlay_show_indicator"), a.removeClass("avpw_overlay_prevent_fade")
		}, u.onEnableZoomMode = function() {
			return e.canvasUI && e.canvasUI.unsubscribe(u), !1
		}, u.onDisableZoomMode = function() {
			e.canvasUI && e.canvasUI.subscribe(u)
		}, u.cancel = function() {
			e.paintWidget.module.vignette.reset(), mediator.trigger("usage:interact", "vignette", "Canceled")
		}, u.commit = function() {
			e.paintWidget.module.vignette.commit(), mediator.trigger("usage:interact", "vignette", "Applied", d)
		}, u.onUndoComplete = function(e) {
			return e && e.global ? !1 : void 0
		}, u.onRedoComplete = function(e) {
			return e && e.global ? !1 : void 0
		}, u
	}(), AV.ControlsWidget.prototype.tool.warmth = function() {
		var e, t, n, a, i = AV.toolDefaults.warmth.presets,
			o = !1,
			r = {},
			s = function(t, n) {
				a = n.value, e.paintWidget.module.warmth.applyPreview(a, !0)
			};
		return r.init = function(a) {
			n = 0, e = a, t = new e.Slider({
				element: document.getElementById("avpw_warmth_slider"),
				min: i[0],
				max: i[3],
				defaultValue: n,
				delay: 0,
				onchange: s,
				onslide: s
			})
		}, r.cancel = function() {
			o = !1
		}, r.panelWillOpen = function() {
			a = n
		}, r.panelDidOpen = function() {
			t.addListeners()
		}, r.panelWillClose = function() {
			t.removeListeners()
		}, r.panelDidClose = function() {
			o && (r.resetUI(), o = !1)
		}, r.onUndo = function(t) {
			t || r.resetUI(), e.paintWidget.module.warmth.resetBacking()
		}, r.onRedo = function(e) {
			!e && t && t.setValue(a)
		}, r.resetUI = function() {
			t.reset()
		}, r.commit = function() {
			e.paintWidget.module.warmth.commit()
		}, r.shutdown = function() {
			t && (t.shutdown(), t = void 0), e = null
		}, r
	}();
	AV.languageStrings = {
		"Enter text here": "Enter text here",
		"Save": "Save",
		"Photo Editor": "Photo Editor",
		"Cancel": "Cancel",
		"Rotate": "Rotate",
		"Mirror": "Mirror",
		"Width": "Width",
		"Maintain proportions": "Maintain proportions",
		"Height": "Height",
		"Frame": "Frame",
		"Enhance": "Enhance",
		"Night": "Night",
		"Balance": "Balance",
		"Hi-Def": "Hi-Def",
		"Illuminate": "Illuminate",
		"Color Fix": "Color Fix",
		"Color Picker": "Color Picker",
		"Eraser": "Eraser",
		"Brush Size": "Brush Size",
		"Add Text": "Add Text",
		"Free Color": "Free Color",
		"Smart Color": "Smart Color",
		"Shape": "Shape",
		"Apply": "Apply",
		"Your work was saved!": "Your work was saved!",
		"Resume": "Resume",
		"Close": "Close",
		"Get this editor": "Get this editor",
		"Width and height must be greater than zero and less than the maximum ({max}px)": "Width and height must be greater than zero and less than the maximum ({max}px)",
		"OK": "OK",
		"Are you sure? This can distort your image": "Are you sure? This can distort your image",
		"Wait! You didn't save your work. Are you certain that you want to close this editor?": "Wait! You didn't save your work. Are you certain that you want to close this editor?",
		"Help / Support": "Help / Support",
		"Have a suggestion to improve this photo editor? Let us know.": "Have a suggestion to improve this photo editor? Let us know.",
		"Send Feedback": "Send Feedback",
		"About this editor": "About this editor",
		"Aviary is the world's leading photo editing platform. Developers: learn how to add it to your app in minutes.": "Aviary is the world's leading photo editing platform. Developers: learn how to add it to your app in minutes.",
		"Visit Aviary.com": "Visit Aviary.com",
		"Please install {Adobe Flash Player} (version {min} or higher), or use a supported browser: {Chrome}, {Firefox}, {Safari}, {Opera}, or {Internet Explorer} (version 9 or higher).": "Please install {Adobe Flash Player} (version {min} or higher), or use a supported browser: {Chrome}, {Firefox}, {Safari}, {Opera}, or {Internet Explorer} (version 9 or higher).",
		"Your photo is smaller than the required size. Please choose a new one to proceed.": "Your photo is smaller than the required size. Please choose a new one to proceed.",
		"Zoom Mode": "Zoom Mode",
		"Click to release": "Click to release",
		"Effects": "Effects",
		"Frames": "Frames",
		"Stickers": "Stickers",
		"Focus": "Focus",
		"Orientation": "Orientation",
		"Brightness": "Brightness",
		"Contrast": "Contrast",
		"Saturation": "Saturation",
		"Warmth": "Warmth",
		"Sharpness": "Sharpness",
		"Splash": "Splash",
		"Draw": "Draw",
		"Text": "Text",
		"Redeye": "Redeye",
		"Whiten": "Whiten",
		"Blemish": "Blemish",
		"Powered by": "Powered by",
		"Crop": "Crop",
		"Please crop your photo to": "Please crop your photo to",
		"Remove": "Remove",
		"Set Color": "Set Color",
		"Lock Dimensions": "Lock Dimensions",
		"Custom": "Custom",
		"Resize": "Resize"
	};

	function EffectsPaintModule(e) {
		AV.PaintModuleActionlist.call(this, e)
	}

	function BrushTool(e) {
		e || (e = {}), e.shouldAllowEmptyStrokes && (this.shouldAllowEmptyStrokes = e.shouldAllowEmptyStrokes)
	}

	function InteractiveBrushTool(e) {
		"use strict";
		BrushTool.call(this, e), this.params = e || e || {}, this.module = e.module
	}

	function PaintModuleSizer(e) {
		AV.PaintModuleActionlist.call(this, e)
	}

	function getWHForRect(e) {
			var t = this.paintWidget.getScaledSize(),
				r = e.parameters.cropParams,
				o = {},
				a = r.width,
				i = r.aspectRatio,
				n = t.width * a + .5 | 0,
				s = n / i + .5 | 0;
			if (o.width = n, o.height = s, t.hiresWidth && t.hiresHeight) {
				var l = t.hiresWidth * a + .5 | 0,
					u = l / i + .5 | 0;
				o.hiresWidth = l, o.hiresHeight = u
			}
			return o
		}! function e(t, r, o) {
			function a(n, s) {
				if (!r[n]) {
					if (!t[n]) {
						var l = "function" == typeof require && require;
						if (!s && l) return l(n, !0);
						if (i) return i(n, !0);
						var u = new Error("Cannot find module '" + n + "'");
						throw u.code = "MODULE_NOT_FOUND", u
					}
					var h = r[n] = {
						exports: {}
					};
					t[n][0].call(h.exports, function(e) {
						var r = t[n][1][e];
						return a(r ? r : e)
					}, h, h.exports, e, t, r, o)
				}
				return r[n].exports
			}
			for (var i = "function" == typeof require && require, n = 0; n < o.length; n++) a(o[n]);
			return a
		}({
			1: [function(e, t, r) {
				! function() {
					function r() {
						this.glBuffers = {}, this.glBuffers = {}, this.glPrograms = {}, this.glRenderingObjects = {}, this.glImageData = {}, this.renderingMode = p.DEFAULT, this.freeTextures = [], this.currentVertices = [], this.currentTexCoords = [], this.currentIndeces = [], this.currentBlendMode = g.NONE, this.freeTextures = [], this.stateOK = !0, this.gl
					}
					var o = {
						MoaTransformImageVertexShader: ["precision highp float;", "attribute highp vec4 a_position;", "attribute highp vec2 a_texCoord;", "uniform highp mat4 u_transform;", "varying highp vec2 v_texCoord;", "", "void main(void) {", "v_texCoord = (vec4(a_texCoord.x, a_texCoord.y, 0.0, 1.0) * u_transform).xy;", "gl_Position = a_position;", "}"].join("\n"),
						MoaTransformImageFragmentShader: ["precision highp float;", "uniform highp sampler2D u_sampler;", "uniform highp float u_factor;", "varying highp vec2 v_texCoord;", "void main(void) {", "gl_FragColor = texture2D(u_sampler, v_texCoord);", "", "}"].join("\n"),
						MoaTransformOverlayVertexShader: ["precision highp float;", "attribute highp vec4 a_position;", "attribute highp vec2 a_texCoord;", "uniform highp mat4 u_transform;", "varying highp vec2 v_texCoord;", "", "void main(void) {", "v_texCoord = a_texCoord;", "gl_Position = (vec4(a_position.x, a_position.y, 0.0, 1.0) * u_transform);", "}"].join("\n"),
						MoaTransformOverlayFragmentShader: ["precision highp float;", "uniform highp sampler2D u_sampler;", "uniform highp sampler2D u_overlaySampler;", "uniform highp float u_alpha;", "uniform highp float u_factor;", "varying highp vec2 v_texCoord;", "void main(void) {", "//                                                            vec4 color = texture2D(u_overlaySampler, v_texCoord);", "//                                                            color.a = color.a * u_alpha;", "//                                                            gl_FragColor = color;", "gl_FragColor = texture2D(u_overlaySampler, v_texCoord) * u_alpha;", "", "}"].join("\n"),
						MoaDotMatrixVertexShader: ["attribute highp vec2 a_position;", "uniform float u_pointSize;", "", "void main()", "{", "gl_Position = vec4(a_position.x, a_position.y, 0.0, 1.0);", "gl_PointSize = u_pointSize;", "}"].join("\n"),
						MoaDotMatrixFragmentShader: ["precision highp float;", "", "uniform sampler2D u_dotSampler;", "", "void main()", "{", "gl_FragColor = texture2D(u_dotSampler, gl_PointCoord);", "}"].join("\n"),
						MoaBasicDotsVertexShader: ["attribute highp vec2 a_position;", "attribute highp float a_pointSize;", "", "void main()", "{", "gl_Position = vec4(a_position.x, a_position.y, 0.0, 1.0);", "gl_PointSize = a_pointSize;", "}"].join("\n"),
						MoaBlurModesPixelateFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_minDim;", "uniform float u_minDimPixels;", "", "void main(){", "vec2 dims = vec2(u_width, u_height);", "", "float pixelSize = u_minDim / u_minDimPixels;", "", "vec2 numPixels = vec2(u_width / pixelSize, u_height / pixelSize);", "", "numPixels = floor(numPixels);", "", "//There seems to be a rounding error causing the above to give the wrong number of pixels on low res images.", "if(u_width < u_height){", "numPixels.x = u_minDimPixels;", "}else{", "numPixels.y = u_minDimPixels;", "}", "", "vec2 pixelDims = 1.0 / numPixels;", "", "vec2 newCoords = (floor(v_texCoord / pixelDims) + 0.5) * pixelDims;", "", "newCoords = (floor(newCoords * dims) / dims);", "", "gl_FragColor = texture2D(u_sampler, newCoords);", "", "}"].join("\n"),
						MoaBlurModesTrianglesFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_minDim;", "uniform float u_minDimPixels;", "", "void main(){", "vec2 dims = vec2(u_width, u_height);", "", "float pixelSize = u_minDim / u_minDimPixels;", "", "vec2 numPixels = vec2(u_width / pixelSize, u_height / pixelSize);", "", "numPixels = floor(numPixels);", "", "//There seems to be a rounding error causing the above to give the wrong number of pixels on low res images.", "if(u_width < u_height){", "numPixels.x = u_minDimPixels;", "}else{", "numPixels.y = u_minDimPixels;", "}", "", "numPixels.x = 2.0 * numPixels.x;", "", "vec2 pixelDims = 1.0 / numPixels;", "", "vec2 pixelNum = floor(v_texCoord / pixelDims);", "", "vec2 newCoords = (pixelNum + 0.5) * pixelDims;", "", "vec2 coordsDiff = (newCoords - v_texCoord) / pixelDims;", "", "if(mod(pixelNum.x, 2.0) == mod(pixelNum.y, 2.0)){", "if(coordsDiff.y <= coordsDiff.x){", "newCoords.x = pixelNum.x * pixelDims.x;", "}else{", "newCoords.x = (pixelNum.x + 1.0) * pixelDims.x;", "}", "}else{", "if(coordsDiff.y <= -coordsDiff.x){", "newCoords.x = (pixelNum.x + 1.0) * pixelDims.x;", "}else{", "newCoords.x = pixelNum.x * pixelDims.x;", "}", "", "}", "", "newCoords = (floor(newCoords * dims) / dims);", "", "gl_FragColor = texture2D(u_sampler, newCoords);", "", "}"].join("\n"),
						MoaBlurModesCirclesFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_minDim;", "uniform float u_minDimPixels;", "", "void main(){", "vec2 dims = vec2(u_width, u_height);", "", "float pixelSize = u_minDim / u_minDimPixels;", "", "vec2 numPixels = u_minDimPixels * vec2(u_width, u_height) / u_minDim;", "", "numPixels = floor(numPixels);", "", "//There seems to be a rounding error causing the above to give the wrong number of pixels on low res images.", "if(u_width < u_height){", "numPixels.x = u_minDimPixels;", "}else{", "numPixels.y = u_minDimPixels;", "}", "", "vec2 pixelDims = 1.0 / numPixels;", "", "vec2 pixelNum = floor(v_texCoord / pixelDims);", "", "vec2 newCoords = (pixelNum + 0.5) * pixelDims;", "", "vec2 newCoords2 = newCoords;", "", "vec2 coordsDiff = (newCoords - v_texCoord) / pixelDims;", "", "newCoords2.x = coordsDiff.x > 0.0 ? pixelNum.x * pixelDims.x : (pixelNum.x + 1.0) * pixelDims.x;", "newCoords2.y = coordsDiff.y > 0.0 ? pixelNum.y * pixelDims.y : (pixelNum.y + 1.0) * pixelDims.y;", "", "float radius = length(coordsDiff);", "", "float alpha = clamp(10.0 * radius - 4.75, 0.0, 1.0);", "", "gl_FragColor = mix(texture2D(u_sampler, newCoords), texture2D(u_sampler, newCoords2), alpha);", "", "}"].join("\n"),
						MoaBlurModesDiamondsFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_minDim;", "uniform float u_minDimPixels;", "", "void main(){", "vec2 dims = vec2(u_width, u_height);", "", "float pixelSize = u_minDim / u_minDimPixels;", "", "vec2 numPixels = vec2(u_width / pixelSize, u_height / pixelSize);", "", "numPixels = floor(numPixels);", "", "//There seems to be a rounding error causing the above to give the wrong number of pixels on low res images.", "if(u_width < u_height){", "numPixels.x = u_minDimPixels;", "}else{", "numPixels.y = u_minDimPixels;", "}", "", "numPixels.x = 1.5 * numPixels.x;", "", "vec2 pixelDims = 1.0 / numPixels;", "", "vec2 pixelNum = floor(v_texCoord / pixelDims);", "", "vec2 newCoords = (pixelNum + 0.5) * pixelDims;", "", "vec2 coordsDiff = (newCoords - v_texCoord) / pixelDims;", "", "if(mod(pixelNum.x, 2.0) == mod(pixelNum.y, 2.0)){", "if(coordsDiff.y <= coordsDiff.x){", "newCoords.x = pixelNum.x * pixelDims.x;", "newCoords.y = (pixelNum.y + 1.0) * pixelDims.y;", "}else{", "newCoords.x = (pixelNum.x + 1.0) * pixelDims.x;", "newCoords.y = pixelNum.y * pixelDims.y;", "}", "}else{", "if(coordsDiff.y <= -coordsDiff.x){", "newCoords = (pixelNum + 1.0) * pixelDims;", "}else{", "newCoords = pixelNum * pixelDims;", "}", "}", "", "", "", "gl_FragColor = texture2D(u_sampler, newCoords);", "}"].join("\n"),
						MoaBlurModesHoundstoothFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_minDim;", "uniform float u_minDimPixels;", "", "void main(){", "vec2 dims = vec2(u_width, u_height);", "", "float pixelSize = u_minDim / u_minDimPixels;", "", "vec2 numPixels = vec2(u_width / pixelSize, u_height / pixelSize);", "", "numPixels = floor(numPixels);", "", "//There seems to be a rounding error causing the above to give the wrong number of pixels on low res images.", "if(u_width < u_height){", "numPixels.x = u_minDimPixels;", "}else{", "numPixels.y = u_minDimPixels;", "}", "", "vec2 pixelDims = 1.0 / numPixels;", "", "vec2 pixelNum = floor(v_texCoord / pixelDims);", "", "vec2 newCoords = (pixelNum + 0.5) * pixelDims;", "", "vec2 coordsDiff = (newCoords - v_texCoord) / pixelDims;", "", "float diagDist = abs(coordsDiff.y - coordsDiff.x);", "", "if(coordsDiff.x < 0.0 && coordsDiff.y < 0.0){", "newCoords = (pixelNum + 0.75) * pixelDims;", "}else if(coordsDiff.x >= 0.0 && coordsDiff.y >= 0.0){", "newCoords = (pixelNum + 0.25) * pixelDims;", "}else if(coordsDiff.x < 0.0 && coordsDiff.y >= 0.0){", "if(diagDist < 0.25){", "newCoords = (pixelNum + 0.75) * pixelDims;", "}else if(diagDist < 0.5){", "newCoords = (pixelNum + 0.25) * pixelDims;", "}else if(diagDist < 0.75){", "newCoords.y = (pixelNum.y - 0.25) * pixelDims.y;", "newCoords.x = (pixelNum.x + 0.75) * pixelDims.x;", "}else{", "newCoords.y = (pixelNum.y + 0.25) * pixelDims.y;", "newCoords.x = (pixelNum.x + 1.25) * pixelDims.x;", "}", "}else{", "if(diagDist < 0.25){", "newCoords = (pixelNum + 0.75) * pixelDims;", "}else if(diagDist < 0.5){", "newCoords = (pixelNum + 0.25) * pixelDims;", "}else if(diagDist < 0.75){", "newCoords.y = (pixelNum.y + 0.75) * pixelDims.y;", "newCoords.x = (pixelNum.x - 0.25) * pixelDims.x;", "}else{", "newCoords.y = (pixelNum.y + 1.25) * pixelDims.y;", "newCoords.x = (pixelNum.x + 0.25) * pixelDims.x;", "}", "}", "", "", "", "", "gl_FragColor = texture2D(u_sampler, newCoords);", "}"].join("\n"),
						MoaBlurModesChevronsFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_minDim;", "uniform float u_minDimPixels;", "", "void main(){", "vec2 dims = vec2(u_width, u_height);", "", "float pixelSize = u_minDim / u_minDimPixels;", "", "vec2 numPixels = vec2(u_width / pixelSize, u_height / pixelSize);", "", "numPixels = floor(numPixels);", "", "//There seems to be a rounding error causing the above to give the wrong number of pixels on low res images.", "if(u_width < u_height){", "numPixels.x = u_minDimPixels;", "}else{", "numPixels.y = u_minDimPixels;", "}", "", "vec2 pixelDims = 1.0 / numPixels;", "", "vec2 pixelNum = floor(v_texCoord / pixelDims);", "", "vec2 newCoords = (pixelNum + 0.5) * pixelDims;", "", "vec2 coordsDiff = (newCoords - v_texCoord) / pixelDims;", "", "if(coordsDiff.x + coordsDiff.y < -0.5 || coordsDiff.x - coordsDiff.y > 0.5){", "newCoords.y = (pixelNum.y + 1.25) * pixelDims.y;", "}else if(coordsDiff.y < coordsDiff.x || coordsDiff.y < -coordsDiff.x){", "newCoords.y = (pixelNum.y + 0.75) * pixelDims.y;", "}else{", "newCoords.y = (pixelNum.y + 0.25) * pixelDims.y;", "}", "", "gl_FragColor = texture2D(u_sampler, newCoords);", "}"].join("\n"),
						MoaBlurModesSinesFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_minDim;", "uniform float u_minDimPixels;", "", "void main(){", "vec2 dims = vec2(u_width, u_height);", "", "float pixelSize = u_minDim / u_minDimPixels;", "", "vec2 numPixels = vec2(u_width / pixelSize, u_height / pixelSize);", "", "//There seems to be a rounding error causing the above to give the wrong number of pixels on low res images.", "if(u_width < u_height){", "numPixels.x = u_minDimPixels;", "}else{", "numPixels.y = u_minDimPixels;", "}", "", "vec2 pixelDims = 1.0 / numPixels;", "", "vec2 pixelNum = floor(v_texCoord / pixelDims)", "", "vec2 newCoords = (pixelNum + 0.5) * pixelDims;", "", "vec2 coordsDiff = (newCoords - v_texCoord) / pixelDims;", "", "if(coordsDiff.y >= 0.25 * cos(2.0 * 3.14159265358979323846264338327950288 * coordsDiff.x) + 0.25){", "newCoords.x = newCoords.x - 0.5 * step(0.0, coordsDiff.x) * pixelDims.x + 0.5 * step(coordsDiff.x,0.0) * pixelDims.x;", "newCoords.y = newCoords.y - 0.5 * pixelDims.y;", "}else if(coordsDiff.y <= -0.25 * cos(2.0 * 3.14159265358979323846264338327950288 * coordsDiff.x) - 0.25){", "newCoords.x = newCoords.x - 0.5 * step(0.0, coordsDiff.x) * pixelDims.x + 0.5 * step(coordsDiff.x,0.0) * pixelDims.x;", "newCoords.y = newCoords.y + 0.5 * pixelDims.y;", "}", "", "gl_FragColor = texture2D(u_sampler, newCoords);", "}"].join("\n"),
						MoaBlurModesScalesFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_minDim;", "uniform float u_minDimPixels;", "", "void main(){", "vec2 dims = vec2(u_width, u_height);", "", "float pixelSize = u_minDim / u_minDimPixels;", "", "vec2 numPixels = vec2(u_width / pixelSize, u_height / pixelSize);", "", "//There seems to be a rounding error causing the above to give the wrong number of pixels on low res images.", "if(u_width < u_height){", "numPixels.x = u_minDimPixels;", "}else{", "numPixels.y = u_minDimPixels;", "}", "", "numPixels = floor(numPixels);", "", "vec2 pixelDims = 1.0 / numPixels;", "", "vec2 pixelNum = floor(v_texCoord / pixelDims);", "", "vec2 newCoords = (floor(v_texCoord / pixelDims) + 0.5) * pixelDims;", "", "vec2 coordsDiff = (newCoords - v_texCoord) / pixelDims;", "vec2 tempDiff1 = coordsDiff + 0.5;", "vec2 tempDiff2 = vec2(coordsDiff.x - 0.5, coordsDiff.y + 0.5);", "", "if(length(coordsDiff) >= 0.5 && coordsDiff.y > 0.0){", "newCoords.x = (step(0.0, coordsDiff.x) * pixelNum.x + step(coordsDiff.x, 0.0) * (pixelNum.x + 1.0)) * pixelDims.x;", "newCoords.y = pixelNum.y * pixelDims.y;", "}else if(length(tempDiff1) <= 0.5 || length(tempDiff2) <= 0.5){", "newCoords.x = (step(0.0, coordsDiff.x) * pixelNum.x + step(coordsDiff.x, 0.0) * (pixelNum.x + 1.0)) * pixelDims.x;", "newCoords.y = (pixelNum.y + 1.0) * pixelDims.y;", "}", "", "gl_FragColor = texture2D(u_sampler, newCoords);", "}"].join("\n"),
						MoaBlurModesBricksFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_minDim;", "uniform float u_minDimPixels;", "", "void main(){", "vec2 dims = vec2(u_width, u_height);", "", "float pixelSize = u_minDim / u_minDimPixels;", "", "vec2 numPixels = vec2(u_width / pixelSize, u_height / pixelSize);", "", "//There seems to be a rounding error causing the above to give the wrong number of pixels on low res images.", "if(u_width < u_height){", "numPixels.x = u_minDimPixels;", "}else{", "numPixels.y = u_minDimPixels;", "}", "", "numPixels = floor(numPixels);", "", "numPixels.y = 1.25 * numPixels.y;", "", "vec2 pixelDims = 1.0 / numPixels;", "", "vec2 pixelNum = floor(v_texCoord / pixelDims);", "", "vec2 newCoords = (pixelNum + 0.5) * pixelDims;", "", "vec2 coordsDiff = (newCoords - v_texCoord) / pixelDims;", "", "newCoords.y = newCoords.y + 0.25 * pixelDims.y;", "", "if(coordsDiff.y > 0.0){", "if(coordsDiff.x > 0.0){", "newCoords.x = pixelNum.x * pixelDims.x;", "}else{", "newCoords.x = (pixelNum.x + 1.0) * pixelDims.x;", "}", "newCoords.y = (pixelNum.y + 0.25) * pixelDims.y;", "}", "", "gl_FragColor = texture2D(u_sampler, newCoords);", "}"].join("\n"),
						MoaBlurModesHeartsFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_minDim;", "uniform float u_minDimPixels;", "", "void main(){", "vec2 dims = vec2(u_width, u_height);", "", "float pixelSize = u_minDim / u_minDimPixels;", "", "vec2 numPixels = u_minDimPixels * vec2(u_width, u_height) / u_minDim;", "", "numPixels = floor(numPixels);", "", "//There seems to be a rounding error causing the above to give the wrong number of pixels on low res images.", "if(u_width < u_height){", "numPixels.x = u_minDimPixels;", "}else{", "numPixels.y = u_minDimPixels;", "}", "", "vec2 pixelDims = 1.0 / numPixels;", "", "vec2 pixelNum = floor(v_texCoord / pixelDims);", "", "vec2 newCoords = (pixelNum + 0.5) * pixelDims;", "vec2 newCoords2 = newCoords;", "", "vec2 coordsDiff = (newCoords - v_texCoord) / pixelDims;", "", "if(coordsDiff.x > 0.0){", "newCoords2.x = pixelNum.x * pixelDims.x;", "}else{", "newCoords2.x = (pixelNum.x + 1.0) * pixelDims.x;", "}", "", "if(coordsDiff.y > 0.2){", "newCoords2.y = pixelNum.y * pixelDims.y;", "}else{", "newCoords2.y = (pixelNum.y + 1.0) * pixelDims.y;", "}", "", "float metric = step(coordsDiff.y, 0.2) * (0.29 * sin(1.25 * 3.14159265358979323846264338327950288 * (coordsDiff.y + 0.2)) + 0.29 - abs(coordsDiff.x)) + step(0.2, coordsDiff.y) * ((0.33 - length(vec2(abs(coordsDiff.x) - 0.23, coordsDiff.y - 0.18))));", "", "float alpha = clamp(12.5 * metric, 0.0, 1.0);", "", "gl_FragColor = mix(texture2D(u_sampler, newCoords2), texture2D(u_sampler, newCoords), alpha);", "", "}"].join("\n"),
						MoaBlurModesHexagonsFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_minDim;", "uniform float u_minDimPixels;", "", "void main(){", "vec2 dims = vec2(u_width, u_height);", "", "float pixelSize = u_minDim / u_minDimPixels;", "", "vec2 numPixels = vec2(u_width / pixelSize, u_height / pixelSize);", "", "numPixels = floor(numPixels);", "", "//There seems to be a rounding error causing the above to give the wrong number of pixels on low res images.", "if(u_width < u_height){", "numPixels.x = u_minDimPixels;", "}else{", "numPixels.y = u_minDimPixels;", "}", "", "numPixels.x = 0.5 * numPixels.x;", "", "vec2 pixelDims = 1.0 / numPixels;", "", "vec2 pixelNum = floor(v_texCoord / pixelDims);", "", "vec2 newCoords = (pixelNum + 0.5) * pixelDims;", "", "vec2 coordsDiff = (newCoords - v_texCoord) / pixelDims;", "", "if(coordsDiff.y > 0.0){", "if(coordsDiff.y > -3.0 * coordsDiff.x + 1.0){", "newCoords = pixelNum * pixelDims;", "}else if(coordsDiff.y > 3.0 * coordsDiff.x + 1.0){", "newCoords.x = (pixelNum.x + 1.0) * pixelDims.x;", "newCoords.y = pixelNum.y * pixelDims.y;", "}", "}else{", "if(coordsDiff.y < 3.0 * coordsDiff.x - 1.0){", "newCoords.x = pixelNum.x * pixelDims.x;", "newCoords.y = (pixelNum.y + 1.0) * pixelDims.y;", "}else if(coordsDiff.y < -3.0 * coordsDiff.x - 1.0){", "newCoords = (pixelNum + 1.0) * pixelDims;", "}", "}", "", "gl_FragColor = texture2D(u_sampler, newCoords);", "", "}"].join("\n"),
						MoaAirbrushFragmentShader: ["precision highp float;", "uniform lowp sampler2D u_sampler;", "uniform lowp sampler2D u_samplerLF;", "uniform lowp sampler2D u_samplerLLF;", "", "varying highp vec2 v_texCoord;", "", "void main() {", "vec4 img = texture2D(u_sampler, v_texCoord);", "vec4 imgLF = texture2D(u_samplerLF, v_texCoord);", "vec4 imgLLF = texture2D(u_samplerLLF, v_texCoord);", "", "// MF = imgLF - imgLLF", "// HF = img - imgLF", "// img = imgLLF + MF + HF", "// img = imgLLF + img - imgLF + imgLF - imgLLF", "", "// want result = imgLLF + HF = imgLLF + img - imgLF", "", "float alpha = 1.0;", "", "vec4 blendColor = imgLLF + img - imgLF;// + 0.4*(imgLF - imgLLF);", "", "vec4 result = mix(img, blendColor, alpha);", "", "gl_FragColor = vec4(result.rgb,img.a);", "}"].join("\n"),
						MoaMascaraFragmentShader: ["precision highp float;", "uniform lowp sampler2D u_sampler;", "uniform lowp sampler2D u_samplerLF;", "uniform lowp sampler2D u_samplerLLF;", "", "varying highp vec2 v_texCoord;", "", "void main() {", "vec4 img = texture2D(u_sampler, v_texCoord);", "vec4 imgLF = texture2D(u_samplerLF, v_texCoord);", "vec4 imgLLF = texture2D(u_samplerLLF, v_texCoord);", "", "// MF = imgLF - imgLLF", "// HF = img - imgLF", "// img = imgLLF + MF + HF", "// img = imgLLF + img - imgLF + imgLF - imgLLF", "", "// want result = imgLLF + HF = imgLLF + img - imgLF", "", "vec4 blendColor = imgLF;", "", "float diff = 0.2*imgLF.r + 0.7*imgLF.g + 0.1*imgLF.b - (0.2*img.r + 0.7*img.g + 0.1*img.b);", "", "if(diff > 0.0) {", "blendColor = img;// * (1.0 - abs(diff));", "}", "", "gl_FragColor = vec4(blendColor.rgb,img.a);", "}"].join("\n"),
						MoaBlemishFragmentShader: ["precision highp float;", "uniform lowp sampler2D u_sampler;", "uniform lowp sampler2D u_samplerLF;", "uniform lowp sampler2D u_samplerOffset;", "uniform lowp sampler2D u_samplerOffsetLF;", "", "uniform vec2 u_center;", "uniform vec2 u_offset;", "uniform vec4 u_avgColor;", "uniform float u_aspectI;", "uniform float u_radius;", "", "varying highp vec2 v_texCoord;", "void main() {", "vec4 img = texture2D(u_sampler, v_texCoord);", "vec4 imgLF = texture2D(u_samplerLF, v_texCoord);", "vec4 imgOffset = texture2D(u_samplerOffset, v_texCoord);", "vec4 imgOffsetLF = texture2D(u_samplerOffsetLF, v_texCoord);", "", "//      float r = length(vec2(v_texCoord.x, u_aspectI * v_texCoord.y) - u_center);", "float r = length(v_texCoord - u_center);", "", "float r2 = r*r;", "float raidus2 = 0.5*0.5;", "", "float alpha = 1.15651764275 * exp(-2.0 * r2/raidus2) - 0.13533528323;", "alpha = clamp(alpha, 0.0, 1.0);", "", "float alphaLF = 1.01865736036 * exp(-4.0 * r2/raidus2) - 0.01831563888;", "alphaLF = clamp(alphaLF, 0.0, 1.0);", "", "vec4 highFreqColor = (imgOffset - imgOffsetLF);", "float highFreqOffset = 1.25 * (0.1 * highFreqColor.r + 0.7 * highFreqColor.g + 0.2 * highFreqColor.b);", "", "vec4 blendColor = mix(imgLF, u_avgColor, alphaLF);", "blendColor = blendColor + highFreqOffset;", "vec4 result = mix(img, blendColor, alpha);", "", "gl_FragColor = vec4(result.rgb,img.a);", "}"].join("\n"),
						MoaWhitenFragmentShader: ["precision highp float;", "", "uniform highp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "void main(void) {", "highp vec4 color = texture2D(u_sampler, v_texCoord);", "", "// RGB to LAB", "float R = color.r * 255.0;", "float G = color.g * 255.0;", "float B = color.b * 255.0;", "", "float l1;", "float a1;", "float b1;", "float r;", "float g;", "float b;", "float x;", "float y;", "float z;", "", "if(R/255.0 <= 0.04045){r = 100.0 *R/255.0/12.92;} else{ r = 100.0*pow((R/255.0+0.055)/1.055,2.40);}", "if(G/255.0 <= 0.04045){g = 100.0 *G/255.0/12.92;} else{ g = 100.0*pow((G/255.0+0.055)/1.055,2.40);}", "if(B/255.0 <= 0.04045){b = 100.0 *B/255.0/12.92;} else{ b = 100.0*pow((B/255.0+0.055)/1.055,2.40);}", "", "x = 0.00433891*r  + 0.00376234915*g + 0.0018990604648*b;", "y = 0.002126*r    + 0.007152*g      + 0.000722*b;", "z = 0.000177255*r + 0.00109475308*g + 0.0087295537*b;", "", "if(x > 0.008856){x = pow(x,1.0/3.0);}else{x = 7.787*x+16.0/116.0;}", "if(y > 0.008856){y = pow(y,1.0/3.0);}else{y = 7.787*y+16.0/116.0;}", "if(z > 0.008856){z = pow(z,1.0/3.0);}else{z = 7.787*z+16.0/116.0;}", "", "l1 = 116.0*y-16.0;", "a1 = 500.0*(x-y);", "b1 = 200.0*(y-z);", "", "color.r = l1 * 2.55; color.g = (a1+127.0); color.b = (b1+127.0);", "", "// Adjust LAB", "float dColor = (color.g - 132.0)*(color.g - 132.0);", "", "if(color.b < 127.0){", "dColor += (color.b - 127.0)*(color.b - 127.0);", "}", "", "float factor = 0.65*exp(-dColor/98.0);", "", "color.r = 255.0*pow(color.r/255.0,1.0/(0.5*factor+1.0));", "color.b = (1.0-factor)*(color.b-127.0)+127.0;", "", "// LAB to RGB", "float lab0 = color.r;", "float lab1 = color.g;", "float lab2 = color.b;", "", "float Y = ( lab0/2.55 + 16.0) / 116.0;", "float X = (lab1-127.0) / 500.0 + Y;", "float Z = Y - (lab2-127.0) / 200.0;", "", "float Y3 = Y*Y*Y;", "float X3 = X*X*X;", "float Z3 = Z*Z*Z;", "", "if ( Y3 > 0.008856 ){ Y = Y3;}else{Y = ( Y - 16.0 / 116.0 ) / 7.787;}", "", "if ( X3 > 0.008856 ){ X = X3;}else{X = ( X - 16.0 / 116.0 ) / 7.787;}", "", "if ( Z3 > 0.008856 ){ Z = Z3;}else{Z = ( Z - 16.0 / 116.0 ) / 7.787;}", "", "X = .95047  * X;", "Y = 1.00000 * Y;", "Z = 1.08883 * Z;", "", "R = X *  3.2406 + Y * -1.5372 + Z * -0.4986;", "G = X * -0.9689 + Y *  1.8758 + Z *  0.0415;", "B = X *  0.0557 + Y * -0.2040 + Z *  1.0570;", "", "if ( R > 0.0031308 ) {R = 1.055 * ( pow(R , ( 0.41666666666667 )) ) - 0.055;}else{ R = 12.92 * R;}", "if ( G > 0.0031308 ) {G = 1.055 * ( pow(G , ( 0.41666666666667 )) ) - 0.055;}else{ G = 12.92 * G;}", "if ( B > 0.0031308 ) {B = 1.055 * ( pow(B , ( 0.41666666666667 )) ) - 0.055;}else{ B = 12.92 * B;}", "", "color.r = R; color.g = G; color.b = B;", "color.a = 1.0;", "", "gl_FragColor = color;", "}"].join("\n"),
						MoaRedeyeOriginalFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "void main(void) {", "lowp vec4 color = texture2D(u_sampler, v_texCoord);", "", "if(color.r >= color.g + color.b){", "color.r = (color.g + color.b) / 2.0;", "}", "", "gl_FragColor = color;", "}"].join("\n"),
						MoaRedeye2013FragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "void main(void) {", "lowp vec4 c = texture2D(u_sampler, v_texCoord);", "", "float chroma = max(max(c.r,c.g),c.b)-min(min(c.r,c.g),c.b);", "", "float srcI = 0.2*c.r+0.7*c.g+0.1*c.b;", "", "float cFactor = exp(-(chroma-175.0/255.0)*(chroma-175.0/255.0)/(2.0*75.0*75.0/255.0/255.0));", "if(chroma > 175.0/255.0){", "cFactor = 1.0;", "}", "", "float gFactor = c.b - c.g;", "if(gFactor < 0.0){", "gFactor = exp(-gFactor*gFactor/(2.0*20.0*20.0/255.0/255.0));", "}else{", "gFactor = 1.0;", "}", "", "float redFactor = c.r - srcI;", "if(redFactor < 0.0){", "redFactor = 0.0;", "}else{", "redFactor = 1.0 - exp(-redFactor*redFactor/(2.0*0.1*0.1));", "}", "", "float alpha = cFactor*redFactor*gFactor;", "clamp(alpha,0.0,1.0);", "", "", "c.r = alpha*(c.g+c.b)/2.0+(1.0-alpha)*c.r;", "", "gl_FragColor = c;", "}"].join("\n"),
						MoaEyeColorFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "void main(void) {", "lowp vec4 c = texture2D(u_sampler, v_texCoord);", "", "float chroma = max(max(c.r,c.g),c.b)-min(min(c.r,c.g),c.b);", "float srcI = 0.2*c.r+0.7*c.g+0.1*c.b;", "", "//eye brightness between 40-100", "//float bFactor = exp(-(srcI-75.0/255.0)*(srcI-75.0/255.0)/(2.0*27.0*27.0/255.0/255.0));", "//exclude very bright", "float tooBright = 137.0/255.0;", "float tooDark = 10.0/255.0;", "float bFactor = 1.0-exp(-(srcI-tooBright)*(srcI-tooBright)/(2.0*27.0*27.0/255.0/255.0));", "bFactor *= 1.0-exp(-(srcI-tooDark)*(srcI-tooDark)/(2.0*17.0*17.0/255.0/255.0));", "if(srcI > tooBright || srcI < tooDark){", "bFactor = 0.0;", "}", "", "", "float chromaGoal = 38.0/255.0;", "float cFactor = 1.0-exp(-(chroma-chromaGoal)*(chroma-chromaGoal)/(2.0*15.0*15.0/255.0/255.0));", "", "if(chroma > chromaGoal){", "cFactor = 0.0;", "}", "", "//float cFactor = 1.0-4.0*chroma;", "", "float alpha = bFactor*cFactor;", "alpha = 0.75*clamp(alpha,0.0,1.0);", "", "float alphaI = 1.0-alpha;", "", "//vec4 eyeColor = vec4(1.0,0.0,0.0,1.0);", "//vec4 eyeColor = vec4(0.0,114.0/255.0,152.0/255.0,1.0);", "vec4 eyeColor = vec4(136.0/255.0,0.0/255.0,152.0/255.0,1.0);", "", "vec4 b = eyeColor;", "vec4 a = c;", "", "vec4 blendColor = 2.0*a*b + a*a - 2.0*a*a*b;", "gl_FragColor = mix(c, blendColor, alpha);", "}"].join("\n"),
						MoaEyeBrightFragmentShader: ["", "// precision highp float;", "//", "// uniform lowp sampler2D u_sampler;", "// varying highp vec2 v_texCoord;", "// #define PI 3.14159265359", "//", "// void main(void) {", "//     lowp vec4 c = texture2D(u_sampler, v_texCoord);", "//", "//     float chroma = max(max(c.r,c.g),c.b)-min(min(c.r,c.g),c.b);", "//     float srcI = 0.2*c.r+0.7*c.g+0.1*c.b;", "//", "//     //eye brightness between 40-100", "//     float bFactor = exp(-(srcI-75.0/255.0)*(srcI-75.0/255.0)/(2.0*27.0*27.0/255.0/255.0));", "//     float cFactor = 1.0-3.0*chroma;", "//", "//     float alpha = 3.0*cFactor*cFactor;", "//     alpha = clamp(alpha,0.0,1.0);", "//", "//     float alphaI = 1.0-alpha;", "//", "//     //Brighten", "//     vec4 blendColor = vec4(c.rgb + 50.0/255.0*sin(c.rgb*PI)*sin(c.rgb*PI/2.0),c.a);", "//", "//     gl_FragColor = mix(c, blendColor, alpha);", "// }", "", "precision highp float;", "", "uniform lowp sampler2D u_sampler;", "uniform lowp sampler2D u_map;", "uniform lowp sampler2D u_colorMapSampler;", "", "varying highp vec2 v_texCoord;", "#define PI 3.14159265359", "", "void main(void) {", "vec4 img = texture2D(u_sampler, v_texCoord);", "", "vec4 result = img;", "", "vec4 c = img;", "", "float alpha = 1.0;", "", "float max = max(max(c.r,c.g),c.b);", "float min = min(min(c.r,c.g),c.b);", "float chroma = max-min;", "float srcI = 0.2*c.r+0.7*c.g+0.1*c.b;", "", "//eye brightness between 40-100", "float bFactor = exp(-(srcI-75.0/255.0)*(srcI-75.0/255.0)/(2.0*27.0*27.0/255.0/255.0));", "float cFactor = 1.0-3.0*chroma;", "", "float redFactor = (c.r - srcI);", "if(redFactor < 0.0){", "redFactor = 0.0;", "}else{", "redFactor = (1.0 - exp(-redFactor*redFactor/(2.0*0.1*0.1)));", "}", "", "alpha *= cFactor;", "alpha = clamp(alpha,0.0,1.0);", "", "// alpha *= 10.0;//0.5;", "float alphaI = 1.0-alpha;", "", "float hue;", "float s;", "float l;", "", "l = (max + min)/2.0;", "", "if(chroma == 0.0){", "hue = 0.0;", "}else{", "if(max == c.r){", "hue = mod((c.g - c.b)/chroma, 6.0);", "}else if(max == c.g){", "hue = (c.b - c.r)/chroma + 2.0;", "}else{", "hue = (c.r - c.g)/chroma + 4.0;", "}", "", "hue *= 60.0;", "if(hue < 0.0){hue += 360.0;}", "if(hue >= 360.0){hue -= 360.0;}", "}", "", "if(chroma == 0.0){", "s = 0.0;", "}else{", "s = chroma/(1.0 - abs(2.0 * l - 1.0));", "}", "", "", "// Dodge Mapping", "l = texture2D(u_colorMapSampler, vec2(0,l)).r * (1.0-redFactor) + l *redFactor;", "s = texture2D(u_colorMapSampler, vec2(0,s)).r * (1.0-redFactor) + s *redFactor;", "", "// l = dodge[Math.floor(l*255)]/255 * (1 - redFactor) + l * redFactor;", "// s = dodge[Math.floor(s*255)]/255 * (1-redFactor) + s * redFactor;", "", "//        l = 1.2*l * (1.0 - redFactor) + l * redFactor;", "//        s = 1.2*s * (1.0 - redFactor) + s * redFactor;", "", "", "float hPrime = hue/60.0;", "float C;", "", "if(l > 0.5) {", "C = 2.0 * s * (1.0-l);", "} else {", "C = 2.0 * s * l;", "}", "", "float X = C * (1.0 - abs(mod(hPrime,2.0) - 1.0));", "", "vec4 blendColor;", "if(hPrime < 1.0){", "blendColor.r = C; blendColor.g = X; blendColor.b = 0.0;", "}else if(hPrime < 2.0){", "blendColor.r = X; blendColor.g = C; blendColor.b = 0.0;", "}else if(hPrime < 3.0){", "blendColor.r = 0.0; blendColor.g = C; blendColor.b = X;", "}else if(hPrime < 4.0){", "blendColor.r = 0.0; blendColor.g = X; blendColor.b = C;", "}else if(hPrime < 5.0){", "blendColor.r = X; blendColor.g = 0.0; blendColor.b = C;", "}else if(hPrime < 6.0){", "blendColor.r = C; blendColor.g = 0.0; blendColor.b = X;", "}", "", "float m = l - 0.5*C;", "", "blendColor.r = blendColor.r + m;", "blendColor.g = blendColor.g + m;", "blendColor.b = blendColor.b + m;", "", "", "// vec4 blendColor = vec4(c.rgb + 50.0/255.0*sin(c.rgb*PI)*sin(c.rgb*PI/2.0),c.a);", "", "// result = 2.0*img;", "result = mix(img, blendColor, alpha);", "", "gl_FragColor = vec4(result.rgb,img.a);", "}"].join("\n"),
						MoaEyeGlareFragmentShader: ["precision highp float;", "uniform lowp sampler2D u_sampler;", "", "uniform float u_angle;", "uniform float u_aspectI;", "uniform vec2 u_center;", "uniform float u_radius;", "", "", "varying highp vec2 v_texCoord;", "", "void main() {", "vec4 img = texture2D(u_sampler, v_texCoord);", "", "vec2 coordnorm = v_texCoord / u_center;", "", "// float angle = (180.0-15.0) * PI/180.0;", "float ca = cos(u_angle);", "float sa = sin(u_angle);", "", "float d2 = 0.7*u_radius;", "", "vec2 center2 = vec2(d2*ca,d2*sa);", "", "float rr1 = 0.3*u_radius;", "float rr2 = 0.95*u_radius;", "", "float r_2 = 0.6*u_radius;", "", "float r = length(vec2(v_texCoord.x,u_aspectI*v_texCoord.y)-u_center);", "float dr2 = length(vec2(v_texCoord.x,u_aspectI*v_texCoord.y)-center2-u_center);", "", "float alphaSpots = 3.0*(1.0-dr2/r_2);", "alphaSpots = clamp(alphaSpots,0.0,1.0);", "", "float alphaOuter = 3.0*(1.0-pow(r/rr2,2.0*0.75));", "alphaOuter = clamp(alphaOuter,0.0,1.0);", "", "float alphaInner = 3.0*(pow(r/rr1,2.0*0.75)-1.0);", "alphaInner = clamp(alphaInner,0.0,1.0);", "", "vec4 result = img;", "vec4 c = img;", "", "float alpha = 3.0*(1.0-(r/u_radius));", "alpha = clamp(alpha,0.0,1.0);", "", "alpha *= alphaSpots * alphaOuter * alphaInner;", "", "//alpha = 1.0;", "", "float powExp = 0.3;", "", "vec4 blendColor = pow(img,vec4(powExp));//vec4(1.0,0.0,0.0,1.0);//", "", "result = mix(img, blendColor, alpha);", "", "gl_FragColor = vec4(result.rgb,img.a);", "}"].join("\n"),
						MoaEyeShadowFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "uniform highp vec4 u_eyeShadowColor;", "varying highp vec2 v_texCoord;", "", "void main(void) {", "lowp vec4 color = texture2D(u_sampler, v_texCoord);", "", "float intensity = 0.2 * color.r + 0.7 * color.g + 0.1 * color.b;", "", "//                                                   float redFactor = 3.0 * (3.0 * color.r - 1.5 * color.g - 1.5 * color.b);", "", "//                                                   redFactor = clamp(redFactor, 0.0, 0.5);", "", "vec4 newColor = u_eyeShadowColor + 0.85 * (intensity - 0.588);", "", "gl_FragColor = mix(color, newColor, 0.3);", "}"].join("\n"),
						MoaConvolutionHorizontalBoxBlur3VertexShader: ["attribute vec4 a_position;", "attribute vec2 a_texCoord;", "varying highp vec2 v_texCoord;", "", "varying highp vec2 v_texCoordMinus1;", "varying highp vec2 v_texCoordPlus1;", "", "", "uniform highp float u_texelStride;", "", "void main(void) {", "v_texCoord = a_texCoord;", "v_texCoordMinus1 = a_texCoord;", "v_texCoordPlus1 = a_texCoord;", "v_texCoordMinus1.x = a_texCoord.x - u_texelStride;", "v_texCoordPlus1.x = a_texCoord.x + u_texelStride;", "", "gl_Position = a_position;", "}"].join("\n"),
						MoaConvolutionVerticalBoxBlur3VertexShader: ["attribute vec4 a_position;", "attribute vec2 a_texCoord;", "varying highp vec2 v_texCoord;", "", "varying highp vec2 v_texCoordMinus1;", "varying highp vec2 v_texCoordPlus1;", "", "", "uniform highp float u_texelStride;", "", "void main(void) {", "v_texCoord = a_texCoord;", "v_texCoordMinus1 = a_texCoord;", "v_texCoordPlus1 = a_texCoord;", "v_texCoordMinus1.y = a_texCoord.y - u_texelStride;", "v_texCoordPlus1.y = a_texCoord.y + u_texelStride;", "", "gl_Position = a_position;", "}"].join("\n"),
						MoaConvolutionBoxBlur3FragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "varying highp vec2 v_texCoordMinus1;", "varying highp vec2 v_texCoordPlus1;", "", "void main(void) {", "highp vec4 resultColor = texture2D(u_sampler, v_texCoord);", "resultColor += texture2D(u_sampler, v_texCoordPlus1);", "resultColor += texture2D(u_sampler, v_texCoordMinus1);", "gl_FragColor = resultColor / 3.0;", "}"].join("\n"),
						MoaConvolutionHorizontalBoxBlur5VertexShader: ["attribute vec4 a_position;", "attribute vec2 a_texCoord;", "varying highp vec2 v_texCoord;", "", "varying highp vec2 v_texCoordMinus1;", "varying highp vec2 v_texCoordPlus1;", "varying highp vec2 v_texCoordMinus2;", "varying highp vec2 v_texCoordPlus2;", "", "", "uniform highp float u_texelStride;", "", "void main(void) {", "v_texCoord = a_texCoord;", "v_texCoordMinus1 = a_texCoord;", "v_texCoordPlus1 = a_texCoord;", "v_texCoordMinus2 = a_texCoord;", "v_texCoordPlus2 = a_texCoord;", "v_texCoordMinus1.x = a_texCoord.x - u_texelStride;", "v_texCoordPlus1.x = a_texCoord.x + u_texelStride;", "v_texCoordMinus2.x = a_texCoord.x - u_texelStride * 2.0;", "v_texCoordPlus2.x = a_texCoord.x + u_texelStride * 2.0;", "", "gl_Position = a_position;", "}"].join("\n"),
						MoaConvolutionVerticalBoxBlur5VertexShader: ["attribute vec4 a_position;", "attribute vec2 a_texCoord;", "varying highp vec2 v_texCoord;", "", "varying highp vec2 v_texCoordMinus1;", "varying highp vec2 v_texCoordPlus1;", "varying highp vec2 v_texCoordMinus2;", "varying highp vec2 v_texCoordPlus2;", "", "uniform highp float u_texelStride;", "", "void main(void) {", "v_texCoord = a_texCoord;", "v_texCoordMinus1 = a_texCoord;", "v_texCoordPlus1 = a_texCoord;", "v_texCoordMinus2 = a_texCoord;", "v_texCoordPlus2 = a_texCoord;", "v_texCoordMinus1.y = a_texCoord.y - u_texelStride;", "v_texCoordPlus1.y = a_texCoord.y + u_texelStride;", "v_texCoordMinus2.y = a_texCoord.y - u_texelStride * 2.0;", "v_texCoordPlus2.y = a_texCoord.y + u_texelStride * 2.0;", "", "gl_Position = a_position;", "}"].join("\n"),
						MoaConvolutionBoxBlur5FragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "varying highp vec2 v_texCoordMinus1;", "varying highp vec2 v_texCoordPlus1;", "varying highp vec2 v_texCoordMinus2;", "varying highp vec2 v_texCoordPlus2;", "", "void main(void) {", "highp vec4 resultColor = texture2D(u_sampler, v_texCoord);", "resultColor += texture2D(u_sampler, v_texCoordPlus1);", "resultColor += texture2D(u_sampler, v_texCoordMinus1);", "resultColor += texture2D(u_sampler, v_texCoordPlus2);", "resultColor += texture2D(u_sampler, v_texCoordMinus2);", "gl_FragColor = resultColor / 5.0;", "}"].join("\n"),
						MoaConvolutionHorizontalBoxBlur7VertexShader: ["attribute vec4 a_position;", "attribute vec2 a_texCoord;", "varying highp vec2 v_texCoord;", "", "varying highp vec2 v_texCoordMinus1;", "varying highp vec2 v_texCoordPlus1;", "varying highp vec2 v_texCoordMinus2;", "varying highp vec2 v_texCoordPlus2;", "varying highp vec2 v_texCoordMinus3;", "varying highp vec2 v_texCoordPlus3;", "", "uniform highp float u_texelStride;", "", "void main(void) {", "v_texCoord = a_texCoord;", "v_texCoordMinus1 = a_texCoord;", "v_texCoordPlus1 = a_texCoord;", "v_texCoordMinus2 = a_texCoord;", "v_texCoordPlus2 = a_texCoord;", "v_texCoordMinus3 = a_texCoord;", "v_texCoordPlus3 = a_texCoord;", "v_texCoordMinus1.x = a_texCoord.x - u_texelStride;", "v_texCoordPlus1.x = a_texCoord.x + u_texelStride;", "v_texCoordMinus2.x = a_texCoord.x - u_texelStride * 2.0;", "v_texCoordPlus2.x = a_texCoord.x + u_texelStride * 2.0;", "v_texCoordMinus3.x = a_texCoord.x - u_texelStride * 3.0;", "v_texCoordPlus3.x = a_texCoord.x + u_texelStride * 3.0;", "", "gl_Position = a_position;", "}"].join("\n"),
						MoaConvolutionVerticalBoxBlur7VertexShader: ["attribute vec4 a_position;", "attribute vec2 a_texCoord;", "varying highp vec2 v_texCoord;", "", "varying highp vec2 v_texCoordMinus1;", "varying highp vec2 v_texCoordPlus1;", "varying highp vec2 v_texCoordMinus2;", "varying highp vec2 v_texCoordPlus2;", "varying highp vec2 v_texCoordMinus3;", "varying highp vec2 v_texCoordPlus3;", "", "uniform highp float u_texelStride;", "", "void main(void) {", "v_texCoord = a_texCoord;", "v_texCoordMinus1 = a_texCoord;", "v_texCoordPlus1 = a_texCoord;", "v_texCoordMinus2 = a_texCoord;", "v_texCoordPlus2 = a_texCoord;", "v_texCoordMinus3 = a_texCoord;", "v_texCoordPlus3 = a_texCoord;", "v_texCoordMinus1.y = a_texCoord.y - u_texelStride;", "v_texCoordPlus1.y = a_texCoord.y + u_texelStride;", "v_texCoordMinus2.y = a_texCoord.y - u_texelStride * 2.0;", "v_texCoordPlus2.y = a_texCoord.y + u_texelStride * 2.0;", "v_texCoordMinus3.y = a_texCoord.y - u_texelStride * 3.0;", "v_texCoordPlus3.y = a_texCoord.y + u_texelStride * 3.0;", "", "gl_Position = a_position;", "}"].join("\n"),
						MoaConvolutionBoxBlur7FragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "varying highp vec2 v_texCoordMinus1;", "varying highp vec2 v_texCoordPlus1;", "varying highp vec2 v_texCoordMinus2;", "varying highp vec2 v_texCoordPlus2;", "varying highp vec2 v_texCoordMinus3;", "varying highp vec2 v_texCoordPlus3;", "", "void main(void) {", "highp vec4 resultColor = texture2D(u_sampler, v_texCoord);", "resultColor += texture2D(u_sampler, v_texCoordPlus1);", "resultColor += texture2D(u_sampler, v_texCoordMinus1);", "resultColor += texture2D(u_sampler, v_texCoordPlus2);", "resultColor += texture2D(u_sampler, v_texCoordMinus2);", "resultColor += texture2D(u_sampler, v_texCoordPlus3);", "resultColor += texture2D(u_sampler, v_texCoordMinus3);", "gl_FragColor = resultColor / 7.0;", "}"].join("\n"),
						MoaConvolutionHorizontalGaussian9VertexShader: ["attribute vec4 a_position;", "attribute vec2 a_texCoord;", "", "varying highp vec2 v_texCoord;", "varying highp vec2 v_texCoordMinus1;", "varying highp vec2 v_texCoordPlus1;", "varying highp vec2 v_texCoordMinus2;", "varying highp vec2 v_texCoordPlus2;", "varying highp vec2 v_texCoordMinus3;", "varying highp vec2 v_texCoordPlus3;", "varying highp vec2 v_texCoordMinus4;", "varying highp vec2 v_texCoordPlus4;", "", "uniform highp float u_texelStride;", "", "void main(void) {", "v_texCoord = a_texCoord;", "v_texCoordMinus1 = a_texCoord;", "v_texCoordPlus1 = a_texCoord;", "v_texCoordMinus2 = a_texCoord;", "v_texCoordPlus2 = a_texCoord;", "v_texCoordMinus3 = a_texCoord;", "v_texCoordPlus3 = a_texCoord;", "v_texCoordMinus4 = a_texCoord;", "v_texCoordPlus4 = a_texCoord;", "", "v_texCoordMinus1.x = a_texCoord.x - u_texelStride;", "v_texCoordPlus1.x = a_texCoord.x + u_texelStride;", "v_texCoordMinus2.x = a_texCoord.x - u_texelStride * 2.0;", "v_texCoordPlus2.x = a_texCoord.x + u_texelStride * 2.0;", "v_texCoordMinus3.x = a_texCoord.x - u_texelStride * 3.0;", "v_texCoordPlus3.x = a_texCoord.x + u_texelStride * 3.0;", "v_texCoordMinus4.x = a_texCoord.x - u_texelStride * 4.0;", "v_texCoordPlus4.x = a_texCoord.x + u_texelStride * 4.0;", "", "gl_Position = a_position;", "}"].join("\n"),
						MoaConvolutionVerticalGaussian9VertexShader: ["attribute vec4 a_position;", "attribute vec2 a_texCoord;", "varying highp vec2 v_texCoord;", "", "varying highp vec2 v_texCoordMinus1;", "varying highp vec2 v_texCoordPlus1;", "varying highp vec2 v_texCoordMinus2;", "varying highp vec2 v_texCoordPlus2;", "varying highp vec2 v_texCoordMinus3;", "varying highp vec2 v_texCoordPlus3;", "varying highp vec2 v_texCoordMinus4;", "varying highp vec2 v_texCoordPlus4;", "", "uniform highp float u_texelStride;", "", "void main(void) {", "v_texCoord = a_texCoord;", "v_texCoordMinus1 = a_texCoord;", "v_texCoordPlus1 = a_texCoord;", "v_texCoordMinus2 = a_texCoord;", "v_texCoordPlus2 = a_texCoord;", "v_texCoordMinus3 = a_texCoord;", "v_texCoordPlus3 = a_texCoord;", "v_texCoordMinus4 = a_texCoord;", "v_texCoordPlus4 = a_texCoord;", "", "v_texCoordMinus1.y = a_texCoord.y - u_texelStride;", "v_texCoordPlus1.y = a_texCoord.y + u_texelStride;", "v_texCoordMinus2.y = a_texCoord.y - u_texelStride * 2.0;", "v_texCoordPlus2.y = a_texCoord.y + u_texelStride * 2.0;", "v_texCoordMinus3.y = a_texCoord.y - u_texelStride * 3.0;", "v_texCoordPlus3.y = a_texCoord.y + u_texelStride * 3.0;", "v_texCoordMinus4.y = a_texCoord.y - u_texelStride * 4.0;", "v_texCoordPlus4.y = a_texCoord.y + u_texelStride * 4.0;", "", "gl_Position = a_position;", "}"].join("\n"),
						MoaConvolutionGaussian9FragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "varying highp vec2 v_texCoordMinus1;", "varying highp vec2 v_texCoordPlus1;", "varying highp vec2 v_texCoordMinus2;", "varying highp vec2 v_texCoordPlus2;", "varying highp vec2 v_texCoordMinus3;", "varying highp vec2 v_texCoordPlus3;", "varying highp vec2 v_texCoordMinus4;", "varying highp vec2 v_texCoordPlus4;", "", "uniform highp float u_weight0;", "uniform highp float u_weight1;", "uniform highp float u_weight2;", "uniform highp float u_weight3;", "uniform highp float u_weight4;", "", "void main(void) {", "highp vec4 resultColor = texture2D(u_sampler, v_texCoord) * u_weight0;", "resultColor += texture2D(u_sampler, v_texCoordPlus1) * u_weight1;", "resultColor += texture2D(u_sampler, v_texCoordMinus1) * u_weight1;", "resultColor += texture2D(u_sampler, v_texCoordPlus2) * u_weight2;", "resultColor += texture2D(u_sampler, v_texCoordMinus2) * u_weight2;", "resultColor += texture2D(u_sampler, v_texCoordPlus3) * u_weight3;", "resultColor += texture2D(u_sampler, v_texCoordMinus3) * u_weight3;", "resultColor += texture2D(u_sampler, v_texCoordPlus4) * u_weight4;", "resultColor += texture2D(u_sampler, v_texCoordMinus4) * u_weight4;", "", "gl_FragColor = resultColor / (u_weight0 + 2.0 * (u_weight1 + u_weight2 + u_weight3 + u_weight4));", "", "}"].join("\n"),
						MoaVertexShader: ["attribute vec4 a_position;", "attribute vec2 a_texCoord;", "", "varying highp vec2 v_texCoord;", "", "void main(void) {", "v_texCoord = a_texCoord;", "gl_Position = a_position;", "}"].join("\n"),
						MoaColorMapFragmentShader: ["precision mediump float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "uniform lowp sampler2D u_colorMapSampler;", "", "void main(void) {", "lowp vec4 color = texture2D(u_sampler, v_texCoord);", "", "lowp vec2 redVec = vec2(0,color.r);", "lowp vec2 greenVec = vec2(0,color.g);", "lowp vec2 blueVec = vec2(0,color.b);", "", "lowp vec4 rColor = texture2D(u_colorMapSampler, redVec);", "lowp vec4 gColor = texture2D(u_colorMapSampler, greenVec);", "lowp vec4 bColor = texture2D(u_colorMapSampler, blueVec);", "", "color.r = rColor.r;", "color.g = gColor.g;", "color.b = bColor.b;", "", "gl_FragColor = color;", "}"].join("\n"),
						MoaIntensityMapOverlayFragmentShader: ["precision mediump float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "uniform lowp sampler2D u_colorMapSampler;", "uniform float u_intensity;", "", "void main(void) {", "lowp vec4 dst = texture2D(u_sampler, v_texCoord);", "lowp vec4 src;", "", "float intensity = 0.212671*dst.r + 0.71516*dst.g + 0.072169*dst.b;", "", "lowp vec2 intensityVec = vec2(0,intensity);", "", "src = texture2D(u_colorMapSampler, intensityVec);", "", "float factor = u_intensity;", "float factorI = 1.0 - factor;", "", "vec4 mult = 2.0 * dst * src;", "vec4 screen = 1.0 - 2.0 * (1.0 - dst) * (1.0 - src);", "vec4 transition = dst * dst * (2.0 - 4.0 * src) + dst * (4.0 * src - 1.0) + (1.0 - 2.0 * src) / 8.0;", "vec4 blendColor = (1.0 - step(0.25, dst)) * mult + (step(0.25, dst) - step(0.75, dst)) * transition + step(0.75, dst) * screen;", "dst = factorI * dst + factor * blendColor;", "", "dst.a = 1.0;", "", "gl_FragColor = dst;", "}"].join("\n"),
						MoaIntensityMapMultiplyFragmentShader: ["precision mediump float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "uniform lowp sampler2D u_colorMapSampler;", "uniform float u_intensity;", "", "void main(void) {", "lowp vec4 dst = texture2D(u_sampler, v_texCoord);", "lowp vec4 src;", "", "float intensity = 0.212671*dst.r + 0.71516*dst.g + 0.072169*dst.b;", "", "lowp vec2 intensityVec = vec2(0,intensity);", "", "src = texture2D(u_colorMapSampler, intensityVec);", "", "// Could use a blend mode here, but we've already gone to the trouble of sampling the source", "float factor = u_intensity;", "float factorI = 1.0 - factor;", "", "dst.rgb = factorI * dst.rgb + factor * (src.rgb * dst.rgb);", "", "dst.a = 1.0;", "", "gl_FragColor = dst;", "}"].join("\n"),
						MoaIntensityMapFragmentShader: ["precision mediump float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "uniform lowp sampler2D u_colorMapSampler;", "uniform float u_intensity;", "", "void main(void) {", "lowp vec4 dst = texture2D(u_sampler, v_texCoord);", "lowp vec4 src;", "", "float intensity = 0.212671*dst.r + 0.71516*dst.g + 0.072169*dst.b;", "", "lowp vec2 intensityVec = vec2(0,intensity);", "", "src = texture2D(u_colorMapSampler, intensityVec);", "dst = mix(dst, src, u_intensity);", "", "dst.a = 1.0;", "gl_FragColor = dst;", "}"].join("\n"),
						MoaBrightnessContrastSaturationWarmthShader: ["precision mediump float;", "uniform sampler2D u_sampler;", "uniform lowp sampler2D u_cMap;", "", "varying vec2 v_texCoord;", "", "uniform float u_brightness;", "uniform float u_contrast;", "uniform float u_contrastExp;", "uniform float u_contrastLessThanZero;", "uniform mat3  u_contrastSatAdjust;", "uniform mat3  u_saturationMatrix;", "", "uniform vec3  u_warmthDelta;", "", "uniform float u_warmth;", "uniform float u_saturation;", "", "", "const float PI = 3.14159265358;", "", "void main() {", "vec4 img = texture2D(u_sampler, v_texCoord);", "", "vec3 result = img.rgb;", "float v;", "", "// **** BRIGHTNESS **** //", "if(u_brightness != 0.0){", "result.r = texture2D(u_cMap,vec2(0,result.r)).r;", "result.g = texture2D(u_cMap,vec2(0,result.g)).r;", "result.b = texture2D(u_cMap,vec2(0,result.b)).r;", "", "clamp(result, 0.0, 1.0);", "}", "// **** END **** //", "", "// **** CONTRAST **** //", "if(u_contrast != 0.0){", "vec3 d;", "d.r = - result.r + result.g + result.b;", "d.g = + result.r - result.g + result.b;", "d.b = + result.r + result.g - result.b;", "", "result.r = texture2D(u_cMap, vec2(0,result.r)).g;", "result.g = texture2D(u_cMap, vec2(0,result.g)).g;", "result.b = texture2D(u_cMap, vec2(0,result.b)).g;", "", "vec3 dNew;", "dNew.r = - result.r + result.g + result.b;", "dNew.g = + result.r - result.g + result.b;", "dNew.b = + result.r + result.g - result.b;", "", "result += 0.2 * (dNew - d);", "", "if (u_contrast < 0.0) {", "result = u_contrastSatAdjust * result;", "}", "", "clamp(result, 0.0, 1.0);", "}", "// **** END **** //", "", "// **** WARMTH **** //", "if(u_warmth != 0.0){", "result = result + u_warmthDelta*sin(PI*result);", "clamp(result, 0.0, 1.0);", "}", "// **** END **** //", "", "", "// **** SATURATION **** //", "if(u_saturation != 0.0){", "result = u_saturationMatrix * result;", "clamp(result, 0.0, 1.0);", "}", "// **** END **** //", "", "gl_FragColor = vec4(result.rgb,img.a);", "}"].join("\n"),
						MoaGradientFlareFragmentShader: ["", "precision highp float;", "", "// our texture", "uniform sampler2D u_gradientMap;", "uniform sampler2D u_sampler;", "uniform int u_aspectMode;", "", "uniform int u_invert;", "uniform int u_wrapMode;", "", "uniform mat4 u_params;", "uniform mat4 u_transform;", "", "uniform float u_width;", "uniform float u_height;", "", "uniform float u_alphaBlend;", "", "uniform int u_shape;", "", "// the texCoords passed in from the vertex shader.", "varying vec2 v_texCoord;", "", "void main(){", "", "vec2 texCoordsTmp = v_texCoord;", "", "vec4 transformed = (vec4(texCoordsTmp,0.0,1.0) * u_transform);", "", "vec2 coords = (transformed.xy);", "", "float noise = 0.0;", "", "if(u_shape == 1){", "noise = 0.5 + 0.5*coords.x;", "}else if(u_shape == 2){", "noise = length(coords);", "}else if(u_shape == 3){", "noise = exp(u_params[0][0] * ((coords.y - u_params[0][2])*(coords.y - u_params[0][2]) + (coords.x - u_params[0][3])*(coords.x - u_params[0][3])) + u_params[0][1] * (coords.y - u_params[1][0])*(coords.y - u_params[1][0]) * (coords.x - u_params[1][1])*(coords.x - u_params[1][1]));", "}else if(u_shape == 4){", "noise = max(abs(coords.x), abs(coords.y));", "}else if(u_shape == 5){", "if(u_params[0][0] == 0.0){", "noise = max(abs(coords.x), abs(coords.y));", "}else{", "noise = pow(pow(abs(coords.x), u_params[0][0]) + pow(abs(coords.y),u_params[0][0]), 1.0 / u_params[0][0]);", "}", "}else if(u_shape == 9){", "//                                                            float theta = coords.x * coords.x + coords.y * coords.y;", "float r = length(coords);//sqrt(theta);", "float sa = -coords.y / r;//Math.sin(a);", "float ca = coords.x / r;//Math.cos(a);", "//                                                            float caAbs = abs(ca);", "float rH = (2.0 - 2.0 * sa + u_params[0][0] * sa * sqrt(abs(ca)) / (sa + u_params[0][1]));", "noise = r - rH;", "}else if(u_shape == 11){", "float r0 = 1.0;", "float r1 = u_params[0][1];", "float dx = u_params[0][0] * (r0 + r1);", "float r = length(coords);", "float rdx = distance(coords, vec2(dx, 0.0));", "float fA = 1.0 - r / r0;", "float fB = rdx / r1 - 1.0;", "float branch = step(r1, rdx) * step(r, r0);", "noise = branch * (1.0 - min(fA, fB)) + (1.0 - branch);", "}else{", "noise = 0.0;", "}", "", "", "", "if(u_wrapMode == 1) {", "noise = fract(noise);", "} else if(u_wrapMode == 2) {", "", "if(mod(floor(noise), 2.0) != 0.0) {", "noise = fract(noise);", "noise = 1.0 - noise;", "} else {", "noise = fract(noise);", "}", "", "}", "", "noise = clamp(noise,0.0,1.0);", "", "if(u_invert == 1){", "noise = 1.0 - noise;", "}", "", "vec4 dst = texture2D(u_gradientMap, vec2(0,noise));", "", "dst.a *= u_alphaBlend;", "", "gl_FragColor = dst;", "", "}"].join("\n"),
						MoaGradientFlareStardomFragmentShader: ["", "precision highp float;", "", "// our texture", "uniform sampler2D u_gradientMap;", "uniform sampler2D u_sampler;", "uniform int u_aspectMode;", "", "uniform int u_invert;", "uniform int u_wrapMode;", "", "uniform mat4 u_params;", "uniform mat4 u_transform;", "", "uniform float u_width;", "uniform float u_height;", "", "uniform float u_alphaBlend;", "", "// the texCoords passed in from the vertex shader.", "varying vec2 v_texCoord;", "", "void main(){", "", "vec2 texCoordsTmp = v_texCoord;", "", "vec4 transformed = (vec4(texCoordsTmp,0.0,1.0) * u_transform);", "", "vec2 coords = (transformed.xy);", "", "float numLobes = floor(u_params[0][0]);", "", "float theta = coords.x * coords.x + coords.y * coords.y;", "", "float a = atan(coords.y, coords.x);", "", "float noise = theta * theta * (sin(numLobes * a / 2.0));", "", "if(u_wrapMode == 1) {", "noise = fract(noise);", "} else if(u_wrapMode == 2) {", "", "if(mod(floor(noise), 2.0) != 0.0) {", "noise = fract(noise);", "noise = 1.0 - noise;", "} else {", "noise = fract(noise);", "}", "", "}", "", "noise = clamp(noise,0.0,1.0);", "", "if(u_invert == 1){", "noise = 1.0 - noise;", "}", "", "vec4 dst = texture2D(u_gradientMap, vec2(0,noise));", "", "dst.a *= u_alphaBlend;", "", "gl_FragColor = dst;", "}"].join("\n"),
						MoaGradientFlareLobesFragmentShader: ["", "precision highp float;", "", "// our texture", "uniform sampler2D u_gradientMap;", "uniform sampler2D u_sampler;", "uniform int u_aspectMode;", "", "uniform int u_invert;", "uniform int u_wrapMode;", "", "uniform mat4 u_params;", "uniform mat4 u_transform;", "", "uniform float u_width;", "uniform float u_height;", "", "uniform float u_alphaBlend;", "", "// the texCoords passed in from the vertex shader.", "varying vec2 v_texCoord;", "", "void main(){", "", "vec2 texCoordsTmp = v_texCoord;", "", "vec4 transformed = (vec4(texCoordsTmp,0.0,1.0) * u_transform);", "", "vec2 coords = (transformed.xy);", "", "float numLobes = floor(u_params[0][0]);", "", "float theta = coords.x * coords.x + coords.y * coords.y;", "", "float a = atan(coords.y, coords.x);", "", "float noise = 1.0 - exp(-theta) * 0.5 * (1.0 + sin(a * numLobes));", "", "noise = clamp(noise,0.0,1.0);", "", "if(u_invert == 1){", "noise = 1.0 - noise;", "}", "", "vec4 dst = texture2D(u_gradientMap, vec2(0,noise));", "", "dst.a *= u_alphaBlend;", "", "gl_FragColor = dst;", "}"].join("\n"),
						MoaGradientFlareRingLobesFragmentShader: ["", "precision highp float;", "", "// our texture", "uniform sampler2D u_gradientMap;", "uniform sampler2D u_sampler;", "uniform int u_aspectMode;", "", "uniform int u_invert;", "uniform int u_wrapMode;", "", "uniform mat4 u_params;", "uniform mat4 u_transform;", "", "uniform float u_width;", "uniform float u_height;", "", "uniform float u_alphaBlend;", "", "// the texCoords passed in from the vertex shader.", "varying vec2 v_texCoord;", "", "void main(){", "", "vec2 texCoordsTmp = v_texCoord;", "", "vec4 transformed = (vec4(texCoordsTmp,0.0,1.0) * u_transform);", "", "vec2 coords = (transformed.xy);", "", "float numLobes = floor(u_params[0][0]);", "float numLobes2 = u_params[0][1];", "float numLobes3 = u_params[0][2];", "", "float theta = coords.x * coords.x + coords.y * coords.y;", "", "float a = atan(coords.y, coords.x);", "", "float noise = 1.0 - (1.0 - sin(numLobes2 * theta + 3.14159265358979323846264338327950288 / 2.0) * sin(numLobes3 * theta + 3.14159265358979323846264338327950288 / 2.0) * sin(numLobes * a / 2.0 + 3.14159265358979323846264338327950288 / 2.0));", "", "", "if(u_wrapMode == 1) {", "noise = fract(noise);", "} else if(u_wrapMode == 2) {", "", "if(mod(floor(noise), 2.0) != 0.0) {", "noise = fract(noise);", "noise = 1.0 - noise;", "} else {", "noise = fract(noise);", "}", "", "}", "", "noise = clamp(noise,0.0,1.0);", "", "if(u_invert == 1){", "noise = 1.0 - noise;", "}", "", "vec4 dst = texture2D(u_gradientMap, vec2(0,noise));", "", "dst.a *= u_alphaBlend;", "", "gl_FragColor = dst;", "}"].join("\n"),
						MoaGradientFlareStarFragmentShader: ["", "precision highp float;", "", "// our texture", "uniform sampler2D u_gradientMap;", "uniform sampler2D u_sampler;", "uniform int u_aspectMode;", "", "uniform int u_invert;", "uniform int u_wrapMode;", "", "uniform mat4 u_params;", "uniform mat4 u_transform;", "", "uniform float u_width;", "uniform float u_height;", "", "uniform float u_alphaBlend;", "", "// the texCoords passed in from the vertex shader.", "varying vec2 v_texCoord;", "", "void main(){", "", "vec2 texCoordsTmp = v_texCoord;", "", "vec4 transformed = (vec4(texCoordsTmp,0.0,1.0) * u_transform);", "", "vec2 coords = (transformed.xy);", "", "float b = 0.0;", "float numLobes = max(1.0, floor(u_params[0][0]));", "float r = length(coords);", "float aInterval = 3.14159265358979323846264338327950288 / numLobes;", "float a = 1.5 * 3.14159265358979323846264338327950288 - atan(coords.y, coords.x);", "float maxVal = 1.0;", "float minVal = u_params[0][2];", "float fractVal = fract(a / aInterval);", "fractVal = mod(floor(a / aInterval), 2.0) == 0.0 ? fractVal : 1.0 - fractVal;", "float beta = aInterval / 2.0;", "float gamma = 3.14159265358979323846264338327950288 - fractVal - beta;", "b =  maxVal * sin(beta) / sin(gamma);", "", "float rS = minVal + (maxVal - minVal) * ((1.0 - u_params[0][1]) * b + u_params[0][1] * (1.0 - fractVal));", "", "float noise = r - rS;", "", "if(u_wrapMode == 1) {", "noise = fract(noise);", "} else if(u_wrapMode == 2) {", "", "if(mod(floor(noise), 2.0) != 0.0) {", "noise = fract(noise);", "noise = 1.0 - noise;", "} else {", "noise = fract(noise);", "}", "", "}", "", "noise = clamp(noise,0.0,1.0);", "", "if(u_invert == 1){", "noise = 1.0 - noise;", "}", "", "vec4 dst = texture2D(u_gradientMap, vec2(0,noise));", "", "dst.a *= u_alphaBlend;", "", "gl_FragColor = dst;", "}"].join("\n"),
						MoaGradientFlareSquigglyFragmentShader: ["", "precision highp float;", "", "// our texture", "uniform sampler2D u_gradientMap;", "uniform sampler2D u_sampler;", "uniform int u_aspectMode;", "", "uniform int u_invert;", "uniform int u_wrapMode;", "", "uniform mat4 u_params;", "uniform mat4 u_transform;", "", "uniform float u_width;", "uniform float u_height;", "", "uniform float u_alphaBlend;", "", "// the texCoords passed in from the vertex shader.", "varying vec2 v_texCoord;", "", "void main(){", "", "vec2 texCoordsTmp = v_texCoord;", "", "vec4 transformed = (vec4(texCoordsTmp,0.0,1.0) * u_transform);", "", "vec2 coords = (transformed.xy);", "", "float noise = 0.5 + 0.5 * sin(coords.x + 2.0 * u_params[0][0] * sin(coords.y));", "", "noise = clamp(noise,0.0,1.0);", "", "if(u_invert == 1){", "noise = 1.0 - noise;", "}", "", "vec4 dst = texture2D(u_gradientMap, vec2(0,noise));", "", "dst.a *= u_alphaBlend;", "", "gl_FragColor = dst;", "}"].join("\n"),
						MoaGradientFlareZigZagFragmentShader: ["", "precision highp float;", "", "// our texture", "uniform sampler2D u_gradientMap;", "uniform sampler2D u_sampler;", "uniform int u_aspectMode;", "", "uniform int u_invert;", "uniform int u_wrapMode;", "", "uniform mat4 u_params;", "uniform mat4 u_transform;", "", "uniform float u_width;", "uniform float u_height;", "", "uniform float u_alphaBlend;", "", "// the texCoords passed in from the vertex shader.", "varying vec2 v_texCoord;", "", "void main(){", "", "vec2 texCoordsTmp = v_texCoord;", "", "vec4 transformed = (vec4(texCoordsTmp,0.0,1.0) * u_transform);", "", "vec2 coords = (transformed.xy);", "", "float a = 2.0 * (coords.x - floor(u_params[0][0] + coords.x));", "", "a = a < 0.0 ? (-a / u_params[0][0]): (a) / (1.0 - u_params[0][0]);", "", "float noise = coords.y - a;", "", "if(u_wrapMode == 1) {", "noise = fract(noise);", "} else if(u_wrapMode == 2) {", "", "if(mod(floor(noise), 2.0) != 0.0) {", "noise = fract(noise);", "noise = 1.0 - noise;", "} else {", "noise = fract(noise);", "}", "", "}", "", "noise = clamp(noise,0.0,1.0);", "", "if(u_invert == 1){", "noise = 1.0 - noise;", "}", "", "vec4 dst = texture2D(u_gradientMap, vec2(0,noise));", "", "dst.a *= u_alphaBlend;", "", "gl_FragColor = dst;", "}"].join("\n"),
						MoaGradientFlareSpiralFragmentShader: ["", "precision highp float;", "", "// our texture", "uniform sampler2D u_gradientMap;", "uniform sampler2D u_sampler;", "uniform int u_aspectMode;", "", "uniform int u_invert;", "uniform int u_wrapMode;", "", "uniform mat4 u_params;", "uniform mat4 u_transform;", "", "uniform float u_width;", "uniform float u_height;", "", "uniform float u_alphaBlend;", "", "// the texCoords passed in from the vertex shader.", "varying vec2 v_texCoord;", "", "void main(){", "", "vec2 texCoordsTmp = v_texCoord;", "", "vec4 transformed = (vec4(texCoordsTmp,0.0,1.0) * u_transform);", "", "vec2 coords = (transformed.xy);", "", "float period = floor(u_params[0][1] + 0.5);", "float rad = coords.x * coords.x + coords.y * coords.y;", "float angle = atan(coords.y,coords.x);", "float noise = pow(rad, u_params[0][0]) + angle * period / 2.0 / 3.14159265358979323846264338327950288;", "", "if(u_wrapMode == 1) {", "noise = fract(noise);", "} else if(u_wrapMode == 2) {", "", "if(mod(floor(noise), 2.0) != 0.0) {", "noise = fract(noise);", "noise = 1.0 - noise;", "} else {", "noise = fract(noise);", "}", "", "}", "", "noise = clamp(noise,0.0,1.0);", "", "if(u_invert == 1){", "noise = 1.0 - noise;", "}", "", "vec4 dst = texture2D(u_gradientMap, vec2(0,noise));", "", "dst.a *= u_alphaBlend;", "", "gl_FragColor = dst;", "}"].join("\n"),
						MoaColorTransformFragmentShader: ["precision mediump float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "uniform mat3 u_colorMat;", "uniform vec3 u_colorTrans;", "", "void main(void) {", "lowp vec4 color = texture2D(u_sampler, v_texCoord);", "", "color.rgb = u_colorMat * color.rgb + u_colorTrans;", "", "gl_FragColor = color;", "}"].join("\n"),
						MoaColorTransformAndOverlayWithOriginalFragmentShader: ["", "precision mediump float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "uniform mat3 u_colorMat;", "uniform vec3 u_colorTrans;", "uniform float u_overlayAmount;", "", "void main(void) {", "lowp vec4 color = texture2D(u_sampler, v_texCoord);", "lowp vec4 originalColor = color;", "", "color.rgb = u_colorMat * color.rgb + u_colorTrans;", "", "float factor = clamp(u_overlayAmount, 0.0, 1.0);", "float factorI = 1.0-factor;", "", "vec4 mult = 2.0 * color * originalColor;", "vec4 screen = 1.0 - 2.0 * (1.0 - color) * (1.0 - originalColor);", "color = factorI * originalColor + factor * mix(mult, screen, step(0.5, originalColor));", "color.a = 1.0;", "", "gl_FragColor = color;", "}"].join("\n"),
						MoaOverlayVertexShader: ["attribute vec4 a_position;", "attribute vec2 a_texCoord;", "uniform mat4 u_transform;", "varying highp vec2 v_texCoord;", "", "void main(void) {", "v_texCoord = (vec4(a_texCoord.x, a_texCoord.y, 0.0, 1.0) * u_transform).xy;", "gl_Position = a_position;", "}"].join("\n"),
						MoaOverlayFragmentShader: ["precision mediump float;", "uniform lowp sampler2D u_overlaySampler;", "uniform lowp sampler2D u_sampler;", "uniform float u_factor;", "varying highp vec2 v_texCoord;", "void main(void) {", "gl_FragColor = texture2D(u_overlaySampler, v_texCoord);", "}"].join("\n"),
						MoaBitmapIdentityFragmentShader: ["precision mediump float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "void main(void) {", "gl_FragColor = texture2D(u_sampler, v_texCoord);", "}"].join("\n"),
						MoaBitmapBlendFragmentShader: ["precision mediump float;", "", "uniform lowp sampler2D u_sampler;", "uniform lowp sampler2D u_srcSampler;", "uniform float u_dstAmount;", "uniform float u_srcAmount;", "varying highp vec2 v_texCoord;", "", "void main(void) {", "vec4 color = texture2D(u_srcSampler, v_texCoord);", "vec4 originalColor = texture2D(u_sampler, v_texCoord);", "gl_FragColor = color * u_srcAmount + originalColor * u_dstAmount;", "gl_FragColor.a = 1.0;", "}"].join("\n"),
						MoaBitmapBlendOverlayFragmentShader: ["precision mediump float;", "", "uniform lowp sampler2D u_sampler;", "uniform lowp sampler2D u_srcSampler;", "uniform float u_factor;", "varying highp vec2 v_texCoord;", "", "void main(void) {", "lowp vec4 src = texture2D(u_srcSampler, v_texCoord);", "lowp vec4 dst = texture2D(u_sampler, v_texCoord);", "", "lowp vec4 color = vec4(0,0,0,0);", "", "float factorI = 1.0 - u_factor;", "", "vec4 mult = 2.0 * dst * src;", "vec4 screen = 1.0 - 2.0 * (1.0 - dst) * (1.0 - src);", "color = factorI * dst + u_factor * mix(mult, screen, step(0.5, dst));", "", "color.a = 1.0;", "gl_FragColor = color;", "", "}"].join("\n"),
						MoaBitmapBlendOverlayReverseFragmentShader: ["precision mediump float;", "", "uniform lowp sampler2D u_sampler;", "uniform lowp sampler2D u_srcSampler;", "uniform float u_factor;", "varying highp vec2 v_texCoord;", "", "void main(void) {", "lowp vec4 dst = texture2D(u_srcSampler, v_texCoord);", "lowp vec4 src = texture2D(u_sampler, v_texCoord);", "", "lowp vec4 color = vec4(0,0,0,0);", "", "float factorI = 1.0 - u_factor;", "", "vec4 mult = 2.0 * dst * src;", "vec4 screen = 1.0 - 2.0 * (1.0 - dst) * (1.0 - src);", "color = factorI * dst + u_factor * mix(mult, screen, step(0.5, dst));", "", "color.a = 1.0;", "gl_FragColor = color;", "", "}"].join("\n"),
						MoaBitmapDrawWithMaskFragmentShader: ["precision mediump float;", "", "uniform lowp sampler2D u_sampler;", "uniform lowp sampler2D u_maskSampler;", "varying highp vec2 v_texCoord;", "", "void main(void) {", "vec4 maskAmount = texture2D(u_maskSampler, v_texCoord);", "vec4 originalColor = texture2D(u_sampler, v_texCoord);", "originalColor.a = 1.0 - maskAmount.a;", "gl_FragColor = originalColor;", "}"].join("\n"),
						MoaBitmapRedrawWithMaskFragmentShader: ["precision mediump float;", "", "uniform lowp sampler2D u_sampler;", "uniform lowp sampler2D u_maskSampler;", "uniform lowp sampler2D u_sourceSampler;", "varying highp vec2 v_texCoord;", "", "void main(void) {", "vec4 maskAmount = texture2D(u_maskSampler, v_texCoord);", "vec4 originalColor = texture2D(u_sampler, v_texCoord);", "vec4 sourceColor = texture2D(u_sourceSampler, v_texCoord);", "gl_FragColor = mix(originalColor, sourceColor, maskAmount.a);", "}"].join("\n"),
						MoaBitmapBlendTexturesUsingMaskFragmentShader: ["precision mediump float;", "", "uniform lowp sampler2D u_maskSampler;", "uniform lowp sampler2D u_baseSampler;", "uniform lowp sampler2D u_blendSampler;", "varying highp vec2 v_texCoord;", "", "void main(void) {", "vec4 maskAmount = texture2D(u_maskSampler, v_texCoord);", "vec4 baseColor = texture2D(u_baseSampler, v_texCoord);", "vec4 blendColor = texture2D(u_blendSampler, v_texCoord);", "", "gl_FragColor = mix(baseColor, blendColor, maskAmount.a);", "}"].join("\n"),
						MoaBitmapColorBlendColorFragmentShader: ["precision highp float;", "", "uniform highp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform highp vec3 u_blendColor;", "uniform highp float u_blendAmount;", "uniform highp float u_blendColorAlpha;", "", "void main(void) {", "highp vec4 color = texture2D(u_sampler, v_texCoord);", "", "// RBG -> HSL", "float r = color.r;", "float g = color.g;", "float b = color.b;", "float h = u_blendColor.x;", "float s = u_blendColor.y;", "float l = u_blendColor.z;", "", "// Blend", "s *= u_blendColorAlpha; //Hack hack hack", "l  = (0.212671*r + 0.71516*g + 0.072169*b);", "", "// End Blend", "", "// HSL -> RGB", "float hPrime;", "float C;", "float X;", "float m;", "float hPrimeMod2;", "", "hPrime = h * 6.0;", "C = l > 0.5 ? 2.0 * s * (1.0 - l) : 2.0 * s * l;", "hPrimeMod2 = hPrime;", "", "hPrimeMod2 = mod(hPrimeMod2, 2.0);", "", "X = C * (1.0 - abs(hPrimeMod2 - 1.0));", "", "m = l - 0.5*C;", "", "if(hPrime < 1.0){", "r = C; g = X; b = 0.0;", "}else if(hPrime < 2.0){", "r = X; g = C; b = 0.0;", "}else if(hPrime < 3.0){", "r = 0.0; g = C; b = X;", "}else if(hPrime < 4.0){", "r = 0.0; g = X; b = C;", "}else if(hPrime < 5.0){", "r = X; g = 0.0; b = C;", "}else if(hPrime < 6.0){", "r = C; g = 0.0; b = X;", "}", "// End HSL -> RGB", "", "vec4 blendedColor = vec4(r+m,g+m,b+m,1.0);", "color = mix(color, blendedColor, u_blendAmount);", "color.a = 1.0; //Just to make sure", "", "gl_FragColor = color;", "}"].join("\n"),
						MoaBitmapBlendDarkestFragmentShader: ["precision mediump float;", "", "uniform lowp sampler2D u_sampler;", "uniform lowp sampler2D u_sourceSampler;", "varying highp vec2 v_texCoord;", "", "void main(void) {", "vec4 dstColor = texture2D(u_sampler, v_texCoord);", "vec4 srcColor = texture2D(u_sourceSampler, v_texCoord);", "", "if(dot(vec3(0.2, 0.7, 0.1), dstColor.rgb) > dot(vec3(0.2, 0.7, 0.1), srcColor.rgb)){", "gl_FragColor = srcColor;", "}else{", "//                                                                 gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0);", "gl_FragColor = dstColor;", "}", "}"].join("\n"),
						MoaBitmapBlendBitmapColorModeFragmentShader: ["precision mediump float;", "", "uniform lowp sampler2D u_sampler;", "uniform lowp sampler2D u_blendSampler;", "uniform float u_alpha;", "", "varying highp vec2 v_texCoord;", "", "void main(void) {", "// a (base color) and b (blend color)", "vec4 bRGBA = texture2D(u_blendSampler, v_texCoord); //Blend Color", "vec4 aRGBA = texture2D(u_sampler, v_texCoord); //Base Color", "", "vec3 a = aRGBA.rgb;", "vec3 b = bRGBA.rgb;", "", "float alpha = u_alpha * bRGBA.a;", "vec3 blendColor = a;", "", "", "float h;", "float s;", "float l;", "", "// RBG -> HSL", "float maxChan = max(b.r, max(b.g, b.b));", "float minChan = min(b.r, min(b.g, b.b));", "", "float chroma = maxChan - minChan;", "l = (maxChan + minChan)/2.0;", "", "if(chroma == 0.0){", "h = 0.0;", "s = 0.0;", "} else{", "s = l > 0.5 ? chroma / (2.0 - maxChan - minChan) : chroma / (maxChan + minChan);", "", "if(b.r == maxChan){", "h = (b.g - b.b) / chroma + (b.g < b.b ? 6.0 : 0.0);", "}else if(b.g == maxChan){", "h = (b.b - b.r) / chroma + 2.0;", "}else if(b.b == maxChan){", "h = (b.r - b.g) / chroma + 4.0;", "}", "", "h *= 60.0;", "", "if(h < 0.0){h += 360.0;}", "if(h >= 360.0){h -= 360.0;}", "}", "", "", "// Blend", "l  = (0.212671*a.r + 0.71516*a.g + 0.072169*a.b);", "s *= alpha;", "", "float hPrime = h / 60.0;", "float C = l > 0.5 ? 2.0 * s * (1.0 - l) : 2.0 * s * l;", "float X = C * (1.0 - abs(mod(hPrime, 2.0) - 1.0));", "", "if(hPrime < 1.0){", "blendColor.r = C; blendColor.g = X; blendColor.b = 0.0;", "}else if(hPrime < 2.0){", "blendColor.r = X; blendColor.g = C; blendColor.b = 0.0;", "}else if(hPrime < 3.0){", "blendColor.r = 0.0; blendColor.g = C; blendColor.b = X;", "}else if(hPrime < 4.0){", "blendColor.r = 0.0; blendColor.g = X; blendColor.b = C;", "}else if(hPrime < 5.0){", "blendColor.r = X; blendColor.g = 0.0; blendColor.b = C;", "}else if(hPrime < 6.0){", "blendColor.r = C; blendColor.g = 0.0; blendColor.b = X;", "}", "", "float m = l - 0.5 * C;", "", "blendColor.r = blendColor.r + m;", "blendColor.g = blendColor.g + m;", "blendColor.b = blendColor.b + m;", "", "", "", "gl_FragColor = vec4(mix(a, blendColor, alpha),1.0);", "", "}"].join("\n"),
						MoaBitmapBlendBitmapFragmentShader1: ["precision mediump float;", "", "uniform lowp sampler2D u_sampler;", "uniform lowp sampler2D u_blendSampler;", "uniform float u_alpha;", "uniform int u_blendMode;", "", "varying highp vec2 v_texCoord;", "", "void main(void) {", "vec4 bRGBA = texture2D(u_blendSampler, v_texCoord); //Blend Color", "vec4 aRGBA = texture2D(u_sampler, v_texCoord); //Base Color", "", "vec3 a = aRGBA.rgb;", "vec3 b = bRGBA.rgb;", "", "float alpha = u_alpha * bRGBA.a;", "vec3 blendColor = a;", "", "if(u_blendMode == 0){", "blendColor = b;", "}else if(u_blendMode == 6){", "blendColor = 2.0*a*b + a*a - 2.0*a*a*b;", "}else if(u_blendMode == 5){", "blendColor = b*a;", "}else if(u_blendMode == 3){", "blendColor = a + b - a*b;", "}else if(u_blendMode == 4){", "blendColor = min(a,b);", "}else if(u_blendMode == 7){", "blendColor = max(a,b);", "}else if(u_blendMode == 8){", "blendColor = abs(a-b);", "}else if(u_blendMode == 9){", "blendColor = 1.0 - abs(1.0-a-b);", "}else if(u_blendMode == 10){", "blendColor = a + b - 2.0*a*b;", "}else if(u_blendMode == 1){", "vec3 mult = 2.0 * a * b;", "vec3 screen = 1.0 - 2.0 * (1.0 - a) * (1.0 - b);", "vec3 transition = a * a * (2.0 - 4.0 * b) + a * (4.0 * b - 1.0) + (1.0 - 2.0 * b) / 8.0;", "blendColor = (1.0 - step(0.25, a)) * mult + (step(0.25, a) - step(0.75, a)) * transition + step(0.75, a) * screen;", "}else if(u_blendMode == 11){", "blendColor = (2.0*a*b)*(1.0-step(0.5,b)) + (1.0-2.0*(1.0-a)*(1.0-b))*step(0.5,b);", "}", "", "blendColor = clamp(blendColor, 0.0, 1.0);", "", "gl_FragColor = vec4(mix(a, blendColor, alpha),1.0);", "}"].join("\n"),
						MoaBitmapBlendBitmapFragmentShader2: ["precision mediump float;", "", "uniform lowp sampler2D u_sampler;", "uniform lowp sampler2D u_blendSampler;", "uniform float u_alpha;", "uniform int u_blendMode;", "", "varying highp vec2 v_texCoord;", "", "void main(void) {", "vec4 bRGBA = texture2D(u_blendSampler, v_texCoord); //Blend Color", "vec4 aRGBA = texture2D(u_sampler, v_texCoord); //Base Color", "", "vec3 a = aRGBA.rgb;", "vec3 b = bRGBA.rgb;", "", "float alpha = u_alpha * bRGBA.a;", "vec3 blendColor = a;", "", "if(u_blendMode == 0){", "blendColor = b;", "}else if(u_blendMode == 12){", "blendColor.r = b.r;", "}else if(u_blendMode == 13){", "blendColor.g = b.g;", "}else if(u_blendMode == 14){", "blendColor.b = b.b;", "}else if(u_blendMode == 15){", "blendColor = 0.5 - 0.25*cos(3.141592654*a) - 0.25*cos(3.141592654*b);", "}else if(u_blendMode == 16){", "blendColor = a / (1.0001 - b);", "}else if(u_blendMode == 17){", "blendColor = b / (1.0001 - a);", "}else if(u_blendMode == 18){", "blendColor = 0.5*a/(1.00001-b) * (1.0-step(1.0,a+b)) + (1.0-0.5*(1.0-b)/(0.00001+a)) * step(1.0,a+b);", "}else if(u_blendMode == 19){", "blendColor = step(0.00001, b) * (1.0 - (1.0 - a) / (0.0001 + b));", "}else if(u_blendMode == 20){", "blendColor = step(0.00001, a) * (1.0 - (1.0 - b) / (0.0001 + a));", "}else if(u_blendMode == 21){", "blendColor = 0.5*(b/(1.0001-a)) * (1.0-step(1.0001,a+b)) + (1.0-0.5*(1.0-a)/(0.00001+b)) * step(1.0001,a+b);", "}else if(u_blendMode == 22){", "blendColor = a+b;", "}else if(u_blendMode == 23){", "blendColor = a+b-1.0;", "}else if(u_blendMode == 24){", "blendColor = a+2.0*b-1.0;", "}", "// else if(u_blendMode == 25){", "//     blendColor = a*a/(1.0001-b);", "// }else if(u_blendMode == 26){", "//     blendColor = b*b/(1.0001-a);", "// }else if(u_blendMode == 27){", "//     blendColor = step(0.0001,b)*(1.0 - (1.0-a)*(1.0-a) / (0.0001+b));", "// }else if(u_blendMode == 28){", "//     blendColor = step(0.0001,a)*(1.0 - (1.0-b)*(1.0-b) / (0.0001+a));", "// }", "", "blendColor = clamp(blendColor, 0.0, 1.0);", "", "gl_FragColor = vec4(mix(a, blendColor, alpha),1.0);", "}"].join("\n"),
						MoaBitmapLaplaceDiffFragmentShader: ["precision mediump float;", "", "uniform lowp sampler2D u_sampler;", "uniform lowp sampler2D u_sourceSampler;", "varying highp vec2 v_texCoord;", "", "void main(void) {", "vec4 dstColor = texture2D(u_sampler, v_texCoord);", "vec4 srcColor = texture2D(u_sourceSampler, v_texCoord);", "", "gl_FragColor = vec4(0.5+0.5*(dstColor.rgb-srcColor.rgb),1.0);", "}"].join("\n"),
						MoaBitmapLaplaceAddFragmentShader: ["precision mediump float;", "", "uniform lowp sampler2D u_sampler;", "uniform lowp sampler2D u_sourceSampler;", "varying highp vec2 v_texCoord;", "", "void main(void) {", "vec4 dstColor = texture2D(u_sampler, v_texCoord);", "vec4 srcColor = texture2D(u_sourceSampler, v_texCoord);", "", "gl_FragColor = vec4(dstColor.rgb-2.0*srcColor.rgb + 1.0,1.0);", "}"].join("\n"),
						MoaMaskRadialFragmentShader: ["precision highp float;", "", "varying highp vec2 v_texCoord;", "", "uniform vec2 u_centerPoint;", "uniform float u_sigmaR2;", "uniform float u_width;", "uniform float u_height;", "", "void main(void) {", "float xComp = u_width * v_texCoord.x - u_centerPoint.x;", "float yComp = u_height * v_texCoord.y - u_centerPoint.y;", "", "float dr2 = xComp * xComp + yComp * yComp;", "//                                                          float dr2 = 1.21 * xComp * xComp + yComp * yComp; // Selfie shader", "", "//                                                          dr2 -= u_sigmaR2/2.0; //Selfie shader", "", "//                                                          if(dr2 < 0.0){", "//                                                              dr2 = 0.0;", "//                                                          }", "", "//                                                          float factor = sqrt(4.0 * dr2/u_sigmaR2);", "", "float factor = 1.0 - exp(-1.0 * dr2 / (2.0 * u_sigmaR2));", "//                                                          float factor = (1.0 - exp(-10.0 * dr2 / (2.0 * u_sigmaR2)));", "", "//                                                          factor = factor > 1.0 ? 1.0 : (factor < 0.0 ? 0.0 : factor);", "", "gl_FragColor = vec4(factor, factor, factor, factor);", "}"].join("\n"),
						MoaMaskElipticalFragmentShader: ["precision highp float;", "", "varying highp vec2 v_texCoord;", "", "uniform vec2 u_centerPoint;", "uniform float u_sigmaX;", "uniform float u_sigmaY;", "uniform float u_width;", "uniform float u_height;", "", "void main(void) {", "float xComp = u_width * v_texCoord.x - u_centerPoint.x;", "float yComp = u_height * v_texCoord.y - u_centerPoint.y;", "", "float dr2 = xComp * xComp + yComp * yComp;", "", "float factor = 1.0 - exp(-1.0 * dr2 / (2.0 * u_sigmaX));", "", "gl_FragColor = vec4(factor, factor, factor, factor);", "}"].join("\n"),
						MoaMaskLinearFragmentShader: ["", "precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform vec2 u_centerPoint;", "uniform float u_sigmaR2;", "uniform float u_normX;", "uniform float u_normY;", "uniform float u_width;", "uniform float u_height;", "", "void main(void) {", "float proj = abs(u_normX * (u_centerPoint.x - u_width * v_texCoord.x) + u_normY * (u_height * v_texCoord.y - u_centerPoint.y));", "", "float factor = 1.0 - exp(-1.0 * proj * proj / (2.0 * u_sigmaR2));", "", "gl_FragColor = vec4(factor, factor, factor, factor); // change", "", "}"].join("\n"),
						MoaMaskDotsVertexShader: ["attribute highp vec4 a_position;", "attribute highp vec2 a_texCoord;", "attribute highp vec2 a_centerTexCoord;", "", "varying highp vec2 v_texCoord;", "varying highp vec2 v_centerTexCoord;", "", "void main()", "{", "v_texCoord = a_texCoord;", "v_centerTexCoord = a_centerTexCoord;", "gl_Position = a_position;", "}"].join("\n"),
						MoaMaskDotFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "varying highp vec2 v_centerTexCoord;", "", "uniform mediump float u_radius;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_alpha;", "uniform float u_dEdge;", "uniform int   u_erase;", "", "void main(void) {", "vec2 distComponents = (v_texCoord - v_centerTexCoord) * vec2(u_width, u_height);", "float dr2 = distComponents.x * distComponents.x + distComponents.y * distComponents.y;", "", "float factor;", "float tmpDouble = 1.0 - (sqrt(dr2) - u_radius)/u_dEdge;", "tmpDouble = clamp(tmpDouble, 0.0, 1.0);", "factor = tmpDouble*tmpDouble;", "", "factor *= u_alpha;", "", "gl_FragColor = vec4(factor,factor,factor,factor);", "}"].join("\n"),
						MoaMaskDotColorFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "varying highp vec2 v_centerTexCoord;", "", "uniform mediump float u_radius;", "uniform float u_width;", "uniform float u_height;", "uniform float u_pointSize;", "uniform float u_alpha;", "uniform float u_dEdge;", "uniform vec4 u_color;", "", "void main(void) {", "vec2 distComponents = (v_texCoord - v_centerTexCoord) * vec2(u_width, u_height);", "float dr2 = distComponents.x * distComponents.x + distComponents.y * distComponents.y;", "", "float factor;", "float tmpDouble = 1.0 - (sqrt(dr2) - u_radius)/u_dEdge;", "tmpDouble = clamp(tmpDouble, 0.0, 1.0);", "factor = tmpDouble*tmpDouble;", "", "gl_FragColor = (factor * u_alpha) * u_color;", "}"].join("\n"),
						MoaColorSplashAutoFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "varying highp vec2 v_centerTexCoord;", "", "uniform mediump float u_radius;", "uniform float u_width;", "uniform float u_height;", "uniform float u_pointSize;", "uniform float u_alpha;", "uniform float u_dEdge;", "uniform float u_l;", "uniform float u_a;", "uniform float u_b;", "uniform float u_sigmaC;", "", "void main(void) {", "vec2 distComponents = (v_texCoord - v_centerTexCoord) * vec2(u_width, u_height);", "float dr2 = distComponents.x * distComponents.x + distComponents.y * distComponents.y;", "", "float factorR;", "float tmpDouble = 1.0 - (sqrt(dr2) - u_radius)/u_dEdge;", "tmpDouble = clamp(tmpDouble, 0.0, 1.0);", "factorR = tmpDouble*tmpDouble;", "", "// Convert to LAB", "vec4 color = texture2D(u_sampler, v_texCoord);", "", "float R = color.r * 255.0;", "float G = color.g * 255.0;", "float B = color.b * 255.0;", "", "float l1;", "float a1;", "float b1;", "float r;", "float g;", "float b;", "float x;", "float y;", "float z;", "", "if(R/255.0 <= 0.04045){r = 100.0 *R/255.0/12.92;} else{ r = 100.0*pow((R/255.0+0.055)/1.055,2.40);}", "if(G/255.0 <= 0.04045){g = 100.0 *G/255.0/12.92;} else{ g = 100.0*pow((G/255.0+0.055)/1.055,2.40);}", "if(B/255.0 <= 0.04045){b = 100.0 *B/255.0/12.92;} else{ b = 100.0*pow((B/255.0+0.055)/1.055,2.40);}", "", "x = 0.00433891*r  + 0.00376234915*g + 0.0018990604648*b;", "y = 0.002126*r    + 0.007152*g      + 0.000722*b;", "z = 0.000177255*r + 0.00109475308*g + 0.0087295537*b;", "", "if(x > 0.008856){x = pow(x,1.0/3.0);}else{x = 7.787*x+16.0/116.0;}", "if(y > 0.008856){y = pow(y,1.0/3.0);}else{y = 7.787*y+16.0/116.0;}", "if(z > 0.008856){z = pow(z,1.0/3.0);}else{z = 7.787*z+16.0/116.0;}", "", "l1 = 116.0*y-16.0;", "a1 = 500.0*(x-y);", "b1 = 200.0*(y-z);", "", "l1 *= 2.55; a1 += 127.0; b1 += 127.0;", "", "// Use those values to determine color factor", "float dColor = (u_a - a1) * (u_a - a1) + (u_b - b1) * (u_b - b1);", "float factorC = exp(-1.0 * dColor/(2.0 * u_sigmaC * u_sigmaC));", "factorC = clamp(factorC, 0.0, 1.0);", "", "// Get overall color", "float factor = u_alpha * factorR * factorC;", "gl_FragColor = vec4(factor,factor,factor,factor);", "", "}"].join("\n"),
						MoaCloneSpotFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform vec2 u_center;", "uniform vec2 u_offset;", "uniform float u_aspectI;", "uniform float u_radius;", "", "void main(void) {", "vec4 img = texture2D(u_sampler, v_texCoord);", "", "float r = length(vec2(v_texCoord.x, u_aspectI * v_texCoord.y) - u_center);", "", "vec4 result = img;", "", "if(r < u_radius){", "float alpha = clamp(3.0 * (1.0 - (r / u_radius)), 0.0, 1.0);", "", "result = texture2D(u_sampler, v_texCoord + u_offset);", "result = mix(img, result, alpha);", "}", "", "gl_FragColor = vec4(result.rgb, img.a);", "}"].join("\n"),
						MoaAdjustmentsFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "uniform lowp sampler2D u_colorShadowsHighlightsSampler;", "uniform lowp sampler2D u_threeChannelColorMapSampler;", "uniform lowp mat4 u_colorMatrix;", "", "varying highp vec2 v_texCoord;", "", "void main(void) {", "highp vec4 color = texture2D(u_sampler, v_texCoord);", "", "color.r = texture2D(u_colorShadowsHighlightsSampler, vec2(0.0, color.r)).r;", "color.g = texture2D(u_colorShadowsHighlightsSampler, vec2(0.0, color.g)).r;", "color.b = texture2D(u_colorShadowsHighlightsSampler, vec2(0.0, color.b)).r;", "", "float intensity = 0.3 * color.r + 0.59 * color.g + 0.11 * color.b;", "", "float shDiff = texture2D(u_colorShadowsHighlightsSampler, vec2(0.0, intensity)).g - intensity;", "", "color.rgb += shDiff;", "", "color.rgb = clamp(color.rgb, 0.0, 1.0);", "", "vec4 colorMatrixRGB = vec4(color.rgb, 1.0);", "", "colorMatrixRGB = colorMatrixRGB * u_colorMatrix;", "", "colorMatrixRGB = clamp(colorMatrixRGB, 0.0, 1.0);", "", "colorMatrixRGB.r = texture2D(u_threeChannelColorMapSampler, vec2(0.0, colorMatrixRGB.r)).r;", "colorMatrixRGB.g = texture2D(u_threeChannelColorMapSampler, vec2(0.0, colorMatrixRGB.g)).g;", "colorMatrixRGB.b = texture2D(u_threeChannelColorMapSampler, vec2(0.0, colorMatrixRGB.b)).b;", "", "gl_FragColor = vec4(colorMatrixRGB.rgb, color.a);", "}"].join("\n"),
						MoaNoiseFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_randomSeed;", "uniform float u_intensity;", "", "float rand(in vec2 n)", "{", "//                                                n *= u_randomSeed;", "return fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);", "}", "", "void main(void) {", "lowp vec4 color = texture2D(u_sampler, v_texCoord);", "", "float v = u_intensity * (2.0 * rand(v_texCoord) - 1.0);", "", "color.rgb += v;", "", "gl_FragColor = color;", "", "}"].join("\n"),
						MoaGradientMapFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform int u_invertMap;", "uniform int u_gradVar;", "uniform int u_blendMode;", "uniform float u_alphaBlend;", "uniform lowp sampler2D u_gradientMap;", "", "void main(void) {", "", "float factor = 0.0;", "float alphaBlend = u_alphaBlend;", "lowp vec4 gradientColor;", "lowp vec3 srcColor = texture2D(u_sampler, v_texCoord).rgb;", "float iSrc = 0.0;", "", "if(u_gradVar == 0){", "iSrc = 0.2 * srcColor.r + 0.7 * srcColor.g + 0.1 * srcColor.b;", "} else if(u_gradVar == 1){", "iSrc = max(srcColor.r, max(srcColor.g, srcColor.b)) - min(srcColor.r, min(srcColor.g, srcColor.b));", "} else if(u_gradVar == 2){", "iSrc = srcColor.r;", "} else if(u_gradVar == 3){", "iSrc = srcColor.g;", "} else if(u_gradVar == 4){", "iSrc = srcColor.b;", "} else if(u_gradVar == 5){", "iSrc = max(srcColor.r, max(srcColor.g, srcColor.b));", "} else if(u_gradVar == 6){", "iSrc = min(srcColor.r, min(srcColor.g, srcColor.b));", "}", "", "if(u_invertMap == 1){", "iSrc = 1.0 - iSrc;", "}", "", "gradientColor = texture2D(u_gradientMap, vec2(0.0,iSrc));", "", "vec3 blendColor = (1.0 - gradientColor.a) * srcColor + gradientColor.a * gradientColor.rgb;", "", "if(u_blendMode == 0){", "gl_FragColor.rgb = (1.0 - alphaBlend) * srcColor + alphaBlend * blendColor;", "} else if(u_blendMode == 6){", "gl_FragColor.rgb = (1.0 - alphaBlend) * srcColor + alphaBlend * (2.0 * srcColor * blendColor + srcColor * srcColor - 2.0 * srcColor * srcColor * blendColor);", "} else if(u_blendMode == 5){", "gl_FragColor.rgb = (1.0 - alphaBlend) * srcColor + alphaBlend * srcColor * blendColor;", "} else if(u_blendMode == 3){", "gl_FragColor.rgb = (1.0 - alphaBlend) * srcColor + alphaBlend * (srcColor + blendColor - srcColor * blendColor);", "} else if(u_blendMode == 1){", "float factorI = 1.0 - alphaBlend;", "", "vec3 mult = 2.0 * srcColor * blendColor;", "vec3 screen = 1.0 - 2.0 * (1.0 - srcColor) * (1.0 - blendColor);", "vec3 transition = srcColor * srcColor * (2.0 - 4.0 * blendColor) + srcColor * (4.0 * blendColor - 1.0) + (1.0 - 2.0 * blendColor) / 8.0;", "vec3 mixingColor = (1.0 - step(0.25, srcColor)) * mult + (step(0.25, srcColor) - step(0.75, srcColor)) * transition + step(0.75, srcColor) * screen;", "", "gl_FragColor.rgb = factorI * srcColor + alphaBlend * mixingColor;", "} else if(u_blendMode == 4){", "if(srcColor.r > blendColor.r){", "gl_FragColor.r = (1.0 - alphaBlend) * srcColor.r + alphaBlend * blendColor.r;", "}else{", "gl_FragColor.r = srcColor.r;", "}", "", "if(srcColor.g > blendColor.g){", "gl_FragColor.g = (1.0 - alphaBlend) * srcColor.g + alphaBlend * blendColor.g;", "}else{", "gl_FragColor.g = srcColor.g;", "}", "", "if(srcColor.b > blendColor.b){", "gl_FragColor.b = (1.0 - alphaBlend) * srcColor.b + alphaBlend * blendColor.b;", "}else{", "gl_FragColor.b = srcColor.b;", "}", "}", "", "gl_FragColor.a = 1.0;", "}"].join("\n"),
						MoaFlareFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "uniform highp float u_flareAmount;", "varying highp vec2 v_texCoord;", "", "uniform int u_blendMode;", "uniform int u_flareType;", "uniform float u_scaleDiffx;", "uniform float u_scaleDiffy;", "uniform vec2 u_onePlusDxTimesCenterCoord;", "uniform lowp vec4 u_flareColor;", "uniform float u_minEXP;", "uniform float u_maxEXP;", "uniform float u_aF;", "uniform float u_alphaBlend;", "", "void setFactorAndExpvForType(out float factor)", "{", "float theta;", "float a;", "float expV = 0.0;", "", "float xF = u_scaleDiffx * (v_texCoord.x - u_onePlusDxTimesCenterCoord.x);", "float yF = u_scaleDiffy * (v_texCoord.y - u_onePlusDxTimesCenterCoord.y);", "", "if(u_flareType == 14){", "xF -= 1.0;", "yF -= 1.0;", "}", "", "if(u_flareType == 0){", "theta = 80.0 * (xF * xF + yF * yF);", "if (theta == 0.0) { factor = 1.0; } else {", "factor = 1.0 - u_aF * 0.4 * (sin(theta) / sqrt(theta));", "}", "}else if(u_flareType == 1){", "expV   = (-(xF * xF + yF * yF) * 2.0 - 16.0 * (yF + 0.5) * (yF + 0.5) * (xF + 0.5) * (xF + 0.5));", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - u_aF) : (1.0 - u_aF * exp(expV));", "}else if(u_flareType == 2){", "expV   = (-(xF * xF + yF * yF) * 2.0 - 16.0 * (yF + 1.0) * (yF + 1.0) * (xF - 0.5) * (xF - 0.5));", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - u_aF) : (1.0 - u_aF * exp(expV));", "}else if(u_flareType == 3){", "theta  = xF * xF + yF * yF;", "expV   = -theta * 2.0 - 1.0 * (yF + 1.7) * (yF + 1.7) * (xF - 0.6) * (xF - 0.6);", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - u_aF) : (1.0 - u_aF * exp(expV));", "}else if(u_flareType == 4){", "// theta  = xF * xF + yF * yF;", "expV   = -0.5 * (yF - 1.7) * (yF - 1.7) * (xF + 0.6) * (xF + 0.6) - 0.5 * (yF + 1.7) * (yF + 1.7) * (xF - 0.6) * (xF - 0.6);", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - u_aF) : (1.0 - u_aF * exp(expV));", "}else if(u_flareType == 5){", "expV   = -(xF * xF + yF * yF) * 2.0 - 5.0 * (xF + 0.2) * (yF + 0.2) * xF * xF;", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - 0.5 * u_aF) : (1.0 - 0.5 * u_aF * exp(expV));", "}else if(u_flareType ==  6){", "theta = xF * xF + yF * yF;", "a = atan(yF, xF);", "factor = 1.0 - u_aF * 0.2 * (1.0 - theta * theta * (sin(10.0 * a)));", "}else if(u_flareType == 7){", "theta = xF * xF + yF * yF;", "a = atan(yF, xF);", "factor = 1.0 - u_aF * 0.5 * exp(-theta * 2.0) * (0.5 + 0.5 * sin(4.0 * a + 1.0));", "}else if(u_flareType == 8){", "// Unimplemented", "}else if(u_flareType == 9){", "expV = (-(xF * xF) - yF * yF / 64.0);", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - u_aF) : (1.0 - u_aF * exp(expV));", "}else if(u_flareType == 10){", "expV = (-(yF * yF) - xF * xF / 64.0);", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - u_aF) : (1.0 - u_aF * exp(expV));", "}else if(u_flareType == 11){", "theta  = xF * xF + yF * yF;", "factor = 1.0 - u_aF *exp(-(theta * theta) *2.0 + (-8.0) *(yF + 0.5) *(yF - 0.5) *(xF + 0.5) *(xF - 0.5));", "}else if(u_flareType == 12){", "theta = xF * xF + yF * yF;", "expV  = -(theta / 180.0) * 2.0 - 16.0 * (yF + 0.5) * (yF + 0.5) * (xF + 0.5) * (xF + 0.5);", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - u_aF) : (1.0 - u_aF * exp(expV));", "}else if(u_flareType == 13){", "theta = xF * xF + yF * yF;", "factor = 1.0 - u_aF *exp(-(theta / 180.0) *2.0) * (exp((-8.0) * (yF + 1.0) * (yF - 1.0) * (xF + 1.0) * (xF - 1.0)));", "}else if(u_flareType == 14){", "theta = (xF + 1.0) * xF + yF * yF;", "factor = u_aF * exp(yF / xF + (-theta) * exp(exp(yF) * xF));", "factor = 1.0 - u_alphaBlend * (1.0-factor);", "}else if(u_flareType == 15){", "theta = xF * xF + yF * yF;", "factor = 1.0 - u_aF *exp(-pow(theta, 2.0) + -0.9 *(yF - 1.7) *(yF + 0.5) *(xF - 1.5) *(xF + 0.5));", "}else if(u_flareType == 16){", "theta = xF * xF + yF * yF;", "a = atan(yF, xF);", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - u_aF) : (1.0 - u_aF * 0.2 * (1.0 - sin(theta) * sin(10.0 * theta) * (sin(10.0 * a))));", "}else if(u_flareType == 17){", "expV = (-((yF * yF + xF * xF) * (yF * yF + xF * xF) * (yF * yF + xF * xF) * (yF * yF + xF * xF))) * 100.0;", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - u_aF) : (1.0 - u_aF * exp(expV));", "}else if(u_flareType == 18){", "float xF2plusyF2 = yF * yF + xF * xF;", "", "expV = (-1.0 * (xF2plusyF2) * (xF2plusyF2))*10.0;", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - u_aF) : (1.0 - u_aF * exp(expV));", "}", "}", "", "void blend(inout vec4 dst, float factor)", "{", "vec4 color = vec4(0,0,0,0);", "float factorI = 1.0 - factor;", "", "if(u_blendMode == 0){", "color = u_flareColor * factor + dst * factorI;", "}else if(u_blendMode==1){", "vec4 mult = 2.0 * dst * u_flareColor;", "vec4 screen = 1.0 - 2.0 * (1.0 - dst) * (1.0 - u_flareColor);", "vec4 transition = dst * dst * (2.0 - 4.0 * u_flareColor) + dst * (4.0 * u_flareColor - 1.0) + (1.0 - 2.0 * u_flareColor) / 8.0;", "vec4 blendColor = (1.0 - step(0.25, dst)) * mult + (step(0.25, dst) - step(0.75, dst)) * transition + step(0.75, dst) * screen;", "color = mix(blendColor, dst, factorI);", "}else if (u_blendMode==3){", "color = factorI * dst + factor * (1.0 - (1.0 - dst) * (1.0 - u_flareColor));", "}else if (u_blendMode==4){", "color = factorI * dst + factor * mix(dst, u_flareColor, step(u_flareColor, dst));", "}else if (u_blendMode==5){", "color = factorI * dst + factor * dst * u_flareColor;", "}", "", "color.a = 1.0;", "dst = color;", "}", "", "void main(void) {", "lowp vec4 color = texture2D(u_sampler, v_texCoord);", "", "float factor = 0.0;", "", "setFactorAndExpvForType(factor);", "", "factor = 1.0-factor;", "factor = clamp(factor,0.0,1.0);", "", "blend(color, factor);", "", "color.a = 1.0;", "gl_FragColor = color;", "}"].join("\n"),
						MoaFlareBlobFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "uniform highp float u_flareAmount;", "varying highp vec2 v_texCoord;", "", "uniform float u_scaleDiffx;", "uniform float u_scaleDiffy;", "uniform vec2 u_onePlusDxTimesCenterCoord;", "uniform lowp vec4 u_flareColor;", "uniform float u_minEXP;", "uniform float u_maxEXP;", "uniform float u_aF;", "", "void main(void) {", "lowp vec4 color = u_flareColor;", "", "float factor = 0.0;", "", "float theta;", "float a;", "float expV = 0.0;", "", "float xF = u_scaleDiffx * (v_texCoord.x - u_onePlusDxTimesCenterCoord.x);", "float yF = u_scaleDiffy * (v_texCoord.y - u_onePlusDxTimesCenterCoord.y);", "", "float xF2plusyF2 = yF * yF + xF * xF;", "", "expV = (-((xF2plusyF2) * (xF2plusyF2) * (xF2plusyF2) * (xF2plusyF2))) * 100.0;", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - u_aF) : (1.0 - u_aF * exp(expV));", "", "factor = 1.0 - factor;", "", "color.a = factor;", "gl_FragColor = color;", "}"].join("\n"),
						MoaFlareBlobOverlayFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "uniform highp float u_flareAmount;", "varying highp vec2 v_texCoord;", "", "uniform float u_scaleDiffx;", "uniform float u_scaleDiffy;", "uniform vec2 u_onePlusDxTimesCenterCoord;", "uniform highp vec4 u_flareColor;", "uniform float u_minEXP;", "uniform float u_maxEXP;", "uniform float u_aF;", "", "void main(void) {", "lowp vec4 dst = texture2D(u_sampler, v_texCoord);", "lowp vec4 color = vec4(0,0,0,0);", "", "float factor = 0.0;", "float factorI = 0.0;", "", "float theta;", "float a;", "float expV = 0.0;", "", "float xF = u_scaleDiffx * (v_texCoord.x - u_onePlusDxTimesCenterCoord.x);", "float yF = u_scaleDiffy * (v_texCoord.y - u_onePlusDxTimesCenterCoord.y);", "", "float xF2plusyF2 = yF * yF + xF * xF;", "", "expV = (-((xF2plusyF2) * (xF2plusyF2) * (xF2plusyF2) * (xF2plusyF2))) * 100.0;", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - u_aF) : (1.0 - u_aF * exp(expV));", "", "factorI = clamp(factor, 0.0, 1.0);", "factor = 1.0-factorI;", "", "vec4 mult = 2.0 * dst * u_flareColor;", "vec4 screen = 1.0 - 2.0 * (1.0 - dst) * (1.0 - u_flareColor);", "vec4 transition = dst * dst * (2.0 - 4.0 * u_flareColor) + dst * (4.0 * u_flareColor - 1.0) + (1.0 - 2.0 * u_flareColor) / 8.0;", "vec4 blendColor = (1.0 - step(0.25, dst)) * mult + (step(0.25, dst) - step(0.75, dst)) * transition + step(0.75, dst) * screen;", "color = mix(blendColor, dst, factorI);", "", "color.a = 1.0;", "gl_FragColor = color;", "}"].join("\n"),
						MoaFlareAngleGaussianFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "uniform highp float u_flareAmount;", "varying highp vec2 v_texCoord;", "", "uniform float u_scaleDiffx;", "uniform float u_scaleDiffy;", "uniform vec2 u_onePlusDxTimesCenterCoord;", "uniform lowp vec4 u_flareColor;", "uniform float u_minEXP;", "uniform float u_maxEXP;", "uniform float u_aF;", "", "void main(void) {", "lowp vec4 color = u_flareColor;", "", "float factor = 0.0;", "", "float theta;", "float a;", "float expV = 0.0;", "", "float xF = u_scaleDiffx * (v_texCoord.x - u_onePlusDxTimesCenterCoord.x);", "float yF = u_scaleDiffy * (v_texCoord.y - u_onePlusDxTimesCenterCoord.y);", "", "expV   = -(xF * xF + yF * yF) * 2.0 - 5.0 * (xF + 0.2) * (yF + 0.2) * xF * xF;", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - 0.5 * u_aF) : (1.0 - 0.5 * u_aF * exp(expV));", "factor = 1.0 - factor;", "", "", "color.a = factor;", "gl_FragColor = color;", "}"].join("\n"),
						MoaFlareGaussianThingFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "uniform highp float u_flareAmount;", "varying highp vec2 v_texCoord;", "", "uniform float u_scaleDiffx;", "uniform float u_scaleDiffy;", "uniform vec2 u_onePlusDxTimesCenterCoord;", "uniform lowp vec4 u_flareColor;", "uniform float u_minEXP;", "uniform float u_maxEXP;", "uniform float u_aF;", "", "void main(void) {", "lowp vec4 color = u_flareColor;", "", "float factor = 0.0;", "", "float theta;", "float a;", "float expV = 0.0;", "", "float xF = u_scaleDiffx * (v_texCoord.x - u_onePlusDxTimesCenterCoord.x);", "float yF = u_scaleDiffy * (v_texCoord.y - u_onePlusDxTimesCenterCoord.y);", "", "expV = (-(xF * xF + yF * yF) * 2.0 - 16.0 * (yF + 0.5) * (yF + 0.5) * (xF + 0.5) * (xF + 0.5));", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - u_aF) : (1.0 - u_aF * exp(expV));", "", "", "factor = 1.0-factor;", "", "color.a = factor;", "gl_FragColor = color;", "}"].join("\n"),
						MoaFlareGaussianThing2FragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "uniform highp float u_flareAmount;", "varying highp vec2 v_texCoord;", "", "uniform float u_scaleDiffx;", "uniform float u_scaleDiffy;", "uniform vec2 u_onePlusDxTimesCenterCoord;", "uniform lowp vec4 u_flareColor;", "uniform float u_minEXP;", "uniform float u_maxEXP;", "uniform float u_aF;", "", "void main(void) {", "lowp vec4 color = u_flareColor;", "", "float factor = 0.0;", "", "float theta;", "float a;", "float expV = 0.0;", "", "float xF = u_scaleDiffx * (v_texCoord.x - u_onePlusDxTimesCenterCoord.x);", "float yF = u_scaleDiffy * (v_texCoord.y - u_onePlusDxTimesCenterCoord.y);", "", "expV = (-(xF * xF + yF * yF) * 2.0 - 16.0 * (yF + 1.0) * (yF + 1.0) * (xF - 0.5) * (xF - 0.5));", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - u_aF) : (1.0 - u_aF * exp(expV));", "", "factor = 1.0-factor;", "color.a = factor;", "", "gl_FragColor = color;", "}"].join("\n"),
						MoaFlareBlob2FragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "uniform highp float u_flareAmount;", "varying highp vec2 v_texCoord;", "", "uniform float u_scaleDiffx;", "uniform float u_scaleDiffy;", "uniform vec2 u_onePlusDxTimesCenterCoord;", "uniform lowp vec4 u_flareColor;", "uniform float u_minEXP;", "uniform float u_maxEXP;", "uniform float u_aF;", "", "void main(void) {", "lowp vec4 color = u_flareColor;", "", "float factor = 0.0;", "", "float theta;", "float a;", "float expV = 0.0;", "", "float xF = u_scaleDiffx * (v_texCoord.x - u_onePlusDxTimesCenterCoord.x);", "float yF = u_scaleDiffy * (v_texCoord.y - u_onePlusDxTimesCenterCoord.y);", "", "float xF2plusyF2 = yF * yF + xF * xF;", "", "expV = (-1.0 * (xF2plusyF2) * (xF2plusyF2))*10.0;", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - u_aF) : (1.0 - u_aF * exp(expV));", "", "factor = 1.0-factor;", "color.a = factor;", "", "gl_FragColor = color;", "}"].join("\n"),
						MoaFlareBlob2OverlayFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "uniform highp float u_flareAmount;", "varying highp vec2 v_texCoord;", "", "uniform float u_scaleDiffx;", "uniform float u_scaleDiffy;", "uniform vec2 u_onePlusDxTimesCenterCoord;", "uniform lowp vec4 u_flareColor;", "uniform float u_minEXP;", "uniform float u_maxEXP;", "uniform float u_aF;", "", "void main(void) {", "lowp vec4 dst = texture2D(u_sampler, v_texCoord);", "lowp vec4 color = vec4(0,0,0,0);", "", "float factor = 0.0;", "float factorI = 0.0;", "", "float theta;", "float a;", "float expV = 0.0;", "", "float xF = u_scaleDiffx * (v_texCoord.x - u_onePlusDxTimesCenterCoord.x);", "float yF = u_scaleDiffy * (v_texCoord.y - u_onePlusDxTimesCenterCoord.y);", "", "float xF2plusyF2 = yF * yF + xF * xF;", "", "expV = (-1.0 * (xF2plusyF2) * (xF2plusyF2))*10.0;", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - u_aF) : (1.0 - u_aF * exp(expV));", "", "factorI = clamp(factor, 0.0, 1.0);", "factor = 1.0-factorI;", "", "vec4 mult = 2.0 * dst * u_flareColor;", "vec4 screen = 1.0 - 2.0 * (1.0 - dst) * (1.0 - u_flareColor);", "vec4 transition = dst * dst * (2.0 - 4.0 * u_flareColor) + dst * (4.0 * u_flareColor - 1.0) + (1.0 - 2.0 * u_flareColor) / 8.0;", "vec4 blendColor = (1.0 - step(0.25, dst)) * mult + (step(0.25, dst) - step(0.75, dst)) * transition + step(0.75, dst) * screen;", "color = mix(blendColor, dst, factorI);", "", "color.a = 1.0;", "gl_FragColor = color;", "}"].join("\n"),
						MoaFlareCornerflaresFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "uniform highp float u_flareAmount;", "varying highp vec2 v_texCoord;", "", "uniform float u_scaleDiffx;", "uniform float u_scaleDiffy;", "uniform vec2 u_onePlusDxTimesCenterCoord;", "uniform lowp vec4 u_flareColor;", "uniform float u_minEXP;", "uniform float u_maxEXP;", "uniform float u_aF;", "", "void main(void) {", "lowp vec4 color = u_flareColor;", "", "float factor = 0.0;", "", "float theta;", "float a;", "float expV = 0.0;", "", "float xF = u_scaleDiffx * (v_texCoord.x - u_onePlusDxTimesCenterCoord.x);", "float yF = u_scaleDiffy * (v_texCoord.y - u_onePlusDxTimesCenterCoord.y);", "", "theta = xF * xF + yF * yF;", "factor = 1.0 - u_aF *exp(-(theta / 180.0) *2.0) * (exp((-8.0) * (yF + 1.0) * (yF - 1.0) * (xF + 1.0) * (xF - 1.0)));", "", "factor = 1.0-factor;", "color.a = factor;", "", "gl_FragColor = color;", "}"].join("\n"),
						MoaFlareCornerflaresOverlayFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "uniform highp float u_flareAmount;", "varying highp vec2 v_texCoord;", "", "uniform float u_scaleDiffx;", "uniform float u_scaleDiffy;", "uniform vec2 u_onePlusDxTimesCenterCoord;", "uniform lowp vec4 u_flareColor;", "uniform float u_minEXP;", "uniform float u_maxEXP;", "uniform float u_aF;", "", "void main(void) {", "lowp vec4 dst = texture2D(u_sampler, v_texCoord);", "lowp vec4 color = vec4(0,0,0,0);", "", "float factor = 0.0;", "float factorI = 0.0;", "", "float theta;", "float a;", "float expV = 0.0;", "", "float xF = u_scaleDiffx * (v_texCoord.x - u_onePlusDxTimesCenterCoord.x);", "float yF = u_scaleDiffy * (v_texCoord.y - u_onePlusDxTimesCenterCoord.y);", "", "float xF2plusyF2 = yF * yF + xF * xF;", "", "theta = xF * xF + yF * yF;", "factor = 1.0 - u_aF *exp(-(theta / 180.0) *2.0) * (exp((-8.0) * (yF + 1.0) * (yF - 1.0) * (xF + 1.0) * (xF - 1.0)));", "", "factorI = clamp(factor, 0.0, 1.0);", "factor = 1.0 - factorI;", "", "vec4 mult = 2.0 * dst * u_flareColor;", "vec4 screen = 1.0 - 2.0 * (1.0 - dst) * (1.0 - u_flareColor);", "vec4 transition = dst * dst * (2.0 - 4.0 * u_flareColor) + dst * (4.0 * u_flareColor - 1.0) + (1.0 - 2.0 * u_flareColor) / 8.0;", "vec4 blendColor = (1.0 - step(0.25, dst)) * mult + (step(0.25, dst) - step(0.75, dst)) * transition + step(0.75, dst) * screen;", "color = mix(blendColor, dst, factorI);", "", "color.a = 1.0;", "gl_FragColor = color;", "}"].join("\n"),
						MoaFlareGaussianThing3OverlayFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "uniform highp float u_flareAmount;", "varying highp vec2 v_texCoord;", "", "uniform float u_scaleDiffx;", "uniform float u_scaleDiffy;", "uniform vec2 u_onePlusDxTimesCenterCoord;", "uniform lowp vec4 u_flareColor;", "uniform float u_minEXP;", "uniform float u_maxEXP;", "uniform float u_aF;", "", "void main(void) {", "lowp vec4 dst = texture2D(u_sampler, v_texCoord);", "lowp vec4 color = vec4(0,0,0,0);", "", "float factor = 0.0;", "float factorI = 0.0;", "", "float theta;", "float a;", "float expV = 0.0;", "", "float xF = u_scaleDiffx * (v_texCoord.x - u_onePlusDxTimesCenterCoord.x);", "float yF = u_scaleDiffy * (v_texCoord.y - u_onePlusDxTimesCenterCoord.y);", "", "float xF2plusyF2 = yF * yF + xF * xF;", "", "theta  = xF * xF + yF * yF;", "expV   = -theta * 2.0 - 1.0 * (yF + 1.7) * (yF + 1.7) * (xF - 0.6) * (xF - 0.6);", "factor = expV < u_minEXP ? 1.0 : expV > u_maxEXP ? (1.0 - u_aF) : (1.0 - u_aF * exp(expV));", "", "factorI = clamp(factor, 0.0, 1.0);", "factor = 1.0-factorI;", "", "vec4 mult = 2.0 * dst * u_flareColor;", "vec4 screen = 1.0 - 2.0 * (1.0 - dst) * (1.0 - u_flareColor);", "vec4 transition = dst * dst * (2.0 - 4.0 * u_flareColor) + dst * (4.0 * u_flareColor - 1.0) + (1.0 - 2.0 * u_flareColor) / 8.0;", "vec4 blendColor = (1.0 - step(0.25, dst)) * mult + (step(0.25, dst) - step(0.75, dst)) * transition + step(0.75, dst) * screen;", "color = mix(blendColor, dst, factorI);", "", "color.a = 1.0;", "gl_FragColor = color;", "}"].join("\n"),
						MoaRingFlareFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_dr22;", "uniform float u_dr12;", "uniform float u_daa;", "uniform float u_avgD;", "uniform float u_bA;", "uniform float u_height;", "uniform float u_width;", "uniform float u_yCenter;", "uniform float u_xCenter;", "uniform vec4 u_color;", "", "void main(void) {", "lowp vec4 color = u_color;", "", "float y = u_height * v_texCoord.y ;", "float x = u_width * v_texCoord.x ;", "float yF = (y - u_yCenter) / u_avgD;", "float xF = (x - u_xCenter) / u_avgD;", "float theta = (xF * xF + yF * yF);", "float factor;", "if(theta > u_dr22+u_daa){", "factor = 0.0;", "}else if(theta > u_dr22){", "factor = (u_dr22+u_daa-theta)/u_daa;", "}else if(theta > u_dr12){", "factor = 1.0;", "}else if(theta > u_dr12-u_daa){", "factor = 1.0-(u_dr12-theta)/u_daa;", "}else{", "factor = 0.0;", "}", "", "factor = factor * factor * u_bA;", "", "color.a = factor;", "", "gl_FragColor = color;", "}"].join("\n"),
						MoaDrawingVertexShader: ["attribute highp vec2 a_position;", "varying highp vec2 v_position;", "", "void main()", "{", "gl_Position = vec4(a_position.x, a_position.y, 0.0, 1.0);", "}", "", ""].join("\n"),
						MoaDrawingFragmentShader: ["precision highp float;", "", "uniform vec4 u_color;", "", "void main()", "{", "vec4 color = u_color;", "gl_FragColor = color;", "}"].join("\n"),
						MoaMultiColorDrawingVertexShader: ["attribute highp vec4 a_color;", "attribute highp vec2 a_position;", "", "varying vec4 v_color;", "", "void main()", "{", "v_color = a_color;", "gl_Position = vec4(a_position.x, a_position.y, 0.0, 1.0);", "}"].join("\n"),
						MoaMultiColorDrawingFragmentShader: ["precision highp float;", "", "varying vec4 v_color;", "", "void main()", "{", "gl_FragColor = v_color;", "}"].join("\n"),
						MoaDrawingLightenBlendModeVertexShader: ["attribute highp vec4 a_strokeGrayLevel;", "attribute highp vec2 a_position;", "attribute highp vec4 a_shade;", "", "varying vec2 v_texCoord;", "varying vec4 v_strokeGrayLevel;", "varying vec4 v_shade;", "", "void main()", "{", "v_strokeGrayLevel = a_strokeGrayLevel;", "v_shade = a_shade;", "v_texCoord = 0.5 * a_position + 0.5;", "gl_Position = vec4(a_position.x, a_position.y, 0.0, 1.0);", "}"].join("\n"),
						MoaDrawingLightenBlendModeFragmentShader: ["precision highp float;", "", "uniform sampler2D u_sampler;", "uniform vec4 u_canvasColor;", "uniform vec4 u_strokeColor;", "", "varying highp vec2 v_texCoord;", "varying highp vec4 v_strokeGrayLevel;", "varying highp vec4 v_shade;", "", "", "void main()", "{", "vec4 v = v_strokeGrayLevel;", "vec4 shadeDraw = v_shade;", "vec4 canvasColor = u_canvasColor;", "vec4 strokeColor = u_strokeColor;", "vec4 imageColor = texture2D(u_sampler, v_texCoord);", "lowp vec4 color;", "", "if (shadeDraw.r >= imageColor.r){", "gl_FragColor = v;", "}", "else{", "gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);", "}", "", "}"].join("\n"),
						MoaLineVertexShader: ["attribute highp vec2 a_position;", "attribute highp vec2 a_imagePos;", "varying highp vec2 v_imagePos;", "", "void main()", "{", "gl_Position = vec4(a_position.x, a_position.y, 0.0, 1.0);", "v_imagePos = a_imagePos;", "}"].join("\n"),
						MoaLineFragmentShader: ["precision highp float;", "", "uniform float u_nHatx;", "uniform float u_nHaty;", "uniform float u_x1;", "uniform float u_y1;", "uniform float u_x2;", "uniform float u_y2;", "uniform float u_r;", "uniform float u_r2;", "uniform float u_dAA;", "uniform float u_bA;", "uniform float u_r2AA;", "uniform vec4 u_color;", "uniform float u_vLength2;", "", "varying highp vec2 v_imagePos;", "", "void main()", "{", "float x = v_imagePos.x;", "float y = v_imagePos.y;", "float dMax;", "float dMin;", "float factor;", "", "//vector math stuff", "float proj = abs(u_nHatx * (x - u_x1) + u_nHaty * (y - u_y1));", "float d1   = (x - u_x1) * (x - u_x1) + (y - u_y1) * (y - u_y1);", "float d2   = (x - u_x2) * (x - u_x2) + (y - u_y2) * (y - u_y2);", "if (d1 < d2) {", "dMax = d2;", "dMin = d1;", "} else {", "dMax = d1;", "dMin = d2;", "}", "", "if (proj > u_r + u_dAA) {	//Is not colinear", "factor = 1.0;", "} else if (dMin + u_vLength2 < dMax) { //is colinear but not in between points", "if (d1 < u_r2 || d2 < u_r2) { //is within circle of one point", "factor = 1.0 - u_bA;", "} else if (d1 < u_r2AA || d2 < u_r2AA) { //is within anti-aliasing", "factor = 1.0 - u_bA + u_bA * (sqrt(dMin) - u_r) / u_dAA;", "} else { //outside", "factor = 1.0;", "}", "} else { //Is colinear and in between points", "if (proj > u_r) {	//within anti-aliasing", "factor = 1.0 - u_bA + u_bA * (proj - u_r) / u_dAA;", "} else { //in line", "factor = 1.0 - u_bA;", "}", "}", "", "vec4 color = u_color;", "if (factor < 0.995) {", "color.a = (1.0 - factor);", "}else{", "color.a = 0.0;", "}", "gl_FragColor = color;", "", "}"].join("\n"),
						MoaBordersVignetteFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_vignetteScale;", "uniform lowp vec4 u_vignetteColor;", "uniform int u_shouldStretch;", "uniform int u_shapeMode;", "uniform float u_dx_2;", "uniform float u_dy_2;", "", "const float cutoff = 1.15;", "const float c4 = 5.0 / 3.0;", "const float c6 = 34.0 / 45.0;", "const float c8 = 13.0 / 63.0;", "const float c10 = 514.0 / 14175.0;", "", "void main(void) {", "lowp vec4 color = u_vignetteColor;", "", "float xDist = u_width * (v_texCoord.x - 0.5 - u_dx_2);", "float yDist = u_height * (v_texCoord.y - 0.5 - u_dy_2);", "", "float denomI = cutoff / (u_vignetteScale * u_vignetteScale);", "", "float theta = 0.0;", "", "if(u_shouldStretch == 0){", "theta = (xDist * xDist + yDist * yDist) * denomI;", "}else{", "theta = (xDist * xDist / u_width / u_width + yDist * yDist / u_height / u_height) * denomI;", "}", "", "if(u_shapeMode == 1){theta *= theta;}", "else if(u_shapeMode == 3){theta *= theta; theta *= theta;}", "else if(u_shapeMode == 2){theta = pow(theta,1.5);}", "", "if(theta < 0.04){", "color.a = 0.0;", "}else if(theta <= cutoff){", "float t2 = theta * theta;", "float t4 = t2 * t2;", "float t6 = t4 * t2;", "float t8 = t6 * t2;", "float factor = 1.0 - 2.0 * t2 + c4 * t4 - c6 * t6 + c8 * t8 - c10 * t8 * t2;", "", "color.a *= 1.0 - factor;", "}", "", "gl_FragColor = color;", "}"].join("\n"),
						MoaBordersVignetteMultiplyFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_vignetteScale;", "uniform lowp vec4 u_vignetteColor;", "uniform int u_shouldStretch;", "uniform int u_shapeMode;", "uniform float u_dx_2;", "uniform float u_dy_2;", "", "", "const float cutoff = 1.15;", "const float c4 = 5.0 / 3.0;", "const float c6 = 34.0 / 45.0;", "const float c8 = 13.0 / 63.0;", "const float c10 = 514.0 / 14175.0;", "", "void main(void) {", "lowp vec4 dst = texture2D(u_sampler, v_texCoord);", "lowp vec4 color = vec4(0,0,0,0);", "", "float xDist = u_width * (v_texCoord.x - 0.5 - u_dx_2);", "float yDist = u_height * (v_texCoord.y - 0.5 - u_dy_2);", "", "float denomI = cutoff / (u_vignetteScale * u_vignetteScale);", "", "float theta = 0.0;", "", "if(u_shouldStretch == 0){", "theta = (xDist * xDist + yDist * yDist) * denomI;", "}else{", "theta = (xDist * xDist / u_width / u_width + yDist * yDist / u_height / u_height) * denomI;", "}", "", "if(u_shapeMode == 1){theta *= theta;}", "else if(u_shapeMode == 3){theta *= theta; theta *= theta;}", "else if(u_shapeMode == 2){theta = pow(theta,1.5);}", "", "float factor = u_vignetteColor.a;", "float factorI = 0.0;", "", "if(theta < 0.04){", "factor = 0.0;", "}else if(theta <= cutoff){", "float t2 = theta * theta;", "float t4 = t2 * t2;", "float t6 = t4 * t2;", "float t8 = t6 * t2;", "float tFactor = 1.0 - 2.0 * t2 + c4 * t4 - c6 * t6 + c8 * t8 - c10 * t8 * t2;", "", "factor = u_vignetteColor.a * (1.0 - tFactor);", "}", "", "factor = clamp(factor,0.0,1.0);", "factorI = 1.0 - factor;", "", "dst.rgb = factorI * dst.rgb + factor * (u_vignetteColor.rgb * dst.rgb);", "dst.a = 1.0;", "", "gl_FragColor = dst;", "}"].join("\n"),
						MoaBordersVignetteOverlayFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_vignetteScale;", "uniform lowp vec4 u_vignetteColor;", "uniform int u_shouldStretch;", "uniform int u_shapeMode;", "uniform float u_dx_2;", "uniform float u_dy_2;", "", "const float cutoff = 1.15;", "const float c4 = 5.0 / 3.0;", "const float c6 = 34.0 / 45.0;", "const float c8 = 13.0 / 63.0;", "const float c10 = 514.0 / 14175.0;", "", "void main(void) {", "lowp vec4 dst = texture2D(u_sampler, v_texCoord);", "lowp vec4 color = vec4(0,0,0,0);", "", "float xDist = u_width * (v_texCoord.x - 0.5 - u_dx_2);", "float yDist = u_height * (v_texCoord.y - 0.5 - u_dy_2);", "", "float denomI = cutoff / (u_vignetteScale * u_vignetteScale);", "", "float theta = 0.0;", "", "if(u_shouldStretch == 0){", "theta = (xDist * xDist + yDist * yDist) * denomI;", "}else{", "theta = (xDist * xDist / u_width / u_width + yDist * yDist / u_height / u_height) * denomI;", "}", "", "if(u_shapeMode == 1){theta *= theta;}", "else if(u_shapeMode == 3){theta *= theta; theta *= theta;}", "else if(u_shapeMode == 2){theta = pow(theta,1.5);}", "", "float factor = u_vignetteColor.a;", "float factorI = 0.0;", "", "if(theta < 0.04){", "factor = 0.0;", "}else if(theta <= cutoff){", "float t2 = theta * theta;", "float t4 = t2 * t2;", "float t6 = t4 * t2;", "float t8 = t6 * t2;", "float tFactor = 1.0 - 2.0 * t2 + c4 * t4 - c6 * t6 + c8 * t8 - c10 * t8 * t2;", "", "factor = u_vignetteColor.a * (1.0 - tFactor);", "}", "", "factor = clamp(factor,0.0,1.0);", "factorI = 1.0 - factor;", "", "vec4 mult = 2.0 * dst * u_vignetteColor;", "vec4 screen = 1.0 - 2.0 * (1.0 - dst) * (1.0 - u_vignetteColor);", "vec4 transition = dst * dst * (2.0 - 4.0 * u_vignetteColor) + dst * (4.0 * u_vignetteColor - 1.0) + (1.0 - 2.0 * u_vignetteColor) / 8.0;", "vec4 blendColor = (1.0 - step(0.25, dst)) * mult + (step(0.25, dst) - step(0.75, dst)) * transition + step(0.75, dst) * screen;", "color = factorI * dst + factor * blendColor;", "", "color.a = 1.0;", "", "gl_FragColor = color;", "}", "", "", ""].join("\n"),
						MoaBordersThetaFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_dw;", "uniform float u_rFactor;", "uniform float u_width;", "uniform float u_height;", "uniform int u_borderStyle;", "uniform lowp vec4 u_borderColor;", "uniform float u_linesScale;", "", "uniform float u_dotScale;", "uniform float u_offsetL;", "uniform float u_offsetR;", "uniform float u_offsetT;", "uniform float u_offsetB;", "", "uniform float u_offsetX;", "uniform float u_offsetY;", "", "float rand(vec2 n)", "{", "return fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);", "}", "", "void main(void) {", "lowp vec4 color = u_borderColor;", "", "float xComp = (v_texCoord.x < 0.5) ? v_texCoord.x * u_width - u_offsetL : u_width - 1.0 - v_texCoord.x * u_width - u_offsetR;", "float yComp = (v_texCoord.y < 0.5) ? v_texCoord.y * u_height - u_offsetT : u_height - 1.0 - v_texCoord.y * u_height - u_offsetB;", "", "float theta = 0.0;", "float factor = 0.0;", "float dots = 0.0;", "float xCompS = 0.0;", "float yCompS = 0.0;", "", "if (yComp < 1.41421356237309504880168872420969808 * u_dw * u_rFactor && xComp < 1.41421356237309504880168872420969808 * u_dw * u_rFactor) {", "theta = 1.41421356237309504880168872420969808*u_dw*u_rFactor - sqrt((yComp - 1.41421356237309504880168872420969808 * u_dw * u_rFactor) * (yComp - 1.41421356237309504880168872420969808 * u_dw * u_rFactor) + (xComp - 1.41421356237309504880168872420969808 * u_dw * u_rFactor) * (xComp - 1.41421356237309504880168872420969808 * u_dw * u_rFactor));", "} else {", "if (yComp < xComp) { theta = yComp; } else { theta = xComp; }", "}", "", "if (yComp < 0.0 || xComp < 0.0) {", "// In this area set to pure border color", "} else if (theta < u_dw) {", "// If within effect scale distance", "if (u_borderStyle == 5) {", "theta = theta < 0.0 ? 0.0 : theta;", "factor = pow(theta / u_dw, 2.0);", "} else if (u_borderStyle == 6) {", "factor = 1.0 - (0.4 * rand(v_texCoord) + 0.6) * 2.0 * pow((1.0 - theta / u_dw), 4.0);", "} else if (u_borderStyle == 16) {", "factor = 1.0 - (0.4 * rand(v_texCoord) + 0.6) * 2.0 * pow((1.0 - theta / u_dw), 4.0);", "} else if (u_borderStyle == 3) {", "factor = 1.0 - 2.0 * pow((1.0 - theta / u_dw), 4.0);", "}", "factor = clamp(factor, 0.0, 1.0);", "color.a = (1.0 - factor);", "}else{", "color.a = 0.0;", "}", "", "gl_FragColor = color;", "}"].join("\n"),
						MoaBorderSideVertexShader: ["attribute highp vec2 a_position;", "attribute float a_alpha;", "varying highp vec2 v_position;", "varying float v_alpha;", "", "void main()", "{", "v_alpha = a_alpha;", "gl_Position = vec4(a_position.x, a_position.y, 0.0, 1.0);", "}", "", ""].join("\n"),
						MoaBorderSideFragmentShader: ["precision highp float;", "", "uniform vec4 u_borderColor;", "", "varying float v_alpha;", "", "void main()", "{", "vec4 color = u_borderColor;", "float alpha = v_alpha;", "alpha = clamp(alpha, 0.0, 0.9999);", "color.a = color.a * alpha;", "gl_FragColor = color;", "}"].join("\n"),
						MoaBordersHardRandFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform sampler2D u_linesSampler;", "uniform float u_height;", "uniform float u_width;", "uniform float u_widthTexCoordMult;", "uniform float u_heightTexCoordMult;", "uniform float u_h2;", "uniform float u_w2;", "uniform float u_offset;", "uniform float u_dw;", "uniform vec4 u_color;", "uniform float u_scale;", "uniform float u_floatMult;", "uniform float u_floatTrans;", "uniform float u_randomSeed;", "", "", "float rand(in vec2 n)", "{", "//                                                   n *= u_randomSeed;", "return fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);", "}", "", "highp float unpackFloatFromVec4i(const vec4 value)", "{", "const vec4 bitSh = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);", "float rawVal = dot(value, bitSh);", "return ((rawVal / u_floatMult) + u_floatTrans);", "}", "", "void main(void) {", "float x = v_texCoord.x * u_width;", "float y = v_texCoord.y * u_height;", "", "// Y tex coords for given lines", "float lineL = 0.125;", "float lineR = 0.375;", "float lineT = 0.625;", "float lineB = 0.875;", "", "float xComp;", "float yComp;", "float theta;", "float factor;", "", "if (y < u_h2) {", "vec2 samplingCoord = vec2(x * u_widthTexCoordMult, lineT);", "vec4 sampledValue = texture2D(u_linesSampler, samplingCoord);", "yComp = y - u_offset - unpackFloatFromVec4i(sampledValue);", "}", "", "else {", "vec2 samplingCoord = vec2(x * u_widthTexCoordMult, lineB);", "yComp = u_height - 1.0 - y - u_offset - unpackFloatFromVec4i(texture2D(u_linesSampler, samplingCoord));", "}", "if (x < u_w2) {", "vec2 samplingCoord = vec2(y * u_heightTexCoordMult, lineL);", "xComp = x - u_offset - unpackFloatFromVec4i(texture2D(u_linesSampler, samplingCoord));", "}else {", "vec2 samplingCoord = vec2(y * u_heightTexCoordMult, lineR);", "xComp = u_width - 1.0 - x - u_offset - unpackFloatFromVec4i(texture2D(u_linesSampler, samplingCoord));", "}", "", "// Set theta to distance to edge with case for rounded edges", "if (yComp < 1.41421356237309504880168872420969808 * u_dw && xComp < 1.41421356237309504880168872420969808 * u_dw) {", "theta = 1.41421356237309504880168872420969808*u_dw - sqrt((yComp - 1.41421356237309504880168872420969808 * u_dw) * (yComp - 1.41421356237309504880168872420969808 * u_dw) + (xComp - 1.41421356237309504880168872420969808 * u_dw) * (xComp - 1.41421356237309504880168872420969808 * u_dw));", "} else {", "if (yComp < xComp) { theta = yComp; } else { theta = xComp; }", "}", "", "vec4 finalColor = u_color;", "if (yComp < 0.0 || xComp < 0.0) {", "", "}", "else if (theta < u_dw) {", "// If within effect scale distance", "factor = 1.0-(0.4*rand(vec2(x,y))+0.6) * 2.0 * pow(1.0 - theta / u_dw, 4.0*u_scale);", "factor = clamp(factor, 0.0, 1.0);", "finalColor.a *= 1.0 - factor;", "}else{", "finalColor.a = 0.0;", "}", "gl_FragColor = finalColor;", "}"].join("\n"),
						MoaGradientFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_scale;", "uniform float u_xCenter;", "uniform float u_yCenter;", "uniform float u_dx_2;", "uniform float u_dy_2;", "uniform float u_denomI;", "uniform float u_alphaBlend;", "uniform int u_shapeMode;", "uniform int u_vignetteShape;", "uniform float u_angleCos;", "uniform float u_angleSin;", "uniform int u_overlayBlendMode; // Only used for linear vignette gradients", "uniform lowp sampler2D u_gradientMap;", "", "const float cutoff = 1.15;", "const float c4 = 5.0 / 3.0;", "const float c6 = 34.0 / 45.0;", "const float c8 = 13.0 / 63.0;", "const float c10 = 514.0 / 14175.0;", "", "void main(void) {", "float xComp = (v_texCoord.x - u_xCenter) / u_scale;", "float yComp = (v_texCoord.y - u_yCenter) / u_scale;", "", "float factor = 0.0;", "float alphaBlend = u_alphaBlend;", "", "if(u_shapeMode == 0){", "factor = u_angleCos * xComp - u_angleSin * yComp;", "}else if(u_shapeMode == 1){", "factor = sqrt(xComp*xComp + yComp*yComp);", "}", "", "factor = clamp(factor, 0.0, 1.0);", "", "vec4 gradientColor = texture2D(u_gradientMap, vec2(0.0, factor));", "gradientColor.a = gradientColor.a * alphaBlend;", "gl_FragColor = gradientColor;", "}"].join("\n"),
						MoaGradientLinearVignetteFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_scale;", "uniform float u_xCenter;", "uniform float u_yCenter;", "uniform float u_dx_2;", "uniform float u_dy_2;", "uniform float u_denomI;", "uniform float u_alphaBlend;", "uniform int u_shapeMode;", "uniform int u_vignetteShape;", "uniform float u_angleCos;", "uniform float u_angleSin;", "uniform int u_overlayBlendMode; // Only used for linear vignette gradients", "uniform lowp sampler2D u_gradientMap;", "", "const float cutoff = 1.15;", "const float c4 = 5.0 / 3.0;", "const float c6 = 34.0 / 45.0;", "const float c8 = 13.0 / 63.0;", "const float c10 = 514.0 / 14175.0;", "", "void main(void) {", "float xComp = (v_texCoord.x - u_xCenter) / u_scale;", "float yComp = (v_texCoord.y - u_yCenter) / u_scale;", "", "float factor = 0.0;", "float alphaBlend = u_alphaBlend;", "", "factor = u_angleCos * xComp - u_angleSin * yComp;", "", "float xDist = u_width * (v_texCoord.x - 0.5 - u_dx_2);", "float yDist = u_height * (v_texCoord.y - 0.5 - u_dy_2);", "", "float theta = u_denomI * (xDist * xDist /  (u_width * u_width) + yDist * yDist /  (u_height * u_height));", "", "if(u_vignetteShape == 1){theta *= theta;}", "else if(u_vignetteShape == 3){theta *= theta; theta *= theta;}", "else if(u_vignetteShape == 2){theta = pow(theta,1.5);}", "", "alphaBlend = u_alphaBlend;", "", "if (theta < 0.04) {", "alphaBlend = 0.0;", "} else if (theta <= cutoff){", "float t2;", "float t4;", "float t6;", "float t8;", "t2 = theta * theta;", "t4 = t2 * t2;", "t6 = t4 * t2;", "t8 = t6 * t2;", "alphaBlend = u_alphaBlend * (1.0 - (1.0 - 2.0 * t2 + c4 * t4 - c6 * t6 + c8 * t8 - c10 * t8 * t2));", "}", "", "factor = clamp(factor, 0.0, 1.0);", "", "vec4 gradientColor = texture2D(u_gradientMap, vec2(0.0, factor));", "", "if(u_overlayBlendMode == 1){", "vec4 imageColor = texture2D(u_sampler, v_texCoord);", "alphaBlend *= gradientColor.a;", "", "vec4 mult = 2.0 * imageColor * gradientColor;", "vec4 screen = 1.0 - 2.0 * (1.0 - imageColor) * (1.0 - gradientColor);", "vec4 transition = imageColor * imageColor * (2.0 - 4.0 * gradientColor) + imageColor * (4.0 * gradientColor - 1.0) + (1.0 - 2.0 * gradientColor) / 8.0;", "vec4 blendColor = (1.0 - step(0.25, imageColor)) * mult + (step(0.25, imageColor) - step(0.75, imageColor)) * transition + step(0.75, imageColor) * screen;", "", "gl_FragColor = vec4(mix(imageColor.rgb, blendColor.rgb, alphaBlend),imageColor.a);", "}else{", "gradientColor.a = gradientColor.a * alphaBlend;", "gl_FragColor = gradientColor;", "}", "}"].join("\n"),
						MoaGradientOverlayFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_scale;", "uniform float u_xCenter;", "uniform float u_yCenter;", "uniform float u_dx_2;", "uniform float u_dy_2;", "uniform float u_denomI;", "uniform float u_alphaBlend;", "uniform int u_shapeMode;", "uniform int u_vignetteShape;", "uniform float u_angleCos;", "uniform float u_angleSin;", "uniform int u_overlayBlendMode; // Only used for linear vignette gradients", "uniform lowp sampler2D u_gradientMap;", "", "const float cutoff = 1.15;", "const float c4 = 5.0 / 3.0;", "const float c6 = 34.0 / 45.0;", "const float c8 = 13.0 / 63.0;", "const float c10 = 514.0 / 14175.0;", "", "void main(void) {", "lowp vec4 dst = texture2D(u_sampler, v_texCoord);", "", "float xComp = (v_texCoord.x - u_xCenter) / u_scale;", "float yComp = (v_texCoord.y - u_yCenter) / u_scale;", "", "float factor = 0.0;", "float alphaBlend = u_alphaBlend;", "", "if(u_shapeMode == 0){", "factor = u_angleCos * xComp - u_angleSin * yComp;", "}else if(u_shapeMode == 1){", "factor = sqrt(xComp*xComp + yComp*yComp);", "}", "", "factor = clamp(factor, 0.0, 1.0);", "", "vec4 gradientColor = texture2D(u_gradientMap, vec2(0.0, factor));", "alphaBlend = gradientColor.a * alphaBlend;", "", "factor = clamp(alphaBlend,0.0,1.0);", "float factorI = 1.0 - factor;", "", "vec4 mult = 2.0 * dst * gradientColor;", "vec4 screen = 1.0 - 2.0 * (1.0 - dst) * (1.0 - gradientColor);", "vec4 transition = dst * dst * (2.0 - 4.0 * gradientColor) + dst * (4.0 * gradientColor - 1.0) + (1.0 - 2.0 * gradientColor) / 8.0;", "vec4 blendColor = (1.0 - step(0.25, dst)) * mult + (step(0.25, dst) - step(0.75, dst)) * transition + step(0.75, dst) * screen;", "", "dst = factorI * dst + factor * blendColor;", "dst.a = 1.0;", "", "gl_FragColor = dst;", "}"].join("\n"),
						MoaSketchVertexShader: ["attribute highp vec4 a_color;", "attribute highp vec2 a_position;", "", "varying vec4 v_color;", "", "void main()", "{", "v_color = a_color;", "gl_Position = vec4(a_position.x, a_position.y, 0.0, 1.0);", "}", "", ""].join("\n"),
						MoaSketchFragmentShader: ["precision highp float;", "", "varying vec4 v_color;", "", "void main()", "{", "gl_FragColor = v_color;", "}"].join("\n"),
						MoaAutoEnhanceFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform lowp sampler2D u_mapFactorSampler;", "uniform float u_gain;", "uniform float u_rScale;", "uniform float u_gScale;", "uniform float u_bScale;", "uniform float u_rMin;", "uniform float u_gMin;", "uniform float u_bMin;", "uniform float u_floatMult;", "uniform float u_floatTrans;", "", "highp float unpackFloatFromVec4i(const vec4 value)", "{", "const vec4 bitSh = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);", "float rawVal = dot(value, bitSh);", "return ((rawVal / u_floatMult) + u_floatTrans);", "}", "", "void main(void) {", "lowp vec4 color = texture2D(u_sampler, v_texCoord);", "", "float r = color.r;", "float g = color.g;", "float b = color.b;", "", "float lum = 0.213*r+0.715*g+0.072*b;", "", "float factor = unpackFloatFromVec4i(texture2D(u_mapFactorSampler, vec2(lum, 0)));", "", "float gNew = factor*g;", "", "r = (r+(r*factor-r)*u_gain + (gNew - g)*(1.0-u_gain)-u_rMin)*u_rScale;", "b = (b+(b*factor-b)*u_gain + (gNew - g)*(1.0-u_gain)-u_bMin)*u_bScale;", "g = (gNew-u_gMin)*u_gScale;", "", "color.r = r;", "color.g = g;", "color.b = b;", "", "gl_FragColor = color;", "}"].join("\n"),
						MoaLABToRGBFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_scaleA;", "uniform float u_scaleB;", "", "void main(void) {", "highp vec4 color = texture2D(u_sampler, v_texCoord);", "", "float lab0 = color.r * 255.0;", "float lab1 = color.g * u_scaleA * 255.0;", "float lab2 = color.b * u_scaleB * 255.0;", "", "float Y = ( lab0/2.55 + 16.0) / 116.0;", "float X = (lab1-127.0) / 500.0 + Y;", "float Z = Y - (lab2-127.0) / 200.0;", "", "float Y3 = Y*Y*Y;", "float X3 = X*X*X;", "float Z3 = Z*Z*Z;", "", "if ( Y3 > 0.008856 ){ Y = Y3;}else{Y = ( Y - 16.0 / 116.0 ) / 7.787;}", "", "if ( X3 > 0.008856 ){ X = X3;}else{X = ( X - 16.0 / 116.0 ) / 7.787;}", "", "if ( Z3 > 0.008856 ){ Z = Z3;}else{Z = ( Z - 16.0 / 116.0 ) / 7.787;}", "", "X = .95047  * X;", "Y = 1.00000 * Y;", "Z = 1.08883 * Z;", "", "float R = X *  3.2406 + Y * -1.5372 + Z * -0.4986;", "float G = X * -0.9689 + Y *  1.8758 + Z *  0.0415;", "float B = X *  0.0557 + Y * -0.2040 + Z *  1.0570;", "", "if ( R > 0.0031308 ) {R = 1.055 * ( pow(R , ( 0.41666666666667 )) ) - 0.055;}else{ R = 12.92 * R;}", "if ( G > 0.0031308 ) {G = 1.055 * ( pow(G , ( 0.41666666666667 )) ) - 0.055;}else{ G = 12.92 * G;}", "if ( B > 0.0031308 ) {B = 1.055 * ( pow(B , ( 0.41666666666667 )) ) - 0.055;}else{ B = 12.92 * B;}", "", "", "color.r = R; color.g = G; color.b = B;", "gl_FragColor = color;", "}"].join("\n"),
						MoaRGBToLABFragmentShader: ["precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "", "void main(void) {", "highp vec4 color = texture2D(u_sampler, v_texCoord);", "", "float R = color.r * 255.0;", "float G = color.g * 255.0;", "float B = color.b * 255.0;", "", "float l1;", "float a1;", "float b1;", "float r;", "float g;", "float b;", "float x;", "float y;", "float z;", "", "if(R/255.0 <= 0.04045){r = 100.0 *R/255.0/12.92;} else{ r = 100.0*pow((R/255.0+0.055)/1.055,2.40);}", "if(G/255.0 <= 0.04045){g = 100.0 *G/255.0/12.92;} else{ g = 100.0*pow((G/255.0+0.055)/1.055,2.40);}", "if(B/255.0 <= 0.04045){b = 100.0 *B/255.0/12.92;} else{ b = 100.0*pow((B/255.0+0.055)/1.055,2.40);}", "", "x = 0.00433891*r  + 0.00376234915*g + 0.0018990604648*b;", "y = 0.002126*r    + 0.007152*g      + 0.000722*b;", "z = 0.000177255*r + 0.00109475308*g + 0.0087295537*b;", "", "if(x > 0.008856){x = pow(x,1.0/3.0);}else{x = 7.787*x+16.0/116.0;}", "if(y > 0.008856){y = pow(y,1.0/3.0);}else{y = 7.787*y+16.0/116.0;}", "if(z > 0.008856){z = pow(z,1.0/3.0);}else{z = 7.787*z+16.0/116.0;}", "", "l1 = 116.0*y-16.0;", "a1 = 500.0*(x-y);", "b1 = 200.0*(y-z);", "", "color.r = l1 * 2.55 / 255.0; color.g = (a1+127.0) / 255.0; color.b = (b1+127.0) / 255.0;", "gl_FragColor = color;", "}"].join("\n"),
						MoaTwitterGrittyDotsFragmentShader: ["", "precision highp float;", "", "varying highp vec2 v_texCoord;", "", "uniform float u_width;", "uniform float u_height;", "uniform float u_alpha;", "", "int modi(int x,int y){", "return x - y * (x / y);", "}", "", "void main(void) {", "", "// get coords", "int xCoord = int(v_texCoord.x * u_width);", "int yCoord = int(v_texCoord.y * u_height);", "", "lowp vec4 color = vec4(0,0,0,0);", "", "if(modi(yCoord,2) == 0 && modi((xCoord + modi(yCoord,4)),4) == 0){", "color = vec4(1.0,1.0,1.0,u_alpha);", "}", "", "", "gl_FragColor = color;", "}"].join("\n"),
						MoaTwitterPhotoshopSatBWShader: ["", "precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_transitionWidth;", "uniform float u_regionWidth;", "uniform float u_weights[6];", "uniform int u_saturationMode;", "uniform float u_alpha;", "", "int modi(int x,int y){", "return x - y * (x / y);", "}", "", "void main(void) {", "lowp vec4 color = texture2D(u_sampler, v_texCoord);", "", "// Can't index uniform arrays with non constant integral expressions....ugh", "float weights[6];", "weights[0] = u_weights[0];", "weights[1] = u_weights[1];", "weights[2] = u_weights[2];", "weights[3] = u_weights[3];", "weights[4] = u_weights[4];", "weights[5] = u_weights[5];", "", "", "// Get Color Components", "", "float components[6];", "", "components[0] = color.r;", "components[2] = color.g;", "components[4] = color.b;", "components[1] = (color.r + color.g) / 2.0;", "components[3] = (color.g + color.b) / 2.0;", "components[5] = (color.r + color.b) / 2.0;", "", "// Get H,S,V colors", "float r;", "float g;", "float b;", "float delta;", "float hue;", "float maxColor;", "float minColor;", "", "r = color.r;", "g = color.g;", "b = color.b;", "", "maxColor = max(max(r,g), b);", "minColor = min(min(r,g), b);", "", "delta = maxColor - minColor;", "", "if(maxColor == 0.0 || delta == 0.0){", "hue = 0.0;", "}else{", "if( r == maxColor ){", "hue = ( g - b ) / delta;		// between yellow & magenta", "}else if( g == maxColor ){", "hue = 2.0 + ( b - r ) / delta;	// between cyan & yellow", "}else{", "hue = 4.0 + ( r - g ) / delta;	// between magenta & cyan", "}", "", "hue *= 60.0;				// degrees", "if( hue < 0.0 ){", "hue += 360.0;", "}", "}", "", "// End hue", "", "float v;", "int hex;", "float start;", "float end;", "float w1;", "float w2;", "float w3;", "float weight;", "", "hex = modi(int(((hue + 30.0) / 60.0)), 6);", "v = 0.0;", "", "", "w1 = 0.0; w3 = 0.0;", "if(hex == 0){", "start = 330.0;", "end = 30.0;", "", "if(hue > end && hue < start + u_transitionWidth){", "w1 = 0.5*(start + u_transitionWidth - hue) / u_transitionWidth;", "}else if(hue < start && hue > end - u_transitionWidth){", "w3 = 0.5*(hue - (end - u_transitionWidth)) / u_transitionWidth;", "}", "", "}else{", "start = float(hex) * u_regionWidth - u_regionWidth/2.0;", "end   = start + u_regionWidth;", "", "if(hue < start + u_transitionWidth){", "w1 = 0.5*(start + u_transitionWidth - hue) / u_transitionWidth;", "}else if(hue > end - u_transitionWidth){", "w3 = 0.5*(hue - (end - u_transitionWidth)) / u_transitionWidth;", "}", "}", "", "w2 = 1.0 - w1 - w3;", "", "int hex5Mod = modi(hex+5,6);", "int hexMod = modi(hex,6);", "int hex1Mod = modi(hex+1,6);", "", "", "weight = 	weights[hex5Mod]*w1 +", "weights[hexMod]*w2 +", "weights[hex1Mod]*w3;", "", "v = 		weights[hex5Mod]*w1*components[hex5Mod] +", "weights[hexMod]*w2*components[hexMod] +", "weights[hex1Mod]*w3*components[hex1Mod];", "", "v += (1.0-weight) * min(min(r,g),b);", "", "if(u_saturationMode==0){", "weight = -1.0;", "}else{", "//Lower weight low brightness pixels", "weight *= pow(v,0.3);", "}", "", "r = (0.0-weight)*v + (weight+1.0)*r;", "g = (0.0-weight)*v + (weight+1.0)*g;", "b = (0.0-weight)*v + (weight+1.0)*b;", "", "color.r = mix(color.r, r, u_alpha);", "color.g = mix(color.g, g, u_alpha);", "color.b = mix(color.b, b, u_alpha);", "", "gl_FragColor = color;", "}", ""].join("\n"),
						MoaTwitterPhotoshopSatBWOverlayShader: ["", "precision highp float;", "", "uniform lowp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform float u_transitionWidth;", "uniform float u_regionWidth;", "uniform float u_weights[6];", "uniform int u_saturationMode;", "uniform float u_alpha;", "", "int modi(int x,int y){", "return x - y * (x / y);", "}", "", "void main(void) {", "lowp vec4 color = texture2D(u_sampler, v_texCoord);", "", "// Can't index uniform arrays with non constant integral expressions....ugh", "float weights[6];", "weights[0] = u_weights[0];", "weights[1] = u_weights[1];", "weights[2] = u_weights[2];", "weights[3] = u_weights[3];", "weights[4] = u_weights[4];", "weights[5] = u_weights[5];", "", "", "// Get Color Components", "", "float components[6];", "", "components[0] = color.r;", "components[2] = color.g;", "components[4] = color.b;", "components[1] = (color.r + color.g) / 2.0;", "components[3] = (color.g + color.b) / 2.0;", "components[5] = (color.r + color.b) / 2.0;", "", "// Get H,S,V colors", "float r;", "float g;", "float b;", "float delta;", "float hue;", "float maxColor;", "float minColor;", "", "r = color.r;", "g = color.g;", "b = color.b;", "", "maxColor = max(max(r,g), b);", "minColor = min(min(r,g), b);", "", "delta = maxColor - minColor;", "", "if(maxColor == 0.0 || delta == 0.0){", "hue = 0.0;", "}else{", "if( r == maxColor ){", "hue = ( g - b ) / delta;		// between yellow & magenta", "}else if( g == maxColor ){", "hue = 2.0 + ( b - r ) / delta;	// between cyan & yellow", "}else{", "hue = 4.0 + ( r - g ) / delta;	// between magenta & cyan", "}", "", "hue *= 60.0;				// degrees", "if( hue < 0.0 ){", "hue += 360.0;", "}", "}", "", "// End hue", "", "float v;", "int hex;", "float start;", "float end;", "float w1;", "float w2;", "float w3;", "float weight;", "", "hex = modi(int(((hue + 30.0) / 60.0)), 6);", "v = 0.0;", "", "", "w1 = 0.0; w3 = 0.0;", "if(hex == 0){", "start = 330.0;", "end = 30.0;", "", "if(hue > end && hue < start + u_transitionWidth){", "w1 = 0.5*(start + u_transitionWidth - hue) / u_transitionWidth;", "}else if(hue < start && hue > end - u_transitionWidth){", "w3 = 0.5*(hue - (end - u_transitionWidth)) / u_transitionWidth;", "}", "", "}else{", "start = float(hex) * u_regionWidth - u_regionWidth/2.0;", "end   = start + u_regionWidth;", "", "if(hue < start + u_transitionWidth){", "w1 = 0.5*(start + u_transitionWidth - hue) / u_transitionWidth;", "}else if(hue > end - u_transitionWidth){", "w3 = 0.5*(hue - (end - u_transitionWidth)) / u_transitionWidth;", "}", "}", "", "w2 = 1.0 - w1 - w3;", "", "int hex5Mod = modi(hex+5,6);", "int hexMod = modi(hex,6);", "int hex1Mod = modi(hex+1,6);", "", "", "weight = 	weights[hex5Mod]*w1 +", "weights[hexMod]*w2 +", "weights[hex1Mod]*w3;", "", "v = 		weights[hex5Mod]*w1*components[hex5Mod] +", "weights[hexMod]*w2*components[hexMod] +", "weights[hex1Mod]*w3*components[hex1Mod];", "", "v += (1.0-weight) * min(min(r,g),b);", "", "if(u_saturationMode==0){", "weight = -1.0;", "}else{", "//Lower weight low brightness pixels", "weight *= pow(v,0.3);", "}", "", "r = (0.0-weight)*v + (weight+1.0)*r;", "g = (0.0-weight)*v + (weight+1.0)*g;", "b = (0.0-weight)*v + (weight+1.0)*b;", "", "float factor = clamp(u_alpha, 0.0, 1.0);", "float factorI = 1.0-factor;", "", "if (color.r <= 0.5) {", "color.r = factorI * color.r + factor * 2.0 * color.r * r;", "} else {", "color.r = factorI * color.r + factor * (1.0 - (1.0 - color.r) * (1.0 - r) / 0.5);", "}", "if (color.g <= 0.5) {", "color.g = factorI * color.g + factor * 2.0 * color.g * g;", "} else {", "color.g = factorI * color.g + factor * (1.0 - (1.0 - color.g) * (1.0 - g) / 0.5);", "}", "if (color.b <= 0.5) {", "color.b = factorI * color.b + factor * 2.0 * color.b * b;", "} else {", "color.b = factorI * color.b + factor * (1.0 - (1.0 - color.b) * (1.0 - b) / 0.5);", "}", "", "", "gl_FragColor = color;", "}", ""].join("\n"),
						MoaTwitterClarityFragmentShader: ["precision highp float;", "", "uniform highp sampler2D u_sampler;", "varying highp vec2 v_texCoord;", "", "uniform highp sampler2D u_avgImgSampler;", "uniform highp sampler2D u_effectedAvgImgSampler;", "uniform float u_gain;", "uniform float u_sharpenAmount;", "", "const float lowestColorVal = 1.0/255.0;", "", "void main(void) {", "highp vec4 color = texture2D(u_sampler, v_texCoord);", "", "// Might want to encode these into floats;", "float avgGray = texture2D(u_avgImgSampler, v_texCoord).r;", "float avgHistGray = texture2D(u_effectedAvgImgSampler, v_texCoord).r;", "", "// Get factor and diff", "float factor = avgHistGray / clamp(avgGray, lowestColorVal, 1.0);", "float diff = avgHistGray - avgGray;", "", "// Do wonderful things to the color.", "float sharpenedVal = u_sharpenAmount * ((0.2 * color.r + 0.7 * color.g + 0.1 * color.b) - avgGray);", "", "color.rgb += sharpenedVal;", "", "color.rgb = color.rgb * (factor * u_gain) + (1.0 - u_gain) * (color.rgb + diff);", "", "gl_FragColor = color;", "}"].join("\n"),
						MoaDisplayTransparencyFragmentShader: ["", "precision mediump float;", "", "uniform sampler2D u_sampler;", "uniform vec2 u_textureSize;", "", "varying vec2 v_texCoord;", "", "void main() {", "", "vec4 src = texture2D(u_sampler, v_texCoord);", "", "vec4 bg = vec4(0.0,0.0,0.0,1.0);", "", "if(mod(floor(v_texCoord.x * 100.0) + floor(v_texCoord.y * 100.0), 2.0) > 0.5){", "bg = vec4(1.0);", "}", "", "//Get rid of alpha in blue channel", "", "// float alpha = fract(src.b*64.0)/255.0 + src.a;", "", "float alpha = mod(floor(src.b*255.0+0.5),4.0)/4.0/255.0 + src.a;", "", "src.b = floor(floor(src.b*255.0*4.0+0.5))/4.0/255.0;", "", "vec4 displayColor = alpha*src+(1.0-alpha)*bg;", "", "gl_FragColor = vec4(displayColor.rgb,1.0);", "}", "", ""].join("\n"),
						MoaShapeMaskFragmentShader: ["", "precision highp float;", "", "vec3 mod289(vec3 x) {", "return x - floor(x * (1.0 / 289.0)) * 289.0;", "}", "", "vec2 mod289(vec2 x) {", "return x - floor(x * (1.0 / 289.0)) * 289.0;", "}", "", "vec3 permute(vec3 x) {", "return mod289(((x*34.0)+1.0)*x);", "}", "", "float snoise(vec2 v)", "{", "const vec4 C = vec4(0.211324865405187,  // (3.0-sqrt(3.0))/6.0", "0.366025403784439,  // 0.5*(sqrt(3.0)-1.0)", "-0.577350269189626,  // -1.0 + 2.0 * C.x", "0.024390243902439); // 1.0 / 41.0", "", "// First corner", "vec2 i  = floor(v + dot(v, C.yy) );", "vec2 x0 = v -   i + dot(i, C.xx);", "", "// Other corners", "vec2 i1;", "//i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0", "//i1.y = 1.0 - i1.x;", "i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);", "// x0 = x0 - 0.0 + 0.0 * C.xx ;", "// x1 = x0 - i1 + 1.0 * C.xx ;", "// x2 = x0 - 1.0 + 2.0 * C.xx ;", "vec4 x12 = x0.xyxy + C.xxzz;", "x12.xy -= i1;", "", "// Permutations", "i = mod289(i); // Avoid truncation effects in permutation", "vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))", "+ i.x + vec3(0.0, i1.x, 1.0 ));", "", "vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);", "m = m*m ;", "m = m*m ;", "", "// Gradients: 41 points uniformly over a line, mapped onto a diamond.", "// The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)", "", "vec3 x = 2.0 * fract(p * C.www) - 1.0;", "vec3 h = abs(x) - 0.5;", "vec3 ox = floor(x + 0.5);", "vec3 a0 = x - ox;", "", "// Normalise gradients implicitly by scaling m", "// Approximation of: m *= inversesqrt( a0*a0 + h*h );", "m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );", "", "// Compute final noise value at P", "vec3 g;", "g.x  = a0.x  * x0.x  + h.x  * x0.y;", "g.yz = a0.yz * x12.xz + h.yz * x12.yw;", "return 130.0 * dot(m, g);", "}", "", "// Cellular noise, returning F1 and F2 in a vec2.", "// Standard 3x3 search window for good F1 and F2 values", "vec2 cellular(vec2 P) {", "#define K 0.142857142857 // 1/7", "#define Ko 0.428571428571 // 3/7", "#define jitter 1.0 // Less gives more regular pattern", "vec2 Pi = mod(floor(P), 289.0);", "vec2 Pf = fract(P);", "vec3 oi = vec3(-1.0, 0.0, 1.0);", "vec3 of = vec3(-0.5, 0.5, 1.5);", "vec3 px = permute(Pi.x + oi);", "vec3 p = permute(px.x + Pi.y + oi); // p11, p12, p13", "vec3 ox = fract(p*K) - Ko;", "vec3 oy = mod(floor(p*K),7.0)*K - Ko;", "vec3 dx = Pf.x + 0.5 + jitter*ox;", "vec3 dy = Pf.y - of + jitter*oy;", "vec3 d1 = dx * dx + dy * dy; // d11, d12 and d13, squared", "p = permute(px.y + Pi.y + oi); // p21, p22, p23", "ox = fract(p*K) - Ko;", "oy = mod(floor(p*K),7.0)*K - Ko;", "dx = Pf.x - 0.5 + jitter*ox;", "dy = Pf.y - of + jitter*oy;", "vec3 d2 = dx * dx + dy * dy; // d21, d22 and d23, squared", "p = permute(px.z + Pi.y + oi); // p31, p32, p33", "ox = fract(p*K) - Ko;", "oy = mod(floor(p*K),7.0)*K - Ko;", "dx = Pf.x - 1.5 + jitter*ox;", "dy = Pf.y - of + jitter*oy;", "vec3 d3 = dx * dx + dy * dy; // d31, d32 and d33, squared", "// Sort out the two smallest distances (F1, F2)", "vec3 d1a = min(d1, d2);", "d2 = max(d1, d2); // Swap to keep candidates for F2", "d2 = min(d2, d3); // neither F1 nor F2 are now in d3", "d1 = min(d1a, d2); // F1 is now in d1", "d2 = max(d1a, d2); // Swap to keep candidates for F2", "d1.xy = (d1.x < d1.y) ? d1.xy : d1.yx; // Swap if smaller", "d1.xz = (d1.x < d1.z) ? d1.xz : d1.zx; // F1 is in d1.x", "d1.yz = min(d1.yz, d2.yz); // F2 is now not in d2.yz", "d1.y = min(d1.y, d1.z); // nor in  d1.z", "d1.y = min(d1.y, d2.x); // F2 is in d1.y, we're done.", "return sqrt(d1.xy);", "}", "", "float noiseMultiscale(vec2 v_texCoord, float octaves, float seed){", "", "float scale = 1.0;", "float scaleinv = 1.0;", "float sumNoise = 0.0;", "float noise;", "", "for(int i = 0; i < 6; i++){", "noise = snoise((2.0*(v_texCoord+seed+5.0)-1.0)*scale);", "sumNoise += noise*scaleinv;", "scale *= 2.0;", "scaleinv *= 0.5;", "seed += 137.0;", "}", "", "return sumNoise*0.5;", "}", "", "float noiseMultiscaleAbs(vec2 v_texCoord, float octaves, float seed){", "", "float scale = 1.0;", "float scaleinv = 1.0;", "float sumNoise = 0.0;", "float noise;", "", "for(int i = 0; i < 6; i++){", "noise = snoise((2.0*(v_texCoord+seed+5.0)-1.0)*scale);", "sumNoise += abs(noise*scaleinv);", "scale *= 2.0;", "scaleinv *= 0.5;", "seed += 137.0;", "}", "", "return sumNoise*0.5;", "}", "// our texture", "uniform sampler2D u_gradientMap;", "uniform sampler2D u_sampler;", "uniform int u_compositeMode;", "uniform int u_noiseType;", "uniform int u_aspectMode;", "", "uniform int u_invert; //TODO change to bool", "uniform int u_maskOnly; //TODO change to bool", "", "uniform mat4 u_params;", "uniform mat4 u_transform;", "", "uniform float u_width;", "uniform float u_height;", "", "// the texCoords passed in from the vertex shader.", "varying vec2 v_texCoord;", "", "float cellPaintNoise(vec2 coords){", "vec2 F = cellular(coords);", "float noise = noiseMultiscale(F, 5.0, 123.0);", "noise = noise*0.5+0.5; //convert to [0,1]", "", "return noise;", "}", "", "float perlinNoise(vec2 coords){", "float noise = noiseMultiscale(coords, 5.0, 123.0);", "noise = noise*0.5+0.5; //convert to [0,1]", "", "return noise;", "}", "", "float perlinNoiseAbs(vec2 coords){", "float noise = noiseMultiscaleAbs(coords, 5.0, 123.0);", "// noise = noise*0.5+0.5; //convert to [0,1]", "", "return noise;", "}", "", "float marbleNoise(vec2 coords){", "", "float xyValue = coords.x + coords.y + noiseMultiscale(coords, 5.0, 123.0);", "float noise = abs(sin(xyValue * 3.14159));", "", "return noise;", "}", "", "void main() {", "", "vec2 texCoordsTmp = v_texCoord;", "", "if(u_aspectMode == MOA_ASPECT_MODE_STRETCH){", "//Nothing, alread in stretch mode implicitly", "}else if(u_aspectMode == MOA_ASPECT_MODE_AVERAGE){", "float avgD = (u_width+u_height)/2.0;", "", "texCoordsTmp -= 0.5;", "texCoordsTmp.x *= u_width / avgD;", "texCoordsTmp.y *= u_height / avgD;", "texCoordsTmp += 0.5;", "", "}else if(u_aspectMode == MOA_ASPECT_MODE_MAX){", "float maxD = max(u_width,u_height);", "", "texCoordsTmp -= 0.5;", "texCoordsTmp.x *= u_width / maxD;", "texCoordsTmp.y *= u_height / maxD;", "texCoordsTmp += 0.5;", "", "}else if(u_aspectMode == MOA_ASPECT_MODE_MIN){", "float minD = min(u_width,u_height);", "", "texCoordsTmp -= 0.5;", "texCoordsTmp.x *= u_width / minD;", "texCoordsTmp.y *= u_height / minD;", "texCoordsTmp += 0.5;", "}", "", "vec4 transformed = (vec4(texCoordsTmp,0.0,1.0) * u_transform);", "", "//TODO: figure out 3d projection", "//vec2 transformedSpace = transformed.xy;// / (transformed.z/1.0+1.0);", "vec2 coords = (transformed.xy-0.5);", "", "float noise = 0.0;", "", "if(u_noiseType == 0){", "noise = perlinNoise(coords);", "}else if(u_noiseType == 1){", "vec2 F = cellular(coords);", "noise = u_params[0].z * dot(u_params[0].xy,F) / (u_params[0].x+u_params[0].y);", "}else if(u_noiseType == 2){", "noise = cellPaintNoise(coords);", "}else if(u_noiseType == 3){", "noise = marbleNoise(coords);", "}else if(u_noiseType == 4){", "noise = perlinNoiseAbs(coords);", "}else if(u_noiseType == 5){", "noise = 0.0;", "}else if(u_noiseType == 6){", "noise = 0.5+0.5*sin(coords.x+coords.y);", "}else if(u_noiseType == 7){", "noise = 0.5+0.5*sin(coords.x+2.0*(u_params[0].x)*sin(coords.y));", "}else if(u_noiseType == 8){", "noise = 0.5 + 0.5*coords.x;", "}else if(u_noiseType == 9){", "// noise = pow(abs(cos(sqrt(pow(coords.x,2.0)+pow(coords.y,2.0)))),4.0);", "", "float metric = u_params[0].x;", "noise = pow(pow(abs(coords.x),metric)+pow(abs(coords.y),metric),1.0/metric);", "}else if(u_noiseType == 10){", "// noise = pow(abs(cos(sqrt(pow(coords.x,2.0)+pow(coords.y,2.0)))),4.0);", "", "float metric = u_params[0].x;", "float x = pow(abs(pow(coords.x,metric))+abs(pow(coords.y,metric)),1.0/metric);", "", "if(x == 0.0){", "noise = 1.0;", "}else{", "noise = (cos(x)/x);", "}", "}else if(u_noiseType == 11){", "float xF = coords.x;", "float yF = coords.y;", "float expV   = (u_params[0].x*((yF-u_params[0].z)*(yF-u_params[0].z)+(xF-u_params[0].w)*(xF-u_params[0].w))+u_params[0].y*(yF-u_params[1].x)*(yF-u_params[1].x)*(xF-u_params[1].y)*(xF-u_params[1].y));", "// float expV   = (-(xF*xF+yF*yF)*2.0-16.0*(yF+1.0)*(yF+1.0)*(xF-0.5)*(xF-0.5));", "noise = exp(expV);", "}", "//else if(u_noiseType == 12){", "//   float x = 0.0;", "//   float y = 0.0;", "", "//   const float max_iteration = 200.0;", "//   float iterationF = 0.0;", "", "//   for(float iteration = 0.0; iteration < max_iteration; iteration+=1.0){", "//     if(x*x + y*y >= 2.0*2.0 || iteration > u_params[0].x){", "//       break;", "//     }else{", "//       iterationF = iteration;", "//     }", "", "//     float xtemp = x*x - y*y + coords.x;", "//     y = 2.0*x*y + coords.y;", "", "//     x = xtemp;", "//   }", "", "//   noise = (coords.x+coords.y)*iterationF / max_iteration;", "", "// }else if(u_noiseType == 13){", "//   float x = coords.x;", "//   float y = coords.y;", "", "//   float x2 = x*x;", "//   float y2 = y*y;", "", "//   const float max_iteration = 200.0;", "//   float iterationF = 0.0;", "", "//   for(float iteration = 0.0; iteration < max_iteration; iteration+=1.0){", "//     if(x2 + y2 >= 2.0*2.0 || iteration > u_params[0].x){break;}else{iterationF = iteration;}", "", "//     y = 2.0*x*y + u_params[0].y;", "//     x = x2 - y2 + u_params[0].z;", "", "//     x2 = x*x;", "//     y2 = y*y;", "//   }", "", "//   noise = iterationF / u_params[0].x;", "// }", "else if(u_noiseType == 14){", "noise = 1.0;", "}", "", "noise = clamp(noise,0.0,1.0);", "", "vec4 dst = vec4(1.0);", "if(u_maskOnly == 1){", "noise = texture2D(u_gradientMap, vec2(0,noise)).a;", "", "if(u_invert == 1){", "noise = 1.0 - noise;", "}", "", "dst.a = floor(noise*255.0)/255.0; //[0,1]  8 most significant bits", "dst.b = fract(noise*255.0); //[0,1) remainder", "}else{", "float alphaMask = texture2D(u_sampler, v_texCoord).a;", "", "if(u_invert == 1){", "noise = 1.0 - noise;", "}", "", "dst = texture2D(u_gradientMap, vec2(0,noise));", "dst.a *= alphaMask; //Assumes previous was mask only", "}", "", "", "gl_FragColor = dst;//blendColor*src.a + dst*(1.0-src.a);", "", "}", "", ""].join("\n")
					};
					if ("function" != typeof a) var a = function(e) {
						e || (e = []);
						for (var t, r = {}, o = 0; o < e.length; o++) t = e[o], t && t.length && 2 == t.length && (r[t[0]] = t[1]);
						return {
							get: function(e) {
								return r[e]
							}
						}
					};
					var i = e("../../../src/js/processors/MoaColorConversion.js"),
						n = e("../../../src/js/core/MoaBitmap"),
						s = e("../../../src/js/core/rng"),
						l = e("../../../src/js/core/MoaColor.js"),
						u = e("../../../src/js/processors/MoaHistogram.js"),
						h = e("../../../src/js/core/MoaAllocAndCopy"),
						d = e("../../../src/js/interactive/MoaRegionInfo"),
						c = e("../../../src/js/processors/MoaSharpen"),
						f = e("../../../src/js/core/MoaTransform"),
						m = 16,
						p = {
							OVERWRITE_ORIGINAL: 0,
							DEFAULT: 1,
							READ_SOURCE_WRITE_NONE: 2,
							READ_LAST_WRITE_NONE: 3,
							READ_LAST_WRITE_TARGET: 4
						},
						g = {
							NONE: 0,
							NORMAL: 1,
							OVERLAY: 2,
							PREMULTIPLIED_ALPHA: 3,
							DRAW_OVER: 4,
							DRAW_BEHIND: 5,
							NONE_DONT_CLEAR: 6
						},
						v = {
							TRIANGLE_FAN: "fan",
							TRIANGLE_STRIP: "strip"
						},
						_ = ["normal", "soft", "overlay", "multiply", "screen", "darken", "lighten", "difference", "negation", "exclusion", "hard"],
						x = ["red", "green", "blue", "interpolation", "colordodge", "invcolordodge", "softdodge", "colorburn", "invcolorburn", "softburn", "add", "subtract", "stamp"],
						M = new a([
							["sinc", 0],
							["gaussianThing", 1],
							["gaussianThing2", 2],
							["gaussianThing3", 3],
							["gaussianThing4", 4],
							["angleGaussian", 5],
							["stardom", 6],
							["lobes", 7],
							["lensFlare", 8],
							["stripe", 9],
							["stripe2", 10],
							["dimondFlare", 11],
							["crossFlare", 12],
							["cornerFlares", 13],
							["fingerFlare", 14],
							["blobFlare", 15],
							["blah", 16],
							["blob", 17],
							["blob2", 18]
						]),
						y = new a([
							["identity", 0],
							["line", 1],
							["circle", 2],
							["gaussian", 3],
							["square", 4],
							["square_round", 5],
							["stardom", 6],
							["lobes", 7],
							["ring_lobes", 8],
							["heart", 9],
							["star", 10],
							["crescent", 11],
							["squiggly", 12],
							["zigzag", 13],
							["spiral", 14]
						]),
						b = new a([
							["clamp", 0],
							["repeat", 1],
							["mirroredRepeat", 2]
						]),
						C = new a([
							["normal", 0],
							["overlay", 1],
							["color", 2],
							["screen", 3],
							["darken", 4],
							["multiply", 5],
							["soft", 6],
							["lighten", 7],
							["difference", 8],
							["negation", 9],
							["exclusion", 10],
							["hard", 11],
							["red", 12],
							["green", 13],
							["blue", 14],
							["interpolation", 15],
							["colordodge", 16],
							["invcolordodge", 17],
							["softdodge", 18],
							["colorburn", 19],
							["invcolorburn", 20],
							["softburn", 21],
							["add", 22],
							["subtract", 23],
							["stamp", 24],
							["reflect", 25],
							["glow", 26],
							["freeze", 27],
							["heat", 28]
						]),
						T = (new a([
							["Perlin", 0],
							["Worley Addition", 1],
							["Cell Paintbrush", 2],
							["Marble", 3],
							["Perlin Abs", 4],
							["Sin(x+y)", 6],
							["Sin(x+2pi*sin(y))", 7],
							["Linear", 8],
							["Radial", 9],
							["Sinc", 10],
							["Gaussian Thing", 11],
							["Mandelbrot", 12],
							["Julia Set", 13],
							["Identity", 14]
						]), new a([
							["linear", 0],
							["radial", 1],
							["linearVignette", 2]
						])),
						A = (new a([
							["stretch", 0],
							["average", 1],
							["min", 2],
							["max", 3]
						]), new a([
							["normal", 0],
							["sharp", 1],
							["mediumSharp", 2],
							["ultraSharp", 3]
						])),
						S = new a([
							["none", 0],
							["halftone", 1],
							["lines", 2],
							["smooth", 3],
							["shadow", 4],
							["fade", 5],
							["rough", 6],
							["bulge", 7],
							["torn", 8],
							["torn2", 9],
							["rect", 10],
							["round", 11],
							["flickr", 12],
							["hardrand", 13],
							["instant", 14],
							["vignette", 15],
							["viewfinder", 16]
						]),
						w = new a([
							["intensity", 0],
							["chroma", 1],
							["redChannel", 2],
							["greenChannel", 3],
							["blueChannel", 4],
							["maxChannel", 5],
							["minChannel", 6]
						]),
						P = {};
					P.MoaGL = r, t.exports = P;
					r.prototype.buildGLMipmap = function(e, t) {
						var r = this.gl,
							o = this._claimFreeTexture();
						r.activeTexture(this._getTextureForIndex(o));
						var a = r.createTexture();
						r.bindTexture(r.TEXTURE_2D, a), e.mipmapTexture = a;
						for (var i = 0; i < e.numLevels; i++) t && n.convertToPremultiplied(e.bitmapLevels[i]), r.texImage2D(r.TEXTURE_2D, i, r.RGBA, e.bitmapLevels[i].width, e.bitmapLevels[i].height, 0, r.RGBA, r.UNSIGNED_BYTE, e.bitmapLevels[i].data), e.bitmapLevels[i] = null;
						r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_LINEAR), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR);
						var s = r.createTexture();
						if (r.bindTexture(r.TEXTURE_2D, s), e.originalImageTexture = s, t) {
							var l = h.makeBitmap(e.originalWidth, e.originalHeight);
							h.copyTo(l, e.originalBitmap), n.convertToPremultiplied(l), r.texImage2D(r.TEXTURE_2D, 0, r.RGBA, e.originalWidth, e.originalHeight, 0, r.RGBA, r.UNSIGNED_BYTE, new Uint8Array(l.data)), l.data = null
						} else r.texImage2D(r.TEXTURE_2D, 0, r.RGBA, e.originalWidth, e.originalHeight, 0, r.RGBA, r.UNSIGNED_BYTE, new Uint8Array(e.originalBitmap.data));
						r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, r.CLAMP_TO_EDGE), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, r.CLAMP_TO_EDGE), this._resetTextureToFree(o)
					}, r.prototype.createEffect = function() {
						var e = this.gl;
						this._resetFreeTextures(), e.bindFramebuffer(e.FRAMEBUFFER, this.glRenderingObjects.offscreenFramebuffer), e.activeTexture(e.TEXTURE0), this.renderingMode != p.READ_LAST_WRITE_NONE && this.renderingMode != p.READ_LAST_WRITE_TARGET && (this.glRenderingObjects.readTexture = this.glImageData.sourceTexture, this.glRenderingObjects.writeTexture = this.glRenderingObjects.processedTexture1), this._setTextureParams(e.LINEAR, e.LINEAR, e.CLAMP_TO_EDGE, e.CLAMP_TO_EDGE)
					}, r.prototype.finalizeEffect = function() {
						var e = this.gl;
						if (this.renderingMode == p.DEFAULT || this.renderingMode == p.READ_LAST_WRITE_TARGET) {
							e.bindFramebuffer(e.FRAMEBUFFER, null), e.activeTexture(e.TEXTURE0), e.bindTexture(e.TEXTURE_2D, this.glRenderingObjects.readTexture), e.useProgram(this.glPrograms.bitmapIdentityProgram), e.clear(e.COLOR_BUFFER_BIT), e.viewport(0, 0, this.glImageData.width, this.glImageData.height);
							var t = [1, 1, 1, 0, 0, 0, 0, 1];
							e.bindBuffer(e.ARRAY_BUFFER, this.glBuffers.texCoordBuffer), e.bufferData(e.ARRAY_BUFFER, new Float32Array(t), e.STATIC_DRAW), this._configureVertexArraysForDraw(this.glPrograms.bitmapIdentityProgram), e.uniform1i(this.glPrograms.bitmapIdentityProgram.samplerSlot, 0), e.drawElements(e.TRIANGLES, this.currentIndeces.length, e.UNSIGNED_SHORT, 0), this._resetVertexBufferVertices()
						} else if (this.renderingMode == p.OVERWRITE_ORIGINAL) {
							var r = this.glRenderingObjects.readTexture;
							if (r != this.glImageData.sourceTexture) {
								var o = this.glImageData.sourceTexture,
									a = this.glRenderingObjects.writeTexture;
								this.glImageData.sourceTexture = r, this.glRenderingObjects.processedTexture2 = a, this.glRenderingObjects.processedTexture1 = o
							}
						}
					}, r.prototype.commit = r.prototype.commitContentsOfFramebuffer = function(e, t) {
						var r = this.glImageData.sourceTexture;
						this.glImageData.sourceTexture = this.glRenderingObjects.readTexture, this.glRenderingObjects.readTexture == this.glRenderingObjects.processedTexture2 ? (this.glRenderingObjects.processedTexture2 = r, this.glRenderingObjects.readTexture = r) : (this.glRenderingObjects.processedTexture1 = r, this.glRenderingObjects.readTexture = r)
					}, r.prototype._swapTextures = function() {
						this.glRenderingObjects.writeTexture = this.glRenderingObjects.writeTexture == this.glRenderingObjects.processedTexture2 ? this.glRenderingObjects.processedTexture1 : this.glRenderingObjects.processedTexture2, this.glRenderingObjects.readTexture = this.glRenderingObjects.writeTexture == this.glRenderingObjects.processedTexture2 ? this.glRenderingObjects.processedTexture1 : this.glRenderingObjects.processedTexture2
					}, r.prototype.startRender = function(e, t) {
						var r = this.gl;
						this.currentBlendMode = t, t != g.NONE && t != g.NONE_DONT_CLEAR ? (this.glRenderingObjects.readTexture == this.glImageData.sourceTexture && (this.renderIdentity(), this.currentBlendMode = t, r.useProgram(e)), r.enable(r.BLEND), t == g.NORMAL ? r.blendFuncSeparate(r.SRC_ALPHA, r.ONE_MINUS_SRC_ALPHA, r.ONE, r.ONE) : t == g.OVERLAY ? r.blendFuncSeparate(r.DST_COLOR, r.SRC_ALPHA, r.ZERO, r.ONE) : t == g.PREMULTIPLIED_ALPHA ? r.blendFuncSeparate(r.ONE, r.ONE_MINUS_SRC_ALPHA, r.ONE, r.ONE) : t == g.DRAW_OVER ? r.blendFunc(r.SRC_ALPHA, r.SRC_ALPHA) : t == g.DRAW_BEHIND && r.blendFunc(r.ONE_MINUS_DST_ALPHA, r.DST_ALPHA), r.blendEquation(r.FUNC_ADD), r.framebufferTexture2D(r.FRAMEBUFFER, r.COLOR_ATTACHMENT0, r.TEXTURE_2D, this.glRenderingObjects.readTexture, 0)) : (r.disable(r.BLEND), r.framebufferTexture2D(r.FRAMEBUFFER, r.COLOR_ATTACHMENT0, r.TEXTURE_2D, this.glRenderingObjects.writeTexture, 0), r.activeTexture(r.TEXTURE0), r.bindTexture(r.TEXTURE_2D, this.glRenderingObjects.readTexture), t != g.NONE_DONT_CLEAR && r.clear(r.COLOR_BUFFER_BIT)), r.viewport(0, 0, this.glImageData.width, this.glImageData.height), -1 != e.positionSlot && -1 != e.texCoordSlot && this._configureVertexArraysForDraw(e), r.uniform1i(e.samplerSlot, 0)
					}, r.prototype.finishRender = function(e) {
						var t = this.gl;
						t.drawElements(t.TRIANGLES, this.currentIndeces.length, t.UNSIGNED_SHORT, 0), t.finish(), e && this._swapTextures()
					}, r.prototype.clearCurrentFrameBuffer = function() {
						var e = this.gl;
						e.bindFramebuffer(e.FRAMEBUFFER, this.glRenderingObjects.offscreenFramebuffer), e.clear(e.COLORATTACHMENT0)
					}, r.prototype.getImageDataFromFramebuffer = function() {
						var e = this.gl,
							t = new Uint8Array(new Array(this.glImageData.width * this.glImageData.height * 4));
						return e.readPixels(0, 0, this.glImageData.width, this.glImageData.height, e.RGBA, e.UNSIGNED_BYTE, t), t
					}, r.prototype._getWriteTextureAndSet = function(e) {
						if (this.gl.isTexture(e)) {
							var t = this.glRenderingObjects.writeTexture;
							return this.glRenderingObjects.writeTexture === this.glRenderingObjects.processedTexture1 ? (this.glRenderingObjects.writeTexture = e, this.glRenderingObjects.processedTexture1 = e) : (this.glRenderingObjects.writeTexture = e, this.glRenderingObjects.processedTexture2 = e), t
						}
						return null
					}, r.prototype._getReadTextureAndSet = function(e) {
						if (this.gl.isTexture(e)) {
							var t = this.glRenderingObjects.readTexture;
							return e === this.glRenderingObjects.sourceTexture ? this.glRenderingObjects.readTexture = this.glRenderingObjects.sourceTexture : this.glRenderingObjects.readTexture === this.glRenderingObjects.processedTexture1 ? (this.glRenderingObjects.readTexture = e, this.glRenderingObjects.processedTexture1 = e) : (this.glRenderingObjects.readTexture = e, this.glRenderingObjects.processedTexture2 = e), t
						}
						return null
					}, r.prototype._getSourceTextureAndSet = function(e) {
						if (this.gl.isTexture(e)) {
							var t = this.glImageData.sourceTexture;
							return this.glImageData.sourceTexture = e, t === this.glRenderingObjects.readTexture && (this.glRenderingObjects.readTexture = e), t
						}
						return null
					}, r.prototype._configurePipelineWithTempReadAndWriteTextures = function(e, t) {
						if (this.gl.isTexture(e) && this.gl.isTexture(t)) {
							for (var r = {}, o = Object.keys(this.glRenderingObjects), a = 0; a < o.length; a++) r[o[a]] = this.glRenderingObjects[o[a]];
							return this.glRenderingObjects.readTexture = e, this.glRenderingObjects.writeTexture = t, this.glRenderingObjects.processedTexture1 = e, this.glRenderingObjects.processedTexture2 = t, r
						}
						return null
					}, r.prototype._resetRenderingObjects = function(e) {
						this.glRenderingObjects = e
					}, r.prototype.showTexture = function(e) {
						if (this.gl.isTexture(e)) {
							{
								this._getReadTextureAndSet(e), this.glRenderingObjects.writeTexture, this._getSourceTextureAndSet(e)
							}
							this.finalizeEffect()
						}
					}, r.prototype._createFramebuffersAndTextures = function(e, t) {
						var r = this.gl;
						this.createFramebuffer(), "undefined" == typeof this.glRenderingObjects.processedTexture1 || null == this.glRenderingObjects.processedTexture1 ? (this.glRenderingObjects.processedTexture1 = r.createTexture(), r.bindTexture(r.TEXTURE_2D, this.glRenderingObjects.processedTexture1), this._setTextureParams(r.LINEAR, r.LINEAR, r.CLAMP_TO_EDGE, r.CLAMP_TO_EDGE)) : r.bindTexture(r.TEXTURE_2D, this.glRenderingObjects.processedTexture1), r.texImage2D(r.TEXTURE_2D, 0, r.RGBA, e, t, 0, r.RGBA, r.UNSIGNED_BYTE, null), "undefined" == typeof this.glRenderingObjects.processedTexture2 || null == this.glRenderingObjects.processedTexture2 ? (this.glRenderingObjects.processedTexture2 = r.createTexture(), r.bindTexture(r.TEXTURE_2D, this.glRenderingObjects.processedTexture2), this._setTextureParams(r.LINEAR, r.LINEAR, r.CLAMP_TO_EDGE, r.CLAMP_TO_EDGE)) : r.bindTexture(r.TEXTURE_2D, this.glRenderingObjects.processedTexture2), r.texImage2D(r.TEXTURE_2D, 0, r.RGBA, e, t, 0, r.RGBA, r.UNSIGNED_BYTE, null)
					}, r.prototype.createFramebuffer = function() {
						var e = this.gl;
						("undefined" == typeof this.glRenderingObjects.offscreenFramebuffer || null == this.glRenderingObjects.offscreenFramebuffer) && (this.glRenderingObjects.offscreenFramebuffer = e.createFramebuffer(), e.bindFramebuffer(e.FRAMEBUFFER, this.glRenderingObjects.offscreenFramebuffer))
					}, r.prototype._configureVertexArraysForDraw = function(e) {
						var t = this.gl;
						t.enableVertexAttribArray(e.positionSlot), t.enableVertexAttribArray(e.texCoordSlot), t.bindBuffer(t.ARRAY_BUFFER, this.glBuffers.positionBuffer), t.vertexAttribPointer(e.positionSlot, 3, t.FLOAT, !1, 0, 0), t.bindBuffer(t.ARRAY_BUFFER, this.glBuffers.texCoordBuffer), t.vertexAttribPointer(e.texCoordSlot, 2, t.FLOAT, !1, 0, 0), t.vertexAttrib3fv(e.positionSlot, this.currentVertices), t.vertexAttrib2fv(e.texCoordSlot, this.currentTexCoords), t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, this.glBuffers.currentIndexBuffer)
					}, r.prototype._setupVBOs = function() {
						var e = this.gl;
						this.glBuffers.positionBuffer = e.createBuffer(), this.glBuffers.texCoordBuffer = e.createBuffer(), this._resetVertexBufferVertices();
						var t = [0, 1, 2, 2, 3, 0];
						this.currentIndeces = t, this.glBuffers.currentIndexBuffer = e.createBuffer(), e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, this.glBuffers.currentIndexBuffer), e.bufferData(e.ELEMENT_ARRAY_BUFFER, new Uint16Array(t), e.STATIC_DRAW)
					}, r.prototype.setImage = function(e) {
						var t = this.gl;
						t.activeTexture(t.TEXTURE0), "undefined" == typeof this.glImageData.sourceTexture || null == this.glImageData.sourceTexture ? (this.glImageData.sourceTexture = t.createTexture(), t.bindTexture(t.TEXTURE_2D, this.glImageData.sourceTexture),
							this._setTextureParams(t.NEAREST, t.NEAREST, t.CLAMP_TO_EDGE, t.CLAMP_TO_EDGE)) : t.bindTexture(t.TEXTURE_2D, this.glImageData.sourceTexture), t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, t.RGBA, t.UNSIGNED_BYTE, e), (this.glImageData.width != e.width || this.glImageData.height != e.height) && (this.glImageData.width = e.width, this.glImageData.height = e.height, this._createFramebuffersAndTextures(e.width, e.height))
					}, r.prototype.setTextureAsSourceImage = function(e, t, r) {
						var o = this.gl;
						o.isTexture(e) && ("undefined" != typeof t && "undefined" != typeof r && (t != this.glImageData.width || r != this.glImageData.height) && (this._createFramebuffersAndTextures(t, r), o.bindTexture(o.TEXTURE_2D, this.glImageData.sourceTexture), o.texImage2D(o.TEXTURE_2D, 0, o.RGBA, t, r, 0, o.RGBA, o.UNSIGNED_BYTE, null), this.glImageData.width = t, this.glImageData.height = r), o.isTexture(e) && this._copyTexture(this.glImageData.sourceTexture, e, this.glImageData.width, this.glImageData.height))
					}, r.prototype.deleteProcessingObjects = function() {
						var e = this.gl;
						this.glRenderingObjects.offscreenFramebuffer && (e.deleteFramebuffer(this.glRenderingObjects.offscreenFramebuffer), this.glRenderingObjects.offscreenFramebuffer = null), this.glRenderingObjects.processedTexture1 && (e.deleteTexture(this.glRenderingObjects.processedTexture1), this.glRenderingObjects.processedTexture1 = null), this.glRenderingObjects.processedTexture2 && (e.deleteTexture(this.glRenderingObjects.processedTexture2), this.glRenderingObjects.processedTexture2 = null), this.glRenderingObjects.readTexture = null, this.glRenderingObjects.writeTexture = null
					}, r.prototype._setTextureParams = function(e, t, r, o) {
						var a = this.gl;
						a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MAG_FILTER, t), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MIN_FILTER, e), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_S, r), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_T, o)
					}, r.prototype._setCurrentlyBoundTexture2DFilterProperties = function(e, t) {
						var r = this.gl;
						r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, e), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, t)
					}, r.prototype.setBilinearSampling = function(e) {
						var t = this.gl;
						this.glRenderingObjects.processedTexture1 && (t.bindTexture(t.TEXTURE_2D, this.glRenderingObjects.processedTexture1), this._setCurrentlyBoundTexture2DFilterProperties(e ? t.LINEAR : t.NEAREST, e ? t.LINEAR : t.NEAREST)), this.glRenderingObjects.processedTexture2 && (t.bindTexture(t.TEXTURE_2D, this.glRenderingObjects.processedTexture2), this._setCurrentlyBoundTexture2DFilterProperties(e ? t.LINEAR : t.NEAREST, e ? t.LINEAR : t.NEAREST)), this.glImageData.sourceTexture && (t.bindTexture(t.TEXTURE_2D, this.glImageData.sourceTexture), this._setCurrentlyBoundTexture2DFilterProperties(e ? t.LINEAR : t.NEAREST, e ? t.LINEAR : t.NEAREST))
					}, r.prototype._resetVertexBufferVertices = function() {
						var e = this.gl,
							t = [1, -1, 0, 1, 1, 0, -1, 1, 0, -1, -1, 0],
							r = [1, 0, 1, 1, 0, 1, 0, 0];
						this.currentVertices = t, this.currentTexCoords = r, e.bindBuffer(e.ARRAY_BUFFER, this.glBuffers.positionBuffer), e.bufferData(e.ARRAY_BUFFER, new Float32Array(t), e.STATIC_DRAW), e.bindBuffer(e.ARRAY_BUFFER, this.glBuffers.texCoordBuffer), e.bufferData(e.ARRAY_BUFFER, new Float32Array(r), e.STATIC_DRAW)
					}, r.prototype._resetFreeTextures = function() {
						this.freeTextures[0] = !0;
						for (var e = 1; m > e; e++) this.freeTextures[e] = !1
					}, r.prototype._claimFreeTexture = function() {
						for (var e = 0; m > e; e++)
							if (!this.freeTextures[e]) return this.freeTextures[e] = !0, e;
						return -1
					}, r.prototype._getTextureForIndex = function(e) {
						var t = this.gl,
							r = [t.TEXTURE0, t.TEXTURE1, t.TEXTURE2, t.TEXTURE3, t.TEXTURE4, t.TEXTURE5, t.TEXTURE6, t.TEXTURE7];
						return r[e]
					}, r.prototype._resetTextureToFree = function(e) {
						this.freeTextures[e] = !1
					};
					var F = function(e, t, r) {
							var o = E(e, r.VERTEX_SHADER, r),
								a = E(t, r.FRAGMENT_SHADER, r),
								i = r.createProgram();
							if (r.attachShader(i, o), r.attachShader(i, a), r.linkProgram(i), !r.getProgramParameter(i, r.LINK_STATUS)) throw new Error("Could not create program: " + r.getProgramInfoLog(i));
							return r.deleteShader(o), r.deleteShader(a), i
						},
						E = function(e, t, r) {
							var o = r.createShader(t);
							if (r.shaderSource(o, e), r.compileShader(o), !r.getShaderParameter(o, r.COMPILE_STATUS)) throw new Error("Could not compile shaders: " + r.getShaderInfoLog(o));
							return o
						};
					r.prototype.setup = function(e) {
						this.gl = e, this.glImageData.pixelFormat = this.gl.RGBA, this.createFramebuffer(), this._setupVBOs(), this.gl.clearColor(0, 0, 0, 1), this.glPrograms.bitmapIdentityProgram = xe(this.glPrograms.bitmapIdentityProgram, L, o.MoaVertexShader, o.MoaBitmapIdentityFragmentShader, !1, this.gl)
					}, r.prototype.deleteAllShaders = function() {
						var e = this.gl;
						for (var t in this.glPrograms) e.deleteProgram(this.glPrograms[t]), delete this.glPrograms[t]
					}, r.prototype.destroyGL = function() {
						var e = this.gl;
						this.deleteAllShaders(), e.bindBuffer(e.ARRAY_BUFFER, null), e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, null), e.deleteBuffer(this.glBuffers.vertexBufferFlipped), e.deleteBuffer(this.glBuffers.currentIndexBuffer), e.bindFramebuffer(e.FRAMEBUFFER, null), e.deleteFramebuffer(this.glRenderingObjects.offscreenFramebuffer), e.activeTexture(e.TEXTURE, null), e.bindTexture(e.TEXTURE_2D, null), e.activeTexture(e.TEXTURE1), e.bindTexture(e.TEXTURE_2D, null), e.deleteTexture(this.glRenderingObjects.processedTexture1), e.deleteTexture(this.glRenderingObjects.processedTexture2), e.deleteTexture(this.glImageData.sourceTexture), this.glBuffers = null, this.glBuffers = null, this.glPrograms = null, this.glRenderingObjects = null, this.glImageData = null, this.renderingMode = null, this.freeTextures = null, this.currentVertices = null, this.currentTexCoords = null, this.currentIndeces = null, this.currentBlendMode = null, this.freeTextures = null, e = null
					}, r.prototype.willAcceptImageOfSize = function(e, t) {
						var r = this.maxImageDim();
						return r >= e && e > 0 && r >= t && t > 0
					}, r.prototype.maxImageDim = function() {
						var e = this.gl;
						return e.getParameter(e.MAX_TEXTURE_SIZE)
					};
					var D = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.colorShadowsHighlightsSamplerSlot = t.getUniformLocation(e, "u_colorShadowsHighlightsSampler"), e.colorMatrixSlot = t.getUniformLocation(e, "u_colorMatrix"), e.threeChannelColorMapSamplerSlot = t.getUniformLocation(e, "u_threeChannelColorMapSampler")
						},
						L = function(e, t) {
							t.useProgram(e, t), _e(e, t)
						},
						R = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.brightnessSlot = t.getUniformLocation(e, "u_brightness"), e.contrastSlot = t.getUniformLocation(e, "u_contrast"), e.saturationSlot = t.getUniformLocation(e, "u_saturation"), e.warmthSlot = t.getUniformLocation(e, "u_warmth"), e.warmthDeltaSlot = t.getUniformLocation(e, "u_warmthDelta"), e.contrastExpSlot = t.getUniformLocation(e, "u_contrastExp"), e.contrastLessThanZeroSlot = t.getUniformLocation(e, "u_contrastLessThanZero"), e.contrastSatAdjustSlot = t.getUniformLocation(e, "u_contrastSatAdjust"), e.cMapSlot = t.getUniformLocation(e, "u_cMap"), e.saturationMatrixSlot = t.getUniformLocation(e, "u_saturationMatrix")
						},
						B = function(e, t) {
							t.useProgram(e, t), e.colorMatSlot = t.getUniformLocation(e, "u_colorMat"), e.colorTransSlot = t.getUniformLocation(e, "u_colorTrans"), _e(e, t)
						},
						O = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.colorMapSamplerSlot = t.getUniformLocation(e, "u_colorMapSampler"), e.colorMapAmountSlot = t.getUniformLocation(e, "u_colorMapAmount")
						},
						I = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.scaleDiffxSlot = t.getUniformLocation(e, "u_scaleDiffx"), e.scaleDiffySlot = t.getUniformLocation(e, "u_scaleDiffy"), e.onePlusDxTimesCenterCoordSlot = t.getUniformLocation(e, "u_onePlusDxTimesCenterCoord"), e.flareColorSlot = t.getUniformLocation(e, "u_flareColor"), e.minEXPSlot = t.getUniformLocation(e, "u_minEXP"), e.maxEXPSlot = t.getUniformLocation(e, "u_maxEXP"), e.aFSlot = t.getUniformLocation(e, "u_aF"), e.flareAmountSlot = t.getUniformLocation(e, "u_flareAmount"), e.flareTypeSlot = t.getUniformLocation(e, "u_flareType"), e.blendModeSlot = t.getUniformLocation(e, "u_blendMode"), e.alphaBlendSlot = t.getUniformLocation(e, "u_alphaBlend")
						},
						N = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.srcSamplerSlot = t.getUniformLocation(e, "u_srcSampler"), e.srcAmountSlot = t.getUniformLocation(e, "u_srcAmount"), e.dstAmountSlot = t.getUniformLocation(e, "u_dstAmount")
						},
						G = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.srcSamplerSlot = t.getUniformLocation(e, "u_srcSampler"), e.factorSlot = t.getUniformLocation(e, "u_factor")
						},
						U = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.widthSlot = t.getUniformLocation(e, "u_width"), e.heightSlot = t.getUniformLocation(e, "u_height"), e.vignetteScaleSlot = t.getUniformLocation(e, "u_vignetteScale"), e.vignetteColorSlot = t.getUniformLocation(e, "u_vignetteColor"), e.blendModeSlot = t.getUniformLocation(e, "u_blend"), e.dx_2Slot = t.getUniformLocation(e, "u_dx_2"), e.dy_2Slot = t.getUniformLocation(e, "u_dy_2"), e.shouldStrecthSlot = t.getUniformLocation(e, "u_shouldStretch"), e.shapeModeSlot = t.getUniformLocation(e, "u_shapeMode")
						},
						V = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.dwSlot = t.getUniformLocation(e, "u_dw"), e.rFactorSlot = t.getUniformLocation(e, "u_rFactor"), e.widthSlot = t.getUniformLocation(e, "u_width"), e.heightSlot = t.getUniformLocation(e, "u_height"), e.borderStyleSlot = t.getUniformLocation(e, "u_borderStyle"), e.borderColorSlot = t.getUniformLocation(e, "u_borderColor"), e.linesScaleSlot = t.getUniformLocation(e, "u_linesScale"), e.dotScaleSlot = t.getUniformLocation(e, "u_dotScale"), e.offsetLSlot = t.getUniformLocation(e, "u_offsetL"), e.offsetRSlot = t.getUniformLocation(e, "u_offsetR"), e.offsetTSlot = t.getUniformLocation(e, "u_offsetT"), e.offsetBSlot = t.getUniformLocation(e, "u_offsetB"), e.offsetXSlot = t.getUniformLocation(e, "u_offsetX"), e.offsetYSlot = t.getUniformLocation(e, "u_offsetY")
						},
						k = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.positionSlot = t.getAttribLocation(e, "a_position"), e.alphaSlot = t.getAttribLocation(e, "a_alpha"), e.borderColorSlot = t.getUniformLocation(e, "u_borderColor")
						},
						j = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.positionSlot = t.getAttribLocation(e, "a_position"), e.pointSizeSlot = t.getUniformLocation(e, "u_pointSize"), e.dotSamplerSlot = t.getUniformLocation(e, "u_dotSampler")
						},
						W = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.positionSlot = t.getAttribLocation(e, "a_position"), e.pointSizeSlot = t.getAttribLocation(e, "a_pointSize"), e.dotSamplerSlot = t.getUniformLocation(e, "u_dotSampler")
						},
						H = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.dr22Slot = t.getUniformLocation(e, "u_dr22"), e.dr12Slot = t.getUniformLocation(e, "u_dr12"), e.daaSlot = t.getUniformLocation(e, "u_daa"), e.avgDSlot = t.getUniformLocation(e, "u_avgD"), e.bASlot = t.getUniformLocation(e, "u_bA"), e.heightSlot = t.getUniformLocation(e, "u_height"), e.widthSlot = t.getUniformLocation(e, "u_width"), e.yCenterSlot = t.getUniformLocation(e, "u_yCenter"), e.xCenterSlot = t.getUniformLocation(e, "u_xCenter"), e.colorSlot = t.getUniformLocation(e, "u_color")
						},
						X = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.positionSlot = t.getAttribLocation(e, "a_position"), e.imagePosSlot = t.getAttribLocation(e, "a_imagePos"), e.nHatxSlot = t.getUniformLocation(e, "u_nHatx"), e.nHatySlot = t.getUniformLocation(e, "u_nHaty"), e.x1Slot = t.getUniformLocation(e, "u_x1"), e.y1Slot = t.getUniformLocation(e, "u_y1"), e.x2Slot = t.getUniformLocation(e, "u_x2"), e.y2Slot = t.getUniformLocation(e, "u_y2"), e.rSlot = t.getUniformLocation(e, "u_r"), e.r2Slot = t.getUniformLocation(e, "u_r2"), e.dAASlot = t.getUniformLocation(e, "u_dAA"), e.bASlot = t.getUniformLocation(e, "u_bA"), e.r2AASlot = t.getUniformLocation(e, "u_r2AA"), e.colorSlot = t.getUniformLocation(e, "u_color"), e.vLength2Slot = t.getUniformLocation(e, "u_vLength2")
						},
						z = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.randomSeedSlot = t.getUniformLocation(e, "u_randomSeed"), e.intensitySlot = t.getUniformLocation(e, "u_intensity")
						},
						Y = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.linesSamplerSlot = t.getUniformLocation(e, "u_linesSampler"), e.heightSlot = t.getUniformLocation(e, "u_height"), e.widthSlot = t.getUniformLocation(e, "u_width"), e.widthTexCoordMultSlot = t.getUniformLocation(e, "u_widthTexCoordMult"), e.heightTexCoordMultSlot = t.getUniformLocation(e, "u_heightTexCoordMult"), e.h2Slot = t.getUniformLocation(e, "u_h2"), e.w2Slot = t.getUniformLocation(e, "u_w2"), e.offsetSlot = t.getUniformLocation(e, "u_offset"), e.dwSlot = t.getUniformLocation(e, "u_dw"), e.colorSlot = t.getUniformLocation(e, "u_color"), e.scaleSlot = t.getUniformLocation(e, "u_scale"), e.floatMultSlot = t.getUniformLocation(e, "u_floatMult"), e.floatTransSlot = t.getUniformLocation(e, "u_floatTrans"), e.randomSeedSlot = t.getUniformLocation(e, "u_randomSeed")
						},
						q = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.mapFactorSamplerSlot = t.getUniformLocation(e, "u_mapFactorSampler"), e.gainSlot = t.getUniformLocation(e, "u_gain"), e.rScaleSlot = t.getUniformLocation(e, "u_rScale"), e.gScaleSlot = t.getUniformLocation(e, "u_gScale"), e.bScaleSlot = t.getUniformLocation(e, "u_bScale"), e.rMinSlot = t.getUniformLocation(e, "u_rMin"), e.gMinSlot = t.getUniformLocation(e, "u_gMin"), e.bMinSlot = t.getUniformLocation(e, "u_bMin"), e.floatMultSlot = t.getUniformLocation(e, "u_floatMult"), e.floatTransSlot = t.getUniformLocation(e, "u_floatTrans")
						},
						K = function(e, t) {
							t.useProgram(e, t), _e(e, t)
						},
						Z = function(e, t) {
							t.useProgram(e, t), e.scaleASlot = t.getUniformLocation(e, "u_scaleA"), e.scaleBSlot = t.getUniformLocation(e, "u_scaleB"), _e(e, t)
						},
						$ = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.maskSamplerSlot = t.getUniformLocation(e, "u_maskSampler")
						},
						Q = function(e, t) {
							t.useProgram(e, t), _e(e, t)
						},
						J = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.avgImgSamplerSlot = t.getUniformLocation(e, "u_avgImgSampler"), e.effectedAvgImgSamplerSlot = t.getUniformLocation(e, "u_effectedAvgImgSampler"), e.gainSlot = t.getUniformLocation(e, "u_gain"), e.sharpenAmountSlot = t.getUniformLocation(e, "u_sharpenAmount")
						},
						ee = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.colorMapSamplerSlot = t.getUniformLocation(e, "u_colorMapSampler"), e.colorMapAmountSlot = t.getUniformLocation(e, "u_colorMapAmount"), e.intensitySlot = t.getUniformLocation(e, "u_intensity")
						},
						te = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.blendColorSlot = t.getUniformLocation(e, "u_blendColor"), e.blendAmountSlot = t.getUniformLocation(e, "u_blendAmount"), e.blendColorAlphaSlot = t.getUniformLocation(e, "u_blendColorAlpha")
						},
						re = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.widthSlot = t.getUniformLocation(e, "u_width"), e.heightSlot = t.getUniformLocation(e, "u_height"), e.scaleSlot = t.getUniformLocation(e, "u_scale"), e.xCenterSlot = t.getUniformLocation(e, "u_xCenter"), e.yCenterSlot = t.getUniformLocation(e, "u_yCenter"), e.dx_2Slot = t.getUniformLocation(e, "u_dx_2"), e.dy_2Slot = t.getUniformLocation(e, "u_dy_2"), e.denomISlot = t.getUniformLocation(e, "u_denomI"), e.alphaBlendSlot = t.getUniformLocation(e, "u_alphaBlend"), e.vignetteShapeSlot = t.getUniformLocation(e, "u_vignetteShape"), e.shapeModeSlot = t.getUniformLocation(e, "u_shapeMode"), e.angleCosSlot = t.getUniformLocation(e, "u_angleCos"), e.angleSinSlot = t.getUniformLocation(e, "u_angleSin"), e.overlayBlendModeSlot = t.getUniformLocation(e, "u_overlayBlendMode"), e.gradientMapSlot = t.getUniformLocation(e, "u_gradientMap")
						},
						oe = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.centerPointSlot = t.getUniformLocation(e, "u_centerPoint"), e.sigmaR2Slot = t.getUniformLocation(e, "u_sigmaR2"), e.widthSlot = t.getUniformLocation(e, "u_width"), e.heightSlot = t.getUniformLocation(e, "u_height"), e.normXSlot = t.getUniformLocation(e, "u_normX"), e.normYSlot = t.getUniformLocation(e, "u_normY")
						},
						ae = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.centerPointSlot = t.getUniformLocation(e, "u_centerPoint"), e.sigmaR2Slot = t.getUniformLocation(e, "u_sigmaR2"), e.widthSlot = t.getUniformLocation(e, "u_width"), e.heightSlot = t.getUniformLocation(e, "u_height")
						},
						ie = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.maskSamplerSlot = t.getUniformLocation(e, "u_maskSampler"), e.sourceSamplerSlot = t.getUniformLocation(e, "u_sourceSampler")
						},
						ne = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.positionSlot = t.getAttribLocation(e, "a_position"), e.texCoordSlot = t.getAttribLocation(e, "a_texCoord"), e.centerTexCoordSlot = t.getAttribLocation(e, "a_centerTexCoord"), e.pointSizeSlot = t.getUniformLocation(e, "u_pointSize"), e.radiusSlot = t.getUniformLocation(e, "u_radius"), e.widthSlot = t.getUniformLocation(e, "u_width"), e.heightSlot = t.getUniformLocation(e, "u_height"), e.alphaSlot = t.getUniformLocation(e, "u_alpha"), e.dEdgeSlot = t.getUniformLocation(e, "u_dEdge")
						},
						se = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.positionSlot = t.getAttribLocation(e, "a_position"), e.colorSlot = t.getAttribLocation(e, "a_color")
						},
						le = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.positionSlot = t.getAttribLocation(e, "a_position"), e.strokeGrayLevelSlot = t.getAttribLocation(e, "a_strokeGrayLevel"), e.shadeSlot = t.getAttribLocation(e, "a_shade"), e.canvasColorSlot = t.getUniformLocation(e, "u_canvasColor"), e.strokeColorSlot = t.getUniformLocation(e, "u_strokeColor")
						},
						ue = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.positionSlot = t.getAttribLocation(e, "a_position"), e.texCoordSlot = t.getAttribLocation(e, "a_texCoord"), e.centerTexCoordSlot = t.getAttribLocation(e, "a_centerTexCoord"), e.pointSizeSlot = t.getUniformLocation(e, "u_pointSize"), e.radiusSlot = t.getUniformLocation(e, "u_radius"), e.widthSlot = t.getUniformLocation(e, "u_width"), e.heightSlot = t.getUniformLocation(e, "u_height"), e.alphaSlot = t.getUniformLocation(e, "u_alpha"), e.dEdgeSlot = t.getUniformLocation(e, "u_dEdge"), e.lSlot = t.getUniformLocation(e, "u_l"), e.aSlot = t.getUniformLocation(e, "u_a"), e.bSlot = t.getUniformLocation(e, "u_b"), e.sigmaCSlot = t.getUniformLocation(e, "u_sigmaC")
						},
						he = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.texelStrideSlot = t.getUniformLocation(e, "u_texelStride")
						},
						de = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.texelStrideSlot = t.getUniformLocation(e, "u_texelStride"), e.weight0Slot = t.getUniformLocation(e, "u_weight0"), e.weight1Slot = t.getUniformLocation(e, "u_weight1"), e.weight2Slot = t.getUniformLocation(e, "u_weight2"), e.weight3Slot = t.getUniformLocation(e, "u_weight3"), e.weight4Slot = t.getUniformLocation(e, "u_weight4")
						},
						ce = function(e, t) {
							t.useProgram(e), _e(e, t), e.gradientMapSlot = t.getUniformLocation(e, "u_gradientMap"), e.gradientVarSlot = t.getUniformLocation(e, "u_gradVar"), e.invertGradientSlot = t.getUniformLocation(e, "u_invertMap"), e.blendModeSlot = t.getUniformLocation(e, "u_blendMode"), e.alphaBlendSlot = t.getUniformLocation(e, "u_alphaBlend")
						},
						fe = function(e, t) {
							t.useProgram(e), _e(e, t), e.shapeSlot = t.getUniformLocation(e, "u_shape"), e.alphaBlendSlot = t.getUniformLocation(e, "u_alphaBlend"), e.gradientMapSlot = t.getUniformLocation(e, "u_gradientMap"), e.invertGradientSlot = t.getUniformLocation(e, "u_invert"), e.wrapModeSlot = t.getUniformLocation(e, "u_wrapMode"), e.transformMatSlot = t.getUniformLocation(e, "u_transform"), e.paramsMatSlot = t.getUniformLocation(e, "u_params")
						},
						me = function(e, t) {
							t.useProgram(e), _e(e, t), e.bitmapBlendSlot = t.getUniformLocation(e, "u_blendSampler"), e.alphaSlot = t.getUniformLocation(e, "u_alpha")
						},
						pe = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.transformSlot = t.getUniformLocation(e, "u_transform")
						},
						ge = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.overlaySamplerSlot = t.getUniformLocation(e, "u_overlaySampler"), e.transformSlot = t.getUniformLocation(e, "u_transform"), e.alphaSlot = t.getUniformLocation(e, "u_alpha")
						},
						ve = function(e, t) {
							t.useProgram(e, t), _e(e, t), e.bitmapLFSamplerSlot = t.getUniformLocation(e, "u_samplerLF"), e.bitmapOffsetSamplerSlot = t.getUniformLocation(e, "u_samplerOffset"), e.bitmapOffsetLFSamplerSlot = t.getUniformLocation(e, "u_samplerOffsetLF"), e.centerSlot = t.getUniformLocation(e, "u_center"), e.offsetSlot = t.getUniformLocation(e, "u_offset"), e.aspectISlot = t.getUniformLocation(e, "u_aspectI"), e.radiusSlot = t.getUniformLocation(e, "u_radius"), e.avgColorSlot = t.getUniformLocation(e, "u_avgColor")
						},
						_e = function(e, t) {
							e.positionSlot = t.getAttribLocation(e, "a_position"), e.texCoordSlot = t.getAttribLocation(e, "a_texCoord"), e.samplerSlot = t.getUniformLocation(e, "u_sampler"), e.blendModeSlot = t.getUniformLocation(e, "u_blendMode")
						};
					r.prototype.createTexture = function(e, t) {
						var r = this.gl,
							o = r.createTexture();
						return r.bindTexture(r.TEXTURE_2D, o), r.texImage2D(r.TEXTURE_2D, 0, r.RGBA, e, t, 0, r.RGBA, r.UNSIGNED_BYTE, null), this._setTextureParams(r.NEAREST, r.NEAREST, r.CLAMP_TO_EDGE, r.CLAMP_TO_EDGE), o
					}, r.prototype.createTextureFromBitmap = function(e) {
						var t = this.gl,
							r = t.createTexture();
						return t.bindTexture(t.TEXTURE_2D, r), t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, e.width, e.height, 0, t.RGBA, t.UNSIGNED_BYTE, new Uint8Array(e.data)), this._setTextureParams(t.NEAREST, t.NEAREST, t.CLAMP_TO_EDGE, t.CLAMP_TO_EDGE), r
					}, r.prototype.destroyTexture = function(e) {
						var t = this.gl;
						t.isTexture(e) && (t.deleteTexture(e), t.bindTexture(t.TEXTURE_2D, null))
					}, r.prototype.getImageDataFromTexture = function(e) {
						var t = this.gl;
						return t.bindFramebuffer(t.FRAMEBUFFER, this.glRenderingObjects.offscreenFramebuffer), t.framebufferTexture2D(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.TEXTURE_2D, e, 0), this.getImageDataFromFramebuffer()
					}, r.prototype._copyTexture = function(e, t, r, a) {
						var i = this.gl;
						if (i.isTexture(t) && i.isTexture(e)) {
							this.glPrograms.bitmapIdentityProgram = xe(this.glPrograms.bitmapIdentityProgram, L, o.MoaVertexShader, o.MoaBitmapIdentityFragmentShader, !1, i);
							var n = this.glPrograms.bitmapIdentityProgram;
							i.useProgram(this.glPrograms.bitmapIdentityProgram);
							var s = this._configurePipelineWithTempReadAndWriteTextures(t, e),
								l = this._claimFreeTexture();
							i.activeTexture(this._getTextureForIndex(l)), i.bindTexture(i.TEXTURE_2D, e), this._setTextureParams(i.LINEAR, i.LINEAR, i.CLAMP_TO_EDGE, i.CLAMP_TO_EDGE), i.texImage2D(i.TEXTURE_2D, 0, i.RGBA, r, a, 0, i.RGBA, i.UNSIGNED_BYTE, null);
							var u = this._claimFreeTexture();
							i.activeTexture(this._getTextureForIndex(u)), i.bindTexture(i.TEXTURE_2D, t), i.disable(i.BLEND);
							var h = i.createFramebuffer();
							i.bindFramebuffer(i.FRAMEBUFFER, h), i.framebufferTexture2D(i.FRAMEBUFFER, i.COLOR_ATTACHMENT0, i.TEXTURE_2D, this.glRenderingObjects.writeTexture, 0), i.clear(i.COLOR_BUFFER_BIT), i.viewport(0, 0, r, a), this._configureVertexArraysForDraw(n), i.uniform1i(n.samplerSlot, u), i.drawElements(i.TRIANGLES, this.currentIndeces.length, i.UNSIGNED_SHORT, 0), i.finish(), i.bindFramebuffer(i.FRAMEBUFFER, this.glRenderingObjects.offscreenFramebuffer), i.deleteFramebuffer(h), this._resetTextureToFree(l), this._resetTextureToFree(u), this._resetRenderingObjects(s)
						}
					}, r.prototype.copyLastRender = function(e) {
						var t, r = this.gl;
						if (r.isTexture(e))
							if (this.glRenderingObjects.readTexture == this.glImageData.sourceTexture) {
								var a = this._getWriteTextureAndSet(e);
								this.glPrograms.bitmapIdentityProgram = xe(this.glPrograms.bitmapIdentityProgram, L, o.MoaVertexShader, o.MoaBitmapIdentityFragmentShader, !1, r), r.useProgram(this.glPrograms.bitmapIdentityProgram), this.startRender(this.glPrograms.bitmapIdentityProgram, g.NONE), this.finishRender(!1), this._getWriteTextureAndSet(a), this.glRenderingObjects.readTexture = this.glImageData.sourceTexture
							} else t = this.glRenderingObjects.readTexture, this._copyTexture(e, t, this.glImageData.width, this.glImageData.height)
					};
					var xe = function(e, t, r, o, a, i) {
						return "undefined" == typeof e && (e = F(r, o, i), e ? (t(e, i), a && i.drawArrays(GL_TRIANGLES, 0, 0)) : glData.state = MoaGLState.FAILED), e
					};
					r.prototype.renderAdjustments = function(e, t, r, a, i, n, s, l) {
						var u, h = this.gl,
							d = "normal" != s || 1 != l;
						if (d) {
							var u = this.createTexture(e.width, e.height);
							this.copyLastRender(u)
						}
						this.glPrograms.adjustmentsProgram = xe(this.glPrograms.adjustmentsProgram, D, o.MoaVertexShader, o.MoaAdjustmentsFragmentShader, !1, h);
						var c = this.glPrograms.adjustmentsProgram;
						h.useProgram(c), this.startRender(c, g.NONE);
						for (var f = new Uint8ClampedArray(1024), m = 0; 256 > m; m++) {
							var p = 4 * m;
							f[p] = t[m] + .5 | 0, f[p + 1] = r[m] + a[m] - m + .5 | 0, f[p + 2] = 0, f[p + 3] = 255
						}
						for (var m = 0; 4 > m; m++) i.push(0);
						for (var v = new Uint8ClampedArray(1024), m = 0; 256 > m; m++) {
							var p = 4 * m;
							v[p] = n.r[m], v[p + 1] = n.g[m], v[p + 2] = n.b[m], v[p + 3] = 255
						}
						var _ = this._claimFreeTexture(),
							x = this._createGradientTexture(_, f);
						h.uniform1i(c.colorShadowsHighlightsSamplerSlot, _), h.uniformMatrix4fv(c.colorMatrixSlot, h.True, new Float32Array(i));
						var M = this._claimFreeTexture(),
							y = this._createGradientTexture(M, v);
						if (h.uniform1i(c.threeChannelColorMapSamplerSlot, M), this.finishRender(!0), this._resetTextureToFree(_), h.deleteTexture(x), this._resetTextureToFree(M), h.deleteTexture(y), d) {
							var b = this.glRenderingObjects.writeTexture,
								C = this.glRenderingObjects.readTexture;
							this.bitmapBlendBitmap(b, u, C, s, l), this._swapTextures(), this.destroyTexture(u)
						}
					}, r.prototype._createBasicDotTexture = function(e, t, r, o) {
						var a, i, n, s, l, u, h, d, c, f, m, p, g, v, _, x = this.gl;
						for (t = 1.5, r = 2 * t, x.activeTexture(this._getTextureForIndex(o)), a = x.createTexture(), x.bindTexture(x.TEXTURE_2D, a), i = Math.ceil(2 * (t + r)), u = t * t, h = Math.pow(t + r, 2), d = e.a / 255, _ = [], n = 0; i > n; n++)
							for (c = 4 * i * n, s = 0; i > s; s++) l = c + 4 * s, _[l] = e.r, _[l + 1] = e.g, _[l + 2] = e.b, m = n + .5, p = s + .5, g = i / 2, v = (m - g) * (m - g) + (p - g) * (p - g), f = v > h ? 0 : v > u ? 1 - (1 - d + d * (Math.sqrt(v) - t) / r) : d, _[l + 3] = 255 * f;
						return x.texImage2D(x.TEXTURE_2D, 0, x.RGBA, i, i, 0, x.RGBA, x.UNSIGNED_BYTE, new Uint8Array(_)), this._setTextureParams(x.LINEAR, x.LINEAR, x.CLAMP_TO_EDGE, x.CLAMP_TO_EDGE), a
					}, r.prototype.renderBasicDots = function(e, t, r, a, i) {
						var n, s, l, u = this.gl;
						this.glPrograms.basicDotsProgram = xe(this.glPrograms.basicDotsProgram, W, o.MoaBasicDotsVertexShader, o.MoaDotMatrixFragmentShader, !1, u), n = this.glPrograms.basicDotsProgram, u.useProgram(n), this.startRender(n, g.NORMAL), u.enable(u.BLEND), u.blendFuncSeparate(u.SRC_ALPHA, u.ONE_MINUS_SRC_ALPHA, u.ZERO, u.ONE), u.blendEquation(u.FUNC_ADD), u.enableVertexAttribArray(n.positionSlot), u.enableVertexAttribArray(n.pointSizeSlot);
						var h = u.createBuffer(),
							d = u.createBuffer();
						u.bindBuffer(u.ARRAY_BUFFER, h), u.vertexAttribPointer(n.positionSlot, 2, u.FLOAT, !1, 0, 0), u.bufferData(u.ARRAY_BUFFER, new Float32Array(t), u.STATIC_DRAW), u.bindBuffer(u.ARRAY_BUFFER, d), u.vertexAttribPointer(n.pointSizeSlot, 1, u.FLOAT, !1, 0, 0), u.bufferData(u.ARRAY_BUFFER, new Float32Array(r), u.STATIC_DRAW), s = this._claimFreeTexture(), l = this._createBasicDotTexture(e, a, i, s), u.uniform1i(n.dotSamplerSlot, s), u.drawArrays(u.POINTS, 0, r.length), u.disable(u.BLEND), u.deleteTexture(l), u.deleteBuffer(h), u.deleteBuffer(d), this._resetTextureToFree(s), u.bindFramebuffer(u.FRAMEBUFFER, this.glRenderingObjects.offscreenFramebuffer), u.bindBuffer(u.ARRAY_BUFFER, this.glBuffers.vertexBufferFlipped), u.bindBuffer(u.ELEMENT_ARRAY_BUFFER, this.glBuffers.currentIndexBuffer)
					}, r.prototype.renderIdentity = function() {
						var e = this.gl;
						this.glPrograms.bitmapIdentityProgram = xe(this.glPrograms.bitmapIdentityProgram, L, o.MoaVertexShader, o.MoaBitmapIdentityFragmentShader, !1, e), e.useProgram(this.glPrograms.bitmapIdentityProgram), this.startRender(this.glPrograms.bitmapIdentityProgram, g.NONE), this.finishRender(!0)
					}, r.prototype.copyBitmapSubsection = function(e, t, r) {
						var a = this.gl;
						this.glPrograms.bitmapIndentityProgram = xe(this.glPrograms.bitmapIdentityProgram, L, o.MoaVertexShader, o.MoaBitmapIdentityFragmentShader, !1, a);
						var i = this.glPrograms.bitmapIdentityProgram,
							n = [r[0], r[1]],
							s = [r[0] + r[2], r[1]],
							l = [r[0], r[1] + r[3]],
							u = [r[0] + r[2], r[1] + r[3]],
							h = [s[0], s[1], u[0], u[1], l[0], l[1], n[0], n[1]];
						a.useProgram(i);
						var d = this._getWriteTextureAndSet(t);
						this.startRender(i, g.NONE), this.currentTexCoords = h, a.bindBuffer(a.ARRAY_BUFFER, this.glBuffers.texCoordBuffer), a.bufferData(a.ARRAY_BUFFER, new Float32Array(h), a.STATIC_DRAW);
						var c = this._claimFreeTexture();
						a.activeTexture(this._getTextureForIndex(c)), a.bindTexture(a.TEXTURE_2D, e), this._setCurrentlyBoundTexture2DFilterProperties(a.NEAREST, a.NEAREST), a.uniform1i(i.samplerSlot, c), this.finishRender(!1), a.activeTexture(this._getTextureForIndex(c)), a.bindTexture(a.TEXTURE_2D, e), this._setCurrentlyBoundTexture2DFilterProperties(a.NEAREST, a.NEAREST), a.bindTexture(a.TEXTURE_2D, null), this._resetTextureToFree(c), this._getWriteTextureAndSet(d), this._resetVertexBufferVertices()
					}, r.prototype.drawTextureToSubregionOfDstTexture = function(e, t, r) {
						var a = this.gl;
						this.glPrograms.bitmapIndentityProgram = xe(this.glPrograms.bitmapIdentityProgram, L, o.MoaVertexShader, o.MoaBitmapIdentityFragmentShader, !1, a);
						var i = this.glPrograms.bitmapIdentityProgram,
							n = [r[0], r[1]],
							s = [r[0] + r[2], r[1]],
							l = [r[0], r[1] + r[3]],
							u = [r[0] + r[2], r[1] + r[3]],
							h = [2 * (s[0] - .5), 2 * (s[1] - .5), 0, 2 * (u[0] - .5), 2 * (u[1] - .5), 0, 2 * (l[0] - .5), 2 * (l[1] - .5), 0, 2 * (n[0] - .5), 2 * (n[1] - .5), 0];
						a.useProgram(i);
						var d = this._getWriteTextureAndSet(t);
						this.startRender(i, g.NONE_DONT_CLEAR), this.currentVertices = h, a.bindBuffer(a.ARRAY_BUFFER, this.glBuffers.positionBuffer), a.bufferData(a.ARRAY_BUFFER, new Float32Array(h), a.STATIC_DRAW);
						var c = this._claimFreeTexture();
						a.activeTexture(this._getTextureForIndex(c)), a.bindTexture(a.TEXTURE_2D, e), a.uniform1i(i.samplerSlot, c), this.finishRender(!1), a.activeTexture(this._getTextureForIndex(c)), a.bindTexture(a.TEXTURE_2D, null), this._resetTextureToFree(c), this._getWriteTextureAndSet(d), this._resetVertexBufferVertices()
					}, r.prototype.renderColorBlendColor = function(e, t, r) {
						var a, i = this.gl;
						this.glPrograms.colorBlendColorProgram = xe(this.glPrograms.colorBlendColorProgram, te, o.MoaVertexShader, o.MoaBitmapColorBlendColorFragmentShader, !1, i), a = this.glPrograms.colorBlendColorProgram, i.useProgram(a), this.startRender(a, g.NONE), i.uniform3fv(a.blendColorSlot, new Float32Array(e)), i.uniform1f(a.blendAmountSlot, r), i.uniform1f(a.blendColorAlphaSlot, t), this.finishRender(!0)
					}, r.prototype.renderBlendWithOriginal = function(e, t) {
						var r = this.gl;
						this.glPrograms.bitmapBlendProgram = xe(this.glPrograms.bitmapBlendProgram, N, o.MoaVertexShader, o.MoaBitmapBlendFragmentShader, !1, r);
						var a = this.glPrograms.bitmapBlendProgram;
						r.useProgram(a), this.startRender(a, g.NONE);
						var i = this._claimFreeTexture();
						this.glRenderingObjects.readTexture != this.glImageData.sourceTexture ? (r.activeTexture(this._getTextureForIndex(i)), r.bindTexture(r.TEXTURE_2D, this.glImageData.sourceTexture)) : i = 0, r.uniform1i(a.srcSamplerSlot, i), r.uniform1f(a.srcAmountSlot, t), r.uniform1f(a.dstAmountSlot, e), this.finishRender(!0), 0 != i && (r.activeTexture(this._getTextureForIndex(i)), r.bindTexture(r.TEXTURE_2D, null)), this._resetTextureToFree(i)
					}, r.prototype.renderBlendWithOriginalOverlayReverse = function(e) {
						var t = this.gl;
						this.glPrograms.bitmapBlendOverlayReverseProgram = xe(this.glPrograms.bitmapBlendOverlayReverseProgram, G, o.MoaVertexShader, o.MoaBitmapBlendOverlayReverseFragmentShader, !1, t);
						var r = this.glPrograms.bitmapBlendOverlayReverseProgram;
						t.useProgram(r), this.startRender(r, g.NONE);
						var a = this._claimFreeTexture();
						this.glRenderingObjects.readTexture != this.glImageData.sourceTexture ? (t.activeTexture(this._getTextureForIndex(a)), t.bindTexture(t.TEXTURE_2D, this.glImageData.sourceTexture)) : a = 0, t.uniform1i(r.srcSamplerSlot, a), t.uniform1f(r.factorSlot, e), this.finishRender(!0), 0 != a && (t.activeTexture(this._getTextureForIndex(a)), t.bindTexture(t.TEXTURE_2D, null)), this._resetTextureToFree(a)
					}, r.prototype.bitmapBlendBitmap = function(e, t, r, a, i) {
						var n, s = this.gl;
						if (_.indexOf(a) > -1) this.glPrograms.bitmapBlendBitmapProgram1 = xe(this.glPrograms.bitmapBlendBitmapProgram, me, o.MoaVertexShader, o.MoaBitmapBlendBitmapFragmentShader1, !1, s), n = this.glPrograms.bitmapBlendBitmapProgram1;
						else if (x.indexOf(a) > -1) this.glPrograms.bitmapBlendBitmapProgram2 = xe(this.glPrograms.bitmapBlendBitmapProgram, me, o.MoaVertexShader, o.MoaBitmapBlendBitmapFragmentShader2, !1, s), n = this.glPrograms.bitmapBlendBitmapProgram2;
						else {
							if ("color" != a) return;
							this.glPrograms.bitmapBlendBitmapColorModeProgram = xe(this.glPrograms.bitmapBlendBitmapColorModeProgram, me, o.MoaVertexShader, o.MoaBitmapBlendBitmapColorModeFragmentShader, !1, s), n = this.glPrograms.bitmapBlendBitmapColorModeProgram
						}
						var l = this._claimFreeTexture();
						s.activeTexture(this._getTextureForIndex(l)), s.bindTexture(s.TEXTURE_2D, r);
						var u = this._configurePipelineWithTempReadAndWriteTextures(t, e);
						s.useProgram(n), this.startRender(n, g.NONE), s.uniform1i(n.bitmapBlendSlot, l), s.uniform1f(n.alphaSlot, i), "color" != a && s.uniform1i(n.blendModeSlot, C.get(a)), this.finishRender(!0), this._resetTextureToFree(l), this._resetRenderingObjects(u)
					}, r.prototype.bitmapBlendBitmapSeparate = function(e, t, r, a, i) {
						var n, s = this.gl;
						this.glPrograms.bitmapBlendProgram = xe(this.glPrograms.bitmapBlendProgram, N, o.MoaVertexShader, o.MoaBitmapBlendFragmentShader, !1, s), n = this.glPrograms.bitmapBlendProgram;
						var l = this._configurePipelineWithTempReadAndWriteTextures(t, e),
							u = this._claimFreeTexture();
						s.activeTexture(this._getTextureForIndex(u)), s.bindTexture(s.TEXTURE_2D, r), s.useProgram(n), this.startRender(n, g.NONE), s.uniform1i(n.srcSamplerSlot, u), s.uniform1f(n.srcAmountSlot, i), s.uniform1f(n.dstAmountSlot, a), this.finishRender(!1), this._resetTextureToFree(u), this._resetRenderingObjects(l)
					}, r.prototype.compositeTexturesUsingPremultipliedAlpha = function(e, t, r) {
						var a, i = this.gl;
						this.glPrograms.bitmapIdentityProgram = xe(this.glPrograms.bitmapIdentityProgram, L, o.MoaVertexShader, o.MoaBitmapIdentityFragmentShader, !1, i), a = this.glPrograms.bitmapIdentityProgram;
						var n = this._claimFreeTexture(),
							s = this._claimFreeTexture(),
							l = this._configurePipelineWithTempReadAndWriteTextures(t, e);
						i.activeTexture(this._getTextureForIndex(n)), i.bindTexture(i.TEXTURE_2D, t), i.activeTexture(this._getTextureForIndex(s)), i.bindTexture(i.TEXTURE_2D, r), i.useProgram(a), this.startRender(a, g.NONE), i.uniform1i(a.samplerSlot, n), this.finishRender(!0), this.startRender(a, g.PREMULTIPLIED_ALPHA),
							i.uniform1i(a.samplerSlot, s), this.finishRender(!1), this._resetRenderingObjects(l), i.activeTexture(this._getTextureForIndex(s)), i.bindTexture(i.TEXTURE_2D, null), i.activeTexture(this._getTextureForIndex(n)), i.bindTexture(i.TEXTURE_2D, null), this._resetTextureToFree(n), this._resetTextureToFree(s)
					}, r.prototype.blendTextureWithLastRenderAsBaseLayer = function(e, t, r) {
						this.bitmapBlendBitmap(this.glRenderingObjects.writeTexture, e, this.glRenderingObjects.readTexture, t, r), this._swapTextures()
					};
					var Me = 70;
					r.prototype.renderBlemishPoint = function(e, t, r) {
						var a, i = this.gl,
							n = e.width,
							s = e.height,
							l = t.center,
							l = t.center,
							u = t.radius,
							h = t.offset,
							f = t.skinColor,
							m = u * n,
							p = [l[0] * n, l[1] * s],
							v = !1;
						if (("undefined" == typeof h || "undefined" == typeof f) && (v = !0), v) {
							var _ = d.findClosestPatch(e, p, m);
							t.offset = [], t.offset[0] = _[0] / n, t.offset[1] = _[1] / s, a = d.findAvgSkinColor(e, p, m), t.skinColor = a
						} else _ = [h[0] * n, h[1] * s], _[0] = 0 | _[0], _[1] = 0 | _[1], a = t.skinColor;
						var x = p[0] - m + .5 | 0,
							M = p[1] - m + .5 | 0,
							y = p[0] + m + .5 | 0,
							b = p[1] + m + .5 | 0,
							C = p[0] + _[0] - m + .5 | 0,
							T = p[1] + _[1] - m + .5 | 0,
							A = p[0] + _[0] + m + .5 | 0,
							S = p[1] + _[1] + m + .5 | 0;
						if (!(0 > C || 0 > T || A > n - 1 || S > s - 1)) {
							var w = y - x + 1,
								P = b - M + 1;
							blurAmount = Me * (n + s) / (w + P);
							var F = this.createTexture(w, P),
								E = this.createTexture(w, P),
								D = this.createTexture(w, P),
								L = this.createTexture(w, P),
								R = this.createTexture(w, P),
								B = this._claimFreeTexture();
							i.activeTexture(this._getTextureForIndex(B)), i.bindTexture(i.TEXTURE_2D, F);
							var O = this._claimFreeTexture();
							i.activeTexture(this._getTextureForIndex(O)), i.bindTexture(i.TEXTURE_2D, E);
							var I = this._claimFreeTexture();
							i.activeTexture(this._getTextureForIndex(I)), i.bindTexture(i.TEXTURE_2D, D);
							var N = this._claimFreeTexture();
							i.activeTexture(this._getTextureForIndex(N)), i.bindTexture(i.TEXTURE_2D, L), this.glImageData.width = w, this.glImageData.height = P;
							var G, U, G = [x / n, M / s, w / n, P / s],
								U = [C / n, T / s, w / n, P / s];
							U[0] = G[0] < 0 ? U[0] + 1 / n : U[0], U[1] = G[1] < 0 ? U[1] + 1 / s : U[1];
							var V = ((0 | p[0]) - x) / (w - 1),
								k = ((0 | p[1]) - M) / (P - 1);
							this.copyBitmapSubsection(r, F, G), this.copyBitmapSubsection(r, D, U);
							var j = this._configurePipelineWithTempReadAndWriteTextures(F, E),
								W = this._getSourceTextureAndSet(r);
							this.renderIdentity(), this._getWriteTextureAndSet(R), e.width = w, e.height = P, c.sharpen(e, -blurAmount), this._getReadTextureAndSet(D), this._getWriteTextureAndSet(L), this.renderIdentity(), this._getWriteTextureAndSet(R), c.sharpen(e, -blurAmount), this._getReadTextureAndSet(F), this._getWriteTextureAndSet(R), this.glPrograms.blemishProgram = xe(this.glPrograms.blemishProgram, ve, o.MoaVertexShader, o.MoaBlemishFragmentShader, !1, i);
							var H = this.glPrograms.blemishProgram;
							i.useProgram(H), this.startRender(H, g.NONE), i.uniform1i(H.bitmapLFSamplerSlot, O), i.uniform1i(H.bitmapOffsetSamplerSlot, I), i.uniform1i(H.bitmapOffsetLFSamplerSlot, N), i.uniform1f(H.aspectISlot, s / n), i.uniform1f(H.radiusSlot, m / n), i.uniform2f(H.centerSlot, V, k), i.uniform4f(H.avgColorSlot, a.r / 255, a.g / 255, a.b / 255, 1), this.finishRender(!0), e.width = n, e.height = s, this.glImageData.width = n, this.glImageData.height = s;
							var G = [x / n, M / s, w / n, P / s];
							this.drawTextureToSubregionOfDstTexture(R, r, G), this._getReadTextureAndSet(r), this._getWriteTextureAndSet(j.writeTexture), this.renderIdentity(), this._getSourceTextureAndSet(W), this._resetRenderingObjects(j), this._swapTextures(), i.deleteTexture(F), i.deleteTexture(D), i.deleteTexture(E), i.deleteTexture(L), i.deleteTexture(R), this._resetTextureToFree(B), this._resetTextureToFree(I), this._resetTextureToFree(O), this._resetTextureToFree(N)
						}
					}, r.prototype.renderVignette = function(e) {
						var t = this.gl,
							r = e.blendMode;
						"undefined" == typeof C.get(r) && (r = "normal");
						var a, i, n, s, l = this.glImageData.width,
							u = this.glImageData.height,
							h = !1;
						"overlay" == r ? (this.glPrograms.borderVignetteOverlayProgram = xe(this.glPrograms.borderVignetteOverlayProgram, U, o.MoaVertexShader, o.MoaBordersVignetteOverlayFragmentShader, !1, t), a = this.glPrograms.borderVignetteOverlayProgram) : "multiply" == r ? (this.glPrograms.borderVignetteMultiplyProgram = xe(this.glPrograms.borderVignetteMultiplyProgram, U, o.MoaVertexShader, o.MoaBordersVignetteMultiplyFragmentShader, !1, t), a = this.glPrograms.borderVignetteMultiplyProgram) : "normal" == r ? (this.glPrograms.borderVignetteProgram = xe(this.glPrograms.borderVignetteProgram, U, o.MoaVertexShader, o.MoaBordersVignetteFragmentShader, !1, t), a = this.glPrograms.borderVignetteProgram) : (this.glRenderingObjects.readTexture == this.glImageData.sourceTexture && this.renderIdentity(), this.glPrograms.borderVignetteProgram = xe(this.glPrograms.borderVignetteProgram, U, o.MoaVertexShader, o.MoaBordersVignetteFragmentShader, !1, t), a = this.glPrograms.borderVignetteProgram, i = this.createTexture(l, u), n = this._claimFreeTexture(), t.activeTexture(this._getTextureForIndex(n)), t.bindTexture(t.TEXTURE_2D, i), s = this._getWriteTextureAndSet(i), h = !0);
						var d = [];
						this._fillFloatColorWithMoaColorVals(d, e.color), t.useProgram(a), "normal" == r ? this.startRender(a, g.NORMAL) : this.startRender(a, g.NONE), t.uniform1f(a.widthSlot, this.glImageData.width), t.uniform1f(a.heightSlot, this.glImageData.height), t.uniform1f(a.vignetteScaleSlot, e.vignetteScale), t.uniform1f(a.dx_2Slot, e.dx / 2), t.uniform1f(a.dy_2Slot, e.dy / 2), t.uniform4fv(a.vignetteColorSlot, d), t.uniform1i(a.shouldStrecthSlot, e.stretch ? 1 : 0), t.uniform1i(a.shapeModeSlot, A.get(e.shapeMode)), this.finishRender("overlay" == r || "multiply" == r ? !0 : !1), h && (this._getWriteTextureAndSet(s), this.bitmapBlendBitmap(this.glRenderingObjects.writeTexture, this.glRenderingObjects.readTexture, i, e.blendMode, 1), this._swapTextures(), this._resetTextureToFree(n), t.deleteTexture(i))
					}, r.prototype.renderThetaBorder = function(e, t, r, a, i, n, s, l, u, h, d, c) {
						var f, m = this.gl,
							p = [];
						this.glPrograms.borderThetaProgram = xe(this.glPrograms.borderThetaProgram, V, o.MoaVertexShader, o.MoaBordersThetaFragmentShader, !1, m), f = this.glPrograms.borderThetaProgram, this._fillFloatColorWithMoaColorVals(p, e), m.useProgram(f), this.startRender(f, g.NORMAL), m.uniform1f(f.dwSlot, r), m.uniform1f(f.rFactorSlot, a), m.uniform1f(f.widthSlot, this.glImageData.width), m.uniform1f(f.heightSlot, this.glImageData.height), m.uniform1i(f.borderStyleSlot, S.get(t)), m.uniform4fv(f.borderColorSlot, p), m.uniform1f(f.offsetLSlot, i), m.uniform1f(f.offsetRSlot, n), m.uniform1f(f.offsetTSlot, s), m.uniform1f(f.offsetBSlot, l), m.uniform1f(f.offsetXSlot, u), m.uniform1f(f.offsetYSlot, h), this.finishRender(!1)
					}, r.prototype._createLinesTexture = function(e, t, r, o, a, i, n, s, l, u) {
						var h, d, c, f, m, p, g, v, _, x = this.gl;
						for (x.activeTexture(this._getTextureForIndex(u)), f = x.createTexture(), x.bindTexture(x.TEXTURE_2D, f), c = [], h = 0; t > h; h++) m = s * (r[h] - l), p = 256 * m * 256 * 256 - Math.floor(256 * m * 256 * 256), g = 256 * m * 256 - Math.floor(256 * m * 256) - p / 256, v = 256 * m - Math.floor(256 * m) - g / 256, _ = m - v / 256, c[4 * h] = 255 * p, c[4 * h + 1] = 255 * g, c[4 * h + 2] = 255 * v, c[4 * h + 3] = 255 * _;
						for (var M = 4 * h; 4 * n > M; M++) c[M] = 0;
						for (d = 4 * n, h = 0; t > h; h++) m = s * (o[h] - l), p = 256 * m * 256 * 256 - Math.floor(256 * m * 256 * 256), g = 256 * m * 256 - Math.floor(256 * m * 256) - p / 256, v = 256 * m - Math.floor(256 * m) - g / 256, _ = m - v / 256, c[d + 4 * h] = 255 * p, c[d + 4 * h + 1] = 255 * g, c[d + 4 * h + 2] = 255 * v, c[d + 4 * h + 3] = 255 * _;
						for (var M = 4 * h; 4 * n > M; M++) c[d + M] = 0;
						for (d = 8 * n, h = 0; e > h; h++) m = s * (a[h] - l), p = 256 * m * 256 * 256 - Math.floor(256 * m * 256 * 256), g = 256 * m * 256 - Math.floor(256 * m * 256) - p / 256, v = 256 * m - Math.floor(256 * m) - g / 256, _ = m - v / 256, c[d + 4 * h] = 255 * p, c[d + 4 * h + 1] = 255 * g, c[d + 4 * h + 2] = 255 * v, c[d + 4 * h + 3] = 255 * _;
						for (var M = 4 * h; 4 * n > M; M++) c[d + M] = 0;
						for (d = 12 * n, h = 0; e > h; h++) m = s * (i[h] - l), p = 256 * m * 256 * 256 - Math.floor(256 * m * 256 * 256), g = 256 * m * 256 - Math.floor(256 * m * 256) - p / 256, v = 256 * m - Math.floor(256 * m) - g / 256, _ = m - v / 256, c[d + 4 * h] = 255 * p, c[d + 4 * h + 1] = 255 * g, c[d + 4 * h + 2] = 255 * v, c[d + 4 * h + 3] = 255 * _;
						for (var M = 4 * h; 4 * n > M; M++) c[d + M] = 0;
						return x.texImage2D(x.TEXTURE_2D, 0, x.RGBA, n, 4, 0, x.RGBA, x.UNSIGNED_BYTE, new Uint8Array(c)), this._setTextureParams(x.LINEAR, x.LINEAR, x.CLAMP_TO_EDGE, x.CLAMP_TO_EDGE), f
					}, r.prototype.renderHardRandBorder = function(e, t, r, a, i, n, s, l, u, h, d) {
						var c, f, m, p = this.gl,
							v = [];
						this.glPrograms.hardRandProgram = xe(this.glPrograms.hardRandProgram, Y, o.MoaVertexShader, o.MoaBordersHardRandFragmentShader, !1, p), m = this.glPrograms.hardRandProgram, 0 == i && (i = 1), this._fillFloatColorWithMoaColorVals(v, e), p.useProgram(m), this.startRender(m, g.NORMAL), f = Math.max(this.glImageData.width, this.glImageData.height);
						var _, x, M, y, b, C, T, A, S, w, P = [Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE],
							F = [0, 0, 0, 0];
						for (c = 0; c < this.glImageData.width; c++) S = h[c], w = d[c], S > F[2] && (F[2] = S), w > F[3] && (F[3] = w), S < P[2] && (P[2] = S), w < P[3] && (P[3] = w);
						for (c = 0; c < this.glImageData.height; c++) T = l[c], A = u[c], T > F[0] && (F[0] = T), A > F[1] && (F[1] = A), T < P[0] && (P[0] = T), A < P[1] && (P[1] = A);
						x = Math.max(Math.max(F[0], F[1]), Math.max(F[2], F[3])), _ = Math.min(Math.min(P[0], P[1]), Math.min(P[2], P[3])), M = 1 / (x - _), y = _, b = this._claimFreeTexture(), C = this._createLinesTexture(this.glImageData.width, this.glImageData.height, l, u, h, d, f, M, y, b), p.uniform1i(m.linesSamplerSlot, b), p.uniform1f(m.heightSlot, this.glImageData.height), p.uniform1f(m.widthSlot, this.glImageData.width), p.uniform1f(m.widthTexCoordMultSlot, 1 / f), p.uniform1f(m.heightTexCoordMultSlot, 1 / f), p.uniform1f(m.h2Slot, s), p.uniform1f(m.w2Slot, n), p.uniform1f(m.offsetSlot, a), p.uniform1f(m.dwSlot, t), p.uniform4fv(m.colorSlot, v), p.uniform1f(m.scaleSlot, r), p.uniform1f(m.floatMultSlot, M), p.uniform1f(m.floatTransSlot, y), p.uniform1f(m.randomSeedSlot, i), this.finishRender(!1), p.deleteTexture(C), this._resetTextureToFree(b)
					}, r.prototype.beginSideBorder = function(e) {
						var t = this.gl,
							r = [];
						this._fillFloatColorWithMoaColorVals(r, e), this.glPrograms.borderSideProgram = xe(this.glPrograms.borderSideProgram, k, o.MoaBorderSideVertexShader, o.MoaBorderSideFragmentShader, !1, t);
						var a = this.glPrograms.borderSideProgram;
						t.useProgram(a), t.enableVertexAttribArray(a.positionSlot), t.enableVertexAttribArray(a.alphaSlot), t.enable(t.BLEND), t.blendFuncSeparate(t.SRC_ALPHA, t.ONE_MINUS_SRC_ALPHA, t.ZERO, t.ONE), t.blendEquation(t.FUNC_ADD), t.uniform4fv(a.borderColorSlot, r)
					}, r.prototype.addSideBorder = function(e, t, r) {
						var a = this.gl;
						this.glPrograms.borderSideProgram = xe(this.glPrograms.borderSideProgram, k, o.MoaBorderSideVertexShader, o.MoaBorderSideFragmentShader, !1, a);
						var i = this.glPrograms.borderSideProgram;
						a.useProgram(i);
						var n, s, l = 8 * (0 == r || 3 == r ? this.glImageData.height : this.glImageData.width),
							u = 0 == r || 3 == r ? this.glImageData.width : this.glImageData.height,
							h = 0 == r || 3 == r ? this.glImageData.height : this.glImageData.width,
							d = [],
							c = [];
						if (n = 0 == r || 1 == r ? 1 : -1, 0 != t)
							for (s = 0; l > s; s += 8) {
								var f = s / (4 * (h - 1)) - 1;
								0 == r || 3 == r ? (d[s / 2] = 2 * (e[s / 8] + n * t) / (u - 1) - 1, d[s / 2 + 1] = f, d[s / 2 + 2] = 0 == r ? -1 : 1, d[s / 2 + 3] = f, c[s / 4] = 0, c[s / 4 + 1] = 0 == r ? (e[s / 8] + t) / (2 * t) : (u - (e[s / 8] - t)) / (2 * t)) : (d[s / 2] = f, d[s / 2 + 1] = 2 * (e[s / 8] + n * t) / (u - 1) - 1, d[s / 2 + 2] = f, d[s / 2 + 3] = 1 == r ? -1 : 1, c[s / 4] = 0, c[s / 4 + 1] = 1 == r ? (e[s / 8] + t) / (2 * t) : (u - (e[s / 8] - t)) / (2 * t))
							} else
								for (s = 0; l > s; s += 8) {
									var f = s / (4 * (h - 1)) - 1;
									0 == r || 3 == r ? (d[s / 2] = 2 * e[s / 8] / (u - 1) - 1, d[s / 2 + 1] = f, d[s / 2 + 2] = 0 == r ? -1 : 1, d[s / 2 + 3] = f, c[s / 4] = 1, c[s / 4 + 1] = 1) : (d[s / 2] = f, d[s / 2 + 1] = 2 * e[s / 8] / (u - 1) - 1, d[s / 2 + 2] = f, d[s / 2 + 3] = 1 == r ? -1 : 1, c[s / 4] = 1, c[s / 4 + 1] = 1)
								}
						var m = a.createBuffer();
						a.bindBuffer(a.ARRAY_BUFFER, m), a.bufferData(a.ARRAY_BUFFER, new Float32Array(d), a.STATIC_DRAW), a.vertexAttribPointer(i.positionSlot, 2, a.FLOAT, !1, 0, 0);
						var p = a.createBuffer();
						a.bindBuffer(a.ARRAY_BUFFER, p), a.bufferData(a.ARRAY_BUFFER, new Float32Array(c), a.STATIC_DRAW), a.vertexAttribPointer(i.alphaSlot, 1, a.FLOAT, !1, 0, 0), a.drawArrays(a.TRIANGLE_STRIP, 0, l / 4), a.deleteBuffer(m), a.deleteBuffer(p)
					}, r.prototype.addBorderDoubleSide = function(e, t, r, a) {
						var i, n, s, l, u, h = this.gl,
							d = [],
							c = [];
						this.glPrograms.borderSideProgram = xe(this.glPrograms.borderSideProgram, k, o.MoaBorderSideVertexShader, o.MoaBorderSideFragmentShader, !1, h);
						var f = this.glPrograms.borderSideProgram;
						h.useProgram(f);
						var i = 8 * (0 == a || 3 == a ? this.glImageData.height : this.glImageData.width),
							n = 0 == a || 3 == a ? this.glImageData.width : this.glImageData.height,
							s = 0 == a || 3 == a ? this.glImageData.height : this.glImageData.width,
							u = 2 == a || 3 == a ? -1 : 1,
							d = [],
							c = [],
							m = [],
							p = [];
						for (l = 0; i / 8 > l; l++) d[l] = (e[l] + t[l]) / 2, c[l] = (u * e[l] - u * t[l]) / (2 * r);
						for (l = 0; i > l; l += 8) {
							var g = l / (4 * (s - 1)) - 1;
							0 == a || 3 == a ? (m[l / 2] = 2 * e[l / 8] / (n - 1) - 1, m[l / 2 + 1] = g, m[l / 2 + 2] = 2 * d[l / 8] / (n - 1) - 1, m[l / 2 + 3] = g, p[l / 4] = 0, p[l / 4 + 1] = c[l / 8]) : (m[l / 2] = g, m[l / 2 + 1] = 2 * e[l / 8] / (n - 1) - 1, m[l / 2 + 2] = g, m[l / 2 + 3] = 2 * d[l / 8] / (n - 1) - 1, p[l / 4] = 0, p[l / 4 + 1] = c[l / 8])
						}
						var v = h.createBuffer();
						h.bindBuffer(h.ARRAY_BUFFER, v), h.bufferData(h.ARRAY_BUFFER, new Float32Array(m), h.STATIC_DRAW), h.vertexAttribPointer(f.positionSlot, 2, h.FLOAT, !1, 0, 0);
						var _ = h.createBuffer();
						for (h.bindBuffer(h.ARRAY_BUFFER, _), h.bufferData(h.ARRAY_BUFFER, new Float32Array(p), h.STATIC_DRAW), h.vertexAttribPointer(f.alphaSlot, 1, h.FLOAT, !1, 0, 0), h.drawArrays(h.TRIANGLE_STRIP, 0, i / 4), l = 0; i > l; l += 8) 0 == a || 3 == a ? m[l / 2] = 2 * t[l / 8] / (n - 1) - 1 : m[l / 2 + 1] = 2 * t[l / 8] / (n - 1) - 1;
						h.bindBuffer(h.ARRAY_BUFFER, v), h.bufferData(h.ARRAY_BUFFER, new Float32Array(m), h.STATIC_DRAW), h.vertexAttribPointer(f.positionSlot, 2, h.FLOAT, !1, 0, 0), h.drawArrays(h.TRIANGLE_STRIP, 0, i / 4), h.deleteBuffer(v), h.deleteBuffer(_)
					}, r.prototype.endSideBorder = function() {
						var e = this.gl;
						e.disable(e.BLEND);
						var t = this.glPrograms.borderSideProgram;
						e.disableVertexAttribArray(t.positionSlot), e.disableVertexAttribArray(t.alphaSlot), e.bindFramebuffer(e.FRAMEBUFFER, this.glRenderingObjects.offscreenFramebuffer), e.bindBuffer(e.ARRAY_BUFFER, this.glBuffers.vertexBufferFlipped), e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, this.glBuffers.currentIndexBuffer)
					};
					var ye = function(e) {
						return 0 > e ? 0 : e > 255 ? 255 : e
					};
					r.prototype._createColorMapTexture = function(e, t, r, o) {
						var a, i, n, s, l = this.gl;
						n = 4, s = 256;
						var u = [];
						for (l.activeTexture(this._getTextureForIndex(o)), a = l.createTexture(), l.bindTexture(l.TEXTURE_2D, a), i = 0; s > i; i++) u[i * n] = ye(e[i]), u[i * n + 1] = ye(t[i]), u[i * n + 2] = ye(r[i]), u[i * n + 3] = 0;
						return l.texImage2D(l.TEXTURE_2D, 0, l.RGBA, 1, 256, 0, l.RGBA, l.UNSIGNED_BYTE, new Uint8Array(u)), this._setTextureParams(l.LINEAR, l.LINEAR, l.CLAMP_TO_EDGE, l.CLAMP_TO_EDGE), a
					}, r.prototype.renderColorMap = function(e) {
						var t, r, a = this.gl;
						this.glPrograms.colorMapProgram = xe(this.glPrograms.colorMapProgram, O, o.MoaVertexShader, o.MoaColorMapFragmentShader, !1, a);
						var i = this.glPrograms.colorMapProgram;
						a.useProgram(i), this.startRender(i, g.NONE), t = this._claimFreeTexture(), r = this._createColorMapTexture(e.r, e.g, e.b, t), a.uniform1i(i.colorMapSamplerSlot, t), this.finishRender(!0), a.activeTexture(this._getTextureForIndex(t)), a.bindTexture(a.TEXTURE_2D, null), a.deleteTexture(r), this._resetTextureToFree(t)
					}, r.prototype._populateGLMultAndTransMatrices = function(e, t, r) {
						t[0] = e[0], t[1] = e[4], t[2] = e[8], t[3] = e[1], t[4] = e[5], t[5] = e[9], t[6] = e[2], t[7] = e[6], t[8] = e[10], r[0] = e[3] / 255, r[1] = e[7] / 255, r[2] = e[11] / 255
					}, r.prototype.renderColorMatrixTransform = function(e) {
						var t = this.gl;
						this.glPrograms.colorTransformProgram = xe(this.glPrograms.colorTransformProgram, B, o.MoaVertexShader, o.MoaColorTransformFragmentShader, !1, t);
						var r = this.glPrograms.colorTransformProgram,
							a = [],
							i = [];
						this._populateGLMultAndTransMatrices(e, a, i), t.useProgram(r), this.startRender(r, g.NONE), t.uniform3fv(r.colorTransSlot, new Float32Array(i)), t.uniformMatrix3fv(r.colorMatSlot, !1, new Float32Array(a)), this.finishRender(!0)
					}, r.prototype.renderColorMatrixTransformAndBlendWithOriginal = function(e, t, r) {
						var a = this.gl;
						if ("undefined" != typeof C.get(t)) {
							var i = this.glImageData.width,
								n = this.glImageData.height;
							this.glPrograms.colorTransformProgram = xe(this.glPrograms.colorTransformProgram, B, o.MoaVertexShader, o.MoaColorTransformFragmentShader, !1, a);
							var s, l, u, h = this.glPrograms.colorTransformProgram,
								d = !1;
							("normal" != t || 1 != r) && (this.glRenderingObjects.readTexture == this.glImageData.sourceTexture && this.renderIdentity(), s = this.createTexture(i, n), l = this._claimFreeTexture(), a.activeTexture(this._getTextureForIndex(l)), a.bindTexture(a.TEXTURE_2D, s), u = this._getWriteTextureAndSet(s), d = !0);
							var c = [],
								f = [];
							this._populateGLMultAndTransMatrices(e, c, f), a.useProgram(h), this.startRender(h, g.NONE), a.uniform3fv(h.colorTransSlot, new Float32Array(f)), a.uniformMatrix3fv(h.colorMatSlot, !1, new Float32Array(c)), this.finishRender(!d), d && (this._getWriteTextureAndSet(u), this.bitmapBlendBitmap(this.glRenderingObjects.writeTexture, this.glRenderingObjects.readTexture, s, t, r), this._swapTextures(), this._resetTextureToFree(l), a.deleteTexture(s))
						}
					}, r.prototype._get357FactorsOfClosetsFactorableNumber = function(e, t) {
						for (var r = !1, o = !1, a = 0, i = e; !r;)
							if (i = e + a, a *= -1, 0 >= a && a--, !(3 > i)) {
								r = !0, o = !1;
								var n = i,
									s = [3, 5, 7];
								t[0] = 0, t[1] = 0, t[2] = 0;
								for (var l = 0, u = 0; n > 1;)
									if (n % s[l] == 0 ? (t[l] ++, u++, n = n / s[l] | 0) : l++, l >= 3) {
										r = !1;
										break
									}
							}
					}, r.prototype.addBoxBlur = function(e, t) {
						var r = this.gl,
							a = [];
						if (!(2 > e)) {
							this._get357FactorsOfClosetsFactorableNumber(e, a);
							var i = 1 / ("horizontal" == t ? this.glImageData.width : this.glImageData.height);
							"horizontal" == t ? (this.glPrograms.horizontalBoxBlur3Program = xe(this.glPrograms.horizontalBoxBlur3Program, he, o.MoaConvolutionHorizontalBoxBlur3VertexShader, o.MoaConvolutionBoxBlur3FragmentShader, !1, r), this.glPrograms.horizontalBoxBlur5Program = xe(this.glPrograms.horizontalBoxBlur5Program, he, o.MoaConvolutionHorizontalBoxBlur5VertexShader, o.MoaConvolutionBoxBlur5FragmentShader, !1, r), this.glPrograms.horizontalBoxBlur7Program = xe(this.glPrograms.horizontalBoxBlur7Program, he, o.MoaConvolutionHorizontalBoxBlur7VertexShader, o.MoaConvolutionBoxBlur7FragmentShader, !1, r)) : (this.glPrograms.verticalBoxBlur3Program = xe(this.glPrograms.verticalBoxBlur3Program, he, o.MoaConvolutionVerticalBoxBlur3VertexShader, o.MoaConvolutionBoxBlur3FragmentShader, !1, r), this.glPrograms.verticalBoxBlur5Program = xe(this.glPrograms.verticalBoxBlur5Program, he, o.MoaConvolutionVerticalBoxBlur5VertexShader, o.MoaConvolutionBoxBlur5FragmentShader, !1, r), this.glPrograms.verticalBoxBlur7Program = xe(this.glPrograms.verticalBoxBlur7Program, he, o.MoaConvolutionVerticalBoxBlur7VertexShader, o.MoaConvolutionBoxBlur7FragmentShader, !1, r));
							var n, s = a[0] + a[1] + a[2],
								l = i,
								u = l;
							for (n = 0; s > n; n++) {
								var h;
								n < a[0] ? (h = "horizontal" == t ? this.glPrograms.horizontalBoxBlur3Program : this.glPrograms.verticalBoxBlur3Program, u *= 3) : n < a[0] + a[1] ? (h = "horizontal" == t ? this.glPrograms.horizontalBoxBlur5Program : this.glPrograms.verticalBoxBlur5Program, u *= 5) : (h = "horizontal" == t ? this.glPrograms.horizontalBoxBlur7Program : this.glPrograms.verticalBoxBlur7Program, u *= 7), r.useProgram(h), r.uniform1f(h.texelStrideSlot, l), this.startRender(h, g.NONE), r.activeTexture(r.TEXTURE0), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR), this.finishRender(!0), l = u
							}
							r.activeTexture(r.TEXTURE0), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)
						}
					}, r.prototype.addConvolution = function(e, t, r) {
						var a, i = this.gl;
						t > 1 && this.addBoxBlur(t, r, this);
						var n = 1 / ("horizontal" == r ? this.glImageData.width : this.glImageData.height),
							s = n * (t ? t : 1);
						"horizontal" == r ? (this.glPrograms.gaussianBlurHorizontalProgram = xe(this.glPrograms.gaussianBlurHorizontalProgram, de, o.MoaConvolutionHorizontalGaussian9VertexShader, o.MoaConvolutionGaussian9FragmentShader, !1, i), a = this.glPrograms.gaussianBlurHorizontalProgram) : (this.glPrograms.gaussianBlurVerticalProgram = xe(this.glPrograms.gaussianBlurVerticalProgram, de, o.MoaConvolutionVerticalGaussian9VertexShader, o.MoaConvolutionGaussian9FragmentShader, !1, i), a = this.glPrograms.gaussianBlurVerticalProgram);
						i.useProgram(a), this.startRender(a, g.NONE), i.uniform1f(a.texelStrideSlot, s), i.uniform1f(a.weight0Slot, e[4]), i.uniform1f(a.weight1Slot, e[3]), i.uniform1f(a.weight2Slot, e[2]), i.uniform1f(a.weight3Slot, e[1]), i.uniform1f(a.weight4Slot, e[0]), i.activeTexture(i.TEXTURE0), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MAG_FILTER, i.LINEAR), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MIN_FILTER, i.LINEAR), this.finishRender(!0), i.activeTexture(i.TEXTURE0), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MAG_FILTER, i.LINEAR), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MIN_FILTER, i.LINEAR)
					}, r.prototype.renderWhiten = function() {
						var e = this.gl;
						this.glPrograms.whitenProgram = xe(this.glPrograms.whitenProgram, $, o.MoaVertexShader, o.MoaWhitenFragmentShader, !1, e);
						var t = this.glPrograms.whitenProgram;
						e.useProgram(t), this.startRender(t, g.NONE), this.finishRender(!0)
					}, r.prototype.renderMaskDraw = function() {
						var e = this.gl,
							t = this.claimFreeTexture(),
							r = this._createEmptyTexture(t, this.glImageData.width, this.glImageData.height),
							a = this.glRenderingObjects.readTexture,
							i = this.glRenderingObjects.writeTexture;
						this.glRenderingObjects.writeTexture = r, this.renderIdentity(), this.glRenderingObjects.readTexture = a, this.glRenderingObjects.writeTexture = i;
						var n, s = r,
							l = t;
						this.glPrograms.noiseProgram = xe(this.glPrograms.noiseProgram, z, o.MoaVertexShader, o.MoaNoiseFragmentShader, !1, e), n = this.glPrograms.noiseProgram, e.useProgram(n), this.startRender(n, g.NONE), e.uniform1f(n.randomSeedSlot, 0), e.uniform1f(n.intensitySlot, 1), this.finishRender(!0), this.glPrograms.bitmapBlendBitmapProgram = xe(this.glPrograms.bitmapBlendBitmapProgram, me, o.MoaVertexShader, o.MoaBitmapBlendBitmapFragmentShader, !1, e);
						var n = this.glPrograms.bitmapBlendBitmapProgram;
						e.useProgram(n), this.startRender(n, g.NONE), e.uniform1i(n.bitmapBlendSampler, l), e.uniform1f(n.alphaUniform, .5), e.uniform1i(n.blendModeUniform, 0), this.finishRender(!0), e.activeTexture(this._getTextureForIndex(l)), e.bindTexture(e.TEXTURE_2D, null), e.deleteTexture(s), this._resetTextureToFree(l)
					}, r.prototype.renderRedeye = function() {
						var e = this.gl;
						this.glPrograms.redeyeProgram = xe(this.glPrograms.redeyeProgram, Q, o.MoaVertexShader, o.MoaRedeye2013FragmentShader, !1, e);
						var t = this.glPrograms.redeyeProgram;
						e.useProgram(t), this.startRender(t, g.NONE), this.finishRender(!0)
					}, r.prototype._createMatrixDotTexture = function(e, t, r) {
						var o, a, i, n, s, l, u, h, d, c, f, m, p, g, v, _ = this.gl;
						for (3.3 > t && (t = 3.3), Math.ceil(10 * t) % 2 == 0 && (t = (Math.ceil(10 * t) + 1) / 10), _.activeTexture(this._getTextureForIndex(r)), s = _.createTexture(), _.bindTexture(_.TEXTURE_2D, s), i = Math.ceil(2 * t * 5), l = Math.PI / (2 * t * t), u = e.a / 255, g = [], o = 0; i > o; o++)
							for (p = 4 * i * o, a = 0; i > a; a++) n = p + 4 * a, g[n] = e.r, g[n + 1] = e.g, g[n + 2] = e.b, d = o + .5, c = a + .5, f = i / 2, m = (d - f) * (d - f) + (c - f) * (c - f), m > t * t * 5 ? h = 0 : (v = m * l, h = 2.25 > v ? u * Math.max(Math.cos(v), Math.cos(Math.sqrt(v) / 1.8) / 2) : u * Math.cos(Math.sqrt(v) / 1.8) / 2, 0 > h ? h = 0 : h > 1 && (h = 1)), g[n + 3] = 255 * h;
						return _.texImage2D(_.TEXTURE_2D, 0, _.RGBA, i, i, 0, _.RGBA, _.UNSIGNED_BYTE, new Uint8Array(g)), this._setTextureParams(_.LINEAR, _.LINEAR, _.CLAMP_TO_EDGE, _.CLAMP_TO_EDGE), s
					}, r.prototype.renderDotMatrix = function(e, t, r) {
						var a, i, n, s, l = this.gl,
							u = [];
						this.glPrograms.dotMatrixProgram = xe(this.glPrograms.dotMatrixProgram, j, o.MoaDotMatrixVertexShader, o.MoaDotMatrixFragmentShader, !1, l), a = this.glPrograms.dotMatrixProgram, this._fillFloatColorWithMoaColorVals(u, e), l.useProgram(a), l.enableVertexAttribArray(a.positionSlot), l.enable(l.BLEND), l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ZERO, l.ONE), l.blendEquation(l.FUNC_ADD);
						var h = l.createBuffer();
						l.bindBuffer(l.ARRAY_BUFFER, h), l.bufferData(l.ARRAY_BUFFER, new Float32Array(t), l.STATIC_DRAW), l.vertexAttribPointer(a.positionSlot, 2, l.FLOAT, !1, 0, 0), i = r * this.glImageData.width / 2, l.uniform1f(a.pointSizeSlot, 2 * i * 5), n = this._claimFreeTexture(), s = this._createMatrixDotTexture(e, i, n), l.uniform1i(a.dotSamplerSlot, n), l.drawArrays(l.POINTS, 0, t.length / 2), l.finish(), l.disable(l.BLEND), l.deleteTexture(s), l.deleteBuffer(h), this._resetTextureToFree(n), l.bindFramebuffer(l.FRAMEBUFFER, this.glRenderingObjects.offscreenFramebuffer), l.bindBuffer(l.ARRAY_BUFFER, this.glBuffers.vertexBufferFlipped), l.bindBuffer(l.ELEMENT_ARRAY_BUFFER, this.glBuffers.currentIndexBuffer)
					}, r.prototype._createmapFTexture = function(e, t, r, o) {
						var a, i, n, s = this.gl;
						for (s.activeTexture(this._getTextureForIndex(o)), a = s.createTexture(), s.bindTexture(s.TEXTURE_2D, a), i = [], n = 0; 256 > n; n++) {
							var l = t * (e[n] - r),
								u = 256 * l * 256 * 256 - Math.floor(256 * l * 256 * 256),
								h = 256 * l * 256 - Math.floor(256 * l * 256) - u / 256,
								d = 256 * l - Math.floor(256 * l) - h / 256,
								c = l - d / 256;
							i[4 * n] = 255 * u | 0, i[4 * n + 1] = 255 * h | 0, i[4 * n + 2] = 255 * d | 0, i[4 * n + 3] = 255 * c | 0
						}
						return s.texImage2D(s.TEXTURE_2D, 0, s.RGBA, 256, 1, 0, s.RGBA, s.UNSIGNED_BYTE, new Uint8Array(i)), this._setTextureParams(s.LINEAR, s.LINEAR, s.CLAMP_TO_EDGE, s.CLAMP_TO_EDGE), a
					}, r.prototype.renderAutoEnhance = function(e, t, r, a, i, n, s, l) {
						var u, h, d, c, f, m, p, v = this.gl,
							_ = Number.MAX_VALUE,
							x = 0;
						for (this.glPrograms.autoEnhanceProgram = xe(this.glPrograms.autoEnhanceProgram, q, o.MoaVertexShader, o.MoaAutoEnhanceFragmentShader, !1, v), u = this.glPrograms.autoEnhanceProgram, h = 0; 256 > h; h++) d = l[h], _ > d && (_ = d), d > x && (x = d);
						i /= 255, n /= 255, s /= 255, v.useProgram(u), this.startRender(u, g.NONE), c = 1 / (x - _), f = _, m = this._claimFreeTexture(), p = this._createmapFTexture(l, c, f, m), v.uniform1i(u.mapFactorSamplerSlot, m), v.uniform1f(u.gainSlot, e), v.uniform1f(u.rMinSlot, i), v.uniform1f(u.gMinSlot, n), v.uniform1f(u.bMinSlot, s), v.uniform1f(u.rScaleSlot, t), v.uniform1f(u.gScaleSlot, r), v.uniform1f(u.bScaleSlot, a), v.uniform1f(u.floatMultSlot, c), v.uniform1f(u.floatTransSlot, f), this.finishRender(!0), v.activeTexture(this._getTextureForIndex(m)), v.bindTexture(v.TEXTURE_2D, null), v.deleteTexture(p), this._resetTextureToFree(m)
					}, r.prototype._createEmptyTexture = function(e, t, r) {
						var o, a = this.gl;
						return a.activeTexture(this._getTextureForIndex(e)), o = a.createTexture(), a.bindTexture(a.TEXTURE_2D, o), a.texImage2D(a.TEXTURE_2D, 0, a.RGBA, t, r, 0, a.RGBA, a.UNSIGNED_BYTE, null), this._setTextureParams(a.LINEAR, a.LINEAR, a.CLAMP_TO_EDGE, a.CLAMP_TO_EDGE), o
					}, r.prototype._getAvgGrayImage = function(e, t, r, o) {
						this.glRenderingObjects.readTexture = e, this.glRenderingObjects.writeTexture = t, this.renderIdentity(), this.glRenderingObjects.readTexture = t, this.glRenderingObjects.writeTexture = r, this.glRenderingObjects.processedTexture1 = t, this.glRenderingObjects.processedTexture2 = r, this.addBoxBlur(2 * o + 1, "horizontal", this), this.addBoxBlur(2 * o + 1, "vertical", this);
						var a = [.213, .715, .072, 0, .213, .715, .072, 0, .213, .715, .072, 0];
						this.renderColorMatrixTransform(a)
					}, r.prototype.renderClarity = function(e, t, r, a) {
						var i, n, s, l, u, h, d, c, f, m = this.gl;
						this.glPrograms.twitterClarityProgram = xe(this.glPrograms.twitterClarityProgram, J, o.MoaVertexShader, o.MoaTwitterClarityFragmentShader, !1, m), f = this.glPrograms.twitterClarityProgram, u = this.glRenderingObjects.readTexture, h = this.glRenderingObjects.writeTexture, d = this.glRenderingObjects.processedTexture1, c = this.glRenderingObjects.processedTexture2, this.renderColorMap(e), i = this._claimFreeTexture(), s = this._createEmptyTexture(i, this.glImageData.width, this.glImageData.height), n = this._claimFreeTexture(), l = this._createEmptyTexture(n, this.glImageData.width, this.glImageData.height), this._getAvgGrayImage(h, l, s, t), this._getAvgGrayImage(u, h, l, t), this.glRenderingObjects.readTexture = u, this.glRenderingObjects.writeTexture = h, this.glRenderingObjects.processedTexture1 = d, this.glRenderingObjects.processedTexture2 = c, m.useProgram(f), this.startRender(f, g.NONE), m.activeTexture(this._getTextureForIndex(n)), m.bindTexture(m.TEXTURE_2D, l), m.activeTexture(this._getTextureForIndex(i)), m.bindTexture(m.TEXTURE_2D, s), m.uniform1i(f.avgImgSamplerSlot, n), m.uniform1i(f.effectedAvgImgSamplerSlot, i), m.uniform1f(f.gainSlot, r), m.uniform1f(f.sharpenAmountSlot, a), this.finishRender(!0), m.deleteTexture(l), m.deleteTexture(s), this._resetTextureToFree(n), this._resetTextureToFree(i)
					}, r.prototype.renderConvertLABToRGB = function(e, t) {
						var r, a = this.gl;
						this.glPrograms.labToRgbProgram = xe(this.glPrograms.labToRgbProgram, Z, o.MoaVertexShader, o.MoaLABToRGBFragmentShader, !1, a), r = this.glPrograms.labToRgbProgram, a.useProgram(r), this.startRender(r, g.NONE), a.uniform1f(r.scaleASlot, e), a.uniform1f(r.scaleBSlot, t), this.finishRender(!0)
					}, r.prototype.renderConvertRGBToLAB = function() {
						var e, t = this.gl;
						this.glPrograms.rgbToLabProgram = xe(this.glPrograms.rgbToLabProgram, K, o.MoaVertexShader, o.MoaRGBToLABFragmentShader, !1, t), e = this.glPrograms.rgbToLabProgram, t.useProgram(e), this.startRender(e, g.NONE), this.finishRender(!0)
					}, r.prototype._fillFloatColorWithMoaColorVals = function(e, t) {
						e[0] = t.r / 255, e[1] = t.g / 255, e[2] = t.b / 255, e[3] = t.a / 255
					}, r.prototype.renderFlare = function(e, t, r, a, i, n, s, l, u) {
						var h = this.gl;
						"undefined" == typeof e && (e = "normal"), "undefined" == typeof u && (u = 1);
						var d, c, f, m, p, v, _ = [],
							x = [];
						this._fillFloatColorWithMoaColorVals(x, a), _[0] = (1 + i) / 2, _[1] = (1 + n) / 2, d = Math.log(1 / (255 * a.a)), c = 0, f = 1 / r / .5 / s, m = 1 / r / .5 / l, "sinc" == t && (f = 2 / r, m = f), p = x[3], "blob" != t || "overlay" != e && "normal" != e ? "angleGaussian" == t && "normal" == e ? (this.glPrograms.flareAngleGaussianProgram = xe(this.glPrograms.flareAngleGaussianProgram, I, o.MoaVertexShader, o.MoaFlareAngleGaussianFragmentShader, !1, h), v = this.glPrograms.flareAngleGaussianProgram) : "gaussianThing" == t && "normal" == e ? (this.glPrograms.flareGaussianThingProgram = xe(this.glPrograms.flareGaussianThingProgram, I, o.MoaVertexShader, o.MoaFlareGaussianThingFragmentShader, !1, h), v = this.glPrograms.flareGaussianThingProgram) : "gaussianThing2" == t && "normal" == e ? (this.glPrograms.flareGaussianThing2Program = xe(this.glPrograms.flareGaussianThing2Program, I, o.MoaVertexShader, o.MoaFlareGaussianThing2FragmentShader, !1, h), v = this.glPrograms.flareGaussianThing2Program) : "blob2" != t || "normal" != e && "overlay" != e ? "cornerFlares" != t || "normal" != e && "overlay" != e ? "gaussianThing3" == t && "overlay" == e ? (this.glPrograms.flareGaussianThing3OverlayProgram = xe(this.glPrograms.flareGaussianThing3OverlayProgram, I, o.MoaVertexShader, o.MoaFlareGaussianThing3OverlayFragmentShader, !1, h), v = this.glPrograms.flareGaussianThing3OverlayProgram) : (this.glPrograms.flareFallbackProgram = xe(this.glPrograms.flareFallbackProgram, I, o.MoaVertexShader, o.MoaFlareFragmentShader, !1, h), v = this.glPrograms.flareFallbackProgram) : "overlay" == e ? (this.glPrograms.flareCornerflaresOverlayProgram = xe(this.glPrograms.flareCornerflaresOverlayProgram, I, o.MoaVertexShader, o.MoaFlareCornerflaresOverlayFragmentShader, !1, h), v = this.glPrograms.flareCornerflaresOverlayProgram) : (this.glPrograms.flareCornerflaresProgram = xe(this.glPrograms.flareCornerflaresProgram, I, o.MoaVertexShader, o.MoaFlareCornerflaresFragmentShader, !1, h), v = this.glPrograms.flareCornerflaresProgram) : "overlay" == e ? (this.glPrograms.flareBlob2OverlayProgram = xe(this.glPrograms.flareBlob2OverlayProgram, I, o.MoaVertexShader, o.MoaFlareBlob2OverlayFragmentShader, !1, h), v = this.glPrograms.flareBlob2OverlayProgram) : (this.glPrograms.flareBlob2Program = xe(this.glPrograms.flareBlob2Program, I, o.MoaVertexShader, o.MoaFlareBlob2FragmentShader, !1, h), v = this.glPrograms.flareBlob2Program) : "overlay" == e ? (this.glPrograms.flareBlobOverlayProgram = xe(this.glPrograms.flareBlobOverlayProgram, I, o.MoaVertexShader, o.MoaFlareBlobOverlayFragmentShader, !1, h), v = this.glPrograms.flareBlobOverlayProgram) : (this.glPrograms.flareBlobProgram = xe(this.glPrograms.flareBlobProgram, I, o.MoaVertexShader, o.MoaFlareBlobFragmentShader, !1, h), v = this.glPrograms.flareBlobProgram), h.useProgram(v), "normal" != e || v == this.glPrograms.flareFallbackProgram ? this.startRender(v, g.NONE) : this.startRender(v, g.NORMAL), v == this.glPrograms.flareFallbackProgram && (h.uniform1i(v.flareTypeSlot, M.get(t)), h.uniform1i(v.blendModeSlot, C.get(e)), h.uniform1f(v.alphaBlendSlot, u)), h.uniform1f(v.scaleDiffxSlot, f), h.uniform1f(v.scaleDiffySlot, m), h.uniform2fv(v.onePlusDxTimesCenterCoordSlot, new Float32Array(_)), h.uniform4fv(v.flareColorSlot, new Float32Array(x)), h.uniform1f(v.minEXPSlot, d), h.uniform1f(v.maxEXPSlot, c), h.uniform1f(v.aFSlot, p), this.finishRender("normal" != e || v == this.glPrograms.flareFallbackProgram ? !0 : !1)
					}, r.prototype._createGradientTexture = function(e, t) {
						var r, o = this.gl;
						return o.activeTexture(this._getTextureForIndex(e)), r = o.createTexture(), o.bindTexture(o.TEXTURE_2D, r), o.texImage2D(o.TEXTURE_2D, 0, o.RGBA, 1, t.length / 4, 0, o.RGBA, o.UNSIGNED_BYTE, new Uint8Array(t)), this._setTextureParams(o.LINEAR, o.LINEAR, o.CLAMP_TO_EDGE, o.CLAMP_TO_EDGE), r
					}, r.prototype.renderGradient = function(e, t, r, a, i, n, s) {
						var l, u, h, d = this.gl;
						if ("overlay" == r) "linearVignette" == e.gradientShape ? (this.glPrograms.gradientLinearVignetteProgram = xe(this.glPrograms.gradientLinearVignetteProgram, re, o.MoaVertexShader, o.MoaGradientLinearVignetteFragmentShader, !1, d), h = this.glPrograms.gradientLinearVignetteProgram) : (this.glPrograms.gradientOverlayProgram = xe(this.glPrograms.gradientOverlayProgram, re, o.MoaVertexShader, o.MoaGradientOverlayFragmentShader, !1, d), h = this.glPrograms.gradientOverlayProgram);
						else {
							if ("normal" != r) return;
							"linearVignette" == e.gradientShape ? (this.glPrograms.gradientLinearVignetteProgram = xe(this.glPrograms.gradientLinearVignetteProgram, re, o.MoaVertexShader, o.MoaGradientLinearVignetteFragmentShader, !1, d), h = this.glPrograms.gradientLinearVignetteProgram) : (this.glPrograms.gradientProgram = xe(this.glPrograms.gradientProgram, re, o.MoaVertexShader, o.MoaGradientFragmentShader, !1, d), h = this.glPrograms.gradientProgram)
						}
						if (l = this._claimFreeTexture(), u = this._createGradientTexture(l, t), d.useProgram(h), "overlay" == r) this.startRender(h, g.NONE);
						else {
							if ("normal" != r) return;
							this.startRender(h, g.NORMAL)
						}
						d.uniform1f(h.widthSlot, this.glImageData.width), d.uniform1f(h.heightSlot, this.glImageData.height), d.uniform1f(h.scaleSlot, e.scale),
							d.uniform1f(h.xCenterSlot, e.xCenter), d.uniform1f(h.yCenterSlot, e.yCenter), d.uniform1f(h.dx_2Slot, e.dx / 2), d.uniform1f(h.dy_2Slot, e.dy / 2), d.uniform1f(h.denomISlot, s), d.uniform1f(h.alphaBlendSlot, a), d.uniform1f(h.angleCosSlot, n), d.uniform1f(h.angleSinSlot, i), d.uniform1i(h.shapeModeSlot, T.get(e.gradientShape)), d.uniform1i(h.vignetteShapeSlot, A.get(e.shapeMode)), d.uniform1i(h.overlayBlendModeSlot, "overlay" == r), d.uniform1i(h.gradientMapSlot, l), this.finishRender("overlay" == r ? !0 : !1), d.activeTexture(this._getTextureForIndex(l)), d.bindTexture(d.TEXTURE_2D, null), d.deleteTexture(u), this._resetTextureToFree(l)
					}, r.prototype.renderGradientFlare = function(e) {
						var t = this.gl;
						if ("undefined" != typeof C.get(e.blendMode)) {
							var r = this.glImageData.width,
								a = this.glImageData.height,
								i = e.gradientShapeType,
								n = (e.aspectMode, e.blendMode),
								s = e.gradientWrapMode,
								l = e.invertGradient,
								u = e.alpha,
								h = e.gradMap,
								d = e.gradientParams,
								c = Ce(e.gradientTransform);
							if (c[3] -= .5, c[7] -= .5, "average" == e.aspectMode) {
								var f = (r + a) / 2;
								c = Te(c, .5, .5), c = Ae(c, r / f, a / f), c = Te(c, -.5, -.5)
							} else if ("fill" == e.aspectMode) {
								var m = Math.max(r, a);
								c = Te(c, .5, .5), c = Ae(c, r / m, a / m), c = Te(c, -.5, -.5)
							} else if ("fit" == e.aspectMode) {
								var p = Math.min(r, a);
								c = Te(c, .5, .5), c = Ae(c, r / p, a / p), c = Te(c, -.5, -.5)
							}
							var v, _, x, r = this.glImageData.width,
								a = this.glImageData.height,
								M = !1;
							"normal" != n && (this.glRenderingObjects.readTexture == this.glImageData.sourceTexture && this.renderIdentity(), v = this.createTexture(r, a), _ = this._claimFreeTexture(), t.activeTexture(this._getTextureForIndex(_)), t.bindTexture(t.TEXTURE_2D, v), x = this._getWriteTextureAndSet(v), M = !0);
							var T, A = this._claimFreeTexture(),
								S = this._createGradientTexture(A, h);
							switch (i) {
								case "stardom":
									this.glPrograms.gradientFlareStardomProgram = xe(this.glPrograms.gradientFlareStardomProgram, fe, o.MoaVertexShader, o.MoaGradientFlareStardomFragmentShader, !1, t), T = this.glPrograms.gradientFlareStardomProgram;
									break;
								case "lobes":
									this.glPrograms.gradientFlareLobesProgram = xe(this.glPrograms.gradientFlareLobesProgram, fe, o.MoaVertexShader, o.MoaGradientFlareLobesFragmentShader, !1, t), T = this.glPrograms.gradientFlareLobesProgram;
									break;
								case "ringLobes":
									this.glPrograms.gradientFlareRingLobesProgram = xe(this.glPrograms.gradientFlareRingLobesProgram, fe, o.MoaVertexShader, o.MoaGradientFlareRingLobesFragmentShader, !1, t), T = this.glPrograms.gradientFlareRingLobesProgram;
									break;
								case "star":
									this.glPrograms.gradientFlareStarProgram = xe(this.glPrograms.gradientFlareStarProgram, fe, o.MoaVertexShader, o.MoaGradientFlareStarFragmentShader, !1, t), T = this.glPrograms.gradientFlareStarProgram;
									break;
								case "squiggly":
									this.glPrograms.gradientFlareSquigglyProgram = xe(this.glPrograms.gradientFlareSquigglyProgram, fe, o.MoaVertexShader, o.MoaGradientFlareSquigglyFragmentShader, !1, t), T = this.glPrograms.gradientFlareSquigglyProgram;
									break;
								case "zigzag":
									this.glPrograms.gradientFlareZigZagProgram = xe(this.glPrograms.gradientFlareZigZagProgram, fe, o.MoaVertexShader, o.MoaGradientFlareZigZagFragmentShader, !1, t), T = this.glPrograms.gradientFlareZigZagProgram;
									break;
								case "spiral":
									this.glPrograms.gradientFlareSpiralProgram = xe(this.glPrograms.gradientFlareSpiralProgram, fe, o.MoaVertexShader, o.MoaGradientFlareSpiralFragmentShader, !1, t), T = this.glPrograms.gradientFlareSpiralProgram;
									break;
								default:
									this.glPrograms.gradientFlareProgram = xe(this.glPrograms.gradientFlareProgram, fe, o.MoaVertexShader, o.MoaGradientFlareFragmentShader, !1, t), T = this.glPrograms.gradientFlareProgram
							}
							t.useProgram(T), "normal" == n ? this.startRender(T, g.NORMAL) : this.startRender(T, g.NONE);
							var w = M ? 1 : u;
							t.uniform1f(T.alphaBlendSlot, w), t.uniform1i(T.invertGradientSlot, l ? 1 : 0), t.uniform1i(T.shapeSlot, y.get(i)), t.uniform1i(T.wrapModeSlot, b.get(s)), t.uniform1i(T.gradientMapSlot, A), t.uniformMatrix4fv(T.transformMatSlot, !1, c), t.uniformMatrix4fv(T.paramsMatSlot, !1, d), this.finishRender(!1), M && (this._getWriteTextureAndSet(x), this.bitmapBlendBitmap(this.glRenderingObjects.writeTexture, this.glRenderingObjects.readTexture, v, e.blendMode, u), this._swapTextures(), this._resetTextureToFree(_), t.deleteTexture(v)), t.activeTexture(this._getTextureForIndex(A)), t.bindTexture(t.TEXTURE_2D, null), t.deleteTexture(S), this._resetTextureToFree(A)
						}
					};
					var be = function(e, t) {
							var r = [];
							return r[0] = e[0] * t[0] + e[1] * t[4] + e[2] * t[8] + e[3] * t[12], r[1] = e[0] * t[1] + e[1] * t[5] + e[2] * t[9] + e[3] * t[13], r[2] = e[0] * t[2] + e[1] * t[6] + e[2] * t[10] + e[3] * t[14], r[3] = e[0] * t[3] + e[1] * t[7] + e[2] * t[11] + e[3] * t[15], r[4] = e[4] * t[0] + e[5] * t[4] + e[6] * t[8] + e[7] * t[12], r[5] = e[4] * t[1] + e[5] * t[5] + e[6] * t[9] + e[7] * t[13], r[6] = e[4] * t[2] + e[5] * t[6] + e[6] * t[10] + e[7] * t[14], r[7] = e[4] * t[3] + e[5] * t[7] + e[6] * t[11] + e[7] * t[15], r[8] = e[8] * t[0] + e[9] * t[4] + e[10] * t[8] + e[11] * t[12], r[9] = e[8] * t[1] + e[9] * t[5] + e[10] * t[9] + e[11] * t[13], r[10] = e[8] * t[2] + e[9] * t[6] + e[10] * t[10] + e[11] * t[14], r[11] = e[8] * t[3] + e[9] * t[7] + e[10] * t[11] + e[11] * t[15], r[12] = e[12] * t[0] + e[13] * t[4] + e[14] * t[8] + e[15] * t[12], r[13] = e[12] * t[1] + e[13] * t[5] + e[14] * t[9] + e[15] * t[13], r[14] = e[12] * t[2] + e[13] * t[6] + e[14] * t[10] + e[15] * t[14], r[15] = e[12] * t[3] + e[13] * t[7] + e[14] * t[11] + e[15] * t[15], r
						},
						Ce = function(e) {
							var t = [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8], e[9], e[10], e[11], e[12], e[13], e[14], e[15]];
							return t
						},
						Te = function(e, t, r, o) {
							var a = Ce(e);
							"number" != typeof o && (o = 0);
							var i = [1, 0, 0, t, 0, 1, 0, r, 0, 0, 1, o, 0, 0, 0, 1];
							return a = be(a, i)
						},
						Ae = function(e, t, r) {
							var o = Ce(e),
								a = [t, 0, 0, 0, 0, r, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
							return o = be(o, a)
						};
					r.prototype.renderGradientMap = function(e) {
						var t = this.gl,
							r = e.blendMode;
						if ("undefined" != typeof C.get(e.blendMode)) {
							var a, i, n, s = this.glImageData.width,
								l = this.glImageData.height,
								u = "normal" != r && "soft" != r && "multiply" != r && "screeen" != r && "darken" != r && "overlay" != r;
							u && (this.glRenderingObjects.readTexture == this.glImageData.sourceTexture && this.renderIdentity(), a = this.createTexture(s, l), i = this._claimFreeTexture(), t.activeTexture(this._getTextureForIndex(i)), t.bindTexture(t.TEXTURE_2D, a), n = this._getWriteTextureAndSet(a), u = !0), this.glPrograms.gradientMapProgram = xe(this.glPrograms.gradientMapProgram, ce, o.MoaVertexShader, o.MoaGradientMapFragmentShader, !1, t);
							var h = this.glPrograms.gradientMapProgram,
								d = this._claimFreeTexture(),
								c = this._createGradientTexture(d, e.gradMap),
								f = C.get(u ? "normal" : r),
								m = u ? 1 : e.alpha;
							t.useProgram(h), this.startRender(h, g.NONE), t.uniform1i(h.gradientMapSlot, d), t.uniform1i(h.gradientVarSlot, w.get(e.gradientVariable)), t.uniform1i(h.invertGradientSlot, e.invertGradient), t.uniform1i(h.blendModeSlot, f), t.uniform1f(h.alphaBlendSlot, m), this.finishRender(!u), u && (this._getWriteTextureAndSet(n), this.bitmapBlendBitmap(this.glRenderingObjects.writeTexture, this.glRenderingObjects.readTexture, a, e.blendMode, e.alpha), this._swapTextures(), this._resetTextureToFree(i), t.deleteTexture(a)), t.activeTexture(this._getTextureForIndex(d)), t.bindTexture(t.TEXTURE_2D, null), t.deleteTexture(c), this._resetTextureToFree(d)
						}
					}, r.prototype._createEmptyHistogram = function() {
						var e = {};
						e.r = [], e.g = [], e.b = [];
						for (var t = 0; 256 > t; t++) e.r[t] = 0, e.g[t] = 0, e.b[t] = 0;
						return e
					}, r.prototype.histogramBuild = function() {
						var e = this.gl,
							t = this.glImageData.width,
							r = this.glImageData.height,
							o = new Uint8Array(4 * t * r),
							a = this._createEmptyHistogram();
						this.finalizeEffect(), e.bindFramebuffer(e.FRAMEBUFFER, null), e.readPixels(0, 0, t, r, e.RGBA, e.UNSIGNED_BYTE, o), e.bindFramebuffer(e.FRAMEBUFFER, this.glRenderingObjects.offscreenFramebuffer);
						var i, n = t * r;
						for (i = 0; n > i; i++) a.r[o[4 * i]] ++, a.g[o[4 * i + 1]] ++, a.b[o[4 * i + 2]] ++;
						return a
					}, r.prototype.renderIntensityMap = function(e, t, r) {
						var a, i, n, s = this.gl;
						if ("multiply" == t) this.glPrograms.intensityMapMultiplyProgram = xe(this.glPrograms.intensityMapMultiplyProgram, ee, o.MoaVertexShader, o.MoaIntensityMapMultiplyFragmentShader, !1, s), n = this.glPrograms.intensityMapMultiplyProgram;
						else if ("overlay" == t) this.glPrograms.intensityMapOverlayProgram = xe(this.glPrograms.intensityMapOverlayProgram, ee, o.MoaVertexShader, o.MoaIntensityMapOverlayFragmentShader, !1, s), n = this.glPrograms.intensityMapOverlayProgram;
						else {
							if ("normal" != t) return;
							this.glPrograms.intensityMapProgram = xe(this.glPrograms.intensityMapProgram, ee, o.MoaVertexShader, o.MoaIntensityMapFragmentShader, !1, s), n = this.glPrograms.intensityMapProgram
						}
						s.useProgram(n), this.startRender(n, g.NONE), a = this._claimFreeTexture(), i = this._createColorMapTexture(e.r, e.g, e.b, a), s.uniform1i(n.colorMapSamplerSlot, a), s.uniform1f(n.intensitySlot, r), this.finishRender(!0), s.activeTexture(this._getTextureForIndex(a)), s.bindTexture(s.TEXTURE_2D, null), s.deleteTexture(i), this._resetTextureToFree(a)
					}, r.prototype.renderLine = function(e, t, r, a, i, n, s, l, u, h, d, c, f, m, p, g, v) {
						var _, x = this.gl,
							M = [],
							y = [],
							b = [];
						this.glPrograms.lineProgram = xe(this.glPrograms.lineProgram, X, o.MoaLineVertexShader, o.MoaLineFragmentShader, !1, x), _ = this.glPrograms.lineProgram, this._fillFloatColorWithMoaColorVals(b, e), x.useProgram(_);
						var C = x.createBuffer(),
							T = x.createBuffer(),
							A = m / (this.glImageData.width - 1) * 2 - 1,
							S = p / (this.glImageData.height - 1) * 2 - 1,
							w = g / (this.glImageData.width - 1) * 2 - 1,
							P = v / (this.glImageData.height - 1) * 2 - 1;
						M[0] = A, M[1] = S, y[0] = m, y[1] = p, M[2] = w, M[3] = S, y[2] = g, y[3] = p, M[4] = A, M[5] = P, y[4] = m, y[5] = v, M[6] = w, M[7] = P, y[6] = g, y[7] = v, x.enableVertexAttribArray(_.positionSlot), x.bindBuffer(x.ARRAY_BUFFER, C), x.bufferData(x.ARRAY_BUFFER, new Float32Array(M), x.STATIC_DRAW), x.vertexAttribPointer(_.positionSlot, 2, x.FLOAT, !1, 0, 0), x.enableVertexAttribArray(_.imagePosSlot), x.bindBuffer(x.ARRAY_BUFFER, T), x.bufferData(x.ARRAY_BUFFER, new Float32Array(y), x.STATIC_DRAW), x.vertexAttribPointer(_.imagePosSlot, 2, x.FLOAT, !1, 0, 0), x.enable(x.BLEND), x.blendFuncSeparate(x.SRC_ALPHA, x.ONE_MINUS_SRC_ALPHA, x.ZERO, x.ONE), x.blendEquation(x.FUNC_ADD), x.uniform1f(_.nHatxSlot, t), x.uniform1f(_.nHatySlot, r), x.uniform1f(_.x1Slot, a), x.uniform1f(_.y1Slot, n), x.uniform1f(_.x2Slot, i), x.uniform1f(_.y2Slot, s), x.uniform1f(_.rSlot, l), x.uniform1f(_.r2Slot, u), x.uniform1f(_.dAASlot, h), x.uniform1f(_.bASlot, d), x.uniform1f(_.r2AASlot, c), x.uniform4fv(_.colorSlot, b), x.uniform1f(_.vLength2Slot, f), x.drawArrays(x.TRIANGLE_STRIP, 0, 4), x.finish(), x.disable(x.BLEND), x.deleteBuffer(C), x.deleteBuffer(T), x.disableVertexAttribArray(_.positionSlot), x.disableVertexAttribArray(_.imagePosSlot), x.bindFramebuffer(x.FRAMEBUFFER, this.glRenderingObjects.offscreenFramebuffer), x.bindBuffer(x.ARRAY_BUFFER, this.glBuffers.vertexBufferFlipped), x.bindBuffer(x.ELEMENT_ARRAY_BUFFER, this.glBuffers.currentIndexBuffer)
					}, r.prototype.createMask = function(e, t) {
						var r = this.gl;
						if (!this.willAcceptImageOfSize(e, t)) return null;
						var o = this._claimFreeTexture();
						r.activeTexture(this._getTextureForIndex(o));
						var a = r.createTexture();
						return r.bindTexture(r.TEXTURE_2D, a), this._setTextureParams(r.LINEAR, r.LINEAR, r.CLAMP_TO_EDGE, r.CLAMP_TO_EDGE), r.texImage2D(r.TEXTURE_2D, 0, r.RGBA, e, t, 0, r.RGBA, r.UNSIGNED_BYTE, null), this._resetTextureToFree(o), a
					}, r.prototype.setMaskTransparent = function(e) {
						this.setTextureToColor(e, {
							r: 0,
							g: 0,
							b: 0,
							a: 0
						})
					}, r.prototype.setMaskOpaque = function(e) {
						this.setTextureToColor(e, {
							r: 1,
							g: 1,
							b: 1,
							a: 1
						})
					}, r.prototype.setTextureToColor = function(e, t) {
						var r = this.gl;
						r.isTexture(e) && (r.bindFramebuffer(r.FRAMEBUFFER, this.glRenderingObjects.offscreenFramebuffer), r.framebufferTexture2D(r.FRAMEBUFFER, r.COLOR_ATTACHMENT0, r.TEXTURE_2D, e, 0), r.clearColor(t.r, t.g, t.b, t.a), r.clear(r.COLOR_BUFFER_BIT))
					}, r.prototype.destroyMask = function(e) {
						var t = this.gl;
						t.isTexture(e) && (t.deleteTexture(e), e = null)
					}, r.prototype.maskFillRadial = function(e, t, r, a) {
						var i = this.gl,
							n = a.posX,
							s = a.posY,
							l = a.sigmaR;
						this.glPrograms.maskRadialProgram = xe(this.glPrograms.maskRadialProgram, ae, o.MoaVertexShader, o.MoaMaskRadialFragmentShader, !1, i);
						var u, h, d, c = this.glPrograms.maskRadialProgram;
						u = this.glRenderingObjects.writeTexture, h = this.glImageData.width, d = this.glImageData.height, this.glRenderingObjects.writeTexture = e, i.useProgram(c), i.bindFramebuffer(i.FRAMEBUFFER, this.glRenderingObjects.offscreenFramebuffer), this.startRender(c, g.NONE), i.viewport(0, 0, t, r);
						var f = [n, s];
						i.uniform2fv(c.centerPointSlot, new Float32Array(f)), i.uniform1f(c.sigmaR2Slot, l * l), i.uniform1f(c.widthSlot, t), i.uniform1f(c.heightSlot, r), i.clearColor(0, 0, 0, 0), i.clear(i.COLOR_BUFFER_BIT), i.clearColor(0, 0, 0, 1), this.finishRender(!1), this.glRenderingObjects.writeTexture = u
					}, r.prototype.maskFillLinear = function(e, t, r, a) {
						var i = this.gl,
							n = a.posX,
							s = a.posY,
							l = a.sigmaR,
							u = a.angle;
						this.glPrograms.maskLinearProgram = xe(this.glPrograms.maskLinearProgram, oe, o.MoaVertexShader, o.MoaMaskLinearFragmentShader, !1, i);
						var h, d, c, f = this.glPrograms.maskLinearProgram;
						h = this.glRenderingObjects.writeTexture, d = this.glImageData.width, c = this.glImageData.height, this.glRenderingObjects.writeTexture = e, i.useProgram(f), i.bindFramebuffer(i.FRAMEBUFFER, this.glRenderingObjects.offscreenFramebuffer), this.startRender(f, g.NONE), i.viewport(0, 0, t, r);
						var m = [n, s],
							p = -Math.sin(u),
							v = Math.cos(u);
						i.uniform2fv(f.centerPointSlot, new Float32Array(m)), i.uniform1f(f.sigmaR2Slot, l * l), i.uniform1f(f.widthSlot, t), i.uniform1f(f.heightSlot, r), i.uniform1f(f.normXSlot, p), i.uniform1f(f.normYSlot, v), i.clearColor(0, 0, 0, 0), i.clear(i.COLOR_BUFFER_BIT), i.clearColor(0, 0, 0, 1), this.finishRender(!1), this.glRenderingObjects.writeTexture = h
					};
					var Se = 7;
					r.prototype.maskAddPoints = function(e, t, r, a, n, s, l, u, h, d) {
						var c, f, m, p = this.gl,
							v = a.length;
						c = this.glRenderingObjects.writeTexture, f = this.glImageData.width, m = this.glImageData.height, this.glRenderingObjects.writeTexture = e, this.glImageData.width = t, this.glImageData.height = r;
						var _;
						if ("normal" == u) this.glPrograms.maskDotsProgram = xe(this.glPrograms.maskDotsProgram, ne, o.MoaMaskDotsVertexShader, o.MoaMaskDotFragmentShader, !1, p), _ = this.glPrograms.maskDotsProgram;
						else {
							if ("splash" != u) throw "Error, invalid GL Mask Type";
							this.glPrograms.colorSplashAutoProgram = xe(this.glPrograms.colorSplashAutoProgram, ue, o.MoaMaskDotsVertexShader, o.MoaColorSplashAutoFragmentShader, !1, p), _ = this.glPrograms.colorSplashAutoProgram
						}
						p.bindFramebuffer(p.FRAMEBUFFER, this.glRenderingObjects.offscreenFramebuffer), p.useProgram(_), this.startRender(_, g.NONE_DONT_CLEAR), p.enable(p.BLEND), d ? (p.blendEquation(p.FUNC_REVERSE_SUBTRACT), p.blendFunc(p.ZERO, p.ONE_MINUS_SRC_ALPHA)) : (p.blendEquation(p.FUNC_ADD), p.blendFunc(p.ONE, p.ONE_MINUS_SRC_ALPHA)), p.bindBuffer(p.ARRAY_BUFFER, null), p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, null);
						for (var x, M, y, b, C, T, A = n * t, S = .5 * A, w = A + S * (1 - Math.sqrt(.4 / 255)), P = 6 * v, F = [], E = 2 * w / t, D = 2 * w / r, L = w / t, R = w / r, B = 0, O = 0, I = t / (t - 1), N = r / (r - 1), G = 0; v > G; G++) a[G][0] = a[G][0] * I, a[G][1] = a[G][1] * N;
						for (var G = 0; P > G; G++) {
							switch (C = Math.floor(G / 6), x = 2 * a[C][0] - 1, M = 2 * a[C][1] - 1, y = a[C][0], b = a[C][1], G % 6) {
								case 0:
									B = -1, O = -1;
									break;
								case 1:
									B = 1, O = -1;
									break;
								case 2:
									B = -1, O = 1;
									break;
								case 3:
									B = -1, O = 1;
									break;
								case 4:
									B = 1, O = -1;
									break;
								case 5:
									B = 1, O = 1
							}
							T = G * Se, F[T + 0] = x + B * E, F[T + 1] = M + O * D, F[T + 2] = 0, F[T + 3] = y + B * L, F[T + 4] = b + O * R, F[T + 5] = y, F[T + 6] = b
						}
						var U = p.createBuffer();
						if (p.bindBuffer(p.ARRAY_BUFFER, U), p.bufferData(p.ARRAY_BUFFER, new Float32Array(F), p.STATIC_DRAW), p.vertexAttribPointer(_.positionSlot, 3, p.FLOAT, p.FALSE, 4 * Se, 0), p.vertexAttribPointer(_.texCoordSlot, 2, p.FLOAT, p.FALSE, 4 * Se, 12), p.vertexAttribPointer(_.centerTexCoordSlot, 2, p.FLOAT, p.FALSE, 4 * Se, 20), p.enableVertexAttribArray(_.positionSlot), p.enableVertexAttribArray(_.texCoordSlot), p.enableVertexAttribArray(_.centerTexCoordSlot), p.activeTexture(p.TEXTURE0), p.bindTexture(p.TEXTURE_2D, this.glImageData.sourceTexture), p.uniform1f(_.radiusSlot, A), p.uniform1f(_.widthSlot, t), p.uniform1f(_.heightSlot, r), p.uniform1f(_.alphaSlot, l), p.uniform1f(_.dEdgeSlot, S), p.uniform1i(_.eraseSlot, d), "splash" == u) {
							var V = i.rgb2labwithcbrtmapping(h.r, h.g, h.b);
							p.uniform1f(_.lSlot, V[0]), p.uniform1f(_.aSlot, V[1]), p.uniform1f(_.bSlot, V[2]), p.uniform1f(_.sigmaCSlot, s)
						}
						p.drawArrays(p.TRIANGLES, 0, P), p.finish(), this.glRenderingObjects.writeTexture = c, this.glImageData.width = f, this.glImageData.height = m, p.deleteBuffer(U), p.disableVertexAttribArray(_.positionSlot), p.disableVertexAttribArray(_.texCoordSlot), p.disableVertexAttribArray(_.centerTexCoordSlot), p.disable(p.BLEND), p.bindBuffer(p.ARRAY_BUFFER, this.glBuffers.vertexBufferFlipped), p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, this.glBuffers.currentIndexBuffer)
					}, r.prototype.redrawBitmapWithGLMask = function(e, t, r) {
						var a, i, n = this.gl;
						this.glPrograms.redrawWithMaskProgram = xe(this.glPrograms.redrawWithMaskProgram, ie, o.MoaVertexShader, o.MoaBitmapRedrawWithMaskFragmentShader, !1, n);
						var s = this.glPrograms.redrawWithMaskProgram;
						n.useProgram(s), this.startRender(s, g.NONE), a = this._claimFreeTexture(), n.activeTexture(this._getTextureForIndex(a)), n.bindTexture(n.TEXTURE_2D, t), i = this._claimFreeTexture(), n.activeTexture(this._getTextureForIndex(i)), n.bindTexture(n.TEXTURE_2D, e), r ? (n.uniform1i(s.samplerSlot, i), n.uniform1i(s.sourceSamplerSlot, 0)) : n.uniform1i(s.sourceSamplerSlot, i), n.uniform1i(s.maskSamplerSlot, a), this.finishRender(!0), n.activeTexture(this._getTextureForIndex(a)), n.bindTexture(n.TEXTURE_2D, null), this._resetTextureToFree(a), n.activeTexture(this._getTextureForIndex(i)), n.bindTexture(n.TEXTURE_2D, null), this._resetTextureToFree(i)
					}, r.prototype.drawMaskOverOriginalImagePreMultipliedAlpha = function(e, t) {
						var r = this.glRenderingObjects.readTexture;
						this.compositeTexturesUsingPremultipliedAlpha(r, t, e)
					}, r.prototype.drawExistingProcessedTextureWithMaskTexture = function(e, t) {
						var r = 0;
						e == this.glRenderingObjects.processedTexture1 ? r = this.glRenderingObjects.processedTexture2 : e == this.glRenderingObjects.processedTexture2 && (r = this.glRenderingObjects.processedTexture1), this.glRenderingObjects.readTexture = this.glImageData.sourceTexture, this.glRenderingObjects.writeTexture = r, this.redrawBitmapWithGLMask(e, t, !1)
					}, r.prototype.getColorAtPoint = function(e, t) {
						var r = this.gl,
							o = new Uint8Array(4),
							a = e / this.glImageData.width,
							i = t / this.glImageData.height;
						return a = 0 > a ? 0 : a > 1 ? 1 : a, i = 0 > i ? 0 : i > 1 ? 1 : i, r.bindFramebuffer(r.FRAMEBUFFER, this.glRenderingObjects.offscreenFramebuffer), r.framebufferTexture2D(r.FRAMEBUFFER, r.COLOR_ATTACHMENT0, r.TEXTURE_2D, this.glImageData.sourceTexture, 0), r.readPixels(e, t, 1, 1, r.RGBA, r.UNSIGNED_BYTE, o), r.framebufferTexture2D(r.FRAMEBUFFER, r.COLOR_ATTACHMENT0, r.TEXTURE_2D, this.glRenderingObjects.writeTexture, 0), {
							r: o[0],
							g: o[1],
							b: o[2],
							a: o[3]
						}
					}, r.prototype.renderNoise = function(e, t) {
						var r, a = this.gl;
						this.glPrograms.noiseProgram = xe(this.glPrograms.noiseProgram, z, o.MoaVertexShader, o.MoaNoiseFragmentShader, !1, a), r = this.glPrograms.noiseProgram, 0 == t && (t = 1), a.useProgram(r), this.startRender(r, g.NONE), a.uniform1f(r.randomSeedSlot, t), a.uniform1f(r.intensitySlot, e), this.finishRender(!0)
					}, r.prototype.getGLConstantForMipmapSamplingMode = function(e) {
						return "linearLinear" == e ? this.gl.LINEAR_MIPMAP_LINEAR : "linearNearest" == e ? this.gl.LINEAR_MIPMAP_NEAREST : "nearestLinear" == e ? this.gl.NEAREST_MIPMAP_LINEAR : "nearestNearest" == e ? this.gl.NEAREST_MIPMAP_NEAREST : this.gl.LINEAR_MIPMAP_LINEAR
					}, r.prototype.getGLConstantForBitmapSamplingMode = function(e) {
						return "linear" == e ? this.gl.LINEAR : "nearest" == e ? this.gl.NEAREST : this.gl.LINEAR
					}, r.prototype.transformOverlay = function(e, t, r, o, a, i) {
						var s = h.copy(t);
						n.convertToPremultiplied(s);
						var l = this.createTextureFromBitmap(s);
						s.data = null, this.transformOverlayFromPremultipliedTexture(e, l, r, o, a, i), this.destroyTexture(l)
					}, r.prototype.transformPremultipliedOverlay = function(e, t, r, o, a, i) {
						var n = this.createTextureFromBitmap(t);
						this.transformOverlayFromPremultipliedTexture(e, n, r, o, a, i), this.destroyTexture(n)
					}, r.prototype.transformOverlayFromPremultipliedTexture = function(e, t, r, a, i, n) {
						var s = this.gl,
							l = "normal" != i;
						this.glPrograms.transformOverlayProgram = xe(this.glPrograms.transformOverlayProgram, ge, o.MoaTransformOverlayVertexShader, o.MoaTransformOverlayFragmentShader, !1, s);
						var u = this.glPrograms.transformOverlayProgram;
						r.preScaleXY(2, 2), r.postScaleXY(.5, .5), r.invert();
						var h = this._claimFreeTexture();
						if (-1 == h) return !1;
						s.activeTexture(this._getTextureForIndex(h)), s.bindTexture(s.TEXTURE_2D, t), "nearest" == a ? this._setTextureParams(s.NEAREST, s.NEAREST, s.CLAMP_TO_EDGE, s.CLAMP_TO_EDGE) : this._setTextureParams(s.LINEAR, s.LINEAR, s.CLAMP_TO_EDGE, s.CLAMP_TO_EDGE);
						var d, c, f, m = this.glImageData.width,
							p = this.glImageData.height,
							l = !1;
						"normal" != i && (this.glRenderingObjects.readTexture == this.glImageData.sourceTexture && this.renderIdentity(), d = this.createTexture(m, p), c = this._claimFreeTexture(), s.activeTexture(this._getTextureForIndex(c)), s.bindTexture(s.TEXTURE_2D, d), s.texImage2D(s.TEXTURE_2D, 0, s.RGBA, e.width, e.height, 0, s.RGBA, s.UNSIGNED_BYTE, null), f = this._getWriteTextureAndSet(d), l = !0);
						var v = l ? 1 : n;
						s.useProgram(u), "normal" != i ? this.startRender(u, g.NONE) : this.startRender(u, g.PREMULTIPLIED_ALPHA), s.uniform1i(u.overlaySamplerSlot, h), s.uniform1f(u.alphaSlot, v), s.uniformMatrix4fv(u.transformSlot, s.FALSE, new Float32Array(r.transformMatrix)), this.finishRender(!1), l && (this._getWriteTextureAndSet(f), this.bitmapBlendBitmap(this.glRenderingObjects.writeTexture, this.glRenderingObjects.readTexture, d, params.blendMode, n), this._swapTextures(), this._resetTextureToFree(c), s.deleteTexture(d)), s.activeTexture(this._getTextureForIndex(h)), s.bindTexture(s.TEXTURE_2D, null), this._resetTextureToFree(h)
					}, r.prototype.transformOverlayUsingMipmap = function(e, t, r, a, i, n) {
						var s = this.gl,
							l = "normal" != i;
						this.glPrograms.transformOverlayProgram = xe(this.glPrograms.transformOverlayProgram, ge, o.MoaTransformOverlayVertexShader, o.MoaTransformOverlayFragmentShader, !1, s);
						var u = this.glPrograms.transformOverlayProgram;
						r.preScaleXY(2, 2), r.postScaleXY(.5, .5), r.invert();
						var h = this._claimFreeTexture();
						if (-1 == h) return !1;
						s.activeTexture(this._getTextureForIndex(h));
						var d = {
								x: 1,
								y: 0,
								z: 0,
								w: 0
							},
							c = {
								x: 0,
								y: 1,
								z: 0,
								w: 0
							};
						r.rightMultiplyVector(d), r.rightMultiplyVector(c), d.x *= e.width, d.y *= e.height, c.x *= e.width, c.y *= e.height;
						var f = Math.sqrt(d.x * d.x + d.y * d.y),
							m = Math.sqrt(c.x * c.x + c.y * c.y),
							p = f / t.originalWidth,
							v = m / t.originalHeight;
						if (.5 > p || .5 > v) {
							var _ = this.getGLConstantForMipmapSamplingMode(a);
							s.bindTexture(s.TEXTURE_2D, t.mipmapTexture), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, _), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, s.LINEAR)
						} else s.bindTexture(s.TEXTURE_2D, t.originalImageTexture), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, s.LINEAR), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, s.LINEAR), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, s.CLAMP_TO_EDGE), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, s.CLAMP_TO_EDGE);
						var x, M, y, b = this.glImageData.width,
							C = this.glImageData.height,
							l = !1;
						"normal" != i && (this.glRenderingObjects.readTexture == this.glImageData.sourceTexture && this.renderIdentity(), x = this.createTexture(b, C), M = this._claimFreeTexture(), s.activeTexture(this._getTextureForIndex(M)), s.bindTexture(s.TEXTURE_2D, x), s.texImage2D(s.TEXTURE_2D, 0, s.RGBA, e.width, e.height, 0, s.RGBA, s.UNSIGNED_BYTE, null), this._setTextureParams(s.NEAREST, s.NEAREST, s.CLAMP_TO_EDGE, s.CLAMP_TO_EDGE), y = this._getWriteTextureAndSet(x), l = !0);
						var T = l ? 1 : n;
						s.useProgram(u), "normal" != i ? this.startRender(u, g.NONE) : this.startRender(u, g.PREMULTIPLIED_ALPHA), s.uniform1i(u.overlaySamplerSlot, h), s.uniform1f(u.alphaSlot, T), s.uniformMatrix4fv(u.transformSlot, s.FALSE, new Float32Array(r.transformMatrix)), this.finishRender(!1), l && (this._getWriteTextureAndSet(y), this.bitmapBlendBitmap(this.glRenderingObjects.writeTexture, this.glRenderingObjects.readTexture, x, params.blendMode, n), this._swapTextures(), this._resetTextureToFree(M), s.deleteTexture(x)), s.activeTexture(this._getTextureForIndex(h)), s.bindTexture(s.TEXTURE_2D, null), this._resetTextureToFree(h)
					}, r.prototype.transformAndResizeImage = function(e, t, r, a, i, n) {
						var s = this.gl;
						this.glPrograms.transformImageProgram = xe(this.glPrograms.transformImageProgram, pe, o.MoaTransformImageVertexShader, o.MoaTransformImageFragmentShader, !1, s);
						var l = this.glPrograms.transformImageProgram,
							u = this._claimFreeTexture();
						s.activeTexture(this._getTextureForIndex(u)), s.bindTexture(s.TEXTURE_2D, this.glImageData.sourceTexture), s.texImage2D(s.TEXTURE_2D, 0, s.RGBA, a, i, 0, s.RGBA, s.UNSIGNED_BYTE, null), this.glImageData.width = a, this.glImageData.height = i, this.glRenderingObjects.renderbufferWidth = a, this.glRenderingObjects.renderbufferHeight = i, this._createFramebuffersAndTextures(a, i), r.preTranslate(.5, .5), r.postTranslate(-.5, -.5);
						var h = this._claimFreeTexture();
						s.activeTexture(this._getTextureForIndex(h)), s.bindTexture(s.TEXTURE_2D, t), "nearest" == n ? this._setTextureParams(s.NEAREST, s.NEAREST, s.CLAMP_TO_EDGE, s.CLAMP_TO_EDGE) : this._setTextureParams(s.LINEAR, s.LINEAR, s.CLAMP_TO_EDGE, s.CLAMP_TO_EDGE), s.useProgram(l), this.startRender(l, g.NONE), s.uniform1i(l.samplerSlot, h), s.uniformMatrix4fv(l.transformSlot, s.FALSE, new Float32Array(r.transformMatrix)), this.finishRender(!0), this._resetTextureToFree(h), this._resetTextureToFree(u)
					}, r.prototype.transformAndResizeImageUsingMipmap = function(e, t, r, a, i, n) {
						var s = this.gl;
						this.glPrograms.transformImageProgram = xe(this.glPrograms.transformImageProgram, pe, o.MoaTransformImageVertexShader, o.MoaTransformImageFragmentShader, !1, s);
						var l = this.glPrograms.transformImageProgram,
							u = this._claimFreeTexture();
						s.activeTexture(this._getTextureForIndex(u)), s.bindTexture(s.TEXTURE_2D, this.glImageData.sourceTexture), s.texImage2D(s.TEXTURE_2D, 0, s.RGBA, a, i, 0, s.RGBA, s.UNSIGNED_BYTE, null), this.glImageData.width = a, this.glImageData.height = i, this.glRenderingObjects.renderbufferWidth = a, this.glRenderingObjects.renderbufferHeight = i, this._createFramebuffersAndTextures(a, i);
						var h = {
								x: 1,
								y: 0,
								z: 0,
								w: 0
							},
							d = {
								x: 0,
								y: 1,
								z: 0,
								w: 0
							},
							c = r.makeCopy();
						c.invert(), c.rightMultiplyVector(h), c.rightMultiplyVector(d), h.x *= a, h.y *= i, d.x *= a, d.y *= i;
						var f = Math.sqrt(h.x * h.x + h.y * h.y),
							m = Math.sqrt(d.x * d.x + d.y * d.y),
							p = f / t.originalWidth,
							v = m / t.originalHeight;
						r.preTranslate(.5, .5), r.postTranslate(-.5, -.5);
						var _ = this._claimFreeTexture();
						if (s.activeTexture(this._getTextureForIndex(_)), .5 > p || .5 > v) {
							var x = this.getGLConstantForMipmapSamplingMode(n);
							s.bindTexture(s.TEXTURE_2D, t.mipmapTexture), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, x), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, s.LINEAR)
						} else s.bindTexture(s.TEXTURE_2D, t.originalImageTexture), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, s.LINEAR), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, s.LINEAR), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, s.CLAMP_TO_EDGE), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, s.CLAMP_TO_EDGE);
						s.useProgram(l), this.startRender(l, g.NONE), s.uniform1i(l.samplerSlot, _), s.uniformMatrix4fv(l.transformSlot, s.FALSE, new Float32Array(r.transformMatrix)), this.finishRender(!0), this._resetTextureToFree(_), this._resetTextureToFree(u)
					}, r.prototype.renderRingFlare = function(e, t, r, a, i, n, s, l) {
						var u, h = this.gl,
							d = [];
						this.glPrograms.ringFlareProgram = xe(this.glPrograms.ringFlareProgram, H, o.MoaVertexShader, o.MoaRingFlareFragmentShader, !1, h), u = this.glPrograms.ringFlareProgram, this._fillFloatColorWithMoaColorVals(d, e), h.useProgram(u), this.startRender(u, g.NORMAL), h.uniform1f(u.dr22Slot, a), h.uniform1f(u.dr12Slot, i), h.uniform1f(u.daaSlot, n), h.uniform1f(u.avgDSlot, s), h.uniform1f(u.bASlot, l), h.uniform1f(u.widthSlot, this.glImageData.width), h.uniform1f(u.heightSlot, this.glImageData.height), h.uniform1f(u.xCenterSlot, t), h.uniform1f(u.yCenterSlot, r), h.uniform4fv(u.colorSlot, d), this.finishRender(!1)
					}, r.prototype.renderSketch = function(e, t, r, a, i, n) {
						var h = this.gl,
							d = [],
							c = this.getImageDataFromTexture(this.glImageData.sourceTexture),
							f = this.glImageData.width,
							m = this.glImageData.height,
							p = {
								data: c,
								width: f,
								height: m
							},
							v = new l,
							_ = v.rgb2graySingleChannel(p),
							x = u.equalizeSingleChannel(_);
						e = Math.min(f, m) * e / 1e3;
						var M = Math.floor(a / 100 * _.length),
							y = we(x, t),
							d = {
								r: i.r / 255,
								g: i.g / 255,
								b: i.b / 255,
								a: 1
							};
						this.setTextureToColor(this.glRenderingObjects.writeTexture, d), d = [i.r / 255, i.g / 255, i.b / 255, 1], strokeColor = [n.r / 255, n.g / 255, n.b / 255, 1], this.glPrograms.drawingLightenBlendModeProgram = xe(this.glPrograms.drawingLightenBlendModeProgram, le, o.MoaDrawingLightenBlendModeVertexShader, o.MoaDrawingLightenBlendModeFragmentShader, !1, h);
						var b = this.glPrograms.drawingLightenBlendModeProgram,
							C = h.createTexture(),
							T = this._claimFreeTexture();
						h.activeTexture(this._getTextureForIndex(T)), h.bindTexture(h.TEXTURE_2D, C), this._setTextureParams(h.NEAREST, h.NEAREST, h.CLAMP_TO_EDGE, h.CLAMP_TO_EDGE), h.pixelStorei(h.UNPACK_ALIGNMENT, 1), h.texImage2D(h.TEXTURE_2D, 0, h.LUMINANCE, f, m, 0, h.LUMINANCE, h.UNSIGNED_BYTE, new Uint8Array(x)), h.pixelStorei(h.UNPACK_ALIGNMENT, 4), this._resetTextureToFree(T), h.bindFramebuffer(h.FRAMEBUFFER, this.glRenderingObjects.offscreenFramebuffer);
						var A = this._configurePipelineWithTempReadAndWriteTextures(C, this.glRenderingObjects.writeTexture);
						h.useProgram(b), this.startRender(b, g.NONE), h.enable(h.BLEND), h.blendEquation(h.FUNC_ADD), h.blendFunc(h.ONE, h.ONE_MINUS_SRC_ALPHA), h.enableVertexAttribArray(b.positionSlot), h.enableVertexAttribArray(b.strokeGrayLevelSlot), h.enableVertexAttribArray(b.shadeSlot);
						var S = [],
							w = [],
							P = [];
						h.uniform4fv(b.canvasColorSlot, d), h.uniform4fv(b.strokeColorSlot, strokeColor);
						var F = e,
							E = r;
						t = Math.round(t);
						for (var D = h.createBuffer(), L = h.createBuffer(), R = h.createBuffer(), B = 5e3, O = 0, I = 0, N = 0, G = 0, U = t - 1; U >= 0; U--) {
							for (var V = y[U], k = new s.RNG(U), j = 0; M > j; j++) {
								var W = k.nextFloat() * f,
									H = k.nextFloat() * m;
								W = W > f - 1 ? f - 1 : W, H = H > m - 1 ? m - 1 : H;
								var X = (H + .5 | 0) * f + (W + .5 | 0);
								if (x[X] <= V) {
									for (var z = V / 255, Y = z * d[0] + (1 - z) * strokeColor[0], q = z * d[1] + (1 - z) * strokeColor[1], K = z * d[2] + (1 - z) * strokeColor[2], Z = 0; 10 > Z; Z++) P[N++] = z, P[N++] = z, P[N++] = z, P[N++] = 1;
									for (var Z = 0; 3 > Z; Z++) S[O++] = 0, S[O++] = 0, S[O++] = 0, S[O++] = 0;
									for (var Z = 3; 7 > Z; Z++) S[O++] = Y, S[O++] = q, S[O++] = K, S[O++] = 1;
									for (var Z = 7; 10 > Z; Z++) S[O++] = 0, S[O++] = 0, S[O++] = 0, S[O++] = 0;
									var $ = (W + E - F - 1.5) / f,
										Q = (H + E) / m,
										J = (W - E - F - 1.5) / f,
										ee = (H - E) / m,
										te = (W + E - F) / f,
										re = (H + E) / m,
										oe = (W - E - F) / f,
										ae = (H - E) / m,
										ie = (W + E + F) / f,
										ne = (H + E) / m,
										se = (W - E + F) / f,
										ue = (H - E) / m,
										he = (W + E + F + 1.5) / f,
										de = (H + E) / m,
										ce = (W - E + F + 1.5) / f,
										fe = (H - E) / m;
									$ = 2 * $ - 1, Q = 2 * Q - 1, J = 2 * J - 1, ee = 2 * ee - 1, te = 2 * te - 1, re = 2 * re - 1, oe = 2 * oe - 1, ae = 2 * ae - 1, ie = 2 * ie - 1, ne = 2 * ne - 1, se = 2 * se - 1, ue = 2 * ue - 1, he = 2 * he - 1, de = 2 * de - 1, ce = 2 * ce - 1, fe = 2 * fe - 1, w[I++] = $, w[I++] = Q, w[I++] = $, w[I++] = Q, w[I++] = J, w[I++] = ee, w[I++] = te, w[I++] = re, w[I++] = oe, w[I++] = ae, w[I++] = ie, w[I++] = ne, w[I++] = se, w[I++] = ue, w[I++] = he, w[I++] = de, w[I++] = ce, w[I++] = fe, w[I++] = ce, w[I++] = fe, G += 10, G >= B && (h.bindBuffer(h.ARRAY_BUFFER, D), h.bufferData(h.ARRAY_BUFFER, new Float32Array(S), h.STATIC_DRAW), h.vertexAttribPointer(b.strokeGrayLevelSlot, 4, h.FLOAT, h.FALSE, 0, 0), h.bindBuffer(h.ARRAY_BUFFER, L), h.bufferData(h.ARRAY_BUFFER, new Float32Array(w), h.STATIC_DRAW), h.vertexAttribPointer(b.positionSlot, 2, h.FLOAT, h.FALSE, 0, 0), h.bindBuffer(h.ARRAY_BUFFER, R), h.bufferData(h.ARRAY_BUFFER, new Float32Array(P), h.STATIC_DRAW), h.vertexAttribPointer(b.shadeSlot, 4, h.FLOAT, h.FALSE, 0, 0), h.drawArrays(h.TRIANGLE_STRIP, 0, B), I = 0, O = 0, N = 0, G = 0)
								}
							}
							B > G && (h.bindBuffer(h.ARRAY_BUFFER, D), h.bufferData(h.ARRAY_BUFFER, new Float32Array(S), h.STATIC_DRAW), h.vertexAttribPointer(b.strokeGrayLevelSlot, 4, h.FLOAT, h.FALSE, 0, 0), h.bindBuffer(h.ARRAY_BUFFER, L), h.bufferData(h.ARRAY_BUFFER, new Float32Array(w), h.STATIC_DRAW), h.vertexAttribPointer(b.positionSlot, 2, h.FLOAT, h.FALSE, 0, 0), h.bindBuffer(h.ARRAY_BUFFER, R), h.bufferData(h.ARRAY_BUFFER, new Float32Array(P), h.STATIC_DRAW), h.vertexAttribPointer(b.shadeSlot, 4, h.FLOAT, h.FALSE, 0, 0), h.drawArrays(h.TRIANGLE_STRIP, 0, G), I = 0, O = 0, N = 0, G = 0)
						}
						h.disable(h.BLEND), h.deleteBuffer(L), h.deleteBuffer(D), h.deleteBuffer(R), h.disableVertexAttribArray(b.positionSlot), h.disableVertexAttribArray(b.strokeGrayLevelSlot), h.disableVertexAttribArray(b.shadeSlot), this._resetRenderingObjects(A), this._swapTextures()
					};
					var we = function(e, t) {
						for (var r = [], o = 0; t > o; o++) r[o] = 25 * (o + 1);
						return r
					};
					r.prototype.drawToolStartEffect = function(e, t) {
						var r = this.gl;
						this.drawToolState = {}, this.glPrograms.multiColorDrawingProgram = xe(this.glPrograms.multiColorDrawingProgram, se, o.MoaMultiColorDrawingVertexShader, o.MoaMultiColorDrawingFragmentShader, !1, r);
						var a = this.glPrograms.multiColorDrawingProgram,
							i = this.glRenderingObjects.readTexture;
						this.drawToolState.cachedRenderingObjects = this._configurePipelineWithTempReadAndWriteTextures(i, e.getTexture()), r.bindFramebuffer(r.FRAMEBUFFER, this.glRenderingObjects.offscreenFramebuffer), r.useProgram(a), this.startRender(a, g.NONE_DONT_CLEAR), r.enable(r.BLEND), t ? (r.blendEquation(r.FUNC_ADD), r.blendFunc(r.ZERO, r.ONE_MINUS_SRC_ALPHA)) : (r.blendEquation(r.FUNC_ADD), r.blendFunc(r.ONE, r.ONE_MINUS_SRC_ALPHA)), "undefined" == typeof this.drawToolState.vertexPositionBuffer && (this.drawToolState.vertexPositionBuffer = r.createBuffer()), "undefined" == typeof this.drawToolState.vertexColorBuffer && (this.drawToolState.vertexColorBuffer = r.createBuffer()), r.enableVertexAttribArray(a.positionSlot), r.enableVertexAttribArray(a.colorSlot)
					}, r.prototype.drawTrianglesWithColor = function(e, t, r) {
						var o = this.gl;
						if (t.length > 2) {
							for (var a = this.glPrograms.multiColorDrawingProgram, i = [], n = [], s = 0, l = 0, u = 0; u < t.length; u++) n[s++] = 2 * (t[u].x / e.width - .5), n[s++] = 2 * (t[u].y / e.height - .5), i[l++] = t[u].color.r / 255, i[l++] = t[u].color.g / 255, i[l++] = t[u].color.b / 255,
								i[l++] = t[u].color.a / 255;
							o.bindBuffer(o.ARRAY_BUFFER, this.drawToolState.vertexPositionBuffer), o.bufferData(o.ARRAY_BUFFER, new Float32Array(n), o.STATIC_DRAW), o.vertexAttribPointer(a.positionSlot, 2, o.FLOAT, o.FALSE, 0, 0), o.bindBuffer(o.ARRAY_BUFFER, this.drawToolState.vertexColorBuffer), o.bufferData(o.ARRAY_BUFFER, new Float32Array(i), o.STATIC_DRAW), o.vertexAttribPointer(a.colorSlot, 4, o.FLOAT, o.FALSE, 0, 0);
							var h = 0;
							r === v.TRIANGLE_STRIP ? h = o.TRIANGLE_STRIP : r === v.TRIANGLE_FAN && (h = o.TRIANGLE_FAN), o.drawArrays(h, 0, t.length)
						}
					}, r.prototype.drawToolEndEffect = function() {
						var e = this.gl;
						this._resetRenderingObjects(this.drawToolState.cachedRenderingObjects), e.disable(e.BLEND);
						var t = this.glPrograms.multiColorDrawingProgram;
						e.disableVertexAttribArray(t.positionSlot), e.disableVertexAttribArray(t.colorSlot), e.bindFramebuffer(e.FRAMEBUFFER, this.glRenderingObjects.offscreenFramebuffer), e.bindBuffer(e.ARRAY_BUFFER, this.glBuffers.vertexBufferFlipped), e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, this.glBuffers.indexBuffer)
					}, r.prototype.applyVignetteToolToMask = function(e, t) {
						var r = this.gl,
							a = (this.glImageData.width, this.glImageData.height, t.gradientShapeType),
							i = (t.aspectMode, t.blendMode, t.wrapMode),
							n = t.invertGradient,
							s = t.alpha,
							l = t.gradMap,
							u = t.gradientParams,
							h = new f(t.gradientTransform);
						h.preTranslate(-.5, -.5);
						var d, c;
						d = this._claimFreeTexture(), r.activeTexture(this._getTextureForIndex(d)), r.bindTexture(r.TEXTURE_2D, e.getTexture()), c = this._getWriteTextureAndSet(e.getTexture());
						var m = this._claimFreeTexture(),
							p = this._createGradientTexture(m, l);
						this.glPrograms.gradientFlareProgram = xe(this.glPrograms.gradientFlareProgram, fe, o.MoaVertexShader, o.MoaGradientFlareFragmentShader, !1, r);
						var v = this.glPrograms.gradientFlareProgram;
						r.useProgram(v), this.startRender(v, g.NONE), r.uniform1f(v.alphaBlendSlot, s), r.uniform1i(v.invertGradientSlot, n ? 1 : 0), r.uniform1i(v.shapeSlot, y.get(a)), r.uniform1i(v.wrapModeSlot, b.get(i)), r.uniform1i(v.gradientMapSlot, m), r.uniformMatrix4fv(v.transformMatSlot, !1, h.transformMatrix), r.uniformMatrix4fv(v.paramsMatSlot, !1, u), this.finishRender(!1), this._getWriteTextureAndSet(c), this._resetTextureToFree(d), r.activeTexture(this._getTextureForIndex(m)), r.bindTexture(r.TEXTURE_2D, null), r.deleteTexture(p), this._resetTextureToFree(m), this.bitmapBlendBitmap(this.glRenderingObjects.writeTexture, this.glImageData.sourceTexture, e.getTexture(), "normal", 1), this._swapTextures()
					}, r.prototype.renderLegacyAdjustments = function(e, t, r, a, i, n, s, l, u, h, d) {
						var c = this.gl;
						if ("undefined" != typeof C.get(h)) {
							var f, m, p, v = this.glImageData.width,
								_ = this.glImageData.height,
								x = !1;
							("normal" != h || 1 != d) && (this.glRenderingObjects.readTexture == this.glImageData.sourceTexture && this.renderIdentity(), f = this.createTexture(v, _), m = this._claimFreeTexture(), c.activeTexture(this._getTextureForIndex(m)), c.bindTexture(c.TEXTURE_2D, f), p = this._getWriteTextureAndSet(f), x = !0), this.glPrograms.brightnessContrastSaturationWarmthProgram = xe(this.glPrograms.brightnessContrastSaturationWarmthProgram, R, o.MoaVertexShader, o.MoaBrightnessContrastSaturationWarmthShader, !1, c);
							var M = this.glPrograms.brightnessContrastSaturationWarmthProgram,
								y = this._claimFreeTexture();
							if (-1 != y) {
								var b = this._createColorMapTexture(i, n, n, y);
								c.useProgram(M), this.startRender(M, g.NONE);
								var T = [1, 0, 0, 0, 1, 0, 0, 0, 1],
									A = [],
									S = [];
								T[0] = u[0], T[1] = u[1], T[2] = u[2], T[3] = u[3], T[4] = u[4], T[5] = u[5], T[6] = u[6], T[7] = u[7], T[8] = u[8], A[0] = s[0], A[1] = s[1], A[2] = s[2], A[3] = s[3], A[4] = s[4], A[5] = s[5], A[6] = s[6], A[7] = s[7], A[8] = s[8], S[0] = l[0], S[1] = l[1], S[2] = l[2], c.uniform1f(M.brightnessSlot, e), c.uniform1f(M.contrastSlot, t), c.uniform1f(M.saturationSlot, r), c.uniform1f(M.warmthSlot, a), c.uniform1i(M.cMapSlot, y), c.uniformMatrix3fv(M.contrastSatAdjustSlot, c.FALSE, T), c.uniformMatrix3fv(M.saturationMatrixSlot, c.FALSE, A), c.uniform3fv(M.warmthDeltaSlot, S), this.finishRender(!x), c.deleteTexture(b), this._resetTextureToFree(y), x && (this._getWriteTextureAndSet(p), this.bitmapBlendBitmap(this.glRenderingObjects.writeTexture, this.glRenderingObjects.readTexture, f, h, d), this._swapTextures(), this._resetTextureToFree(m), c.deleteTexture(f))
							}
						}
					}
				}()
			}, {
				"../../../src/js/core/MoaAllocAndCopy": 34,
				"../../../src/js/core/MoaBitmap": 35,
				"../../../src/js/core/MoaColor.js": 36,
				"../../../src/js/core/MoaTransform": 40,
				"../../../src/js/core/rng": 42,
				"../../../src/js/interactive/MoaRegionInfo": 59,
				"../../../src/js/processors/MoaColorConversion.js": 74,
				"../../../src/js/processors/MoaHistogram.js": 89,
				"../../../src/js/processors/MoaSharpen": 96
			}],
			2: [function(e, t, r) {
				var o = {
					copyCanvas: function(e, t, r, o, a) {
						var i, n = document.createElement("canvas");
						if (void 0 === a)
							if (n.width = e.width, n.height = e.height, i = n.getContext("2d"), "undefined" != typeof avpw$ && avpw$.browser && avpw$.browser.msie) {
								var s = e.getContext("2d");
								i.putImageData(s.getImageData(0, 0, e.width, e.height), 0, 0)
							} else i.drawImage(e, 0, 0);
						else n.width = o, n.height = a, i = n.getContext("2d"), i.drawImage(e, -t, -r);
						return n
					},
					getCanvasPixelData: function(e) {
						var t = e.getContext("2d");
						return t.getImageData(0, 0, e.width, e.height)
					},
					getBitmapForImage: function(e) {
						var t = document.createElement("canvas"),
							r = t.getContext("2d");
						return t.width = e.width, t.height = e.height, r.drawImage(e, 0, 0, e.width, e.height), r.getImageData(0, 0, t.width, t.height)
					},
					convertToPremultipliedAlpha: function(e) {
						for (var t = 0; t < e.height; t++)
							for (var r = 0; r < e.width; r++) {
								var o = 4 * (t * e.width + r),
									a = e.data[o + 3] / 255,
									i = e.data[o],
									n = e.data[o + 1],
									s = e.data[o + 2];
								e.data[o] = a * i, e.data[o + 1] = a * n, e.data[o + 2] = a * s
							}
						return e
					},
					isOriginClean: function(e) {
						var t = !0;
						try {
							e.getImageData(0, 0, 1, 1)
						} catch (r) {
							r && r.message && -1 !== r.message.toLowerCase().indexOf("security") && (t = !1), r && r.name && -1 !== r.name.toLowerCase().indexOf("security") && (t = !1)
						}
						return t
					}
				};
				t.exports = o
			}, {}],
			3: [function(e, t, r) {
				function o(e, t) {
					var r = e.label;
					if (e.system) t.active && t.active();
					else if (a) {
						e.familyStyle && (r += ":" + e.familyStyle);
						var o = {
							loading: t.loading || function() {},
							active: t.active || function() {},
							inactive: t.inactive || function() {}
						};
						e.custom ? (o.custom = {
							families: [r],
							urls: [e.url]
						}, o.active = function() {
							t.active && window.setTimeout(function() {
								t.active()
							}, 0)
						}) : o.google = {
							families: [r]
						}, a.load(o)
					}
				}
				var a = e("./lib/webfontloader.js").WebFont;
				t.exports = {
					loadFont: o
				}
			}, {
				"./lib/webfontloader.js": 7
			}],
			4: [function(e, t, r) {
				var o = e("./../../../src/js/actionlist/MoaLiteRequires");
				"undefined" != typeof Aviary && "undefined" != typeof Aviary.util && (Aviary.util.resourceProvider = e("./MoaResourceProvider"), Aviary.util.cnvs = e("./MoaCanvasUtils.js"), Aviary.util.moaLite = o), t.exports = o
			}, {
				"./../../../src/js/actionlist/MoaLiteRequires": 10,
				"./MoaCanvasUtils.js": 2,
				"./MoaResourceProvider": 5
			}],
			5: [function(e, t, r) {
				function o() {
					var e = {},
						t = {
							saveResource: function(t, r, o) {
								t && r && (e[t + r] = o)
							},
							doesResourceExist: function(t, r) {
								return t && r ? "undefined" != typeof e[t + r] : !1
							},
							effectJSONProvider: function(t, r, o) {
								return e[t + r]
							},
							contentImageProvider: function(t, r, o, a) {
								var n = e[t + r],
									s = i.getBitmapForImage(n);
								return i.convertToPremultipliedAlpha(s)
							},
							frameSegmentProvider: function(t, r, o, a) {
								return e[t + r][o]
							},
							textProvider: a.provideTextImage,
							updateViewDimensions: null,
							context: null,
							utils: {
								TextProvider: a
							}
						};
					return t
				} {
					var a = e("./MoaTextProvider.js"),
						i = e("./MoaCanvasUtils.js");
					e("./lib/webfontloader.js")
				}
				t.exports = o
			}, {
				"./MoaCanvasUtils.js": 2,
				"./MoaTextProvider.js": 6,
				"./lib/webfontloader.js": 7
			}],
			6: [function(e, t, r) {
				function o(e, t) {
					for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]);
					return e
				}

				function a(e, t, r, a, s) {
					t.textCase === M.MoaActionlistTextCaseUpper ? e = e.toUpperCase() : t.textCase === M.MoaActionlistTextCaseLower && (e = e.toLowerCase());
					var u = t.fontSize,
						m = e.length;
					s && "top" === s ? "undefined" != typeof h && "undefined" != typeof d && m > d && (u = h) : s && "bottom" === s && "undefined" != typeof c && "undefined" != typeof f && m > f && (u = c), "League Gothic" === t.fontName && (t.fontName = "LeagueGothic-Regular");
					var p = {
						text: e,
						length: m,
						fontSize: u,
						fontName: t.fontName,
						color: t.color,
						alignment: t.alignment,
						maxLineWidth: 0,
						totalHeight: 0
					};
					o(p, t);
					var g;
					r ? S[s].hasOwnProperty(e) ? g = S[s][e] : (g = i(e, m, u, t, r, p), S[s][e] = g) : g = n(e, m, u, p, !0), o(p, g), s && "top" === s ? (d = e.length, h = p.fontSize) : s && "bottom" === s && (f = e.length, c = p.fontSize);
					var v = l(p);
					return v
				}

				function i(e, t, r, o, a, i) {
					for (var s, l = new Array(2 * e.length), u = {}, h = o.outlineSize * r / o.fontSize, d = -1, c = 0, f = 0, m = 0, p = a.minimumBitmapSize.width, g = a.minimumBitmapSize.height, v = 0, _ = 0, x = 1, M = 0, y = 0, b = 0, C = !1, T = !1, A = 0, S = r + 1, w = 0; t > b;) {
						if (y = b + M, l[y] = e[b], "\n" === l[y]) d = -1, c = 0, _ = 0, x++, t + M - 1 > y && (v = 0 + y + 1), C = !1;
						else {
							if (0 === c && C && (" " === l[y] || "	" === l[y])) {
								M--, b++;
								continue
							}
							c++;
							var P = e.substr(v, c);
							if (s = n(P, c, r, i), _ = s.maxLineWidth, 1 === c) {
								var F = l.join(""),
									E = F.substr(0, y + 1);
								s = n(E, y + 1, r, i), m = s.totalHeight
							}
						}
						" " === l[y] || "	" === l[y] ? (T ? A++ : (d = y, A = 1), T = !0) : (T = !1, A = 0), _ > p && (c = 0, d > -1 ? (l[d] = "\n", M -= Math.max(0, A - 1), b = d - M, t - 1 > b + M && (v = 0 + b + M + 1)) : (l[y] = "\n", M++, b--, t + M - 1 > y && (v = 0 + y + 1)), d = -1, c = 0, _ = 0, x++, C = !0);
						var D = m > g,
							L = b === t - 1 && S - r > 1;
						if (D || L) {
							if (b = 0, d = -1, c = 0, _ = 0, x = 1, v = l, M = 0, y = 0, C = !1, T = !1, A = 0, L) w = r, r++;
							else if (w > 0) S = r, r--;
							else if (r > a.minimumFontSize) {
								S > r && (S = r);
								var R = Math.sqrt(b / (t - 1)),
									B = Math.floor(r * R);
								B < a.minimumFontSize ? r = a.minimumFontSize : B === r ? r-- : r = B
							} else p *= 2, g *= 2, r = o.fontSize, S = r + 1, w = 0;
							h = o.outlineRatio * r
						} else b++
					}
					h = o.outlineRatio * r;
					var O = l.join(""),
						s = n(O, t, r, i, !0),
						I = s.topOffset,
						N = s.bottomOffset,
						G = s.maxLineHeight,
						m = s.totalHeight;
					return u.width = p, u.height = g, {
						length: t,
						maxLineWidth: f,
						fontSize: r,
						outlineSize: h,
						text: O,
						totalHeight: m,
						maxLineHeight: G,
						stringCopy: l,
						outSize: u,
						topOffset: I,
						bottomOffset: N
					}
				}

				function n(e, t, r, o, a) {
					var i = u || document.createElement("canvas"),
						n = i.getContext("2d"),
						l = r,
						h = e.split("\n"),
						d = 0,
						c = 0,
						f = 0;
					s(n, r, o ? o.fontName : null, null, o ? o.alignment : null);
					for (var m, h = e.split("\n"), p = 0; p < h.length; p++) m = n.measureText(h[p]).width, d = Math.max(d, m);
					if (a) {
						for (var v = [], p = 0; 256 > p; p++) v.push(String.fromCharCode(p)); {
							v.join("")
						}
						i.width = 1.5 * o.fontSize, i.height = 1.5 * o.fontSize, s(n, r, o ? o.fontName : null, null, o ? o.alignment : null);
						var _ = i.height / 2;
						n.textAlign = "left", n.fillStyle = "black", n.textBaseline = "middle";
						for (var m, p = 0; p < v.length; p++) n.fillText(v[p], 0, _);
						for (var x = n.getImageData(0, 0, i.width, i.height), M = x.data, y = i.width, b = i.height, C = !1, T = 0, A = 0; b - 1 > A; A++) {
							for (var S = 0; y - 1 > S; S++) {
								var w = 4 * (A * y + S) + 3,
									P = M[w];
								if (P > 0) {
									C = !0, T = A;
									break
								}
							}
							if (C) break
						}
						for (var F = !1, E = b, A = b - 1; A >= T; A--) {
							for (var S = 0; y - 1 > S; S++) {
								var w = 4 * (A * y + S) + 3,
									P = M[w];
								if (P > 0) {
									F = !0, E = A;
									break
								}
							}
							if (F) break
						}
						l = E - T, c = _ - T, f = E - _
					}
					return s(n, r, o ? o.fontName : null, null, o ? o.alignment : null), {
						length: t,
						maxLineWidth: d,
						maxLineHeight: l,
						totalHeight: h.length * r * g,
						topOffset: c,
						bottomOffset: f
					}
				}

				function s(e, t, r, o, a, i, n) {
					var s = (n || "normal") + " " + t + "px " + (r + w || "Arial");
					if (e.font = s, o) {
						var l = o.a / 255;
						e.fillStyle = "rgba(" + o.r + "," + o.g + "," + o.b + "," + l + ")"
					}
					a && (e.textAlign = a), e.textBaseline = "alphabetic"
				}

				function l(e, t, r) {
					var o, a = t || u || document.createElement("canvas"),
						i = a.getContext("2d"),
						n = (e.maxLineHeight, 0),
						l = e.text.split("\n"),
						h = 0,
						d = 0;
					e.outSize ? (a.width = e.outSize.width, a.height = e.outSize.height) : (h = Math.max(_ * e.maxLineWidth, e.fontSize * x), d = Math.max(_ * e.fontSize * l.length * g, e.fontSize * x), a.width = e.maxLineWidth + 2 * h, a.height = e.fontSize * l.length * g + 2 * d), e.vAlignment && e.vAlignment != y ? e.vAlignment == b && (o = a.height - ((l.length * g - 1) * e.fontSize + d)) : o = d + e.fontSize;
					var c;
					if (e.alignment === C ? c = h : e.alignment === T ? c = Math.floor(a.width / 2) : e.alignment === A && (c = a.width - h), s(i, e.fontSize, e.fontName, e.color, e.alignment), e.outlineSize > 0) {
						var f = e.outlineColor,
							m = f.a / 255;
						i.strokeStyle = "rgba(" + f.r + "," + f.g + "," + f.b + "," + m + ")", i.lineWidth = e.outlineSize * v
					}
					for (var M = o, S = 0; S < l.length; S++) e.outlineSize > 0 && i.strokeText(l[S], n + c, o), i.fillText(l[S], n + c, o), o += e.fontSize * g;
					return r ? {
						horizontalPaddingPixels: h,
						yOffset: -(M - a.height) - (l.length - 1) * e.fontSize * g
					} : p.convertToPremultipliedAlpha(i.getImageData(0, 0, a.width, a.height))
				}
				var u, h, d, c, f, m = e("./MoaFontLoader.js"),
					p = e("./MoaCanvasUtils.js"),
					g = 1.17,
					v = 2.4,
					_ = .1,
					x = .5,
					M = {
						MoaActionlistTextCaseNormal: "normal",
						MoaActionlistTextCaseLower: "lower",
						MoaActionlistTextCaseUpper: "upper"
					},
					y = "verticalAlignTop",
					b = "verticalAlignBottom",
					C = "left",
					T = "center",
					A = "right",
					S = {
						top: {},
						bottom: {}
					},
					w = ", 'Arial','Arial-BoldMT','ArialMT','Arial','Lucida Grande','Arial Unicode MS',sans-serif";
				t.exports = {
					provideTextImage: a,
					getStringDimensions: n,
					drawString: l,
					loadFont: m.loadFont
				}
			}, {
				"./MoaCanvasUtils.js": 2,
				"./MoaFontLoader.js": 3
			}],
			7: [function(e, t, r) {
				"use strict";
				if ("undefined" == typeof document) return void(t.exports = {});
				var o = {};
				o.bind = function(e, t, r) {
					var o = arguments.length > 2 ? Array.prototype.slice.call(arguments, 2) : [];
					return function() {
						return o.push.apply(o, arguments), t.apply(e, o)
					}
				}, o.extendsClass = function(e, t) {
					function r() {}
					r.prototype = e.prototype, t.prototype = new r, t.prototype.constructor = t, t.superCtor_ = e, t.super_ = e.prototype
				}, o.DomHelper = function(e) {
					this.document_ = e, this.supportForStyle_ = void 0
				}, o.DomHelper.prototype.createElement = function(e, t, r) {
					var o = this.document_.createElement(e);
					if (t)
						for (var a in t) t.hasOwnProperty(a) && ("style" == a ? this.setStyle(o, t[a]) : o.setAttribute(a, t[a]));
					return r && o.appendChild(this.document_.createTextNode(r)), o
				}, o.DomHelper.prototype.insertInto = function(e, t) {
					var r = this.document_.getElementsByTagName(e)[0];
					return r || (r = document.documentElement), r && r.lastChild ? (r.insertBefore(t, r.lastChild), !0) : !1
				}, o.DomHelper.prototype.whenBodyExists = function(e) {
					var t = function() {
						document.body ? e() : setTimeout(t, 0)
					};
					t()
				}, o.DomHelper.prototype.removeElement = function(e) {
					return e.parentNode ? (e.parentNode.removeChild(e), !0) : !1
				}, o.DomHelper.prototype.createCssLink = function(e) {
					return this.createElement("link", {
						rel: "stylesheet",
						href: e
					})
				}, o.DomHelper.prototype.createScriptSrc = function(e) {
					return this.createElement("script", {
						src: e
					})
				}, o.DomHelper.prototype.appendClassName = function(e, t) {
					for (var r = e.className.split(/\s+/), o = 0, a = r.length; a > o; o++)
						if (r[o] == t) return;
					r.push(t), e.className = r.join(" ").replace(/^\s+/, "")
				}, o.DomHelper.prototype.removeClassName = function(e, t) {
					for (var r = e.className.split(/\s+/), o = [], a = 0, i = r.length; i > a; a++) r[a] != t && o.push(r[a]);
					e.className = o.join(" ").replace(/^\s+/, "").replace(/\s+$/, "")
				}, o.DomHelper.prototype.hasClassName = function(e, t) {
					for (var r = e.className.split(/\s+/), o = 0, a = r.length; a > o; o++)
						if (r[o] == t) return !0;
					return !1
				}, o.DomHelper.prototype.setStyle = function(e, t) {
					this.hasSupportForStyle_() ? e.setAttribute("style", t) : e.style.cssText = t
				}, o.DomHelper.prototype.hasSupportForStyle_ = function() {
					if (void 0 === this.supportForStyle_) {
						var e = this.document_.createElement("p");
						e.innerHTML = '<a style="top:1px;">w</a>', this.supportForStyle_ = /top/.test(e.getElementsByTagName("a")[0].getAttribute("style"))
					}
					return this.supportForStyle_
				}, o.UserAgent = function(e, t, r, o, a, i, n, s) {
					this.name_ = e, this.version_ = t, this.engine_ = r, this.engineVersion_ = o, this.platform_ = a, this.platformVersion_ = i, this.documentMode_ = n, this.webFontSupport_ = s
				}, o.UserAgent.prototype.getName = function() {
					return this.name_
				}, o.UserAgent.prototype.getVersion = function() {
					return this.version_
				}, o.UserAgent.prototype.getEngine = function() {
					return this.engine_
				}, o.UserAgent.prototype.getEngineVersion = function() {
					return this.engineVersion_
				}, o.UserAgent.prototype.getPlatform = function() {
					return this.platform_
				}, o.UserAgent.prototype.getPlatformVersion = function() {
					return this.platformVersion_
				}, o.UserAgent.prototype.getDocumentMode = function() {
					return this.documentMode_
				}, o.UserAgent.prototype.isSupportingWebFont = function() {
					return this.webFontSupport_
				}, o.UserAgentParser = function(e, t) {
					this.userAgent_ = e, this.doc_ = t
				}, o.UserAgentParser.UNKNOWN = "Unknown", o.UserAgentParser.UNKNOWN_USER_AGENT = new o.UserAgent(o.UserAgentParser.UNKNOWN, o.UserAgentParser.UNKNOWN, o.UserAgentParser.UNKNOWN, o.UserAgentParser.UNKNOWN, o.UserAgentParser.UNKNOWN, o.UserAgentParser.UNKNOWN, void 0, !1), o.UserAgentParser.prototype.parse = function() {
					return this.isIe_() ? this.parseIeUserAgentString_() : this.isOpera_() ? this.parseOperaUserAgentString_() : this.isWebKit_() ? this.parseWebKitUserAgentString_() : this.isGecko_() ? this.parseGeckoUserAgentString_() : o.UserAgentParser.UNKNOWN_USER_AGENT
				}, o.UserAgentParser.prototype.getPlatform_ = function() {
					var e = this.getMatchingGroup_(this.userAgent_, /(iPod|iPad|iPhone|Android)/, 1);
					if ("" != e) return e;
					var t = this.getMatchingGroup_(this.userAgent_, /(Linux|Mac_PowerPC|Macintosh|Windows|CrOS)/, 1);
					return "" != t ? ("Mac_PowerPC" == t && (t = "Macintosh"), t) : o.UserAgentParser.UNKNOWN
				}, o.UserAgentParser.prototype.getPlatformVersion_ = function() {
					var e = this.getMatchingGroup_(this.userAgent_, /(OS X|Windows NT|Android|CrOS) ([^;)]+)/, 2);
					if (e) return e;
					var t = this.getMatchingGroup_(this.userAgent_, /(iPhone )?OS ([\d_]+)/, 2);
					if (t) return t;
					var r = this.getMatchingGroup_(this.userAgent_, /Linux ([i\d]+)/, 1);
					return r ? r : o.UserAgentParser.UNKNOWN
				}, o.UserAgentParser.prototype.isIe_ = function() {
					return -1 != this.userAgent_.indexOf("MSIE")
				}, o.UserAgentParser.prototype.parseIeUserAgentString_ = function() {
					{
						var e = this.getMatchingGroup_(this.userAgent_, /(MSIE [\d\w\.]+)/, 1);
						o.UserAgentParser.UNKNOWN, o.UserAgentParser.UNKNOWN
					}
					if ("" != e) {
						var t = e.split(" "),
							r = t[0],
							a = t[1];
						return new o.UserAgent(r, a, r, a, this.getPlatform_(), this.getPlatformVersion_(), this.getDocumentMode_(this.doc_), this.getMajorVersion_(a) >= 6)
					}
					return new o.UserAgent("MSIE", o.UserAgentParser.UNKNOWN, "MSIE", o.UserAgentParser.UNKNOWN, this.getPlatform_(), this.getPlatformVersion_(), this.getDocumentMode_(this.doc_), !1)
				}, o.UserAgentParser.prototype.isOpera_ = function() {
					return -1 != this.userAgent_.indexOf("Opera")
				}, o.UserAgentParser.prototype.parseOperaUserAgentString_ = function() {
					var e = o.UserAgentParser.UNKNOWN,
						t = o.UserAgentParser.UNKNOWN,
						r = this.getMatchingGroup_(this.userAgent_, /(Presto\/[\d\w\.]+)/, 1);
					if ("" != r) {
						var a = r.split("/");
						e = a[0], t = a[1]
					} else {
						-1 != this.userAgent_.indexOf("Gecko") && (e = "Gecko");
						var i = this.getMatchingGroup_(this.userAgent_, /rv:([^\)]+)/, 1);
						"" != i && (t = i)
					}
					if (-1 != this.userAgent_.indexOf("Opera Mini/")) {
						var n = this.getMatchingGroup_(this.userAgent_, /Opera Mini\/([\d\.]+)/, 1);
						return "" == n && (n = o.UserAgentParser.UNKNOWN), new o.UserAgent("OperaMini", n, e, t, this.getPlatform_(), this.getPlatformVersion_(), this.getDocumentMode_(this.doc_), !1)
					}
					if (-1 != this.userAgent_.indexOf("Version/")) {
						var n = this.getMatchingGroup_(this.userAgent_, /Version\/([\d\.]+)/, 1);
						if ("" != n) return new o.UserAgent("Opera", n, e, t, this.getPlatform_(), this.getPlatformVersion_(), this.getDocumentMode_(this.doc_), this.getMajorVersion_(n) >= 10)
					}
					var n = this.getMatchingGroup_(this.userAgent_, /Opera[\/ ]([\d\.]+)/, 1);
					return "" != n ? new o.UserAgent("Opera", n, e, t, this.getPlatform_(), this.getPlatformVersion_(), this.getDocumentMode_(this.doc_), this.getMajorVersion_(n) >= 10) : new o.UserAgent("Opera", o.UserAgentParser.UNKNOWN, e, t, this.getPlatform_(), this.getPlatformVersion_(), this.getDocumentMode_(this.doc_), !1)
				}, o.UserAgentParser.prototype.isWebKit_ = function() {
					return -1 != this.userAgent_.indexOf("AppleWebKit")
				}, o.UserAgentParser.prototype.parseWebKitUserAgentString_ = function() {
					var e = this.getPlatform_(),
						t = this.getPlatformVersion_(),
						r = this.getMatchingGroup_(this.userAgent_, /AppleWebKit\/([\d\.\+]+)/, 1);
					"" == r && (r = o.UserAgentParser.UNKNOWN);
					var a = o.UserAgentParser.UNKNOWN; - 1 != this.userAgent_.indexOf("Chrome") || -1 != this.userAgent_.indexOf("CrMo") || -1 != this.userAgent_.indexOf("CriOS") ? a = "Chrome" : -1 != this.userAgent_.indexOf("Safari") ? a = "Safari" : -1 != this.userAgent_.indexOf("AdobeAIR") && (a = "AdobeAIR");
					var i = o.UserAgentParser.UNKNOWN; - 1 != this.userAgent_.indexOf("Version/") ? i = this.getMatchingGroup_(this.userAgent_, /Version\/([\d\.\w]+)/, 1) : "Chrome" == a ? i = this.getMatchingGroup_(this.userAgent_, /(Chrome|CrMo|CriOS)\/([\d\.]+)/, 2) : "AdobeAIR" == a && (i = this.getMatchingGroup_(this.userAgent_, /AdobeAIR\/([\d\.]+)/, 1));
					var n = !1;
					if ("AdobeAIR" == a) {
						var s = this.getMatchingGroup_(i, /\d+\.(\d+)/, 1);
						n = this.getMajorVersion_(i) > 2 || 2 == this.getMajorVersion_(i) && parseInt(s, 10) >= 5
					} else {
						var s = this.getMatchingGroup_(r, /\d+\.(\d+)/, 1);
						n = this.getMajorVersion_(r) >= 526 || this.getMajorVersion_(r) >= 525 && parseInt(s, 10) >= 13
					}
					return new o.UserAgent(a, i, "AppleWebKit", r, e, t, this.getDocumentMode_(this.doc_), n)
				}, o.UserAgentParser.prototype.isGecko_ = function() {
					return -1 != this.userAgent_.indexOf("Gecko")
				}, o.UserAgentParser.prototype.parseGeckoUserAgentString_ = function() {
					var e = o.UserAgentParser.UNKNOWN,
						t = o.UserAgentParser.UNKNOWN,
						r = !1;
					if (-1 != this.userAgent_.indexOf("Firefox")) {
						e = "Firefox";
						var a = this.getMatchingGroup_(this.userAgent_, /Firefox\/([\d\w\.]+)/, 1);
						if ("" != a) {
							var i = this.getMatchingGroup_(a, /\d+\.(\d+)/, 1);
							t = a, r = "" != a && this.getMajorVersion_(a) >= 3 && parseInt(i, 10) >= 5
						}
					} else -1 != this.userAgent_.indexOf("Mozilla") && (e = "Mozilla");
					var n = this.getMatchingGroup_(this.userAgent_, /rv:([^\)]+)/, 1);
					if ("" == n) n = o.UserAgentParser.UNKNOWN;
					else if (!r) {
						var s = this.getMajorVersion_(n),
							l = parseInt(this.getMatchingGroup_(n, /\d+\.(\d+)/, 1), 10),
							u = parseInt(this.getMatchingGroup_(n, /\d+\.\d+\.(\d+)/, 1), 10);
						r = s > 1 || 1 == s && l > 9 || 1 == s && 9 == l && u >= 2 || null != n.match(/1\.9\.1b[123]/) || null != n.match(/1\.9\.1\.[\d\.]+/)
					}
					return new o.UserAgent(e, t, "Gecko", n, this.getPlatform_(), this.getPlatformVersion_(), this.getDocumentMode_(this.doc_), r)
				}, o.UserAgentParser.prototype.getMajorVersion_ = function(e) {
					var t = this.getMatchingGroup_(e, /(\d+)/, 1);
					return "" != t ? parseInt(t, 10) : -1
				}, o.UserAgentParser.prototype.getMatchingGroup_ = function(e, t, r) {
					var o = e.match(t);
					return o && o[r] ? o[r] : ""
				}, o.UserAgentParser.prototype.getDocumentMode_ = function(e) {
					return e.documentMode ? e.documentMode : void 0
				}, o.EventDispatcher = function(e, t, r, a) {
					this.domHelper_ = e, this.htmlElement_ = t, this.callbacks_ = r, this.namespace_ = a || o.EventDispatcher.DEFAULT_NAMESPACE, this.cssClassName_ = new o.CssClassName("-")
				}, o.EventDispatcher.DEFAULT_NAMESPACE = "wf", o.EventDispatcher.LOADING = "loading", o.EventDispatcher.ACTIVE = "active", o.EventDispatcher.INACTIVE = "inactive", o.EventDispatcher.FONT = "font", o.EventDispatcher.prototype.dispatchLoading = function() {
					this.domHelper_.appendClassName(this.htmlElement_, this.cssClassName_.build(this.namespace_, o.EventDispatcher.LOADING)), this.dispatch_(o.EventDispatcher.LOADING)
				}, o.EventDispatcher.prototype.dispatchFontLoading = function(e, t) {
					this.domHelper_.appendClassName(this.htmlElement_, this.cssClassName_.build(this.namespace_, e, t, o.EventDispatcher.LOADING)), this.dispatch_(o.EventDispatcher.FONT + o.EventDispatcher.LOADING, e, t)
				}, o.EventDispatcher.prototype.dispatchFontActive = function(e, t) {
					this.domHelper_.removeClassName(this.htmlElement_, this.cssClassName_.build(this.namespace_, e, t, o.EventDispatcher.LOADING)), this.domHelper_.removeClassName(this.htmlElement_, this.cssClassName_.build(this.namespace_, e, t, o.EventDispatcher.INACTIVE)), this.domHelper_.appendClassName(this.htmlElement_, this.cssClassName_.build(this.namespace_, e, t, o.EventDispatcher.ACTIVE)), this.dispatch_(o.EventDispatcher.FONT + o.EventDispatcher.ACTIVE, e, t)
				}, o.EventDispatcher.prototype.dispatchFontInactive = function(e, t) {
					this.domHelper_.removeClassName(this.htmlElement_, this.cssClassName_.build(this.namespace_, e, t, o.EventDispatcher.LOADING));
					var r = this.domHelper_.hasClassName(this.htmlElement_, this.cssClassName_.build(this.namespace_, e, t, o.EventDispatcher.ACTIVE));
					r || this.domHelper_.appendClassName(this.htmlElement_, this.cssClassName_.build(this.namespace_, e, t, o.EventDispatcher.INACTIVE)), this.dispatch_(o.EventDispatcher.FONT + o.EventDispatcher.INACTIVE, e, t)
				}, o.EventDispatcher.prototype.dispatchInactive = function() {
					this.domHelper_.removeClassName(this.htmlElement_, this.cssClassName_.build(this.namespace_, o.EventDispatcher.LOADING));
					var e = this.domHelper_.hasClassName(this.htmlElement_, this.cssClassName_.build(this.namespace_, o.EventDispatcher.ACTIVE));
					e || this.domHelper_.appendClassName(this.htmlElement_, this.cssClassName_.build(this.namespace_, o.EventDispatcher.INACTIVE)), this.dispatch_(o.EventDispatcher.INACTIVE)
				}, o.EventDispatcher.prototype.dispatchActive = function() {
					this.domHelper_.removeClassName(this.htmlElement_, this.cssClassName_.build(this.namespace_, o.EventDispatcher.LOADING)), this.domHelper_.removeClassName(this.htmlElement_, this.cssClassName_.build(this.namespace_, o.EventDispatcher.INACTIVE)), this.domHelper_.appendClassName(this.htmlElement_, this.cssClassName_.build(this.namespace_, o.EventDispatcher.ACTIVE)), this.dispatch_(o.EventDispatcher.ACTIVE)
				}, o.EventDispatcher.prototype.dispatch_ = function(e, t, r) {
					this.callbacks_[e] && this.callbacks_[e](t, r)
				}, o.FontModuleLoader = function() {
					this.modules_ = {}
				}, o.FontModuleLoader.prototype.addModuleFactory = function(e, t) {
					this.modules_[e] = t
				}, o.FontModuleLoader.prototype.getModules = function(e) {
					var t = [];
					for (var r in e)
						if (e.hasOwnProperty(r)) {
							var o = this.modules_[r];
							o && t.push(o(e[r]))
						}
					return t
				}, o.FontWatcher = function(e, t, r, o, a) {
					this.domHelper_ = e, this.eventDispatcher_ = t, this.fontSizer_ = r, this.asyncCall_ = o, this.getTime_ = a, this.currentlyWatched_ = 0, this.last_ = !1, this.success_ = !1
				}, o.FontWatcher.DEFAULT_VARIATION = "n4", o.FontWatcher.prototype.watch = function(e, t, r, a, i) {
					for (var n = e.length, s = 0; n > s; s++) {
						var l = e[s];
						t[l] || (t[l] = [o.FontWatcher.DEFAULT_VARIATION]), this.currentlyWatched_ += t[l].length
					}
					i && (this.last_ = i);
					for (var s = 0; n > s; s++)
						for (var l = e[s], u = t[l], h = r[l], d = 0, c = u.length; c > d; d++) {
							var f = u[d];
							this.eventDispatcher_.dispatchFontLoading(l, f);
							var m = o.bind(this, this.fontActive_),
								p = o.bind(this, this.fontInactive_),
								g = new a(m, p, this.domHelper_, this.fontSizer_, this.asyncCall_, this.getTime_, l, f, h);
							g.start()
						}
				}, o.FontWatcher.prototype.fontActive_ = function(e, t) {
					this.eventDispatcher_.dispatchFontActive(e, t), this.success_ = !0, this.decreaseCurrentlyWatched_()
				}, o.FontWatcher.prototype.fontInactive_ = function(e, t) {
					this.eventDispatcher_.dispatchFontInactive(e, t), this.decreaseCurrentlyWatched_()
				}, o.FontWatcher.prototype.decreaseCurrentlyWatched_ = function() {
					0 == --this.currentlyWatched_ && this.last_ && (this.success_ ? this.eventDispatcher_.dispatchActive() : this.eventDispatcher_.dispatchInactive())
				}, o.FontWatchRunner = function(e, t, r, a, i, n, s, l, u) {
					this.activeCallback_ = e, this.inactiveCallback_ = t, this.domHelper_ = r, this.fontSizer_ = a, this.asyncCall_ = i, this.getTime_ = n, this.nameHelper_ = new o.CssFontFamilyName, this.fvd_ = new o.FontVariationDescription, this.fontFamily_ = s, this.fontDescription_ = l, this.fontTestString_ = u || o.FontWatchRunner.DEFAULT_TEST_STRING, this.originalSizeA_ = this.getDefaultFontSize_(o.FontWatchRunner.DEFAULT_FONTS_A), this.originalSizeB_ = this.getDefaultFontSize_(o.FontWatchRunner.DEFAULT_FONTS_B), this.lastObservedSizeA_ = this.originalSizeA_, this.lastObservedSizeB_ = this.originalSizeB_, this.requestedFontA_ = this.createHiddenElementWithFont_(o.FontWatchRunner.DEFAULT_FONTS_A), this.requestedFontB_ = this.createHiddenElementWithFont_(o.FontWatchRunner.DEFAULT_FONTS_B)
				}, o.FontWatchRunner.DEFAULT_FONTS_A = "arial,'URW Gothic L',sans-serif", o.FontWatchRunner.DEFAULT_FONTS_B = "Georgia,'Century Schoolbook L',serif", o.FontWatchRunner.DEFAULT_TEST_STRING = "BESbswy", o.FontWatchRunner.prototype.start = function() {
					this.started_ = this.getTime_(), this.check_()
				}, o.FontWatchRunner.prototype.check_ = function() {
					var e = this.fontSizer_.getWidth(this.requestedFontA_),
						t = this.fontSizer_.getWidth(this.requestedFontB_);
					this.originalSizeA_ == e && this.originalSizeB_ == t || this.lastObservedSizeA_ != e || this.lastObservedSizeB_ != t ? this.getTime_() - this.started_ >= 5e3 ? this.finish_(this.inactiveCallback_) : (this.lastObservedSizeA_ = e, this.lastObservedSizeB_ = t, this.asyncCheck_()) : this.finish_(this.activeCallback_)
				}, o.FontWatchRunner.prototype.asyncCheck_ = function() {
					this.asyncCall_(function(e, t) {
						return function() {
							t.call(e)
						}
					}(this, this.check_), 25)
				}, o.FontWatchRunner.prototype.finish_ = function(e) {
					this.domHelper_.removeElement(this.requestedFontA_), this.domHelper_.removeElement(this.requestedFontB_), e(this.fontFamily_, this.fontDescription_)
				}, o.FontWatchRunner.prototype.getDefaultFontSize_ = function(e) {
					var t = this.createHiddenElementWithFont_(e, !0),
						r = this.fontSizer_.getWidth(t);
					return this.domHelper_.removeElement(t), r
				}, o.FontWatchRunner.prototype.createHiddenElementWithFont_ = function(e, t) {
					var r = this.computeStyleString_(e, this.fontDescription_, t),
						o = this.domHelper_.createElement("span", {
							style: r
						}, this.fontTestString_);
					return this.domHelper_.insertInto("body", o), o
				}, o.FontWatchRunner.prototype.computeStyleString_ = function(e, t, r) {
					var o = this.fvd_.expand(t),
						a = "position:absolute;top:-999px;left:-999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;font-family:" + (r ? "" : this.nameHelper_.quote(this.fontFamily_) + ",") + e + ";" + o;
					return a
				}, o.WebFont = function(e, t, r, o, a) {
					this.domHelper_ = e, this.fontModuleLoader_ = t, this.htmlElement_ = r, this.asyncCall_ = o, this.userAgent_ = a, this.moduleLoading_ = 0, this.moduleFailedLoading_ = 0
				}, o.WebFont.prototype.addModule = function(e, t) {
					this.fontModuleLoader_.addModuleFactory(e, t)
				}, o.WebFont.prototype.load = function(e) {
					var t = new o.EventDispatcher(this.domHelper_, this.htmlElement_, e);
					this.userAgent_.isSupportingWebFont() ? this.load_(t, e) : t.dispatchInactive()
				}, o.WebFont.prototype.isModuleSupportingUserAgent_ = function(e, t, r, a) {
					var i = e.getFontWatchRunnerCtor ? e.getFontWatchRunnerCtor() : o.FontWatchRunner;
					if (!a) {
						var n = 0 == --this.moduleLoading_;
						return this.moduleFailedLoading_--, n && (0 == this.moduleFailedLoading_ ? t.dispatchInactive() : t.dispatchLoading()), void r.watch([], {}, {}, i, n)
					}
					e.load(o.bind(this, this.onModuleReady_, t, r, i))
				}, o.WebFont.prototype.onModuleReady_ = function(e, t, r, a, i, n) {
					var s = 0 == --this.moduleLoading_;
					s && e.dispatchLoading(), this.asyncCall_(o.bind(this, function(e, t, r, o, a, i) {
						e.watch(t, r || {}, o || {}, a, i)
					}, t, a, i, n, r, s))
				}, o.WebFont.prototype.load_ = function(e, t) {
					var r = this.fontModuleLoader_.getModules(t),
						a = this;
					this.moduleFailedLoading_ = this.moduleLoading_ = r.length;
					for (var i = new o.FontWatcher(this.domHelper_, e, {
							getWidth: function(e) {
								return e.offsetWidth
							}
						}, a.asyncCall_, function() {
							return (new Date).getTime()
						}), n = 0, s = r.length; s > n; n++) {
						var l = r[n];
						l.supportUserAgent(this.userAgent_, o.bind(this, this.isModuleSupportingUserAgent_, l, e, i))
					}
				}, o.CssClassName = function(e) {
					this.joinChar_ = e || o.CssClassName.DEFAULT_JOIN_CHAR
				}, o.CssClassName.DEFAULT_JOIN_CHAR = "-", o.CssClassName.prototype.sanitize = function(e) {
					return e.replace(/[\W_]+/g, "").toLowerCase()
				}, o.CssClassName.prototype.build = function(e) {
					for (var t = [], r = 0; r < arguments.length; r++) t.push(this.sanitize(arguments[r]));
					return t.join(this.joinChar_)
				}, o.CssFontFamilyName = function() {
					this.quote_ = "'"
				}, o.CssFontFamilyName.prototype.quote = function(e) {
					for (var t = [], r = e.split(/,\s*/), o = 0; o < r.length; o++) {
						var a = r[o].replace(/['"]/g, "");
						t.push(-1 == a.indexOf(" ") ? a : this.quote_ + a + this.quote_)
					}
					return t.join(",")
				}, o.FontVariationDescription = function() {
					this.properties_ = o.FontVariationDescription.PROPERTIES, this.values_ = o.FontVariationDescription.VALUES
				}, o.FontVariationDescription.PROPERTIES = ["font-style", "font-weight"], o.FontVariationDescription.VALUES = {
					"font-style": [
						["n", "normal"],
						["i", "italic"],
						["o", "oblique"]
					],
					"font-weight": [
						["1", "100"],
						["2", "200"],
						["3", "300"],
						["4", "400"],
						["5", "500"],
						["6", "600"],
						["7", "700"],
						["8", "800"],
						["9", "900"],
						["4", "normal"],
						["7", "bold"]
					]
				}, o.FontVariationDescription.Item = function(e, t, r) {
					this.index_ = e, this.property_ = t, this.values_ = r
				}, o.FontVariationDescription.Item.prototype.compact = function(e, t) {
					for (var r = 0; r < this.values_.length; r++)
						if (t == this.values_[r][1]) return void(e[this.index_] = this.values_[r][0])
				}, o.FontVariationDescription.Item.prototype.expand = function(e, t) {
					for (var r = 0; r < this.values_.length; r++)
						if (t == this.values_[r][0]) return void(e[this.index_] = this.property_ + ":" + this.values_[r][1])
				}, o.FontVariationDescription.prototype.compact = function(e) {
					for (var t = ["n", "4"], r = e.split(";"), o = 0, a = r.length; a > o; o++) {
						var i = r[o].replace(/\s+/g, "").split(":");
						if (2 == i.length) {
							var n = i[0],
								s = i[1],
								l = this.getItem_(n);
							l && l.compact(t, s)
						}
					}
					return t.join("")
				}, o.FontVariationDescription.prototype.expand = function(e) {
					if (2 != e.length) return null;
					for (var t = [null, null], r = 0, a = this.properties_.length; a > r; r++) {
						var i = this.properties_[r],
							n = e.substr(r, 1),
							s = this.values_[i],
							l = new o.FontVariationDescription.Item(r, i, s);
						l.expand(t, n)
					}
					return t[0] && t[1] ? t.join(";") + ";" : null
				}, o.FontVariationDescription.prototype.getItem_ = function(e) {
					for (var t = 0; t < this.properties_.length; t++)
						if (e == this.properties_[t]) {
							var r = this.values_[e];
							return new o.FontVariationDescription.Item(t, e, r)
						}
					return null
				};
				var a = "WebFont",
					i = t.exports[a] = function() {
						var e = new o.UserAgentParser(navigator.userAgent, document),
							t = e.parse(),
							r = new o.DomHelper(document),
							a = function(e, t) {
								setTimeout(e, t)
							};
						return new o.WebFont(r, new o.FontModuleLoader, document.documentElement, a, t)
					}();
				i.load = i.load, i.addModule = i.addModule, o.UserAgent.prototype.getName = o.UserAgent.prototype.getName, o.UserAgent.prototype.getVersion = o.UserAgent.prototype.getVersion, o.UserAgent.prototype.getEngine = o.UserAgent.prototype.getEngine, o.UserAgent.prototype.getEngineVersion = o.UserAgent.prototype.getEngineVersion,
					o.UserAgent.prototype.getPlatform = o.UserAgent.prototype.getPlatform, o.UserAgent.prototype.getPlatformVersion = o.UserAgent.prototype.getPlatformVersion, o.UserAgent.prototype.getDocumentMode = o.UserAgent.prototype.getDocumentMode, o.UserAgent.prototype.isSupportingWebFont = o.UserAgent.prototype.isSupportingWebFont, o.FontdeckScript = function(e, t, r) {
						this.global_ = e, this.domHelper_ = t, this.configuration_ = r, this.fontFamilies_ = [], this.fontVariations_ = {}, this.fvd_ = new o.FontVariationDescription
					}, o.FontdeckScript.NAME = "fontdeck", o.FontdeckScript.HOOK = "__webfontfontdeckmodule__", o.FontdeckScript.API = "//f.fontdeck.com/s/css/js/", o.FontdeckScript.prototype.getScriptSrc = function(e) {
						var t = "https:" == this.global_.location.protocol ? "https:" : "http:",
							r = this.configuration_.api || o.FontdeckScript.API;
						return t + r + this.global_.document.location.hostname + "/" + e + ".js"
					}, o.FontdeckScript.prototype.supportUserAgent = function(e, t) {
						var r = this.configuration_.id,
							a = this;
						if (r) {
							this.global_[o.FontdeckScript.HOOK] || (this.global_[o.FontdeckScript.HOOK] = {}), this.global_[o.FontdeckScript.HOOK][r] = function(e, r) {
								for (var o = 0, i = r.fonts.length; i > o; ++o) {
									var n = r.fonts[o];
									a.fontFamilies_.push(n.name), a.fontVariations_[n.name] = [a.fvd_.compact("font-weight:" + n.weight + ";font-style:" + n.style)]
								}
								t(e)
							};
							var i = this.domHelper_.createScriptSrc(this.getScriptSrc(r));
							this.domHelper_.insertInto("head", i)
						} else t(!0)
					}, o.FontdeckScript.prototype.load = function(e) {
						e(this.fontFamilies_, this.fontVariations_)
					}, i.addModule(o.FontdeckScript.NAME, function(e) {
						var t = new o.DomHelper(document);
						return new o.FontdeckScript(window, t, e)
					}), o.CustomCss = function(e, t) {
						this.domHelper_ = e, this.configuration_ = t
					}, o.CustomCss.NAME = "custom", o.CustomCss.prototype.load = function(e) {
						for (var t = this.configuration_.urls || [], r = this.configuration_.families || [], o = 0, a = t.length; a > o; o++) {
							var i = t[o];
							this.domHelper_.insertInto("head", this.domHelper_.createCssLink(i))
						}
						e(r)
					}, o.CustomCss.prototype.supportUserAgent = function(e, t) {
						return t(e.isSupportingWebFont())
					}, i.addModule(o.CustomCss.NAME, function(e) {
						var t = new o.DomHelper(document);
						return new o.CustomCss(t, e)
					}), o.LastResortWebKitFontWatchRunner = function(e, t, r, a, i, n, s, l, u) {
						o.LastResortWebKitFontWatchRunner.superCtor_.call(this, e, t, r, a, i, n, s, l, u), this.webKitLastResortFontSizes_ = this.setUpWebKitLastResortFontSizes_(), this.webKitLastResortSizeChange_ = !1
					}, o.extendsClass(o.FontWatchRunner, o.LastResortWebKitFontWatchRunner), o.LastResortWebKitFontWatchRunner.METRICS_COMPATIBLE_FONTS = {
						Arimo: !0,
						Cousine: !0,
						Tinos: !0
					}, o.LastResortWebKitFontWatchRunner.prototype.setUpWebKitLastResortFontSizes_ = function() {
						var e = ["Times New Roman", "Arial", "Times", "Sans", "Serif"],
							t = e.length,
							r = {},
							o = this.createHiddenElementWithFont_(e[0], !0);
						r[this.fontSizer_.getWidth(o)] = !0;
						for (var a = 1; t > a; a++) {
							var i = e[a];
							this.domHelper_.setStyle(o, this.computeStyleString_(i, this.fontDescription_, !0)), r[this.fontSizer_.getWidth(o)] = !0, "4" != this.fontDescription_[1] && (this.domHelper_.setStyle(o, this.computeStyleString_(i, this.fontDescription_[0] + "4", !0)), r[this.fontSizer_.getWidth(o)] = !0)
						}
						return this.domHelper_.removeElement(o), r
					}, o.LastResortWebKitFontWatchRunner.prototype.check_ = function() {
						var e = this.fontSizer_.getWidth(this.requestedFontA_),
							t = this.fontSizer_.getWidth(this.requestedFontB_);
						!this.webKitLastResortSizeChange_ && e == t && this.webKitLastResortFontSizes_[e] && (this.webKitLastResortFontSizes_ = {}, this.webKitLastResortFontSizes_[e] = !0, this.webKitLastResortSizeChange_ = !0), this.originalSizeA_ == e && this.originalSizeB_ == t || this.webKitLastResortFontSizes_[e] || this.webKitLastResortFontSizes_[t] ? this.getTime_() - this.started_ >= 5e3 ? this.finish_(this.webKitLastResortFontSizes_[e] && this.webKitLastResortFontSizes_[t] && o.LastResortWebKitFontWatchRunner.METRICS_COMPATIBLE_FONTS[this.fontFamily_] ? this.activeCallback_ : this.inactiveCallback_) : this.asyncCheck_() : this.finish_(this.activeCallback_)
					}, o.FontApiUrlBuilder = function(e) {
						if (e) this.apiUrl_ = e;
						else {
							var t = "https:" == window.location.protocol ? "https:" : "http:";
							this.apiUrl_ = t + o.FontApiUrlBuilder.DEFAULT_API_URL
						}
						this.fontFamilies_ = [], this.subsets_ = []
					}, o.FontApiUrlBuilder.DEFAULT_API_URL = "//fonts.googleapis.com/css", o.FontApiUrlBuilder.prototype.setFontFamilies = function(e) {
						this.parseFontFamilies_(e)
					}, o.FontApiUrlBuilder.prototype.parseFontFamilies_ = function(e) {
						for (var t = e.length, r = 0; t > r; r++) {
							var o = e[r].split(":");
							3 == o.length && this.subsets_.push(o.pop());
							var a = "";
							2 == o.length && "" != o[1] && (a = ":"), this.fontFamilies_.push(o.join(a))
						}
					}, o.FontApiUrlBuilder.prototype.webSafe = function(e) {
						return e.replace(/ /g, "+")
					}, o.FontApiUrlBuilder.prototype.build = function() {
						if (0 == this.fontFamilies_.length) throw new Error("No fonts to load !");
						if (-1 != this.apiUrl_.indexOf("kit=")) return this.apiUrl_;
						for (var e = this.fontFamilies_.length, t = [], r = 0; e > r; r++) t.push(this.webSafe(this.fontFamilies_[r]));
						var o = this.apiUrl_ + "?family=" + t.join("%7C");
						return this.subsets_.length > 0 && (o += "&subset=" + this.subsets_.join(",")), o
					}, o.FontApiParser = function(e) {
						this.fontFamilies_ = e, this.parsedFontFamilies_ = [], this.variations_ = {}, this.fontTestStrings_ = {}, this.fvd_ = new o.FontVariationDescription
					}, o.FontApiParser.VARIATIONS = {
						ultralight: "n2",
						light: "n3",
						regular: "n4",
						bold: "n7",
						italic: "i4",
						bolditalic: "i7",
						ul: "n2",
						l: "n3",
						r: "n4",
						b: "n7",
						i: "i4",
						bi: "i7"
					}, o.FontApiParser.INT_FONTS = {
						latin: o.FontWatchRunner.DEFAULT_TEST_STRING,
						cyrillic: "&#1081;&#1103;&#1046;",
						greek: "&#945;&#946;&#931;",
						khmer: "&#x1780;&#x1781;&#x1782;",
						Hanuman: "&#x1780;&#x1781;&#x1782;"
					}, o.FontApiParser.prototype.parse = function() {
						for (var e = this.fontFamilies_.length, t = 0; e > t; t++) {
							var r = this.fontFamilies_[t].split(":"),
								a = r[0].replace(/\+/g, " "),
								i = ["n4"];
							if (r.length >= 2) {
								var n = this.parseVariations_(r[1]);
								if (n.length > 0 && (i = n), 3 == r.length) {
									var s = this.parseSubsets_(r[2]);
									if (s.length > 0) {
										var l = o.FontApiParser.INT_FONTS[s[0]];
										l && (this.fontTestStrings_[a] = l)
									}
								}
							}
							if (!this.fontTestStrings_[a]) {
								var u = o.FontApiParser.INT_FONTS[a];
								u && (this.fontTestStrings_[a] = u)
							}
							this.parsedFontFamilies_.push(a), this.variations_[a] = i
						}
					}, o.FontApiParser.prototype.generateFontVariationDescription_ = function(e) {
						if (!e.match(/^[\w ]+$/)) return "";
						var t = o.FontApiParser.VARIATIONS[e];
						if (t) return t;
						var r = e.match(/^(\d*)(\w*)$/),
							a = r[1],
							i = r[2],
							n = i ? i : "n",
							s = a ? a.substr(0, 1) : "4",
							l = this.fvd_.expand([n, s].join(""));
						return l ? this.fvd_.compact(l) : null
					}, o.FontApiParser.prototype.parseVariations_ = function(e) {
						var t = [];
						if (!e) return t;
						for (var r = e.split(","), o = r.length, a = 0; o > a; a++) {
							var i = r[a],
								n = this.generateFontVariationDescription_(i);
							n && t.push(n)
						}
						return t
					}, o.FontApiParser.prototype.parseSubsets_ = function(e) {
						var t = [];
						return e ? e.split(",") : t
					}, o.FontApiParser.prototype.getFontFamilies = function() {
						return this.parsedFontFamilies_
					}, o.FontApiParser.prototype.getVariations = function() {
						return this.variations_
					}, o.FontApiParser.prototype.getFontTestStrings = function() {
						return this.fontTestStrings_
					}, o.GoogleFontApi = function(e, t, r) {
						this.userAgent_ = e, this.domHelper_ = t, this.configuration_ = r
					}, o.GoogleFontApi.NAME = "google", o.GoogleFontApi.prototype.supportUserAgent = function(e, t) {
						t(e.isSupportingWebFont())
					}, o.GoogleFontApi.prototype.getFontWatchRunnerCtor = function() {
						return "AppleWebKit" == this.userAgent_.getEngine() ? o.LastResortWebKitFontWatchRunner : o.FontWatchRunner
					}, o.GoogleFontApi.prototype.load = function(e) {
						var t = this.domHelper_,
							r = "MSIE" == this.userAgent_.getName() && 1 != this.configuration_.blocking;
						r ? t.whenBodyExists(o.bind(this, this.insertLink_, e)) : this.insertLink_(e)
					}, o.GoogleFontApi.prototype.insertLink_ = function(e) {
						var t = this.domHelper_,
							r = new o.FontApiUrlBuilder(this.configuration_.api),
							a = this.configuration_.families;
						r.setFontFamilies(a);
						var i = new o.FontApiParser(a);
						i.parse(), t.insertInto("head", t.createCssLink(r.build())), e(i.getFontFamilies(), i.getVariations(), i.getFontTestStrings())
					}, i.addModule(o.GoogleFontApi.NAME, function(e) {
						var t = new o.UserAgentParser(navigator.userAgent, document),
							r = t.parse();
						return new o.GoogleFontApi(r, new o.DomHelper(document), e)
					}), o.AscenderScript = function(e, t) {
						this.domHelper_ = e, this.configuration_ = t
					}, o.AscenderScript.NAME = "ascender", o.AscenderScript.VARIATIONS = {
						regular: "n4",
						bold: "n7",
						italic: "i4",
						bolditalic: "i7",
						r: "n4",
						b: "n7",
						i: "i4",
						bi: "i7"
					}, o.AscenderScript.prototype.supportUserAgent = function(e, t) {
						return t(e.isSupportingWebFont())
					}, o.AscenderScript.prototype.load = function(e) {
						var t = this.configuration_.key,
							r = "https:" == document.location.protocol ? "https:" : "http:",
							o = r + "//webfonts.fontslive.com/css/" + t + ".css";
						this.domHelper_.insertInto("head", this.domHelper_.createCssLink(o));
						var a = this.parseFamiliesAndVariations(this.configuration_.families);
						e(a.families, a.variations)
					}, o.AscenderScript.prototype.parseFamiliesAndVariations = function(e) {
						var t, r, o;
						t = [], r = {};
						for (var a = 0, i = e.length; i > a; a++) o = this.parseFamilyAndVariations(e[a]), t.push(o.family), r[o.family] = o.variations;
						return {
							families: t,
							variations: r
						}
					}, o.AscenderScript.prototype.parseFamilyAndVariations = function(e) {
						var t, r, o;
						return o = e.split(":"), t = o[0], r = [], r = o[1] ? this.parseVariations(o[1]) : ["n4"], {
							family: t,
							variations: r
						}
					}, o.AscenderScript.prototype.parseVariations = function(e) {
						for (var t = e.split(","), r = [], a = 0, i = t.length; i > a; a++) {
							var n = t[a];
							if (n) {
								var s = o.AscenderScript.VARIATIONS[n];
								r.push(s ? s : n)
							}
						}
						return r
					}, i.addModule(o.AscenderScript.NAME, function(e) {
						var t = new o.DomHelper(document);
						return new o.AscenderScript(t, e)
					}), o.MonotypeScript = function(e, t, r, o, a) {
						this.global_ = e, this.userAgent_ = t, this.domHelper_ = r, this.doc_ = o, this.configuration_ = a, this.fontFamilies_ = [], this.fontVariations_ = {}
					}, o.MonotypeScript.NAME = "monotype", o.MonotypeScript.HOOK = "__mti_fntLst", o.MonotypeScript.SCRIPTID = "__MonotypeAPIScript__", o.MonotypeScript.prototype.supportUserAgent = function(e, t) {
						var r = this,
							a = r.configuration_.projectId;
						if (a) {
							var i = r.domHelper_.createScriptSrc(r.getScriptSrc(a));
							i.id = o.MonotypeScript.SCRIPTID + a, i.onreadystatechange = function(e) {
								("loaded" === i.readyState || "complete" === i.readyState) && (i.onreadystatechange = null, i.onload(e))
							}, i.onload = function(i) {
								if (r.global_[o.MonotypeScript.HOOK + a]) {
									var n = r.global_[o.MonotypeScript.HOOK + a]();
									if (n && n.length) {
										var s;
										for (s = 0; s < n.length; s++) r.fontFamilies_.push(n[s].fontfamily)
									}
								}
								t(e.isSupportingWebFont())
							}, this.domHelper_.insertInto("head", i)
						} else t(!0)
					}, o.MonotypeScript.prototype.getScriptSrc = function(e) {
						var t = this.protocol(),
							r = (this.configuration_.api || "fast.fonts.com/jsapi").replace(/^.*http(s?):(\/\/)?/, "");
						return t + "//" + r + "/" + e + ".js"
					}, o.MonotypeScript.prototype.load = function(e) {
						e(this.fontFamilies_, this.fontVariations_)
					}, o.MonotypeScript.prototype.protocol = function() {
						var e = ["http:", "https:"],
							t = e[0];
						if (this.doc_ && this.doc_.location && this.doc_.location.protocol) {
							var r = 0;
							for (r = 0; r < e.length; r++)
								if (this.doc_.location.protocol === e[r]) return this.doc_.location.protocol
						}
						return t
					}, i.addModule(o.MonotypeScript.NAME, function(e) {
						var t = new o.UserAgentParser(navigator.userAgent, document),
							r = t.parse(),
							a = new o.DomHelper(document);
						return new o.MonotypeScript(window, r, a, document, e)
					}), o.TypekitScript = function(e, t, r) {
						this.global_ = e, this.domHelper_ = t, this.configuration_ = r, this.fontFamilies_ = [], this.fontVariations_ = {}
					}, o.TypekitScript.NAME = "typekit", o.TypekitScript.HOOK = "__webfonttypekitmodule__", o.TypekitScript.prototype.getScriptSrc = function(e) {
						var t = "https:" == window.location.protocol ? "https:" : "http:",
							r = this.configuration_.api || t + "//use.typekit.com";
						return r + "/" + e + ".js"
					}, o.TypekitScript.prototype.supportUserAgent = function(e, t) {
						var r = this.configuration_.id,
							a = this.configuration_,
							i = this;
						if (r) {
							this.global_[o.TypekitScript.HOOK] || (this.global_[o.TypekitScript.HOOK] = {}), this.global_[o.TypekitScript.HOOK][r] = function(r) {
								var o = function(e, r, o) {
									i.fontFamilies_ = r, i.fontVariations_ = o, t(e)
								};
								r(e, a, o)
							};
							var n = this.domHelper_.createScriptSrc(this.getScriptSrc(r));
							this.domHelper_.insertInto("head", n)
						} else t(!0)
					}, o.TypekitScript.prototype.load = function(e) {
						e(this.fontFamilies_, this.fontVariations_)
					}, i.addModule(o.TypekitScript.NAME, function(e) {
						var t = new o.DomHelper(document);
						return new o.TypekitScript(window, t, e)
					})
			}, {}],
			8: [function(e, t, r) {
				function o(e, t, r) {
					function o(e) {
						return (a ? /^\d+[A-Za-z]*$/ : /^\d+$/).test(e)
					}
					var a = r && r.lexicographical,
						i = r && r.zeroExtend,
						n = e.split("."),
						s = t.split(".");
					if (!n.every(o) || !s.every(o)) return 0 / 0;
					if (i) {
						for (; n.length < s.length;) n.push("0");
						for (; s.length < n.length;) s.push("0")
					}
					a || (n = n.map(Number), s = s.map(Number));
					for (var l = 0; l < n.length; ++l) {
						if (s.length == l) return 1;
						if (n[l] != s[l]) return n[l] > s[l] ? 1 : -1
					}
					return n.length != s.length ? -1 : 0
				}
				r.versionCompare = o
			}, {}],
			9: [function(e, t, r) {
				function o(e, t, r) {
					if (!e) return null;
					for (var o, a = e.minVersion || "0.0.0", i = 0, n = e[t].length; n > i; i++) o = r(e[t][i]), u.versionCompare(o, a) > 0 && (a = o);
					return a
				}

				function a(e) {
					return o(e, "items", i)
				}

				function i(e) {
					return o(e, "processors", n)
				}

				function n(e) {
					if (!l.schemasByProcessor) throw "Error: No global schemasByProcessor map";
					var t, r = l.schemasByProcessor[e.name],
						o = r.properties,
						a = r.minVersion || e.minVersion || "0.0.0";
					for (var i in e.parameters) {
						if (t = s(e.parameters[i], o.parameters.properties[i]), !t) throw "Error: No minVersionNumber found";
						u.versionCompare(t, a) > 0 && (a = t)
					}
					return a
				}

				function s(e, t) {
					if (!t) throw "Error: Bad schema";
					var r, o = t.minVersion || "1.0.0";
					if ("array" === t.type) {
						if (t.items.type && t.items.type instanceof Array) {
							for (var a, i, n = 0; n < e.length; n++) {
								a = e[n];
								for (var l = 0; l < t.items.type.length; l++) {
									var h = !0;
									i = t.items.type[l];
									for (var d in i.properties) a.hasOwnProperty(d) || (h = !1);
									if (h)
										if ("undefined" != typeof a) r = s(a, i), u.versionCompare(r, o) > 0 && (o = r);
										else if (i && i.required) throw "Missing required property " + a
								}
							}
							return o
						}
						if (!t.items.properties) return o;
						for (var n = 0, c = e.length; c > n; n++) r = s(e[n], t.items), u.versionCompare(r, o) > 0 && (o = r);
						return o
					}
					if (!t["enum"] || !t.enumMinVersions) {
						if ("object" === t.type) {
							for (var f = Object.keys(t.properties), n = 0, c = f.length; c > n; n++) {
								var m = t.properties[f[n]];
								if (!m) throw "Error: No subitem schema";
								if ("undefined" != typeof e[f[n]]) r = s(e[f[n]], m), u.versionCompare(r, o) > 0 && (o = r);
								else if (m && m.required) throw "Missing required property " + f[n]
							}
							return o
						}
						return t.minVersion
					}
					for (var n = 0, c = t.enumMinVersions.length; c > n; n++)
						if (t["enum"][n] === e) return r = t.enumMinVersions[n], u.versionCompare(r, o) > 0 && (o = r), o
				}
				var l, u = e("./helpers/version-util");
				"undefined" != typeof GLOBAL ? l = GLOBAL : "undefined" != typeof window ? l = window : "undefined" != typeof self && (l = self), t.exports = {
					getMinPackVersion: a,
					getMinEffectVersion: i,
					getMinProcessorVersion: n,
					getMinParameterVersion: s,
					versionCompare: u.versionCompare
				}
			}, {
				"./helpers/version-util": 8
			}],
			10: [function(e, t, r) {
				t.exports = {
					Version: e("./../core/MoaVersion"),
					moaGL: e("../../../platforms/web/dist/moaGL_bundle"),
					copyProcessor: e("../core/MoaAllocAndCopy"),
					enhanceProcessor: e("../processors/MoaEnhance"),
					adjustmentsProcessor: e("../processors/MoaAdjustments"),
					adjustColorProcessor: e("../processors/MoaAdjustColor"),
					adjustLightingProcessor: e("../processors/MoaAdjustLighting"),
					versionerUtil: e("../../../scripts/versioner.js"),
					MoaResizeProcessor: e("../processors/MoaResize"),
					MoaliteActionlistEffectProcessorRunning: e("./MoaliteActionlistEffectProcessorRunning"),
					MoaliteActionlistManager: e("./MoaliteActionlistManager"),
					MoaliteActionlistGenerator: e("./MoaliteActionlistGenerator"),
					MoaBlemishState: e("../interactive/MoaBlemishState"),
					MoaDrawBrushState: e("../interactive/MoaDrawBrushState"),
					MoaSelectiveBrushState: e("../interactive/MoaSelectiveBrushState"),
					MoaTiltShiftState: e("../interactive/MoaTiltShiftState"),
					MoaVignetteToolState: e("../interactive/MoaVignetteToolState"),
					MoaFrame: e("../processors/MoaFrame")
				}
			}, {
				"../../../platforms/web/dist/moaGL_bundle": 1,
				"../../../scripts/versioner.js": 9,
				"../core/MoaAllocAndCopy": 34,
				"../interactive/MoaBlemishState": 44,
				"../interactive/MoaDrawBrushState": 50,
				"../interactive/MoaSelectiveBrushState": 60,
				"../interactive/MoaTiltShiftState": 63,
				"../interactive/MoaVignetteToolState": 66,
				"../processors/MoaAdjustColor": 68,
				"../processors/MoaAdjustLighting": 69,
				"../processors/MoaAdjustments": 71,
				"../processors/MoaEnhance": 78,
				"../processors/MoaFrame": 82,
				"../processors/MoaResize": 94,
				"./../core/MoaVersion": 41,
				"./MoaliteActionlistEffectProcessorRunning": 18,
				"./MoaliteActionlistGenerator": 21,
				"./MoaliteActionlistManager": 22
			}],
			11: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../processors/MoaAdjustColor");
				o.runAction = function(e, t, r) {
					if ("object" != typeof e.parameters) return !1;
					var o = e.parameters;
					return "number" != typeof o[a.kSaturation] || "number" != typeof o[a.kWarmth] || "number" != typeof o[a.kTint] || "number" != typeof o[a.kFade] ? !1 : a.adjustColor(t, o)
				}, t.exports = o
			}, {
				"../processors/MoaAdjustColor": 68
			}],
			12: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../processors/MoaAdjustLighting");
				o.runAction = function(e, t, r) {
					if ("object" != typeof e.parameters) return !1;
					var o = e.parameters;
					return "number" != typeof o[a.kBrightness] || "number" != typeof o[a.kContrast] || "number" != typeof o[a.kHighlights] || "number" != typeof o[a.kShadows] ? !1 : a.adjustLighting(t, o)
				}, t.exports = o
			}, {
				"../processors/MoaAdjustLighting": 69
			}],
			13: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../processors/MoaAdjustments"),
					i = "brightness",
					n = "exposure",
					s = "contrast",
					l = "shadows",
					u = "highlights",
					h = "warmth",
					d = "tint",
					c = "saturation",
					f = "vibrance",
					m = "fade",
					p = -100,
					g = 100;
				o.runAction = function(e, t, r) {
					if ("object" != typeof e.parameters) return !1;
					var o = e.parameters;
					if ("number" != typeof o[i] || "number" != typeof o[n] || "number" != typeof o[s] || "number" != typeof o[l] || "number" != typeof o[u] || "number" != typeof o[h] || "number" != typeof o[d] || "number" != typeof o[c] || "number" != typeof o[f] || "number" != typeof o[m]) return !1;
					var v = {};
					if (o[i] < p || o[n] < p || o[s] < p || o[l] < p || o[u] < p || o[h] < p || o[d] < p || o[c] < p || o[f] < p || o[m] < p || o[i] > g || o[n] > g || o[s] > g || o[l] > g || o[u] > g || o[h] > g || o[d] > g || o[c] > g || o[f] > g || o[m] > g) return !1;
					var v = {
						brightness: o[i],
						exposure: o[n],
						contrast: o[s],
						shadows: o[l],
						highlights: o[u],
						warmth: o[h],
						tint: o[d],
						saturation: o[c],
						vibrance: o[f],
						fade: o[m],
						blendMode: "normal",
						alpha: 1
					};
					return a.runAdjustments(t, v)
				}, t.exports = o
			}, {
				"../processors/MoaAdjustments": 71
			}],
			14: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../interactive/MoaBlemishState"),
					i = "locations",
					n = "point",
					s = "radius",
					l = "offset",
					u = "color";
				o.runAction = function(e, t, r) {
					var o = !1;
					if ("object" != typeof e.parameters) return !1;
					var h = e.parameters;
					if ("object" != typeof h[i]) return !1;
					for (var d = h[i], c = 0; c < d.length; c++) {
						var f = d[c];
						if ("object" != typeof f[n] || "number" != typeof f[s] || "object" != typeof f[l] || "object" != typeof f[u]) return !1
					}
					for (var m = new a(t), c = 0; c < d.length; c++) {
						var f = d[c];
						m.addPointWithOffsetAndColor(f[n], f[s], f[l], f[u])
					}
					return o = m.renderPreview()
				}, t.exports = o
			}, {
				"../interactive/MoaBlemishState": 44
			}],
			15: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../processors/MoaResize"),
					i = "cropParams",
					n = "topLeft",
					s = "width",
					l = "aspectRatio",
					u = "size";
				o.runAction = function(e, t, r) {
					var o = !1;
					if ("object" != typeof e.parameters) return !1;
					var h = e.parameters;
					if ("object" != typeof h[i]) return !1;
					var d = h[i];
					if ("object" != typeof d[n] || "number" != typeof d[s] || "number" != typeof d[l]) return !1;
					var c = d[n],
						f = d[s],
						m = d[l];
					if (2 != c.length) return !1;
					if ("object" != typeof h[u]) return !1;
					var p = h[u];
					return 2 != p.length ? !1 : (o = a.cropImage(t, c, f, m, r.updateViewDimensions)) ? ("function" == typeof r.updateViewDimensions && null != r.updateViewDimensions && r.updateViewDimensions(p[0], p[1]), o = a.resizeImage(t, p[0], p[1])) : !1
				}, t.exports = o
			}, {
				"../processors/MoaResize": 94
			}],
			16: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../processors/MoaResize"),
					i = "cropParams",
					n = "topLeft",
					s = "width",
					l = "aspectRatio";
				o.runAction = function(e, t, r) {
					var o = !1;
					if ("object" != typeof e.parameters) return !1;
					var u = e.parameters;
					if ("object" != typeof u[i]) return !1;
					var h = u[i];
					if ("object" != typeof h[n] || "number" != typeof h[s] || "number" != typeof h[l]) return !1;
					var d = h[n],
						c = h[s],
						f = h[l];
					return 2 != d.length ? !1 : o = a.cropImage(t, d, c, f, r.updateViewDimensions)
				}, t.exports = o
			}, {
				"../processors/MoaResize": 94
			}],
			17: [function(e, t, r) {
				"use strict";
				var o = e("../interactive/MoaDrawBrushState"),
					a = {},
					i = function(e, t) {
						var r = !1;
						if ("object" != typeof e.parameters) return !1;
						var a = e.parameters,
							i = 0;
						if ("undefined" == typeof a.strokes) return null;
						for (var s = a.strokes, i = s.length, l = new o(t, t), u = 0; i > u; u++) {
							var h = s[u],
								d = [];
							if (!n(h, d)) return !1;
							l.startNewStroke(h.radius, h.color, h.brushMode, h.zoomFactor), l.addPointsToCurrentStroke(d), l.endCurrentStroke()
						}
						return r = l.renderPreview()
					},
					n = function(e, t) {
						if ("number" != typeof e.radius || "string" != typeof e.brushMode || "object" != typeof e.color || "object" != typeof e.points) return !1;
						var r = e.color;
						if ("number" != typeof r.r || "number" != typeof r.g || "number" != typeof r.b || "number" != typeof r.a) return !1;
						for (var o = e.points, a = 0; a < o.length; a++) {
							var i = o[a];
							if ("number" != typeof i.point[0] || "number" != typeof i.point[1] || "number" != typeof i.timeOffset) return !1;
							t[a] = [i.point[0], i.point[1], i.timeOffset]
						}
						return !0
					};
				a.runAction = function(e, t, r) {
					if ("undefined" == typeof e.name) return null;
					e.name;
					return i(e, t)
				}, t.exports = a
			}, {
				"../interactive/MoaDrawBrushState": 50
			}],
			18: [function(e, t, r) {
				"use strict";
				var o, a = {},
					i = e("../core/MoaAllocAndCopy"),
					n = e("../processors/MoaBitmapBlend"),
					o = e("./MoaliteProclistProcessorRunning"),
					s = "alpha",
					l = "pack",
					u = "item",
					h = "actions",
					d = "processors";
				a.MLPLLoadEffect = function(e) {
					var t, r, o;
					return (r = JSON.parse(e)) ? (t = r.identifier, o = r.processors, t && o ? r : null) : null
				}, a.MLPLRunEffect = function(e, t, r) {
					var a, i, n;
					if (n = !1, a = e.identifier, i = e.processors, !a || !i) return !1;
					for (var s = 0; s < i.length; s++) {
						var l = i[s];
						if (n = o.MLPLRunProcessor(l, t, r), !n) return !1
					}
					return n
				}, a.runAction = function(e, t, r) {
					var o, a = !1;
					if ("object" != typeof e.parameters) return !1;
					var i, n = e.parameters;
					if (i = "number" != typeof n[s] ? 1 : n[s], "undefined" != typeof n[h]) o = n[h];
					else if ("undefined" != typeof n[d]) o = n[d];
					else {
						if ("undefined" == typeof n[l] || "undefined" == typeof n[u]) return !1;
						var o, m = n[l],
							p = n[u],
							g = r.effectJSONProvider(m, p, r.context);
						if (g && "string" == typeof g) try {
							o = JSON.parse(g)
						} catch (v) {
							return !1
						} else o = g
					}
					return a = t.moaGL ? c(t, o, i) : f(t, o, i)
				};
				var c = function(e, t, r) {
						for (var a = !1, i = 0; i < t.length; i++) {
							var n = t[i];
							if (a = o.MLPLRunProcessor(n, e), !a) return !1
						}
						return 1 != r && e.moaGL.renderBlendWithOriginal(r, 1 - r), a
					},
					f = function(e, t, r) {
						var a, s = !1;
						if (0 === r) return !0;
						1 != r && (a = i.copy(e));
						for (var l = 0; l < t.length; l++) {
							var u = t[l];
							if (s = o.MLPLRunProcessor(u, e), !s) return !1
						}
						return 1 == r || (s = !1, s = n.blendWithBitmap(e, a, e, "normal", r)) ? s : !1
					};
				t.exports = a
			}, {
				"../core/MoaAllocAndCopy": 34,
				"../processors/MoaBitmapBlend": 72,
				"./MoaliteProclistProcessorRunning": 33
			}],
			19: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../processors/MoaEnhance.js");
				o.runAction = function(e, t, r) {
					if ("object" != typeof e.parameters) return !1;
					var o = e.parameters;
					if ("undefined" == typeof o.type) return !1;
					var i = o.type,
						n = a[i];
					return "undefined" == typeof n ? !1 : n(t)
				}, t.exports = o
			}, {
				"../processors/MoaEnhance.js": 78
			}],
			20: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../processors/MoaFrame.js"),
					i = "pack",
					n = "item",
					s = "width",
					l = "refBitmapSize",
					u = ["l", "r", "t", "b", "tl", "tr", "bl", "br"];
				o.runAction = function(e, t, r) {
					var o = !1;
					if ("object" != typeof e.parameters) return !1;
					var h = e.parameters;
					if ("string" != typeof h[i] || "string" != typeof h[n] || "number" != typeof h[s]) return !1;
					var d, c = h[i],
						f = h[n];
					if ("object" == typeof h[l]) {
						var m = h[l];
						if (2 != m.length || m[0] <= 0 || m[1] <= 0) return !1;
						d = {
							width: Math.floor(m[0]),
							height: Math.floor(m[1])
						}
					} else d = {
						width: 0,
						height: 0
					};
					for (var p = {}, g = 0; g < u.length; g++) {
						var v = u[g];
						if (p[v] = r.frameSegmentProvider(c, f, v, r.context), "object" != typeof p[v].data || "number" != typeof p[v].width || "number" != typeof p[v].height) return !1
					}
					var _ = h[s],
						x = r.renderQuality,
						M = "fastest" === x ? "nearest" : "linear";
					return o = a.applyFrame(t, p, _, d, M)
				}, t.exports = o
			}, {
				"../processors/MoaFrame.js": 82
			}],
			21: [function(e, t, r) {
				"use strict";

				function o(e, t) {
					var r = {};
					return r[Y] = e, r[q] = t, r
				}

				function a(e, t) {
					var r = "string" == typeof e;
					return r && "undefined" != typeof t && (r = r && -1 !== t.indexOf(e)), r
				}

				function i(e, t, r) {
					var o = e.constructor === Array;
					return "undefined" != typeof t && (o = o && e.length >= t), "undefined" != typeof r && (o = o && e.length <= t), o
				}

				function n(e, t, r) {
					if (0 >= r) return !1;
					if (0 >= t) return !1;
					return e[0] >= 0 && e[1] >= 0 && e[0] + t <= 1
				}

				function s(e) {
					if (!i(e, or, or)) return !1;
					for (var t = 0; t < e.length; t++)
						if (!c(e[t])) return !1;
					return e[0] > 1 || e[1] > 1 ? !1 : e[0] + e[2] < 0 || e[1] + e[3] < 0 ? !1 : !0
				}

				function l(e) {
					return c(e, nr, sr)
				}

				function u(e) {
					return c(e, lr, null, !0, !1)
				}

				function h(e) {
					if (!i(e, ar, ar)) return !1;
					for (var t = 0; t < e.length; t++)
						if (!c(e[t])) return !1;
					return !0
				}

				function d(e) {
					if (!i(e, ir, ir)) return !1;
					for (var t = 0; t < e.length; t++)
						if (!f(e[t], 0, null, !0)) return !1;
					return !0
				}

				function c(e, t, r, o, a) {
					var i = "number" == typeof e;
					return i && null !== t && "undefined" != typeof t && (i = i && (o === !0 ? e > t : e >= t)), i && null !== r && "undefined" != typeof r && (i = i && (a === !0 ? r > e : r >= e)), i
				}

				function f(e, t, r, o, a) {
					var i = c(e, t, r, o, a);
					return i = i && Math.floor(e) === e
				}

				function m(e) {
					return c(e, ur, hr)
				}

				function p(e) {
					return e === !0 || e === !1
				}

				function g(e) {
					if ("object" == typeof e) return e;
					try {
						return JSON.parse(e)
					} catch (t) {
						return null
					}
				}

				function v(e) {
					return "object" == typeof e && e.hasOwnProperty(vt) && e.hasOwnProperty(_t)
				}

				function _(e) {
					var t = [Cr, Tr, Ar],
						r = "object" == typeof e && e.hasOwnProperty(xr) && e.hasOwnProperty(Mr) && e.hasOwnProperty(yr) && e.hasOwnProperty(br) && a(e[xr]) && c(e[Mr], 0, null, !0) && a(e[yr], t) && x(e[br]);
					return r
				}

				function x(e) {
					var t = "object" == typeof e && e.hasOwnProperty(Jt) && e.hasOwnProperty(er) && e.hasOwnProperty(tr) && e.hasOwnProperty(rr) && c(e[Jt], dr, cr) && c(e[er], dr, cr) && c(e[tr], dr, cr) && c(e[rr], dr, cr);
					return t
				}

				function M(e) {
					var t = [ot, rt],
						r = "object" == typeof e && e.hasOwnProperty(Sr) && e.hasOwnProperty(wr) && e.hasOwnProperty(Pr) && u(e[Sr]) && a(e[wr], t) && i(e[Pr], 1);
					if (r)
						for (var o = 0; o < e[Pr].length; o++)
							if (!h(e[Pr][o])) return !1;
					return r
				}

				function y(e) {
					var t = [ot, rt],
						r = "object" == typeof e && e.hasOwnProperty(Sr) && e.hasOwnProperty(wr) && e.hasOwnProperty(Pr) && e.hasOwnProperty(Fr) && e.hasOwnProperty(Er) && u(e[Sr]) && a(e[wr], t) && i(e[Pr], 1) && x(e[Fr]) && c(e[Er], 0, null, !0);
					if (r)
						for (var o, n = 0; n < e[Pr].length; n++) {
							if (o = e[Pr][n], !o.hasOwnProperty(Dr) || !h(o[Dr])) return !1;
							if (!o.hasOwnProperty(Lr) || !c(o[Lr], 0)) return !1
						}
					return r
				}

				function b(e) {
					var t = [ot, rt, at],
						r = "object" == typeof e && e.hasOwnProperty(Sr) && e.hasOwnProperty(wr) && e.hasOwnProperty(Pr) && u(e[Sr]) && a(e[wr], t) && i(e[Pr], 1);
					if (r && (r = e.brushMode == at ? e.hasOwnProperty(Fr) && x(e.color) : !e.hasOwnProperty(Fr)), r)
						for (var o = 0; o < e[Pr].length; o++)
							if (!h(e[Pr][o])) return !1;
					return r
				}

				function C(e) {
					var t = "object" == typeof e && e.hasOwnProperty(lt) && e.hasOwnProperty(ht) && e.hasOwnProperty(st) && e.hasOwnProperty(ut) && h(e[lt]) && u(e[ht]) && h(e[st], 1) && x(e[ut]);
					return t
				}

				function T(e) {
					if (!i(e)) return null;
					var t = {};
					return t[z] = e, t
				}

				function A(e, t, r, a, i, n, s, l, u, h) {
					var d = -100,
						f = 100,
						m = c(e, d, f, !1, !1) && c(t, d, f, !1, !1) && c(r, d, f, !1, !1) && c(a, d, f, !1, !1) && c(i, d, f, !1, !1) && c(n, d, f, !1, !1) && c(s, d, f, !1, !1) && c(l, d, f, !1, !1) && c(u, d, f, !1, !1) && c(h, d, f, !1, !1);
					if (!m) return null;
					if (0 == e && 0 == t && 0 == r && 0 == a && 0 == i && 0 == n && 0 == s && 0 == l && 0 == u && 0 == h) return null;
					var p = {};
					return p[xe] = e, p[Me] = t, p[ye] = r, p[be] = a, p[Ce] = i, p[Te] = n, p[Ae] = s, p[Se] = l, p[we] = u, p[Pe] = h, o(K, p)
				}

				function S(e, t, r, a) {
					if (!n(e, t, r)) return null;
					if (!d(a)) return null;
					if (a[0] < 1 || a[1] < 1) return null;
					var i = {};
					i[Ge] = e, i[Ue] = t, i[Ve] = r;
					var s = {};
					return s[Ne] = i, s[ke] = a, o(ee, s)
				}

				function w(e, t, r, i) {
					var n = [We, He];
					if (!a(e, n)) return null;
					if (!h(t)) return null;
					if (!c(r)) return null;
					if (!l(i)) return null;
					var s = {};
					return s[je] = e, s[Xe] = t, s[ze] = r, s[Ye] = i, o(ge, s)
				}

				function P(e) {
					if (!i(e)) return null;
					for (var t = 0; t < e.length; t++)
						if (!C(e[t])) return null;
					var r = {};
					return r[nt] = e, o(Z, r)
				}

				function F(e, t) {
					var r = [te, fe, $, _e, he];
					if (!a(e, r)) return null;
					if (!i(t)) return null;
					if (t.length < 1 && e != fe) return null;
					if (e === te) {
						for (var n = 0; n < t.length; n++)
							if (!y(t[n])) return null
					} else if (e === fe) {
						for (var n = 0; n < t.length; n++)
							if (!b(t[n])) return null
					} else
						for (var n = 0; n < t.length; n++)
							if (!M(t[n])) return null; var s = {};
					return s[it] = t, o(e, s)
				}

				function E(e, t, r, a) {
					if (!c(e, pr, gr)) return null;
					if (!c(t, pr, gr)) return null;
					if (!c(r, pr, gr)) return null;
					if (!c(a, pr, gr)) return null;
					var i = {};
					return i[Xt] = e, i[zt] = t, i[Yt] = r, i[qt] = a, o(Q, i)
				}

				function D(e, t, r) {
					if (!n(e, t, r)) return null;
					var a = {};
					a[Ge] = e, a[Ue] = t, a[Ve] = r;
					var i = {};
					return i[Ne] = a, o(J, i)
				}

				function L(e) {
					var t = [Ee, De, Le, Re, Be, Oe, Ie];
					if (!a(e, t)) return null;
					var r = {};
					return r[Fe] = e, o(oe, r)
				}

				function R(e, t) {
					var r = g(e);
					if (!r) return null;
					if (!m(t)) return null;
					var a = {};
					return a[Ft] = r, a[Et] = t, o(re, a)
				}

				function B(e, t) {
					if (!v(e)) return null;
					if (!m(t)) return null;
					var r = {};
					return r[vt] = e[vt], r[_t] = e[_t], r[Et] = t, o(re, r)
				}

				function O(e, t, r) {
					if (!v(e)) return null;
					if (!c(t, At, St)) return null;
					var a = {};
					if (a[vt] = e[vt], a[_t] = e[_t], a[Ct] = t, r) {
						if (!d(r)) return null;
						a[Tt] = r
					}
					return o(ae, a)
				}

				function I(e, t, r, a) {
					if (!c(e, vr, _r)) return null;
					if (!c(t, vr, _r)) return null;
					if (!c(r, vr, _r)) return null;
					if (!c(a, vr, _r)) return null;
					var i = {};
					return i[Kt] = e, i[Zt] = t, i[$t] = r, i[Qt] = a, o(ne, i)
				}

				function N(e, t) {
					var r = [K, Z, $, Q, J, te, re, oe, ae, ne, se, le, ue, he, de, ce, fe, me, pe, ge, ve, _e];
					if (!a(t, r)) return null;
					for (var i = 0; i < e.length; i++)
						if ("string" != typeof e[i].name || e[i].name != t) return null;
					var n = {};
					return n[wt] = e, n[Pt] = t, o(ie, n)
				}

				function G(e, t, r, a) {
					if (!p(e)) return null;
					if (!p(t)) return null;
					if (!l(r)) return null;
					if (!c(a, gt, pt)) return null;
					var i = {};
					return i[dt] = e, i[ct] = t, i[ft] = r, i[mt] = a, o(se, i)
				}

				function U(e, t, r, a) {
					if (!v(e)) return null;
					if (!n(t, r, a)) return null;
					var i = {};
					i[Ge] = t, i[Ue] = r, i[Ve] = a;
					var s = {};
					return s[vt] = e[vt], s[_t] = e[_t], s[Dt] = i, o(le, s)
				}

				function V(e, t, r, i) {
					if (!a(e)) return null;
					if (!a(t)) return null;
					if (!x(r)) return null;
					if (!x(i)) return null;
					var n = {};
					return n[Lt] = e, n[Rt] = t, n[Bt] = r, n[Ot] = i, o(ue, n)
				}

				function k(e) {
					if (!d(e)) return null;
					var t = {};
					return t[ke] = e, o(de, t)
				}

				function j(e) {
					if (!c(e, fr, mr)) return null;
					var t = {};
					return t[Ht] = e, o(ce, t)
				}

				function W(e, t, r, a, i) {
					if (!v(e)) return null;
					if (!s(t)) return null;
					if (!m(r)) return null;
					if (!l(a)) return null;
					if (!p(i)) return null;
					var n = {};
					return n[vt] = e[vt], n[_t] = e[_t], n[xt] = t, n[yt] = r, n[Mt] = a, n[bt] = i, o(me, n)
				}

				function H(e, t, r, i, n) {
					if (!a(e)) return null;
					if (!_(t)) return null;
					if (!m(r)) return null;
					if (!h(i)) return null;
					if (!l(n)) return null;
					var s = {};
					return s[It] = e, s[Nt] = t.fontName, s[Gt] = t.fontSize, s[Ut] = t.alignment, s[kt] = t.color, s[Vt] = r, s[jt] = i, s[Wt] = n, o(pe, s)
				}

				function w(e, t, r, i) {
					var n = [We, He];
					if (!a(e, n)) return null;
					if (!h(t)) return null;
					if (!c(r)) return null;
					if (!l(i)) return null;
					var s = {};
					return s[je] = e, s[Xe] = t, s[ze] = r, s[Ye] = i, o(ge, s)
				}

				function X(e, t, r, i) {
					var n = [Ke, Ze];
					if (!a(e, n)) return null;
					if (!s(t)) return null;
					if (!m(r)) return null;
					if (!c(i, et, tt)) return null;
					var l = {};
					return l[qe] = e, l[$e] = t, l[Qe] = r, l[Je] = i, o(ve, l)
				}
				var z = "actions",
					Y = "name",
					q = "parameters",
					K = "adjust",
					Z = "blemish",
					$ = "blur",
					Q = "color",
					J = "crop",
					ee = "cropAndResize",
					te = "draw",
					re = "effect",
					oe = "enhance",
					ae = "frame",
					ie = "group",
					ne = "lighting",
					se = "orientation",
					le = "overlay",
					ue = "meme",
					he = "redeye",
					de = "resize",
					ce = "sharpness",
					fe = "splash",
					me = "sticker",
					pe = "text",
					ge = "focus",
					ve = "vignette",
					_e = "whiten",
					xe = "brightness",
					Me = "exposure",
					ye = "contrast",
					be = "shadows",
					Ce = "highlights",
					Te = "saturation",
					Ae = "vibrance",
					Se = "warmth",
					we = "tint",
					Pe = "fade",
					Fe = "type",
					Ee = "hidef",
					De = "portrait",
					Le = "food",
					Re = "scenery",
					Be = "night",
					Oe = "illuminate",
					Ie = "colorfix",
					Ne = "cropParams",
					Ge = "topLeft",
					Ue = "width",
					Ve = "aspectRatio",
					ke = "size",
					je = "mode",
					We = "radial",
					He = "linear",
					Xe = "center",
					ze = "radius",
					Ye = "angle",
					qe = "mode",
					Ke = "black",
					Ze = "white",
					$e = "rect",
					Qe = "alpha",
					Je = "feather",
					et = 0,
					tt = 1,
					rt = "free",
					ot = "erase",
					at = "smart",
					it = "strokes",
					nt = "locations",
					st = "offset",
					lt = "point",
					ut = "color",
					ht = "radius",
					dt = "flipAroundX",
					ct = "flipAroundY",
					ft = "imageRotation",
					mt = "straightenRotation",
					pt = 45,
					gt = -45,
					vt = "pack",
					_t = "item",
					xt = "rect",
					Mt = "rotation",
					yt = "alpha",
					bt = "flip",
					Ct = "width",
					Tt = "refBitmapSize",
					At = 0,
					St = 1,
					wt = "components",
					Pt = "actionType",
					Ft = "processors",
					Et = "alpha",
					Dt = "cropParams",
					Lt = "topString",
					Rt = "bottomString",
					Bt = "fillColor",
					Ot = "strokeColor",
					It = "string",
					Nt = "fontName",
					Gt = "size",
					Ut = "align",
					Vt = "alpha",
					kt = "color",
					jt = "center",
					Wt = "rotation",
					Ht = "amount",
					Xt = "saturation",
					zt = "warmth",
					Yt = "fade",
					qt = "tint",
					Kt = "brightness",
					Zt = "contrast",
					$t = "highlights",
					Qt = "shadows",
					Jt = "r",
					er = "g",
					tr = "b",
					rr = "a",
					or = 4,
					ar = 2,
					ir = 2,
					nr = 0,
					sr = 360,
					lr = 0,
					ur = 0,
					hr = 1,
					dr = 0,
					cr = 255,
					fr = -100,
					mr = 100,
					pr = -100,
					gr = 100,
					vr = -100,
					_r = 100,
					xr = "fontName",
					Mr = "fontSize",
					yr = "alignment",
					br = "color",
					Cr = "left",
					Tr = "center",
					Ar = "right",
					Sr = "radius",
					wr = "brushMode",
					Pr = "points",
					Fr = "color",
					Er = "zoomFactor",
					Dr = "point",
					Lr = "timeOffset";
				t.exports = {
					MLPLActionlistWithActions: T,
					MLPLActionAdjust: A,
					MLPLActionBlemish: P,
					MLPLActionBrush: F,
					MLPLActionColor: E,
					MLPLActionCrop: D,
					MLPLActionCropAndResize: S,
					MLPLActionEffectJSON: R,
					MLPLActionEffectIdentifier: B,
					MLPLActionEnhance: L,
					MLPLActionFrame: O,
					MLPLActionGroup: N,
					MLPLActionLighting: I,
					MLPLActionOrientation: G,
					MLPLActionOverlay: U,
					MLPLActionMeme: V,
					MLPLActionResize: k,
					MLPLActionSharpness: j,
					MLPLActionSticker: W,
					MLPLActionText: H,
					MLPLActionTiltShift: w,
					MLPLActionVignette: X
				}
			}, {}],
			22: [function(e, t, r) {
				"use strict";
				var o = {},
					a = "name",
					i = "parameters",
					n = "components",
					s = "actionType",
					l = {};

				l.runAction = function(e, t, r) {
					if ("object" != typeof e[i]) return !1;
					var o = e[i];
					if ("object" != typeof o[n]) return !1;
					var a = o[n];
					if ("string" != typeof o[s]) return !1;
					for (var l = o[s], u = a.length, h = !1, d = 0; u > d; d++) {
						var c = a[d];
						if ("string" != typeof c.name) return !1;
						if (c.name != l) return !1
					}
					for (var d = 0; u > d; d++) {
						var c = a[d];
						if (h = E(c, t, r), !h) return h
					}
					return h
				};
				var u = e("./MoaliteActionlistAdjustProcessorRunning"),
					h = e("./MoaliteActionlistAdjustColorProcessorRunning"),
					d = e("./MoaliteActionlistAdjustLightingProcessorRunning"),
					c = e("./MoaliteActionlistBlemishProcessorRunning"),
					f = e("./MoaliteActionlistCropProcessorRunning"),
					m = e("./MoaliteActionlistCropAndResizeProcessorRunning"),
					p = e("./MoaliteActionlistDrawProcessorRunning"),
					g = e("./MoaliteActionlistEffectProcessorRunning"),
					v = e("./MoaliteActionlistEnhanceProcessorRunning"),
					_ = e("./MoaliteActionlistFrameProcessorRunning"),
					x = e("./MoaliteActionlistMemeProcessorRunning"),
					M = e("./MoaliteActionlistOverlayProcessorRunning"),
					y = e("./MoaliteActionlistResizeProcessorRunning"),
					b = e("./MoaliteActionlistStickerProcessorRunning"),
					C = e("./MoaliteActionlistSharpnessProcessorRunning"),
					T = e("./MoaliteActionlistTextProcessorRunning"),
					A = e("./MoaliteActionlistTiltShiftProcessorRunning"),
					S = e("./MoaliteActionlistVignetteToolProcessorRunning"),
					w = e("./MoaliteActionlistSelectiveBrushProcessorRunning"),
					P = e("./MoaliteActionlistOrientationProcessorRunning"),
					F = {
						adjust: u,
						blemish: c,
						blur: w,
						color: h,
						crop: f,
						cropAndResize: m,
						draw: p,
						effect: g,
						enhance: v,
						focus: A,
						frame: _,
						group: l,
						lighting: d,
						overlay: M,
						meme: x,
						orientation: P,
						redeye: w,
						resize: y,
						sharpness: C,
						splash: w,
						sticker: b,
						text: T,
						vignette: S,
						whiten: w
					};
				o.MLPLRunActionlistFromJSON = function(e, t, r) {
					var a = this.MLPLLoadActionlist(e);
					return null == a ? null : o.MLPLRunActionlistObject(a, t, r)
				}, o.MLPLLoadActionlist = function(e) {
					var t, r;
					try {
						t = JSON.parse(e)
					} catch (o) {
						return !1
					}
					return t ? (r = t.actions, r ? t : null) : null
				}, o.MLPLRunActionlistObject = function(e, t, r) {
					if ("undefined" == typeof t) return !1;
					if ("undefined" == typeof e.actions) return !1;
					var o = e.actions;
					t.moaGL && t.moaGL.createEffect();
					for (var a = 0; a < o.length; a++) {
						var i = o[a],
							n = E(i, t, r);
						if (!n) return !1
					}
					return t.moaGL && t.moaGL.finalizeEffect(), n
				}, o.MLPLRunAction = function(e, t, r) {
					if ("undefined" == typeof t) return !1;
					if ("undefined" == typeof e) return !1; {
						var o = e[a];
						F[o]
					}
					t.moaGL && t.moaGL.createEffect();
					var i = E(e, t, r);
					return t.moaGL && t.moaGL.finalizeEffect(), i
				};
				var E = function(e, t, r) {
					var o = e[a],
						i = F[o];
					if ("undefined" == typeof i) return !1;
					var n = i.runAction(e, t, r);
					return n
				};
				t.exports = o
			}, {
				"./MoaliteActionlistAdjustColorProcessorRunning": 11,
				"./MoaliteActionlistAdjustLightingProcessorRunning": 12,
				"./MoaliteActionlistAdjustProcessorRunning": 13,
				"./MoaliteActionlistBlemishProcessorRunning": 14,
				"./MoaliteActionlistCropAndResizeProcessorRunning": 15,
				"./MoaliteActionlistCropProcessorRunning": 16,
				"./MoaliteActionlistDrawProcessorRunning": 17,
				"./MoaliteActionlistEffectProcessorRunning": 18,
				"./MoaliteActionlistEnhanceProcessorRunning": 19,
				"./MoaliteActionlistFrameProcessorRunning": 20,
				"./MoaliteActionlistMemeProcessorRunning": 23,
				"./MoaliteActionlistOrientationProcessorRunning": 24,
				"./MoaliteActionlistOverlayProcessorRunning": 25,
				"./MoaliteActionlistResizeProcessorRunning": 26,
				"./MoaliteActionlistSelectiveBrushProcessorRunning": 27,
				"./MoaliteActionlistSharpnessProcessorRunning": 28,
				"./MoaliteActionlistStickerProcessorRunning": 29,
				"./MoaliteActionlistTextProcessorRunning": 30,
				"./MoaliteActionlistTiltShiftProcessorRunning": 31,
				"./MoaliteActionlistVignetteToolProcessorRunning": 32
			}],
			23: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../processors/MoaComposite"),
					i = e("./MoaliteActionlistGenerator"),
					n = "topString",
					s = "bottomString",
					l = 2,
					u = 16,
					h = 2.5,
					d = 3,
					c = "League Gothic",
					f = .035,
					m = "center",
					p = "upper",
					g = "verticalAlignTop",
					v = "verticalAlignBottom",
					_ = "fillColor",
					x = "strokeColor";
				o.runAction = function(e, t, r) {
					var o = !1;
					if ("object" != typeof e.parameters) return !1;
					var M = e.parameters;
					if ("string" != typeof M[n] || "string" != typeof M[s] || "object" != typeof M[_] || "object" != typeof M[x]) return !1;
					var y = M[n],
						b = M[s],
						C = M[_],
						T = M[x];
					if (!i.MLPLActionMeme(b, y, C, T)) return !1;
					var A = {
							width: t.width - 2 * l,
							height: t.height / d
						},
						S = {
							minimumBitmapSize: A,
							minimumFontSize: u
						},
						w = Math.max(Math.floor(A.height / h), u),
						P = {
							fontName: c,
							fontSize: w,
							outlineRatio: f,
							outlineColor: T,
							alignment: m,
							vAlignment: g,
							color: C,
							textCase: p
						},
						F = r.textProvider(y, P, S, r.context, "top");
					P.vAlignment = v;
					var E = r.textProvider(b, P, S, r.context, "bottom");
					if (null === F || "object" != typeof F.data || "number" != typeof F.width || "number" != typeof F.height) return !1;
					if (null === E || "object" != typeof E.data || "number" != typeof E.width || "number" != typeof E.height) return !1;
					var D = [.5, A.height / 2 / t.height],
						L = [S.minimumBitmapSize.width / t.width, S.minimumBitmapSize.height / t.height],
						R = [.5, 1 - A.height / 2 / t.height],
						B = [S.minimumBitmapSize.width / t.width, S.minimumBitmapSize.height / t.height],
						O = [D[0] - .5 * L[0], D[1] - .5 * L[1], L[0], L[1]],
						I = [R[0] - .5 * B[0], R[1] - .5 * B[1], B[0], B[1]],
						N = r.renderQuality,
						G = "fastest" === N ? "nearest" : "linear";
					return o = a.compositePremultipliedBitmap(t, F, O, 0, !1, G, 1), o && (o = a.compositePremultipliedBitmap(t, E, I, 0, !1, G, 1)), o
				}, t.exports = o
			}, {
				"../processors/MoaComposite": 77,
				"./MoaliteActionlistGenerator": 21
			}],
			24: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../processors/MoaResize"),
					i = "flipAroundX",
					n = "flipAroundY",
					s = "imageRotation",
					l = "straightenRotation";
				o.runAction = function(e, t, r) {
					var o = !1;
					if ("object" != typeof e.parameters) return !1;
					var u = e.parameters;
					if ("boolean" != typeof u[i] || "boolean" != typeof u[n] || "number" != typeof u[s] || "number" != typeof u[l]) return !1;
					var h = u[i],
						d = u[n],
						c = u[s],
						f = u[l];
					return c % 90 != 0 ? !1 : Math.abs(f) > 45 ? !1 : o = a.renderOrientation(t, h, d, c, f, r.updateViewDimensions)
				}, t.exports = o
			}, {
				"../processors/MoaResize": 94
			}],
			25: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../processors/MoaResize"),
					i = e("../processors/MoaComposite"),
					n = "pack",
					s = "item",
					l = "cropParams",
					u = "topLeft",
					h = "width",
					d = "aspectRatio";
				o.runAction = function(e, t, r) {
					var o = !1;
					if ("object" != typeof e.parameters) return !1;
					var c = e.parameters;
					if ("string" != typeof c[n] || "string" != typeof c[s] || "undefined" == typeof c[l]) return !1;
					var f = r.contentImageProvider(c[n], c[s], "overlay", r.context),
						m = r.renderQuality,
						p = "fastest" === m ? "nearest" : "linear";
					if ("object" != typeof f || "object" != typeof f.data || "number" != typeof f.width || "number" != typeof f.height) return !1;
					var g = c[l];
					if ("object" != typeof g[u] || "number" != typeof g[h] || "number" != typeof g[d]) return !1;
					var v = g[u],
						_ = g[h],
						x = g[d];
					if (2 != v.length) return !1;
					var M = [0, 0, 1, 1];
					return o = a.cropImage(t, v, _, x, r.updateViewDimensions), o && (o = i.compositePremultipliedBitmapWithResize(t, f, M, 0, !1, p, 1)), o
				}, t.exports = o
			}, {
				"../processors/MoaComposite": 77,
				"../processors/MoaResize": 94
			}],
			26: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../processors/MoaResize.js"),
					i = "size";
				o.runAction = function(e, t, r) {
					var o = !1;
					if ("object" != typeof e.parameters) return !1;
					var n = e.parameters;
					if ("object" != typeof n[i]) return !1;
					var s = n[i];
					return 2 != s.length ? !1 : ("function" == typeof r.updateViewDimensions && null != r.updateViewDimensions && r.updateViewDimensions(s[0], s[1]), o = a.resizeImage(t, s[0], s[1]))
				}, t.exports = o
			}, {
				"../processors/MoaResize.js": 94
			}],
			27: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../interactive/MoaSelectiveBrushState"),
					i = (e("../core/MoaAllocAndCopy"), function(e, t, r) {
						var o = !1,
							i = 0;
						if ("object" != typeof e.parameters) return !1;
						var n = e.parameters;
						if ("undefined" == typeof n.strokes) return !1;
						for (var s = n.strokes, i = s.length, l = new a(t, t, r), u = 0; i > u; u++) {
							var h = s[u];
							if ("number" != typeof h.radius || "string" != typeof h.brushMode || "object" != typeof h.points) return !1;
							l.startNewStroke(h.radius, h.brushMode, h.color), l.addPointsToCurrentStroke(h.points), l.endCurrentStroke()
						}
						return o = l.renderPreview()
					});
				o.runAction = function(e, t, r) {
					var o = !1;
					if ("undefined" == typeof e.name) return !1;
					var a = e.name;
					return o = i(e, t, a)
				}, t.exports = o
			}, {
				"../core/MoaAllocAndCopy": 34,
				"../interactive/MoaSelectiveBrushState": 60
			}],
			28: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../processors/MoaSharpen");
				o.runAction = function(e, t, r) {
					var o = !1;
					if ("object" != typeof e.parameters) return !1;
					var i = e.parameters;
					if ("number" != typeof i[a.kAmount]) return !1;
					var n, s, l = i[a.kAmount];
					return n = "number" != typeof i[a.kAlpha] ? 1 : i[a.kAlpha], s = "string" != typeof i[a.kBlendMode] ? "normal" : i[a.kBlendMode], o = a.sharpen(t, l, n, s)
				}, t.exports = o
			}, {
				"../processors/MoaSharpen": 96
			}],
			29: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../processors/MoaComposite"),
					i = "pack",
					n = "item",
					s = "rect",
					l = "rotation",
					u = "alpha",
					h = "flip";
				o.runAction = function(e, t, r) {
					var o = !1;
					if ("object" != typeof e.parameters) return !1;
					var d = e.parameters;
					if ("string" != typeof d[i] || "string" != typeof d[n] || "undefined" == typeof d[s] || "number" != typeof d[l] || "number" != typeof d[u] || "boolean" != typeof d[h]) return !1;
					var c = r.contentImageProvider(d[i], d[n], "sticker", r.context),
						f = r.renderQuality,
						m = "fastest" === f ? "nearest" : "linear";
					if ("object" != typeof c.data || "number" != typeof c.width || "number" != typeof c.height) return !1;
					var p = d[s];
					if (4 != p.length) return !1;
					for (var g = 0; g < p.length; g++)
						if ("number" != typeof p[g]) return !1;
					var v = d[l],
						_ = d[u],
						x = d[h];
					return o = a.compositePremultipliedBitmapWithResize(t, c, p, v, x, m, _)
				}, t.exports = o
			}, {
				"../processors/MoaComposite": 77
			}],
			30: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../processors/MoaComposite"),
					i = "string",
					n = "fontName",
					s = "size",
					l = "align",
					u = "color",
					h = "rotation",
					d = "center",
					c = "alpha",
					f = "verticalAlignTop";
				o.runAction = function(e, t, r) {
					var o = !1;
					if ("object" != typeof e.parameters) return !1;
					var m = e.parameters;
					if ("string" != typeof m[i] || "string" != typeof m[n] || "number" != typeof m[s] || "string" != typeof m[l] || "object" != typeof m[u] || "number" != typeof m[h] || "object" != typeof m[d] || "number" != typeof m[c]) return !1;
					var p = m[l];
					if ("left" !== p && "center" !== p && "right" !== p) return !1;
					var g = m[u];
					if ("number" != typeof g.r || "number" != typeof g.g || "number" != typeof g.b || "number" != typeof g.a) return !1;
					var v = m[d];
					if ("number" != typeof v[0] || "number" != typeof v[1]) return !1;
					var _ = {
							fontName: m[n],
							fontSize: m[s] * t.width,
							outlineRatio: 0,
							outlineColor: {
								r: 0,
								g: 0,
								b: 0,
								a: 0
							},
							alignment: p,
							vAlignment: f,
							textCase: "normal",
							color: g
						},
						x = r.textProvider(m[i], _, null, r.context);
					if (null === x || "object" != typeof x.data || "number" != typeof x.width || "number" != typeof x.height) return !1;
					var M = x.width / t.width,
						y = x.height / t.height,
						b = [v[0] - .5 * M, v[1] - .5 * y, M, y],
						C = m[h],
						T = m[c],
						A = r.renderQuality,
						S = "fastest" === A ? "nearest" : "linear";
					return o = a.compositePremultipliedBitmap(t, x, b, C, !1, S, T)
				}, t.exports = o
			}, {
				"../processors/MoaComposite": 77
			}],
			31: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../interactive/MoaTiltShiftState"),
					i = "mode",
					n = "center",
					s = "radius",
					l = "angle",
					u = "linear",
					h = "radial";
				o.runAction = function(e, t, r) {
					var o = !1;
					if ("object" != typeof e.parameters) return !1;
					var d = e.parameters;
					if ("undefined" == typeof e.name || "string" != typeof d[i] || "object" != typeof d[n] || "number" != typeof d[s] || "number" != typeof d[l]) return !1;
					var c = d[i],
						f = d[n],
						m = d[s],
						p = d[l];
					if (c != u && c != h) return !1;
					if (2 != f.length || "number" != typeof f[0] || "number" != typeof f[1]) return !1;
					p *= Math.PI / 180;
					var g = new a(t, t);
					if (c == u) g.renderLinearBlur(f[0], f[1], m, p);
					else {
						if (c != h) return !1;
						g.renderRadialBlur(f[0], f[1], m)
					}
					return o = g.renderPreview()
				}, t.exports = o
			}, {
				"../interactive/MoaTiltShiftState": 63
			}],
			32: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../interactive/MoaVignetteToolState"),
					i = "mode",
					n = "rect",
					s = "feather",
					l = "alpha",
					u = "black",
					h = "white";
				o.runAction = function(e, t, r) {
					var o = !1;
					if ("object" != typeof e.parameters) return !1;
					var d = e.parameters;
					if ("undefined" == typeof e.name || "string" != typeof d[i] || "object" != typeof d[n] || "number" != typeof d[s] || "number" != typeof d[l]) return !1;
					var c = d[i],
						f = d[n],
						m = d[s],
						p = d[l];
					if (c != u && c != h) return !1;
					if (4 != f.length) return !1;
					for (var g = 0; 4 > g; g++)
						if ("number" != typeof f[g]) return !1;
					var v = new a(t, t);
					return o = v.applyVignetteTool(f, p, m, c, !1)
				}, t.exports = o
			}, {
				"../interactive/MoaVignetteToolState": 66
			}],
			33: [function(e, t, r) {
				(function() {
					var r, o, a, i, n, s = function(e, t) {
							function r() {
								this.constructor = e
							}
							for (var o in t) l.call(t, o) && (e[o] = t[o]);
							return r.prototype = t.prototype, e.prototype = new r, e.__super__ = t.prototype, e
						},
						l = {}.hasOwnProperty;
					r = function(e) {
						function t(e, r) {
							t.__super__.constructor.call(this), this.name = "Processor Error", this.processorName = r, this.message = e, this.toString = function() {
								return this.name + ": " + this.message + " (" + this.processorName + ")"
							}
						}
						return s(t, e), t
					}(Error), n = {}, n.original = function(t, r, o, a) {
						var i, n;
						return n = !1, i = e("../../../src/js/core/MoaAllocAndCopy"), r = i.copy(r), n = !0
					}, n.legacyProcessor = function(t, r, o, a) {
						var i, n, s;
						return s = !1, n = e("../../../src/js/processors/MoaLegacyProcessors"), i = t.legacyName, r && r.moaGL && r.moaGL.glRenderingObjects.readTexture === r.moaGL.glImageData.sourceTexture && r.moaGL.renderIdentity(), null != i && "function" == typeof n[i] && (n[i](r, o), s = !0), s
					}, n.colorMatrixTransform = function(t, r, o, a) {
						var i = !1,
							n = e("../../../src/js/processors/MoaColorMatrixTransform"),
							s = (e("../../../src/js/processors/MoaAdjustments"), t.operations),
							l = t.blendMode,
							u = t.alpha;
						return 0 == s.length ? !0 : (s && (i = n.runOperations(r, s, l, u)), i)
					}, n.histogramMapping = function(t, o, i, n) {
						var s, l, u;
						if (u = !1, l = e("../../../src/js/processors/MoaHistogramMapping"), s = t.histMap, !s) throw new r("histMap dne or is not an object.", "histogramMapping");
						return s = a(s), l.fadeMapping(s, i.intensity), l.mapHist(o, s), u = !0
					}, n.vignette = function(t, o, a, i) {
						var n, s, l, u, h, d, c, f, m, p, g, v;
						switch (g = !1, d = e("../../../src/js/processors/MoaVignette"), n = 1e-9, l = t.color, s = t.blendMode, f = t.shape, v = f.vignetteScale, m = f.shapeMode, c = f.scaling, u = f.dx, h = f.dy, p = !1, c) {
							case "average":
								v = (o.width + o.height) / 2 * v / (a.intensity + n), p = !1;
								break;
							case "max":
								v = Math.max(o.width, o.height) * v / (a.intensity + n), p = !1;
								break;
							case "stretch":
								v /= a.intensity + n, p = !0;
								break;
							default:
								throw new r("scaling mode " + c + " not defined.", "vignette")
						}
						return d.vignette(o, v, l.r, l.g, l.b, l.a, s, m, p, u, h), g = !0
					}, n.contrast = function(t, a, i, n) {
						var s = !1,
							l = e("../../../src/js/processors/MoaAdjustmentCurves"),
							u = t.value;
						if ("number" != typeof u) throw new r("value is missing.", "contrast");
						return amount = o(u, 1, i.intensity), l.contrastCurve(a, amount), s = !0
					}, n.adjustments = function(t, o, a, i) {
						var n, s;
						if (s = !1, n = e("../../../src/js/processors/legacy/MoaLegacyAdjustments"), "number" != typeof t.brightness || "number" != typeof t.contrast || "number" != typeof t.warmth || "number" != typeof t.saturation || "string" != typeof t.blendMode || "number" != typeof t.alpha) throw new r("value is missing.", "adjustments");
						return s = n.adjustments(o, t)
					}, n.adjustments2 = function(t, o, a, i) {
						var n = !1;
						if (MoaAdjustments2 = e("../../../src/js/processors/MoaAdjustments"), "number" != typeof t.exposure || "number" != typeof t.brightness || "number" != typeof t.contrast || "number" != typeof t.highlights || "number" != typeof t.shadows || "number" != typeof t.saturation || "number" != typeof t.vibrance || "number" != typeof t.warmth || "number" != typeof t.tint || "number" != typeof t.fade || "string" != typeof t.blendMode || "number" != typeof t.alpha) throw new r("value is missing.", "adjustments");
						return n = MoaAdjustments2.runAdjustments(o, t)
					}, n.noise = function(t, o, a, i) {
						var n = !1,
							s = e("../../../src/js/core/rng"),
							l = e("../../../src/js/processors/MoaNoise"),
							u = t.intensity;
						if ("number" != typeof u) throw new r("intensity is missing.", "noise");
						return u *= a.intensity, rng = new s.RNG(a.seed), l.noise(o, u, rng.nextInt()), n = !0
					}, n.blendWithColor = function(t, o, a, i) {
						var n = !1,
							s = e("../../../src/js/processors/MoaBlendWithColor"),
							l = t.color,
							u = t.blendMode;
						if (u || (u = "normal"), alpha = t.alpha, null == l || null == alpha) throw new r("color or alpha param is missing.", "blendWithColor");
						return s.blendWithColor(o, {
							color: l,
							blendMode: u,
							alpha: alpha
						}), n = !0
					}, n.gamma = function(t, a, i, n) {
						var s = !1,
							l = e("../../../src/js/processors/MoaGamma"),
							u = t.value;
						if ("number" != typeof u) throw new r("value is missing.", "gamma");
						return amount = o(u, 1, i.intensity), l.gamma(a, amount), s = !0
					}, n.fade = function(t, a, i, n) {
						var s = !1,
							l = e("../../../src/js/processors/MoaFade"),
							u = t.value;
						if ("number" != typeof u) throw new r("value is missing.", "fade");
						return amount = o(u, 1, i.intensity), l.fade(a, amount), s = !0
					}, n.exposure = function(t, a, i, n) {
						var s = !1,
							l = e("../../../src/js/processors/MoaExposure"),
							u = t.value;
						if ("number" != typeof u) throw new r("value is missing.", "exposure");
						var h = o(u, 1, i.intensity);
						return l.exposure(a, h), s = !0
					}, n.shadows = function(t, a, i, n) {
						var s = !1,
							l = e("../../../src/js/processors/MoaShadows"),
							u = t.value;
						if ("number" != typeof u) throw new r("value is missing.", "shadows");
						var h = o(u, 1, i.intensity);
						return l.shadows(a, h), s = !0
					}, n.highlights = function(t, a, i, n) {
						var s = !1,
							l = e("../../../src/js/processors/MoaHighlights"),
							u = t.value;
						if ("number" != typeof u) throw new r("value is missing.", "highlights");
						var h = o(u, 1, i.intensity);
						return l.highlights(a, h), s = !0
					}, n.flare = function(t, o, a, i) {
						var n = !1,
							s = e("../../../src/js/processors/MoaFlare"),
							l = t.color,
							u = t.blendMode,
							h = t.type,
							d = t.dx,
							c = t.dy,
							f = t.dsx,
							m = t.dsy,
							p = t.fScale;
						if ("string" != typeof h || "object" != typeof l || "string" != typeof u || "number" != typeof d || "number" != typeof c || "number" != typeof f || "number" != typeof m || "number" != typeof p) throw new r("some params are incorrect or missing.", "flare");
						var g = parseFloat(l.a / 255);
						return "fingerFlare" !== h && (g *= a.intensity), s.flare(o, p, l.r, l.g, l.b, g, h, d, c, f, m, u, a.intensity), n = !0
					}, n.intensityMap = function(t, o, i, n) {
						var s, l, u, h, d, c;
						if (c = !1, d = e("../../../src/js/processors/MoaIntensityMap"), h = e("../../../src/js/processors/MoaHistogramMapping"), u = null != t ? t.histMap : void 0, l = null != t ? t.blendMode : void 0, s = null != t ? t.alpha : void 0, null == u || null == s) throw new r("histMap or alpha missing or problematic.", "intensityMap");
						return u = a(u), h.fadeMapping(u, null != i ? i.intensity : void 0), d.mapIntensity(o, u, l, s * i.intensity), c = !0
					}, n.sharpness = function(t, o, a, i) {
						var n, s, l, u = !1,
							h = e("../../../src/js/processors/MoaSharpen");
						if ("number" != typeof t.amount || null == t.amount) throw new r("amount param is missing.", "sharpness");
						return s = t.amount, n = "number" != typeof t.alpha || null == t.alpha ? 1 : t.alpha, "string" != typeof t.blendMode || null == t.blendMode || (l = t.blendMode), n *= a.intensity, h.sharpen(o, s, n, l), u = !0
					}, n.gradient = function(t, o, a, i) {
						var n, s, l, u, h, d, c, f, m, p, g, v, _, x, M, y;
						if (_ = !1, m = e("../../../src/js/processors/MoaGradient"), h = t.colors, f = t.opacities, c = t.gradientShape, p = t.scale, M = t.xCenter, y = t.yCenter, l = t.angle, l *= Math.PI / 180, s = t.alpha, u = t.blendMode, v = t.vignetteShape || {}, t.vignetteShape) switch (n = 1e-9, g = v.scaling, x = v.vignetteScale, g) {
							case "average":
								v.vignetteScale = (o.width + o.height) / 2 * x / (a.intensity + n), v.stretch = !1;
								break;
							case "max":
								v.vignetteScale = Math.max(o.width, o.height) * x / (a.intensity + n), v.stretch = !1;
								break;
							case "stretch":
								v.vignetteScale = x / (a.intensity + n), v.stretch = !0;
								break;
							default:
								throw new r("scaling mode " + g + " not defined.", "vignette")
						}
						if (null == h || null == f) throw new r("colors or opacities param is missing.", "sharpness");
						return d = {
							colors: h,
							opacities: f
						}, m.applyGradient(o, d, c, p, M, y, l, v, u, s), _ = !0
					}, n.gradientFlare = function(t, r, o, a) {
						var i, n;
						return n = !1, i = e("../../../src/js/processors/MoaGradientFlare"), i.gradientFlare(r, t), n = !0
					}, n.gradientMap = function(t, r, o, a) {
						var i, n;
						return n = !1, i = e("../../../src/js/processors/MoaGradientMap"), i.gradientMap(r, t), n = !0
					}, n.sketch = function(t, r, o, a) {
						var i = e("../../../src/js/processors/MoaSketch"),
							n = t.canvasColor,
							s = t.strokeColor;
						return "number" != typeof t.radius || "number" != typeof t.levels || "number" != typeof t.strokeLength || "number" != typeof t.saturation || "object" != typeof s || "object" != typeof n ? !1 : (i.runSketch(r, t.radius, t.levels, t.strokeLength, t.saturation, n, s), !0)
					}, n.halftone = function(t, r, o, a) {
						var i, n;
						return n = !1, i = e("../../../src/js/processors/MoaHalftone"), i.halftone(r, t), n = !0
					}, i = function(e) {
						var t, r, o;
						for (t = [], r = 0, o = e.length; o > r;) t.push(e[r]), r++;
						return t
					}, a = function(e) {
						return {
							r: i(e.r),
							g: i(e.g),
							b: i(e.b)
						}
					}, o = function(e, t, r) {
						return null == t && (t = 1), "number" != typeof r && (r = 1), e * r + 1 * (1 - r)
					}, t.exports = {
						MLPLRunProcessor: function(e, t, o) {
							var a, i, s;
							if (a = null != e ? e.parameters : void 0, "undefined" == typeof o && (o = {}), "undefined" == typeof o.border && (o.border = !0), "undefined" == typeof o.intensity && (o.intensity = 1), "undefined" == typeof o.seed && (o.seed = 0), i = n[e.name], "undefined" != typeof i) s = i(a, t, o);
							else {
								if (null == i) throw new r("unrecognized processor");
								try {
									s = i(a, t, o)
								} catch (l) {}
							}
							return s
						}
					}
				}).call(this)
			}, {
				"../../../src/js/core/MoaAllocAndCopy": 34,
				"../../../src/js/core/rng": 42,
				"../../../src/js/processors/MoaAdjustmentCurves": 70,
				"../../../src/js/processors/MoaAdjustments": 71,
				"../../../src/js/processors/MoaBlendWithColor": 73,
				"../../../src/js/processors/MoaColorMatrixTransform": 76,
				"../../../src/js/processors/MoaExposure": 79,
				"../../../src/js/processors/MoaFade": 80,
				"../../../src/js/processors/MoaFlare": 81,
				"../../../src/js/processors/MoaGamma": 83,
				"../../../src/js/processors/MoaGradient": 84,
				"../../../src/js/processors/MoaGradientFlare": 85,
				"../../../src/js/processors/MoaGradientMap": 86,
				"../../../src/js/processors/MoaHalftone": 87,
				"../../../src/js/processors/MoaHighlights": 88,
				"../../../src/js/processors/MoaHistogramMapping": 90,
				"../../../src/js/processors/MoaIntensityMap": 91,
				"../../../src/js/processors/MoaLegacyProcessors": 92,
				"../../../src/js/processors/MoaNoise": 93,
				"../../../src/js/processors/MoaShadows": 95,
				"../../../src/js/processors/MoaSharpen": 96,
				"../../../src/js/processors/MoaSketch": 97,
				"../../../src/js/processors/MoaVignette": 98,
				"../../../src/js/processors/legacy/MoaLegacyAdjustments": 99
			}],
			34: [function(e, t, r) {
				function o(e) {
					try {
						var t = document.createElement("canvas"),
							r = t.getContext("2d"),
							o = r.getImageData(0, 0, 1, Math.ceil(e / 4));
						return o.data
					} catch (a) {
						return new Array(e)
					}
				}
				var a = {};
				a.copy = function(e) {
					var t = {};
					return t.width = e.width, t.height = e.height, e.moaGL ? (t.moaGL = e.moaGL, e.moaGL.renderIdentity(), t) : (t.data = "undefined" != typeof Uint8ClampedArray ? new Uint8ClampedArray(e.data.length) : o(e.data.length), a.copyTo(t, e))
				}, a.copyTo = function(e, t) {
					if ("undefined" != typeof Uint8ClampedArray && "undefined" != typeof ImageData && Uint8ClampedArray.prototype.set && t instanceof ImageData && e instanceof ImageData) return e.data.set(t), e;
					for (var r = t.data.length, o = 0; r > o; o += 4) e.data[o] = t.data[o], e.data[o + 1] = t.data[o + 1], e.data[o + 2] = t.data[o + 2], e.data[o + 3] = t.data[o + 3];
					return e
				}, a.copyBitmapSubsection = function(e, t, r, o, a, i) {
					var n = e.width,
						s = e.height,
						l = t.width,
						u = t.height;
					if (0 > r || 0 > o || a > l - 1 || i > u - 1) return !1;
					if (n != a - r + 1 || s != i - o + 1) return !1;
					for (var h = e.data, d = t.data, c = 0; s > c; c++)
						for (var f = 0; n > f; f++) {
							var m = 4 * (c * n + f),
								p = 4 * ((o + c) * l + r + f);
							h[m] = d[p], h[m + 1] = d[p + 1], h[m + 2] = d[p + 2], h[m + 3] = d[p + 3]
						}
					return !0
				}, a.makeData = function(e) {
					var t;
					return t = "undefined" != typeof Uint8ClampedArray ? new Uint8ClampedArray(e) : o(e)
				}, a.makeUint8Array = function(e) {
					var t;
					return t = "undefined" != typeof Uint8Array ? new Uint8Array(e) : new Array(e)
				}, a.makeBitmap = function(e, t) {
					var r = {},
						a = 4 * e * t;
					return r.data = "undefined" != typeof Uint8ClampedArray ? new Uint8ClampedArray(a) : o(a), r.width = e, r.height = t, r
				}, t.exports = a
			}, {}],
			35: [function(e, t, r) {
				"use strict";
				var o = {};
				o.convertToPremultiplied = function(e) {
					if (null == e.moaGL)
						for (var t = e.data, r = 0; r < e.height; r++)
							for (var o = 0; o < e.width; o++) {
								var a = 4 * (r * e.width + o),
									i = t[a + 3] / 255;
								t[a] *= i, t[a + 1] *= i, t[a + 2] *= i
							}
				}, t.exports = o
			}, {}],
			36: [function(e, t, r) {
				"use strict";

				function o(e, t, r, o) {
					this.r = e, this.g = t, this.b = r, this.a = o
				}

				function i(e, t, r) {
					e /= 255, t /= 255, r /= 255;
					var o, a, i, n = Math.max(e, t, r),
						s = Math.min(e, t, r),
						l = n - s;
					if (i = (n + s) / 2, 0 == l) o = 0, a = 0;
					else {
						switch (a = i > .5 ? l / (2 - n - s) : l / (n + s), n) {
							case e:
								o = (t - r) / l + (r > t ? 6 : 0);
								break;
							case t:
								o = (r - e) / l + 2;
								break;
							case r:
								o = (e - t) / l + 4
						}
						o /= 6
					}
					return [o, a, i]
				}

				function n(e, t, r) {
					var o, a, i, n = 6 * e,
						s = r > .5 ? 2 * t * (1 - r) : 2 * t * r,
						l = s * (1 - Math.abs(n % 2 - 1));
					1 > n ? (o = s, a = l, i = 0) : 2 > n ? (o = l, a = s, i = 0) : 3 > n ? (o = 0, a = s, i = l) : 4 > n ? (o = 0, a = l, i = s) : 5 > n ? (o = l, a = 0, i = s) : 6 >= n && (o = s, a = 0, i = l);
					var u = r - .5 * s;
					return o += u, a += u, i += u, o = 255 * o + .5 | 0, a = 255 * a + .5 | 0, i = 255 * i + .5 | 0, [o, a, i]
				}
				var s = e("./MoaAllocAndCopy"),
					l = e("./MoaEnums"),
					u = l.BLEND_MODES;
				o.prototype.setARGB = function(e, t, r, o) {
					this.r = t, this.g = r, this.b = o, this.a = e
				}, o.prototype.setRGB = function(e, t, r) {
					this.r = e, this.g = t, this.b = r, this.a = 255
				}, o.prototype.copy = function(e) {
					this.r = e.r, this.g = e.g, this.b = e.b, this.a = e.a
				}, o.prototype.isEqual = function(e) {
					return this.r != e.r || this.g != e.g || this.b != e.b || this.a != e.a ? !1 : !0
				}, o.prototype.blendEmbededAlphaFromArray = function(e, t, r, o) {
					var i, n, s, l = e[t],
						h = e[t + 1],
						d = e[t + 2],
						c = r.r,
						f = r.g,
						m = r.b,
						p = r.a;
					if (0 != p) {
						switch (o) {
							case u.MOA_BLEND_MODE_NORMAL:
								i = c, n = f, s = m;
								break;
							case u.MOA_BLEND_MODE_OVERLAY:
								;
								i = 64 >= l ? 2 * l * c / 255 : l >= 192 ? (65025 - 2 * (255 - l) * (255 - c)) / 255 : l * l * (510 - 4 * c) / 255 / 255 + l * (4 * c - 255) / 255 + (255 - 2 * c) / 8, n = 64 >= h ? 2 * h * f / 255 : h >= 192 ? (65025 - 2 * (255 - h) * (255 - f)) / 255 : h * h * (510 - 4 * f) / 255 / 255 + h * (4 * f - 255) / 255 + (255 - 2 * f) / 8, s = 64 >= d ? 2 * d * m / 255 : d >= 192 ? (65025 - 2 * (255 - d) * (255 - m)) / 255 : d * d * (510 - 4 * m) / 255 / 255 + d * (4 * m - 255) / 255 + (255 - 2 * m) / 8;
								break;
							case u.MOA_BLEND_MODE_COLOR:
								return void this.colorBlendColorFromArrayEmbeddedAlpha(e, t, r);
							case u.MOA_BLEND_MODE_SCREEN:
								i = (65025 - (255 - l) * (255 - c)) / 255, n = (65025 - (255 - h) * (255 - f)) / 255, s = (65025 - (255 - d) * (255 - m)) / 255;
								break;
							case u.MOA_BLEND_MODE_DARKEN:
								i = c > l ? l : c, n = f > h ? h : f, s = m > d ? d : m;
								break;
							case u.MOA_BLEND_MODE_MULTIPLY:
								i = l * c / 255, n = h * f / 255, s = d * m / 255;
								break;
							case u.MOA_BLEND_MODE_SOFT:
								i = (2 * l * c + l * l - 2 * l * l * c / 255) / 255, n = (2 * h * f + h * h - 2 * h * h * f / 255) / 255, s = (2 * d * m + d * d - 2 * d * d * m / 255) / 255;
								break;
							case u.MOA_BLEND_MODE_LIGHTEN:
								i = l > c ? l : c, n = h > f ? h : f, s = d > m ? d : m;
								break;
							case u.MOA_BLEND_MODE_DIFFERENCE:
								i = l > c ? l - c : c - l, n = h > f ? h - f : f - h, s = d > m ? d - m : m - d;
								break;
							case u.MOA_BLEND_MODE_NEGATION:
								i = 255 - (0 > 255 - l - c ? -(255 - l - c) : 255 - l - c), n = 255 - (0 > 255 - h - f ? -(255 - h - f) : 255 - h - f), s = 255 - (0 > 255 - d - m ? -(255 - d - m) : 255 - d - m);
								break;
							case u.MOA_BLEND_MODE_EXCLUSION:
								i = l + c - 2 * l * c / 255, n = h + f - 2 * h * f / 255, s = d + m - 2 * d * m / 255;
								break;
							case u.MOA_BLEND_MODE_HARD:
								i = (127 > c ? 2 * l * c : 65025 - 2 * (255 - l) * (255 - c)) / 255, n = (127 > f ? 2 * h * f : 65025 - 2 * (255 - h) * (255 - f)) / 255, s = (127 > m ? 2 * d * m : 65025 - 2 * (255 - d) * (255 - m)) / 255;
								break;
							case u.MOA_BLEND_MODE_RED:
								i = c, n = h, s = d;
								break;
							case u.MOA_BLEND_MODE_GREEN:
								i = l, n = f, s = d;
								break;
							case u.MOA_BLEND_MODE_BLUE:
								i = l, n = h, s = m;
								break;
							case u.MOA_BLEND_MODE_INTERPOLATION:
								return void MoaColorBlendInterpolationEmbededAlpha(a, b);
							case u.MOA_BLEND_MODE_COLOR_DODGE:
								i = l >= 255 - c ? 255 : 255 * l / (255 - c), n = h >= 255 - f ? 255 : 255 * h / (255 - f), s = d >= 255 - m ? 255 : 255 * d / (255 - m);
								break;
							case u.MOA_BLEND_MODE_INV_COLOR_DODGE:
								i = c >= 255 - l ? 255 : 255 * c / (255 - l), n = f >= 255 - h ? 255 : 255 * f / (255 - h), s = m >= 255 - d ? 255 : 255 * m / (255 - d);
								break;
							case u.MOA_BLEND_MODE_SOFT_DODGE:
								i = 256 > l + c ? (255 == c ? 255 : 255 * l / (255 - c)) / 2 : 255 - 127 * (255 - c) / l, n = 256 > h + f ? (255 == f ? 255 : 255 * h / (255 - f)) / 2 : 255 - 127 * (255 - f) / h, s = 256 > d + m ? (255 == m ? 255 : 255 * d / (255 - m)) / 2 : 255 - 127 * (255 - m) / d;
								break;
							case u.MOA_BLEND_MODE_COLOR_BURN:
								i = 255 - l >= c ? 0 : 255 - 255 * (255 - l) / c, n = 255 - h >= f ? 0 : 255 - 255 * (255 - h) / f, s = 255 - d >= m ? 0 : 255 - 255 * (255 - d) / m;
								break;
							case u.MOA_BLEND_MODE_INV_COLOR_BURN:
								i = 255 - c >= l ? 0 : 255 - 255 * (255 - c) / l, n = 255 - f >= h ? 0 : 255 - 255 * (255 - f) / h, s = 255 - m >= d ? 0 : 255 - 255 * (255 - m) / d;
								break;
							case u.MOA_BLEND_MODE_SOFT_BURN:
								i = 256 > l + c ? 255 == l ? 255 : 127 * c / (255 - l) : 255 - 127 * (255 - l) / c, n = 256 > h + f ? 255 == h ? 255 : 127 * f / (255 - h) : 255 - 127 * (255 - h) / f, s = 256 > d + m ? 255 == d ? 255 : 127 * m / (255 - d) : 255 - 127 * (255 - d) / m;
								break;
							case u.MOA_BLEND_MODE_ADD:
								i = l + c > 255 ? 255 : l + c, n = h + f > 255 ? 255 : h + f, s = d + m > 255 ? 255 : d + m;
								break;
							case u.MOA_BLEND_MODE_SUBTRACT:
								i = 0 > l + c - 255 ? 0 : l + c - 255, n = 0 > h + f - 255 ? 0 : h + f - 255, s = 0 > d + m - 255 ? 0 : d + m - 255;
								break;
							case u.MOA_BLEND_MODE_STAMP:
								i = l + 2 * c > 510 ? 255 : 255 > l + 2 * c ? 0 : l + 2 * c - 255, n = h + 2 * f > 510 ? 255 : 255 > h + 2 * f ? 0 : h + 2 * f - 255, s = d + 2 * m > 510 ? 255 : 255 > d + 2 * m ? 0 : d + 2 * m - 255;
								break;
							case u.MOA_BLEND_MODE_REFLECT:
								i = l * l > 65025 - 255 * c ? 255 : l * l / (255 - c), n = h * h > 65025 - 255 * f ? 255 : h * h / (255 - f), s = d * d > 65025 - 255 * m ? 255 : d * d / (255 - m);
								break;
							case u.MOA_BLEND_MODE_GLOW:
								i = c * c > 65025 - 255 * l ? 255 : c * c / (255 - l), n = f * f > 65025 - 255 * h ? 255 : f * f / (255 - h), s = m * m > 65025 - 255 * d ? 255 : m * m / (255 - d);
								break;
							case u.MOA_BLEND_MODE_FREEZE:
								i = (255 - l) * (255 - l) >= 255 * c ? 0 : 255 - (255 - l) * (255 - l) / c, n = (255 - h) * (255 - h) >= 255 * f ? 0 : 255 - (255 - h) * (255 - h) / f, s = (255 - d) * (255 - d) >= 255 * m ? 0 : 255 - (255 - d) * (255 - d) / m;
								break;
							case u.MOA_BLEND_MODE_HEAT:
								i = (255 - c) * (255 - c) >= 255 * l ? 0 : 255 - (255 - c) * (255 - c) / l, n = (255 - f) * (255 - f) >= 255 * h ? 0 : 255 - (255 - f) * (255 - f) / h, s = (255 - m) * (255 - m) >= 255 * d ? 0 : 255 - (255 - m) * (255 - m) / d;
								break;
							default:
								i = 0, n = 0, s = 0
						}
						i = 0 | i, n = 0 | n, s = 0 | s, e[t] = (p * i + (255 - p) * l) / 255 | 0, e[t + 1] = (p * n + (255 - p) * h) / 255 | 0, e[t + 2] = (p * s + (255 - p) * d) / 255 | 0
					}
				}, o.prototype.generateMoaColorArray = function(e) {
					for (var t = [], r = 0; e > r; r++) t[r] = new o;
					return t
				}, o.prototype.colorBlendColorFromArrayEmbeddedAlpha = function(e, t, r) {
					var o = r.a,
						a = i(r.r, r.g, r.b),
						s = e[t],
						l = e[t + 1],
						u = e[t + 2];
					a[1] *= o / 255, a[2] = (.212671 * s + .71516 * l + .072169 * u) / 255;
					var h = n(a[0], a[1], a[2]);
					e[t] = ((255 - o) * s + o * h[0]) / 255 | 0, e[t + 1] = ((255 - o) * l + o * h[1]) / 255 | 0, e[t + 2] = ((255 - o) * u + o * h[2]) / 255 | 0
				}, o.prototype.colorBlendColorFromArray = function(e, t, r, o, a) {
					var i, s, l, u, h = e[t],
						d = e[t + 1],
						c = e[t + 2],
						f = 1 - a,
						m = r[0],
						p = r[1],
						g = r[2];
					p *= o / 255, g = (.212671 * h + .71516 * d + .072169 * c) / 255, i = n(m, p, g), s = f * h + a * i[0], l = f * d + a * i[1], u = f * c + a * i[2], h = 0 | s, d = 0 | l, c = 0 | u, e[t] = h > 255 ? 255 : 0 > h ? 0 : h, e[t + 1] = d > 255 ? 255 : 0 > d ? 0 : d, e[t + 2] = c > 255 ? 255 : 0 > c ? 0 : c
				}, o.prototype.rgb2graySingleChannel = function(e) {
					for (var t, r, o, a, i, n, l = e.width, u = e.height, h = s.makeData(l * u), d = 0; u > d; d++)
						for (var c = 0; l > c; c++) r = d * l + c, t = 4 * (d * l + c), o = e.data[t], a = e.data[t + 1], i = e.data[t + 2], n = .3 * o + .59 * a + .11 * i, h[r] = n > 255 ? 255 : Math.round(n);
					return h
				}, o.prototype.rgb2hsl = i, o.prototype.hsl2rgb = n, t.exports = o
			}, {
				"./MoaAllocAndCopy": 34,
				"./MoaEnums": 38
			}],
			37: [function(e, t, r) {
				"use strict";

				function o(e, t) {
					this.x = e, this.y = t
				}
				o.prototype.translate = function(e, t) {
					this.x += e, this.y += t
				}, o.prototype.scale = function(e, t) {
					this.x *= e, this.y *= t
				}, o.prototype.copy = function() {
					return new o(this.x, this.y)
				}, t.exports = {
					MoaPoint: o
				}
			}, {}],
			38: [function(e, t, r) {
				"use strict";
				var o = {
					MOA_BLEND_MODE_NORMAL: 0,
					MOA_BLEND_MODE_OVERLAY: 1,
					MOA_BLEND_MODE_COLOR: 2,
					MOA_BLEND_MODE_SCREEN: 3,
					MOA_BLEND_MODE_DARKEN: 4,
					MOA_BLEND_MODE_MULTIPLY: 5,
					MOA_BLEND_MODE_SOFT: 6,
					MOA_BLEND_MODE_LIGHTEN: 7,
					MOA_BLEND_MODE_DIFFERENCE: 8,
					MOA_BLEND_MODE_NEGATION: 9,
					MOA_BLEND_MODE_EXCLUSION: 10,
					MOA_BLEND_MODE_HARD: 11,
					MOA_BLEND_MODE_RED: 12,
					MOA_BLEND_MODE_GREEN: 13,
					MOA_BLEND_MODE_BLUE: 14,
					MOA_BLEND_MODE_INTERPOLATION: 15,
					MOA_BLEND_MODE_COLOR_DODGE: 16,
					MOA_BLEND_MODE_INV_COLOR_DODGE: 17,
					MOA_BLEND_MODE_SOFT_DODGE: 18,
					MOA_BLEND_MODE_COLOR_BURN: 19,
					MOA_BLEND_MODE_INV_COLOR_BURN: 20,
					MOA_BLEND_MODE_SOFT_BURN: 21,
					MOA_BLEND_MODE_ADD: 22,
					MOA_BLEND_MODE_SUBTRACT: 23,
					MOA_BLEND_MODE_STAMP: 24,
					MOA_BLEND_MODE_REFLECT: 25,
					MOA_BLEND_MODE_GLOW: 26,
					MOA_BLEND_MODE_FREEZE: 27,
					MOA_BLEND_MODE_HEAT: 28,
					MOA_COMPOSITE_MODE_CLEAR: 0,
					MOA_COMPOSITE_MODE_SRC: 1,
					MOA_COMPOSITE_MODE_DST: 2,
					MOA_COMPOSITE_MODE_SRC_OVER: 3,
					MOA_COMPOSITE_MODE_DST_OVER: 4,
					MOA_COMPOSITE_MODE_SRC_IN: 5,
					MOA_COMPOSITE_MODE_DST_IN: 6,
					MOA_COMPOSITE_MODE_SRC_OUT: 7,
					MOA_COMPOSITE_MODE_DST_OUT: 8,
					MOA_COMPOSITE_MODE_SRC_ATOP: 9,
					MOA_COMPOSITE_MODE_DST_ATOP: 10,
					MOA_COMPOSITE_MODE_XOR: 11,
					MOA_ASPECT_MODE_STRETCH: 0,
					MOA_ASPECT_MODE_AVERAGE: 1,
					MOA_ASPECT_MODE_FIT: 2,
					MOA_ASPECT_MODE_FILL: 3,
					MOA_SHAPE_MODE_IDENTITY: 0,
					MOA_SHAPE_MODE_LINE: 1,
					MOA_SHAPE_MODE_CIRCLE: 2,
					MOA_SHAPE_MODE_GAUSSIAN: 3,
					MOA_SHAPE_MODE_SQUARE: 4,
					MOA_SHAPE_MODE_SQUARE_ROUND: 5,
					MOA_SHAPE_MODE_STARDOM: 6,
					MOA_SHAPE_MODE_LOBES: 7,
					MOA_SHAPE_MODE_RING_LOBES: 8,
					MOA_SHAPE_MODE_HEART: 9,
					MOA_SHAPE_MODE_STAR: 10,
					MOA_SHAPE_MODE_CRESCENT: 11,
					MOA_SHAPE_MODE_SQUIGGLY: 12,
					MOA_SHAPE_MODE_ZIGZAG: 13,
					MOA_SHAPE_MODE_SPIRAL: 14
				};
				o.getAspectModeIndex = function(e) {
					return "stretch" === e ? o.MOA_ASPECT_MODE_STRETCH : "average" === e ? o.MOA_ASPECT_MODE_AVERAGE : "fit" === e ? o.MOA_ASPECT_MODE_FIT : "fill" === e ? o.MOA_ASPECT_MODE_FILL : -1
				}, o.getShapeModeIndex = function(e) {
					return "line" === e ? o.MOA_SHAPE_MODE_LINE : "circle" === e ? o.MOA_SHAPE_MODE_CIRCLE : "gaussian" === e ? o.MOA_SHAPE_MODE_GAUSSIAN : "square" === e ? o.MOA_SHAPE_MODE_SQUARE : "squareRound" === e ? o.MOA_SHAPE_MODE_SQUARE_ROUND : "stardom" === e ? o.MOA_SHAPE_MODE_STARDOM : "lobes" === e ? o.MOA_SHAPE_MODE_LOBES : "ringLobes" === e ? o.MOA_SHAPE_MODE_RING_LOBES : "heart" === e ? o.MOA_SHAPE_MODE_HEART : "star" === e ? o.MOA_SHAPE_MODE_STAR : "crescent" === e ? o.MOA_SHAPE_MODE_CRESCENT : "squiggly" === e ? o.MOA_SHAPE_MODE_SQUIGGLY : "zigzag" === e ? o.MOA_SHAPE_MODE_ZIGZAG : "spiral" === e ? o.MOA_SHAPE_MODE_SPIRAL : -1
				}, o.getBlendModeIndex = function(e) {
					return "normal" == e ? o.MOA_BLEND_MODE_NORMAL : "overlay" == e ? o.MOA_BLEND_MODE_OVERLAY : "color" == e ? o.MOA_BLEND_MODE_COLOR : "screen" == e ? o.MOA_BLEND_MODE_SCREEN : "darken" == e ? o.MOA_BLEND_MODE_DARKEN : "multiply" == e ? o.MOA_BLEND_MODE_MULTIPLY : "soft" == e ? o.MOA_BLEND_MODE_SOFT : "lighten" == e ? o.MOA_BLEND_MODE_LIGHTEN : "difference" == e ? o.MOA_BLEND_MODE_DIFFERENCE : "negation" == e ? o.MOA_BLEND_MODE_NEGATION : "exclusion" == e ? o.MOA_BLEND_MODE_EXCLUSION : "hard" == e ? o.MOA_BLEND_MODE_HARD : "red" == e ? o.MOA_BLEND_MODE_RED : "green" == e ? o.MOA_BLEND_MODE_GREEN : "blue" == e ? o.MOA_BLEND_MODE_BLUE : "interpolation" == e ? o.MOA_BLEND_MODE_INTERPOLATION : "colordodge" == e ? o.MOA_BLEND_MODE_COLOR_DODGE : "invcolordodge" == e ? o.MOA_BLEND_MODE_INV_COLOR_DODGE : "softdodge" == e ? o.MOA_BLEND_MODE_SOFT_DODGE : "colorburn" == e ? o.MOA_BLEND_MODE_COLOR_BURN : "invcolorburn" == e ? o.MOA_BLEND_MODE_INV_COLOR_BURN : "softburn" == e ? o.MOA_BLEND_MODE_SOFT_BURN : "add" == e ? o.MOA_BLEND_MODE_ADD : "subtract" == e ? o.MOA_BLEND_MODE_SUBTRACT : "stamp" == e ? o.MOA_BLEND_MODE_STAMP : "reflect" == e ? o.MOA_BLEND_MODE_REFLECT : "glow" == e ? o.MOA_BLEND_MODE_GLOW : "freeze" == e ? o.MOA_BLEND_MODE_FREEZE : "heat" == e ? o.MOA_BLEND_MODE_HEAT : -1;

				}, o.BLEND_MODES = {
					MOA_BLEND_MODE_NORMAL: "normal",
					MOA_BLEND_MODE_OVERLAY: "overlay",
					MOA_BLEND_MODE_COLOR: "color",
					MOA_BLEND_MODE_SCREEN: "screen",
					MOA_BLEND_MODE_DARKEN: "darken",
					MOA_BLEND_MODE_MULTIPLY: "multiply",
					MOA_BLEND_MODE_SOFT: "soft",
					MOA_BLEND_MODE_LIGHTEN: "lighten",
					MOA_BLEND_MODE_DIFFERENCE: "difference",
					MOA_BLEND_MODE_NEGATION: "negation",
					MOA_BLEND_MODE_EXCLUSION: "exclusion",
					MOA_BLEND_MODE_HARD: "hard",
					MOA_BLEND_MODE_RED: "red",
					MOA_BLEND_MODE_GREEN: "green",
					MOA_BLEND_MODE_BLUE: "blue",
					MOA_BLEND_MODE_INTERPOLATION: "interpolation",
					MOA_BLEND_MODE_COLOR_DODGE: "colordodge",
					MOA_BLEND_MODE_INV_COLOR_DODGE: "invcolordodge",
					MOA_BLEND_MODE_SOFT_DODGE: "softdodge",
					MOA_BLEND_MODE_COLOR_BURN: "colorburn",
					MOA_BLEND_MODE_INV_COLOR_BURN: "invcolorburn",
					MOA_BLEND_MODE_SOFT_BURN: "softburn",
					MOA_BLEND_MODE_ADD: "add",
					MOA_BLEND_MODE_SUBTRACT: "subtract",
					MOA_BLEND_MODE_STAMP: "stamp",
					MOA_BLEND_MODE_REFLECT: "reflect",
					MOA_BLEND_MODE_GLOW: "glow",
					MOA_BLEND_MODE_FREEZE: "freeze",
					MOA_BLEND_MODE_HEAT: "heat"
				}, t.exports = o
			}, {}],
			39: [function(e, t, r) {
				"use strict";

				function o(e) {
					this.originalBitmap = e, this.originalWidth = e.width, this.originalHeight = e.height, this.bitmapLevels = [], this.numLevels = 0;
					var t = !0;
					"undefined" != typeof e.moaGL && (this.moaGL = e.moaGL);
					var r = this.originalWidth,
						o = this.originalHeight;
					if (this.moaGL && !e.data) {
						t = !1, e.data = a.makeUint8Array(4 * this.originalWidth * this.originalHeight);
						var i = this.moaGL.gl;
						i.bindFramebuffer(i.FRAMEBUFFER, this.moaGL.glRenderingObjects.offscreenFramebuffer), i.framebufferTexture2D(i.FRAMEBUFFER, i.COLOR_ATTACHMENT0, i.TEXTURE_2D, this.moaGL.glImageData.sourceTexture, 0), i.readPixels(0, 0, this.originalWidth, this.originalHeight, i.RGBA, i.UNSIGNED_BYTE, e.data)
					}
					r = this._findNextPowerOfTwo(this.originalWidth) / 2, o = this._findNextPowerOfTwo(this.originalHeight) / 2;
					var n = Math.max(r, o);
					return this.numLevels = this._findNumLevels(n), this._allocateMipmap(r, o), this._fillMipmap(), this.moaGL && this.moaGL.buildGLMipmap(this, t), this.setWrapMode(this.WRAP_MODES.TransparentOutsideBounds), this.currentSamplingLevel = 0, this.sampleBitmap = this.getColorAtLocationOfBitmapLinearLinear, this.sampleOverlay = this.getColorAtLocationOfOverlayLinearLinear, !0
				}
				var a = e("./MoaAllocAndCopy"),
					i = (e("./MoaColor"), 1e-4);
				o.prototype.WRAP_MODES = {
					Repeat: 0,
					ClampToEdge: 1,
					MirroredRepeat: 2,
					TransparentOutsideBounds: 3
				}, o.prototype.setSamplingLevel = function(e, t) {
					var r = e / this.originalWidth,
						o = t / this.originalHeight;
					if (r >= .5 && o >= .5) this.currentSamplingLevel = 0;
					else {
						var a = e / this.bitmapLevels[0].width,
							i = t / this.bitmapLevels[0].height,
							n = Math.min(a, i);
						this.currentSamplingLevel = -Math.log(n) / Math.log(2)
					}
					this.currentSamplingLevel = this.currentSamplingLevel < 0 ? 0 : this.currentSamplingLevel
				}, o.prototype.setOverlaySamplingFuncForSamplingMode = function(e) {
					this.sampleOverlay = "linearLinear" == e ? o.prototype.getColorAtLocationOfOverlayLinearLinear : "nearestLinear" == e ? o.prototype.getColorAtLocationOfOverlayNearestLinear : "linearNearest" == e ? o.prototype.getColorAtLocationOfOverlayLinearNearest : "nearestNearest" == e ? o.prototype.getColorAtLocationOfOverlayNearestNearest : null
				}, o.prototype.setBitmapSamplingFuncForSamplingMode = function(e) {
					this.sampleImage = "linearLinear" == e ? o.prototype.getColorAtLocationOfBitmapLinearLinear : "nearestLinear" == e ? o.prototype.getColorAtLocationOfBitmapNearestLinear : "linearNearest" == e ? o.prototype.getColorAtLocationOfBitmapLinearNearest : "nearestNearest" == e ? o.prototype.getColorAtLocationOfBitmapNearestNearest : null
				}, o.prototype.getBitmapSamplingFuncForSamplingMode = function(e) {
					return "linear" == e ? o.prototype.interpolateBilinear : "nearest" == e ? o.prototype.sampleNearestNeighbor : void 0
				}, o.prototype.getColorAtLocationOfBitmapLinearLinear = function(e, t, r) {
					if (!this.moaGL)
						if (0 == this.currentSamplingLevel) {
							var o = (this.originalBitmap.width - 1) * e,
								a = (this.originalBitmap.height - 1) * t;
							this.interpolateBilinear(this.originalBitmap, o, a, r)
						} else {
							var i = this.currentSamplingLevel,
								n = Math.floor(i),
								s = n + 1;
							n > this.numLevels - 1 && (n = this.numLevels - 1), s > this.numLevels - 1 && (s = this.numLevels - 1);
							var l = i - n,
								u = 1 - l,
								h = (this.bitmapLevels[n].width - 1) * e,
								d = (this.bitmapLevels[n].height - 1) * t,
								c = (this.bitmapLevels[s].width - 1) * e,
								f = (this.bitmapLevels[s].height - 1) * t,
								m = {
									r: 0,
									g: 0,
									b: 0,
									a: 0
								},
								p = {
									r: 0,
									g: 0,
									b: 0,
									a: 0
								};
							this.interpolateBilinear(this.bitmapLevels[n], h, d, m), this.interpolateBilinear(this.bitmapLevels[s], c, f, p), rFinal = l * p.r + u * m.r, gFinal = l * p.g + u * m.g, bFinal = l * p.b + u * m.b, aFinal = l * p.a + u * m.a, r.r = rFinal + .5 | 0, r.g = gFinal + .5 | 0, r.b = bFinal + .5 | 0, r.a = aFinal + .5 | 0
						}
				}, o.prototype.getColorAtLocationOfBitmapNearestLinear = function(e, t, r) {
					if (!this.moaGL)
						if (0 == this.currentSamplingLevel) {
							var o = (this.originalBitmap.width - 1) * e,
								a = (this.originalBitmap.height - 1) * t;
							this.sampleNearestNeighbor(this.originalBitmap, o, a, r)
						} else {
							var i = this.currentSamplingLevel,
								n = Math.floor(i),
								s = n + 1;
							n > this.numLevels - 1 && (n = this.numLevels - 1), s > this.numLevels - 1 && (s = this.numLevels - 1);
							var l = i - n,
								u = 1 - l,
								h = (this.bitmapLevels[n].width - 1) * e,
								d = (this.bitmapLevels[n].height - 1) * t,
								c = (this.bitmapLevels[s].width - 1) * e,
								f = (this.bitmapLevels[s].height - 1) * t,
								m = {
									r: 0,
									g: 0,
									b: 0,
									a: 0
								},
								p = {
									r: 0,
									g: 0,
									b: 0,
									a: 0
								};
							this.sampleNearestNeighbor(this.bitmapLevels[n], h, d, m), this.sampleNearestNeighbor(this.bitmapLevels[s], c, f, p), rFinal = l * p.r + u * m.r, gFinal = l * p.g + u * m.g, bFinal = l * p.b + u * m.b, aFinal = l * p.a + u * m.a, r.r = rFinal + .5 | 0, r.g = gFinal + .5 | 0, r.b = bFinal + .5 | 0, r.a = aFinal + .5 | 0
						}
				}, o.prototype.getColorAtLocationOfBitmapLinearNearest = function(e, t, r) {
					if (!this.moaGL) {
						var o = this.currentSamplingLevel,
							a = o + .5 | 0;
						a > this.numLevels - 1 && (a = this.numLevels - 1);
						var i = (this.bitmapLevels[a].width - 1) * e,
							n = (this.bitmapLevels[a].height - 1) * t;
						this.interpolateBilinear(this.bitmapLevels[a], i, n, r)
					}
				}, o.prototype.getColorAtLocationOfBitmapNearestNearest = function(e, t, r) {
					if (!this.moaGL) {
						var o = this.currentSamplingLevel,
							a = o + .5 | 0;
						a > this.numLevels - 1 && (a = this.numLevels - 1);
						var i = (this.bitmapLevels[a].width - 1) * e,
							n = (this.bitmapLevels[a].height - 1) * t;
						this.sampleNearestNeighbor(this.bitmapLevels[a], i, n, r)
					}
				}, o.prototype.getColorAtLocationOfOverlayLinearLinear = function(e, t, r) {
					if (!this.moaGL)
						if (0 == this.currentSamplingLevel) {
							var o = this.originalBitmap.width * e - .5,
								a = this.originalBitmap.height * t - .5;
							this.interpolateBilinear(this.originalBitmap, o, a, r)
						} else {
							var i = this.currentSamplingLevel,
								n = 0 | i,
								s = n + 1;
							n > this.numLevels - 1 && (n = this.numLevels - 1), s > this.numLevels - 1 && (s = this.numLevels - 1);
							var l = i - n,
								u = 1 - l,
								h = this.bitmapLevels[n].width * e - .5,
								d = this.bitmapLevels[n].height * t - .5,
								c = this.bitmapLevels[s].width * e - .5,
								f = this.bitmapLevels[s].height * t - .5,
								m = {
									r: 0,
									g: 0,
									b: 0,
									a: 0
								},
								p = {
									r: 0,
									g: 0,
									b: 0,
									a: 0
								};
							this.interpolateBilinear(this.bitmapLevels[n], h, d, m), this.interpolateBilinear(this.bitmapLevels[s], c, f, p);
							var g = m.a / 255,
								v = p.a / 255,
								_ = l * v * p.r + u * g * m.r,
								x = l * v * p.g + u * g * m.g,
								M = l * v * p.b + u * g * m.b,
								y = l * p.a + u * m.a,
								b = y / 255;
							b = 0 >= b ? 1 : b, _ /= b, x /= b, M /= b, r.r = _ + .5 | 0, r.g = x + .5 | 0, r.b = M + .5 | 0, r.a = y + .5 | 0
						}
				}, o.prototype.getColorAtLocationOfOverlayNearestLinear = function(e, t, r) {
					if (!this.moaGL)
						if (0 == this.currentSamplingLevel) {
							var o = this.originalBitmap.width * e - .5,
								a = this.originalBitmap.height * t - .5;
							this.sampleNearestNeighbor(this.originalBitmap, o, a, r)
						} else {
							var i = this.currentSamplingLevel,
								n = 0 | i,
								s = n + 1;
							n > this.numLevels - 1 && (n = this.numLevels - 1), s > this.numLevels - 1 && (s = this.numLevels - 1);
							var l = i - n,
								u = 1 - l,
								h = this.bitmapLevels[n].width * e - .5,
								d = this.bitmapLevels[n].height * t - .5,
								c = this.bitmapLevels[s].width * e - .5,
								f = this.bitmapLevels[s].height * t - .5,
								m = {
									r: 0,
									g: 0,
									b: 0,
									a: 0
								},
								p = {
									r: 0,
									g: 0,
									b: 0,
									a: 0
								};
							this.sampleNearestNeighbor(this.bitmapLevels[n], h, d, m), this.sampleNearestNeighbor(this.bitmapLevels[s], c, f, p);
							var g = m.a / 255,
								v = p.a / 255,
								_ = l * v * p.r + u * g * m.r,
								x = l * v * p.g + u * g * m.g,
								M = l * v * p.b + u * g * m.b,
								y = l * p.a + u * m.a,
								b = y / 255;
							b = 0 >= b ? 1 : b, _ /= b, x /= b, M /= b, r.r = _ + .5 | 0, r.g = x + .5 | 0, r.b = M + .5 | 0, r.a = y + .5 | 0
						}
				}, o.prototype.getColorAtLocationOfOverlayLinearNearest = function(e, t, r) {
					if (!this.moaGL) {
						var o = this.currentSamplingLevel,
							a = o + .5 | 0;
						a > this.numLevels - 1 && (a = this.numLevels - 1);
						var i = this.bitmapLevels[a].width * e - .5,
							n = this.bitmapLevels[a].height * t - .5;
						this.interpolateBilinear(this.bitmapLevels[a], i, n, r)
					}
				}, o.prototype.getColorAtLocationOfOverlayNearestNearest = function(e, t, r) {
					if (!this.moaGL) {
						var o = this.currentSamplingLevel,
							a = o + .5 | 0;
						a > this.numLevels - 1 && (a = this.numLevels - 1);
						var i = this.bitmapLevels[a].width * e,
							n = this.bitmapLevels[a].height * t;
						this.sampleNearestNeighbor(this.bitmapLevels[a], i, n, r)
					}
				}, o.prototype.sampleNearestNeighbor = function(e, t, r, o) {
					if (-i - .5 > t || t > e.width - .5 + i) return o.r = 0, o.g = 0, o.b = 0, void(o.a = 0);
					if (-i - .5 > r || r > e.height - .5 + i) return o.r = 0, o.g = 0, o.b = 0, void(o.a = 0);
					var a = e.data,
						n = e.width - 1,
						s = e.height - 1;
					t = 0 > t ? 0 : t > n ? n : t, r = 0 > r ? 0 : r > s ? s : r;
					var l = t + .5 | 0,
						u = r + .5 | 0,
						h = 4 * (u * e.width + l);
					o.r = a[h], o.g = a[h + 1], o.b = a[h + 2], o.a = a[h + 3]
				}, o.prototype.interpolateBilinear = function(e, t, r, o) {
					var a = e.width,
						n = e.height,
						s = e.data;
					if (-i - .5 > t || t > a - .5 + i) return o.r = 0, o.g = 0, o.b = 0, void(o.a = 0);
					if (-i - .5 > r || r > n - .5 + i) return o.r = 0, o.g = 0, o.b = 0, void(o.a = 0);
					var l, u, h, d, c, f, m, p, g, v, _, x;
					t = 0 > t ? 0 : t > a - 1 ? a - 1 : t, r = 0 > r ? 0 : r > n - 1 ? n - 1 : r;
					var M = 0 | t,
						y = 0 | r;
					M = M > a - 2 ? a - 2 : M, y = y > n - 2 ? n - 2 : y;
					var b = y + 1,
						C = t - M,
						T = r - y,
						A = 1 - C,
						S = 1 - T,
						w = 4 * (y * a + M),
						P = w + 4,
						F = 4 * (b * a + M),
						E = F + 4;
					w = 0 > w ? 0 : w, P = 0 > P ? 0 : P;
					var D, L, R, B, O;
					D = s[w + 3] / 255, L = s[P + 3] / 255, R = s[F + 3] / 255, B = s[E + 3] / 255;
					var I = D * A,
						N = L * C;
					l = I * s[w] + N * s[P], u = I * s[w + 1] + N * s[P + 1], h = I * s[w + 2] + N * s[P + 2], d = A * s[w + 3] + C * s[P + 3];
					var G = R * A,
						U = B * C;
					c = G * s[F] + U * s[E], f = G * s[F + 1] + U * s[E + 1], m = G * s[F + 2] + U * s[E + 2], p = A * s[F + 3] + C * s[E + 3], g = S * l + T * c, v = S * u + T * f, _ = S * h + T * m, x = S * d + T * p, O = x / 255, O = 0 >= O ? 1 : O, g /= O, v /= O, _ /= O, o.r = g + .5 | 0, o.g = v + .5 | 0, o.b = _ + .5 | 0, o.a = x + .5 | 0
				}, o.prototype.interpolateBilinearPremultiplied = function(e, t, r, o) {
					var a = e.width,
						n = e.height,
						s = e.data;
					if (-i - .5 > t || t > a - .5 + i) return o.r = 0, o.g = 0, o.b = 0, void(o.a = 0);
					if (-i - .5 > r || r > n - .5 + i) return o.r = 0, o.g = 0, o.b = 0, void(o.a = 0);
					var l, u, h, d, c, f, m, p, g, v, _, x;
					t = 0 > t ? 0 : t > a - 1 ? a - 1 : t, r = 0 > r ? 0 : r > n - 1 ? n - 1 : r;
					var M = 0 | t,
						y = 0 | r;
					M = M > a - 2 ? a - 2 : M, y = y > n - 2 ? n - 2 : y;
					var b = y + 1,
						C = t - M,
						T = r - y,
						A = 1 - C,
						S = 1 - T,
						w = 4 * (y * a + M),
						P = w + 4,
						F = 4 * (b * a + M),
						E = F + 4;
					l = A * s[w] + C * s[P], u = A * s[w + 1] + C * s[P + 1], h = A * s[w + 2] + C * s[P + 2], d = A * s[w + 3] + C * s[P + 3], c = A * s[F] + C * s[E], f = A * s[F + 1] + C * s[E + 1], m = A * s[F + 2] + C * s[E + 2], p = A * s[F + 3] + C * s[E + 3], g = S * l + T * c, v = S * u + T * f, _ = S * h + T * m, x = S * d + T * p, o.r = g + .5 | 0, o.g = v + .5 | 0, o.b = _ + .5 | 0, o.a = x + .5 | 0
				}, o.prototype.setWrapMode = function(e) {
					if (this.wrapMode = e, this.moaGL) {
						var t = this.moaGL.gl,
							r = this.moaGL._claimFreeTexture();
						t.activeTexture(this.moaGL._getTextureForIndex(r)), t.bindTexture(t.TEXTURE_2D, this.mipmapTexture), e == this.WRAP_MODES.Repeat ? (t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, t.REPEAT), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, t.REPEAT)) : e == this.WRAP_MODES.ClampToEdge ? (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 == this.WRAP_MODES.MirroredRepeat ? (t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, t.MIRRORED_REPEAT), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, t.MIRRORED_REPEAT)) : e == this.WRAP_MODES.TransparentOutsideBounds && (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)), this.moaGL._resetTextureToFree(r)
					}
				}, o.prototype.freeMipmap = function() {
					if (this.moaGL) this.moaGL.destroyTexture(this.originalImageTexture), this.moaGL.destroyTexture(this.mipmapTexture);
					else
						for (var e = 0; e < this.numLevels; e++) this.bitmapLevels[e] = null
				};
				var n = [0, .0003035269835, .0006070539671, .0009105809506, .001214107934, .001517634918, .001821161901, .002124688885, .002428215868, .002731742852, .003035269835, .003346535764, .003676507324, .004024717018, .004391442037, .004776953481, .005181516702, .005605391624, .006048833023, .006512090793, .006995410187, .007499032043, .008023192985, .008568125618, .009134058702, .00972121732, .01032982303, .01096009401, .01161224518, .01228648836, .01298303234, .01370208305, .0144438436, .01520851442, .01599629337, .01680737575, .01764195449, .01850022013, .01938236096, .02028856306, .02121901038, .02217388479, .02315336618, .02415763245, .02518685963, .02624122189, .02732089164, .0284260395, .02955683444, .03071344373, .03189603307, .03310476657, .03433980681, .03560131488, .0368894504, .0382043716, .03954623528, .04091519691, .04231141062, .04373502926, .04518620439, .04666508634, .04817182423, .04970656598, .05126945837, .05286064702, .05448027644, .05612849005, .05780543019, .05951123816, .06124605423, .06301001765, .06480326669, .06662593864, .06847816984, .0703600957, .07227185068, .07421356838, .07618538148, .07818742181, .08021982031, .08228270713, .08437621154, .08650046204, .08865558629, .09084171118, .09305896285, .09530746663, .09758734714, .09989872825, .1022417331, .1046164841, .107023103, .1094617108, .1119324278, .1144353738, .1169706678, .119538428, .1221387722, .1247718176, .1274376804, .1301364767, .1328683216, .1356333297, .138431615, .1412632911, .1441284709, .1470272665, .1499597898, .152926152, .1559264637, .1589608351, .1620293756, .1651321945, .1682694002, .1714411007, .1746474037, .177888416, .1811642442, .1844749945, .1878207723, .1912016827, .1946178304, .1980693196, .2015562538, .2050787364, .2086368701, .2122307574, .2158605001, .2195261997, .2232279573, .2269658735, .2307400485, .2345505822, .2383975738, .2422811225, .2462013267, .2501582847, .2541520943, .2581828529, .2622506575, .2663556048, .270497791, .2746773121, .2788942635, .2831487404, .2874408377, .2917706498, .2961382708, .3005437944, .3049873141, .3094689228, .3139887134, .3185467781, .3231432091, .3277780981, .3324515363, .337163615, .3419144249, .3467040564, .3515325995, .3564001441, .3613067798, .3662525956, .3712376805, .376262123, .3813260114, .3864294338, .3915724777, .3967552307, .4019777798, .4072402119, .4125426135, .4178850708, .42326767, .4286904966, .4341536362, .4396571738, .4452011945, .4507857828, .4564110232, .4620769997, .4677837961, .4735314961, .4793201831, .4851499401, .4910208498, .4969329951, .502886458, .5088813209, .5149176654, .5209955732, .5271151257, .533276404, .539479489, .5457244614, .5520114015, .5583403896, .5647115057, .5711248295, .5775804404, .5840784179, .5906188409, .5972017884, .6038273389, .6104955708, .6172065624, .6239603917, .6307571363, .637596874, .644479682, .6514056374, .6583748173, .6653872983, .672443157, .6795424696, .6866853124, .6938717613, .7011018919, .7083757799, .7156935005, .7230551289, .7304607401, .7379104088, .7454042095, .7529422168, .7605245047, .7681511472, .7758222183, .7835377915, .7912979403, .799102738, .8069522577, .8148465722, .8227857544, .8307698768, .8387990117, .8468732315, .8549926081, .8631572135, .8713671192, .8796223969, .8879231179, .8962693534, .9046611744, .9130986518, .9215818563, .9301108584, .9386857285, .9473065367, .9559733532, .9646862479, .9734452904, .9822505503, .9911020971, 1],
					s = [0, 1, 2, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 10, 11, 12, 13, 13, 14, 15, 15, 16, 16, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 27, 27, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 50, 50, 50, 50, 50, 51, 51, 51, 51, 51, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 54, 55, 55, 55, 55, 55, 55, 56, 56, 56, 56, 56, 57, 57, 57, 57, 57, 57, 58, 58, 58, 58, 58, 58, 59, 59, 59, 59, 59, 59, 60, 60, 60, 60, 60, 60, 61, 61, 61, 61, 61, 61, 62, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 64, 64, 64, 64, 64, 64, 64, 65, 65, 65, 65, 65, 65, 66, 66, 66, 66, 66, 66, 66, 67, 67, 67, 67, 67, 67, 67, 68, 68, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, 71, 71, 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, 72, 72, 72, 73, 73, 73, 73, 73, 73, 73, 74, 74, 74, 74, 74, 74, 74, 74, 75, 75, 75, 75, 75, 75, 75, 75, 76, 76, 76, 76, 76, 76, 76, 77, 77, 77, 77, 77, 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 80, 80, 80, 80, 80, 80, 80, 80, 81, 81, 81, 81, 81, 81, 81, 81, 81, 82, 82, 82, 82, 82, 82, 82, 82, 83, 83, 83, 83, 83, 83, 83, 83, 83, 84, 84, 84, 84, 84, 84, 84, 84, 84, 85, 85, 85, 85, 85, 85, 85, 85, 85, 86, 86, 86, 86, 86, 86, 86, 86, 86, 87, 87, 87, 87, 87, 87, 87, 87, 87, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 89, 89, 89, 89, 89, 89, 89, 89, 89, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255];
				o.prototype._allocateMipmap = function(e, t) {
					var r, o;
					this.bitmapLevels[0] = {
						width: e,
						height: t,
						data: a.makeUint8Array(4 * e * t)
					};
					for (var i = 1; i < this.numLevels; i++) r = Math.ceil(this.bitmapLevels[i - 1].width / 2), o = Math.ceil(this.bitmapLevels[i - 1].height / 2), this.bitmapLevels[i] = {
						width: r,
						height: o,
						data: a.makeUint8Array(4 * r * o)
					}
				}, o.prototype._fillMipmap = function() {
					this._fillBaseImage(this.originalBitmap, this.bitmapLevels[0]);
					for (var e = 1; e < this.numLevels;) this._averageAndDownSample(this.bitmapLevels[e], this.bitmapLevels[e - 1]), e++
				}, o.prototype._fillBaseImage = function(e, t) {
					if (e.width == 2 * t.width && e.height == 2 * t.height) return void this._averageAndDownSample(t, e);
					for (var r, o, a, i = t.width, n = t.height, s = (e.width - 1) / (t.width - 1), l = (e.height - 1) / (t.height - 1), u = {
							r: 0,
							g: 0,
							b: 0,
							a: 0
						}, h = 0; n > h; h++)
						for (var d = 0; i > d; d++) r = d * s, o = h * l, a = 4 * (h * i + d), this.interpolateBilinear(e, r, o, u), t.data[a] = u.r, t.data[a + 1] = u.g, t.data[a + 2] = u.b, t.data[a + 3] = u.a
				}, o.prototype._averageAndDownSample = function(e, t) {
					for (var r, o, a, i, l, u, h, d, c, f, m, p, g, v, _, x = e.width, M = e.height, y = t.width, b = (t.height, 0); M > b; b++)
						for (var C = 0; x > C; C++) v = 2 * C < t.width - 1, _ = 2 * b < t.height - 1, r = 4 * (x * b + C), o = 4 * (2 * y * b + 2 * C), h = n[t.data[o + 3]], a = h * n[t.data[o]], i = h * n[t.data[o + 1]], l = h * n[t.data[o + 2]], u = h, d = 1, v && (o += 4, h = n[t.data[o + 3]], a += h * n[t.data[o]], i += h * n[t.data[o + 1]], l += h * n[t.data[o + 2]], u += h, d++), _ && (o = 4 * ((2 * b + 1) * y + 2 * C), h = n[t.data[o + 3]], a += h * n[t.data[o]], i += h * n[t.data[o + 1]], l += h * n[t.data[o + 2]], u += h, d++), v && _ && (o = 4 * ((2 * b + 1) * y + 2 * C + 1), h = n[t.data[o + 3]], a += h * n[t.data[o]], i += h * n[t.data[o + 1]], l += h * n[t.data[o + 2]], u += h, d++), d = 1 / d, a *= d, i *= d, l *= d, u *= d, c = 0 >= u ? 1 : 1 / u, a *= c, i *= c, l *= c, f = Math.round(4095 * a), m = Math.round(4095 * i), p = Math.round(4095 * l), g = Math.round(4095 * u), e.data[r] = s[f], e.data[r + 1] = s[m], e.data[r + 2] = s[p], e.data[r + 3] = s[g]
				}, o.prototype._findNumLevels = function(e) {
					for (var t = 0; e > 1;) e = Math.ceil(e / 2), t++;
					return t++, t
				}, o.prototype._findNextPowerOfTwo = function(e) {
					for (var t = 1; e > t;) t *= 2;
					return t
				}, o.prototype._applyWrapModeToNormalizedCoordinate = function(e, t) {
					if (e == this.WRAP_MODES.Repeat) t = t >= 0 ? t - Math.floor(t) : t - Math.floor(t) + 1;
					else if (e == this.WRAP_MODES.MirroredRepeat) {
						t = Math.abs(t);
						var r = Math.floor(t);
						r % 2 == 0 ? t -= r : t = 1 - t + r
					} else e == this.WRAP_MODES.ClampToEdge && (t = 0 > t ? 0 : t > 1 ? 1 : t);
					return t
				}, t.exports = o
			}, {
				"./MoaAllocAndCopy": 34,
				"./MoaColor": 36
			}],
			40: [function(e, t, r) {
				"use strict";

				function o(e) {
					"undefined" != typeof e && 16 == e.length ? this.copy(e) : (this.transformMatrix = new Array(16), this.setIdentity())
				}
				var a = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
				o.prototype.setIdentity = function() {
					this.copy(a)
				}, o.prototype.copy = function(e) {
					this.transformMatrix = e.slice()
				}, o.prototype.makeCopy = function() {
					var e = new o(this.transformMatrix);
					return e
				}, o.prototype.postTransformPoint = function(e) {
					var t = this.transformMatrix,
						r = e[0],
						o = e[1],
						a = 0,
						i = 1;
					e[0] = t[0] * r + t[1] * o + t[2] * a + t[3] * i, e[1] = t[4] * r + t[5] * o + t[6] * a + t[7] * i
				}, o.prototype.postTranslateVec = function(e) {
					var t = new o([1, 0, 0, e.x, 0, 1, 0, e.y, 0, 0, 1, e.z, 0, 0, 0, e.w]);
					n(this, t)
				}, o.prototype.preTranslateVec = function(e) {
					var t = new o([1, 0, 0, e.x, 0, 1, 0, e.y, 0, 0, 1, e.z, 0, 0, 0, e.w]);
					s(this, t)
				}, o.prototype.postTranslate = function(e, t) {
					var r = new o([1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, 0, 0, 0, 0, 1]);
					n(this, r)
				}, o.prototype.preTranslate = function(e, t) {
					var r = new o([1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, 0, 0, 0, 0, 1]);
					s(this, r)
				}, o.prototype.postRotateX = function(e) {
					var t = new o([1, 0, 0, 0, 0, Math.cos(e), -Math.sin(e), 0, 0, Math.sin(e), Math.cos(e), 0, 0, 0, 0, 1]);
					n(this, t)
				}, o.prototype.postRotateY = function(e) {
					var t = new o([Math.cos(e), 0, Math.sin(e), 0, 0, 1, 0, 0, -Math.sin(e), 0, Math.cos(e), 0, 0, 0, 0, 1]);
					n(this, t)
				}, o.prototype.postRotateZ = function(e) {
					var t = new o([Math.cos(e), -Math.sin(e), 0, 0, Math.sin(e), Math.cos(e), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
					n(this, t)
				}, o.prototype.preRotateX = function(e) {
					var t = new o([1, 0, 0, 0, 0, Math.cos(e), -Math.sin(e), 0, 0, Math.sin(e), Math.cos(e), 0, 0, 0, 0, 1]);
					s(this, t)
				}, o.prototype.preRotateY = function(e) {
					var t = new o([Math.cos(e), 0, Math.sin(e), 0, 0, 1, 0, 0, -Math.sin(e), 0, Math.cos(e), 0, 0, 0, 0, 1]);
					s(this, t)
				}, o.prototype.preRotateZ = function(e) {
					var t = new o([Math.cos(e), -Math.sin(e), 0, 0, Math.sin(e), Math.cos(e), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
					s(this, t)
				}, o.prototype.postShearX = function(e, t) {
					var r = new o([1, 0, 0, 0, e, 1, 0, 0, t, 0, 1, 0, 0, 0, 0, 1]);
					n(this, r)
				}, o.prototype.postShearY = function(e, t) {
					var r = new o([1, e, 0, 0, 0, 1, 0, 0, 0, t, 1, 0, 0, 0, 0, 1]);
					n(this, r)
				}, o.prototype.postShearZ = function(e, t) {
					var r = new o([1, 0, e, 0, 0, 1, t, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
					n(this, r)
				}, o.prototype.preShearX = function(e, t) {
					var r = new o([1, 0, 0, 0, e, 1, 0, 0, t, 0, 1, 0, 0, 0, 0, 1]);
					s(this, r)
				}, o.prototype.preShearY = function(e, t) {
					var r = new o([1, e, 0, 0, 0, 1, 0, 0, 0, t, 1, 0, 0, 0, 0, 1]);
					s(this, r)
				}, o.prototype.preShearZ = function(e, t) {
					var r = new o([1, 0, e, 0, 0, 1, t, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
					s(this, r)
				}, o.prototype.postScaleXY = function(e, t) {
					var r = {
						x: e,
						y: t,
						z: 1,
						w: 1
					};
					l(this, r)
				}, o.prototype.postScale = function(e) {
					this.postScaleXY(e, e)
				}, o.prototype.preScaleXY = function(e, t) {
					var r = {
						x: e,
						y: t,
						z: 1,
						w: 1
					};
					u(this, r)
				}, o.prototype.preScale = function(e) {
					this.preScaleXY(e, e)
				}, o.prototype.getLengthX = function() {
					var e = {
						x: 1,
						y: 0,
						z: 0,
						w: 0
					};
					this.rightMultiplyVector(e);
					var t = Math.sqrt(e.x * e.x + e.y * e.y);
					return t
				}, o.prototype.getLengthY = function() {
					var e = {
						x: 0,
						y: 1,
						z: 0,
						w: 0
					};
					this.rightMultiplyVector(e);
					var t = Math.sqrt(e.x * e.x + e.y * e.y);
					return t
				}, o.prototype.rightMultiplyVector = function(e) {
					var t = this.transformMatrix,
						r = e.x,
						o = e.y,
						a = e.z,
						i = e.w;
					e.x = t[0] * r + t[1] * o + t[2] * a + t[3] * i, e.y = t[4] * r + t[5] * o + t[6] * a + t[7] * i, e.z = t[8] * r + t[9] * o + t[10] * a + t[11] * i, e.w = t[12] * r + t[13] * o + t[14] * a + t[15] * i
				}, o.prototype.leftMultiplyVector = function(e) {
					var t = this.transformMatrix,
						r = e.x,
						o = e.y,
						a = e.z,
						i = e.w;
					e.x = t[0] * r + t[4] * o + t[8] * a + t[12] * i, e.y = t[1] * r + t[5] * o + t[9] * a + t[13] * i, e.z = t[2] * r + t[6] * o + t[10] * a + t[14] * i, e.w = t[3] * r + t[7] * o + t[11] * a + t[15] * i
				}, o.prototype.invert = function() {
					var e, t = this.transformMatrix,
						r = [];
					if (r[0] = t[5] * t[10] * t[15] - t[5] * t[11] * t[14] - t[9] * t[6] * t[15] + t[9] * t[7] * t[14] + t[13] * t[6] * t[11] - t[13] * t[7] * t[10], r[4] = -t[4] * t[10] * t[15] + t[4] * t[11] * t[14] + t[8] * t[6] * t[15] - t[8] * t[7] * t[14] - t[12] * t[6] * t[11] + t[12] * t[7] * t[10], r[8] = t[4] * t[9] * t[15] - t[4] * t[11] * t[13] - t[8] * t[5] * t[15] + t[8] * t[7] * t[13] + t[12] * t[5] * t[11] - t[12] * t[7] * t[9], r[12] = -t[4] * t[9] * t[14] + t[4] * t[10] * t[13] + t[8] * t[5] * t[14] - t[8] * t[6] * t[13] - t[12] * t[5] * t[10] + t[12] * t[6] * t[9], r[1] = -t[1] * t[10] * t[15] + t[1] * t[11] * t[14] + t[9] * t[2] * t[15] - t[9] * t[3] * t[14] - t[13] * t[2] * t[11] + t[13] * t[3] * t[10], r[5] = t[0] * t[10] * t[15] - t[0] * t[11] * t[14] - t[8] * t[2] * t[15] + t[8] * t[3] * t[14] + t[12] * t[2] * t[11] - t[12] * t[3] * t[10], r[9] = -t[0] * t[9] * t[15] + t[0] * t[11] * t[13] + t[8] * t[1] * t[15] - t[8] * t[3] * t[13] - t[12] * t[1] * t[11] + t[12] * t[3] * t[9], r[13] = t[0] * t[9] * t[14] - t[0] * t[10] * t[13] - t[8] * t[1] * t[14] + t[8] * t[2] * t[13] + t[12] * t[1] * t[10] - t[12] * t[2] * t[9], r[2] = t[1] * t[6] * t[15] - t[1] * t[7] * t[14] - t[5] * t[2] * t[15] + t[5] * t[3] * t[14] + t[13] * t[2] * t[7] - t[13] * t[3] * t[6], r[6] = -t[0] * t[6] * t[15] + t[0] * t[7] * t[14] + t[4] * t[2] * t[15] - t[4] * t[3] * t[14] - t[12] * t[2] * t[7] + t[12] * t[3] * t[6], r[10] = t[0] * t[5] * t[15] - t[0] * t[7] * t[13] - t[4] * t[1] * t[15] + t[4] * t[3] * t[13] + t[12] * t[1] * t[7] - t[12] * t[3] * t[5], r[14] = -t[0] * t[5] * t[14] + t[0] * t[6] * t[13] + t[4] * t[1] * t[14] - t[4] * t[2] * t[13] - t[12] * t[1] * t[6] + t[12] * t[2] * t[5], r[3] = -t[1] * t[6] * t[11] + t[1] * t[7] * t[10] + t[5] * t[2] * t[11] - t[5] * t[3] * t[10] - t[9] * t[2] * t[7] + t[9] * t[3] * t[6], r[7] = t[0] * t[6] * t[11] - t[0] * t[7] * t[10] - t[4] * t[2] * t[11] + t[4] * t[3] * t[10] + t[8] * t[2] * t[7] - t[8] * t[3] * t[6], r[11] = -t[0] * t[5] * t[11] + t[0] * t[7] * t[9] + t[4] * t[1] * t[11] - t[4] * t[3] * t[9] - t[8] * t[1] * t[7] + t[8] * t[3] * t[5], r[15] = t[0] * t[5] * t[10] - t[0] * t[6] * t[9] - t[4] * t[1] * t[10] + t[4] * t[2] * t[9] + t[8] * t[1] * t[6] - t[8] * t[2] * t[5], e = t[0] * r[0] + t[1] * r[4] + t[2] * r[8] + t[3] * r[12], 0 == e) return !1;
					e = 1 / e;
					for (var o = 0; 16 > o; o++) t[o] = r[o] * e;
					return !0
				}, o.prototype.print = function() {
					this.transformMatrix.slice(0, 4), this.transformMatrix.slice(4, 8), this.transformMatrix.slice(8, 12), this.transformMatrix.slice(12, 16)
				};
				var i = function(e, t, r) {
						var o = e.transformMatrix,
							a = t.transformMatrix,
							i = r.transformMatrix;
						o[0] = a[0] * i[0] + a[1] * i[4] + a[2] * i[8] + a[3] * i[12], o[1] = a[0] * i[1] + a[1] * i[5] + a[2] * i[9] + a[3] * i[13], o[2] = a[0] * i[2] + a[1] * i[6] + a[2] * i[10] + a[3] * i[14], o[3] = a[0] * i[3] + a[1] * i[7] + a[2] * i[11] + a[3] * i[15], o[4] = a[4] * i[0] + a[5] * i[4] + a[6] * i[8] + a[7] * i[12], o[5] = a[4] * i[1] + a[5] * i[5] + a[6] * i[9] + a[7] * i[13], o[6] = a[4] * i[2] + a[5] * i[6] + a[6] * i[10] + a[7] * i[14], o[7] = a[4] * i[3] + a[5] * i[7] + a[6] * i[11] + a[7] * i[15], o[8] = a[8] * i[0] + a[9] * i[4] + a[10] * i[8] + a[11] * i[12], o[9] = a[8] * i[1] + a[9] * i[5] + a[10] * i[9] + a[11] * i[13], o[10] = a[8] * i[2] + a[9] * i[6] + a[10] * i[10] + a[11] * i[14], o[11] = a[8] * i[3] + a[9] * i[7] + a[10] * i[11] + a[11] * i[15], o[12] = a[12] * i[0] + a[13] * i[4] + a[14] * i[8] + a[15] * i[12], o[13] = a[12] * i[1] + a[13] * i[5] + a[14] * i[9] + a[15] * i[13], o[14] = a[12] * i[2] + a[13] * i[6] + a[14] * i[10] + a[15] * i[14], o[15] = a[12] * i[3] + a[13] * i[7] + a[14] * i[11] + a[15] * i[15]
					},
					n = function(e, t) {
						var r = new o;
						r.copy(e.transformMatrix), i(e, r, t)
					},
					s = function(e, t) {
						var r = new o;
						r.copy(e.transformMatrix), i(e, t, r)
					},
					l = function(e, t) {
						var r = new o([t.x, 0, 0, 0, 0, t.y, 0, 0, 0, 0, t.z, 0, 0, 0, 0, t.w]);
						n(e, r)
					},
					u = function(e, t) {
						var r = new o([t.x, 0, 0, 0, 0, t.y, 0, 0, 0, 0, t.z, 0, 0, 0, 0, t.w]);
						s(e, r)
					};
				t.exports = o
			}, {}],
			41: [function(e, t, r) {
				var o = e("./../../../version.json");
				t.exports = {
					getVersion: function() {
						return [o.major, o.minor, o.patch].join(".")
					}
				}
			}, {
				"./../../../version.json": 102
			}],
			42: [function(e, t, r) {
				"use strict";

				function o(e) {
					this.state = "number" == typeof e && e >= 0 ? e : Math.floor(4294967295 * Math.random()), this.seed = this.state
				}
				var a = {};
				o.prototype.nextInt = function() {
					return this.state = (69069 * this.state + 1) % 4294967296, this.state
				}, o.prototype.nextIntN = function(e) {
					for (; e > 0;) this.state = (69069 * this.state + 1) % 4294967296, e--;
					return this.state
				}, o.prototype.nextFloat = function() {
					return this.state = (69069 * this.state + 1) % 4294967296, this.state / 4294967296
				}, o.prototype.getState = function() {
					return this.state
				}, o.prototype.getSeed = function() {
					return this.seed
				}, o.prototype.nextFloatNormal = function() {
					for (var e = this.nextFloat(), t = this.nextFloat(); 0 === e;) e = this.nextFloat();
					for (; 0 === t;) t = this.nextFloat();
					return Math.sqrt(-2 * Math.log(e)) * Math.cos(2 * Math.PI * t)
				}, o.prototype.nextFloatLaplace = function() {
					var e = .5 - this.nextFloat();
					return 0 > e ? Math.log(1 + 2 * e) : -Math.log(1 - 2 * e)
				}, a.RNG = o, t.exports = a
			}, {}],
			43: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../core/MoaAllocAndCopy"),
					i = e("../processors/MoaSharpen"),
					n = e("./MoaRegionInfo"),
					s = 70;
				o.renderBlemishPoint = function(e, t) {
					var r = e.width,
						o = e.height,
						l = e.data,
						u = t.center,
						h = t.radius,
						d = t.offset,
						c = t.skinColor,
						f = h * r,
						m = [u[0] * r, u[1] * o],
						p = !1;
					if (("undefined" == typeof d || "undefined" == typeof c) && (p = !0), 2 * f > r || 2 * f > o) return !0;
					var g, v, _ = 1;
					p ? (g = n.findClosestPatch(e, m, f * _), t.offset = [], t.offset[0] = g[0] / r, t.offset[1] = g[1] / o, v = n.findAvgSkinColor(e, m, f, v), t.skinColor = v) : (g = [d[0] * r, d[1] * o], g[0] = 0 | g[0], g[1] = 0 | g[1], v = c);
					var x = Math.min(r - 1, Math.max(0, m[0] - f + .5 | 0)),
						M = Math.min(o - 1, Math.max(0, m[1] - f + .5 | 0)),
						y = Math.min(r - 1, Math.max(0, m[0] + f + .5 | 0)),
						b = Math.min(o - 1, Math.max(0, m[1] + f + .5 | 0)),
						C = m[0] + g[0] - f + .5 | 0,
						T = m[1] + g[1] - f + .5 | 0,
						A = m[0] + g[0] + f + .5 | 0,
						S = m[1] + g[1] + f + .5 | 0;
					if (0 > C || 0 > T || A > r - 1 || S > o - 1) return !0;
					var w = y - x + 1,
						P = b - M + 1,
						F = A - C + 1,
						E = S - T + 1,
						D = a.makeBitmap(w, P),
						L = a.makeBitmap(F, E),
						R = a.makeBitmap(F, E),
						B = D.data,
						O = L.data,
						I = R.data;
					a.copyBitmapSubsection(D, e, x, M, y, b), a.copyBitmapSubsection(L, e, C, T, A, S), a.copyBitmapSubsection(R, e, C, T, A, S), i.sharpen(D, -s * (r + o) / (w + P)), i.sharpen(R, -s * (r + o) / (F + E));
					for (var N, G, U, V, k, j, W, H, X, z, Y, q, K, Z, $, Q, J, ee, te, re, oe, ae, ie, ne, se, le = 0 | m[0], ue = 0 | m[1], he = .25 * F * E, de = M; b >= de; de++)
						for (var ce = x; y >= ce; ce++)
							if (k = ce - le, j = de - ue, V = k * k + j * j, he > V) {
								W = ce + g[0], H = de + g[1], W = 0 > W ? 0 : W > r - 1 ? r - 1 : W, H = 0 > H ? 0 : H > o - 1 ? o - 1 : H, X = W - C, z = H - T, X = 0 > X ? 0 : X > F - 1 ? F - 1 : X, z = 0 > z ? 0 : z > E - 1 ? E - 1 : z, N = 4 * (de * r + ce), G = 4 * ((de - M) * w + ce - x), U = 4 * (z * F + X), Z = l[N], $ = l[N + 1], Q = l[N + 2], J = B[G], ee = B[G + 1], te = B[G + 2], re = O[U], oe = O[U + 1], ae = O[U + 2], ie = I[U], ne = I[U + 1], se = I[U + 2];
								var fe = 1.15651764275 * Math.exp(-2 * V / he) - .13533528323;
								fe = 0 > fe ? 0 : fe > 1 ? 1 : fe;
								var me = 1.01865736036 * Math.exp(-4 * V / he) - .01831563888;
								me = 0 > me ? 0 : me > 1 ? 1 : me;
								var pe = 1.25 * (.1 * (re - ie) + .7 * (oe - ne) + .2 * (ae - se)) | 0;
								Y = me * v.r + (1 - me) * J + pe, q = me * v.g + (1 - me) * ee + pe, K = me * v.b + (1 - me) * te + pe;
								var ge = 1 - fe;
								Z = fe * Y + ge * Z | 0, $ = fe * q + ge * $ | 0, Q = fe * K + ge * Q | 0, l[N] = 0 > Z ? 0 : Z > 255 ? 255 : Z, l[N + 1] = 0 > $ ? 0 : $ > 255 ? 255 : $, l[N + 2] = 0 > Q ? 0 : Q > 255 ? 255 : Q
							}
					return D.data = null, L.data = null, R.data = null, !0
				}, t.exports = o
			}, {
				"../core/MoaAllocAndCopy": 34,
				"../processors/MoaSharpen": 96,
				"./MoaRegionInfo": 59
			}],
			44: [function(e, t, r) {
				"use strict";

				function o(e) {
					this.dstBitmap = e, e.moaGL && (this.moaGL = e.moaGL, this.processedTexture = this.moaGL.createTexture(e.width, e.height), this.moaGL.copyLastRender(this.processedTexture)), this.processedPts = [], this.unprocessedPts = []
				}
				var a = e("./MoaBlemish"),
					i = e("../actionlist/MoaliteActionlistGenerator");
				o.prototype.addPoint = function(e, t) {
					this.addPointWithOffsetAndColor(e, t)
				}, o.prototype.addPointWithOffsetAndColor = function(e, t, r, o) {
					var a = {
						center: e,
						radius: t,
						offset: r,
						skinColor: o
					};
					this.unprocessedPts = this.unprocessedPts.concat(a)
				}, o.prototype.renderPreview = function() {
					for (var e = this.unprocessedPts.length, t = 0; e > t; t++) {
						var r = this.unprocessedPts[t];
						this.moaGL ? this.moaGL.renderBlemishPoint(this.dstBitmap, r, this.processedTexture) : a.renderBlemishPoint(this.dstBitmap, r)
					}
					return this.processedPts = this.processedPts.concat(this.unprocessedPts), this.unprocessedPts = [], !0
				}, o.prototype.getActionlistObject = function() {
					for (var e = this.processedPts.length, t = [], r = 0; e > r; r++) {
						var o = this.processedPts[r],
							a = {
								r: o.skinColor.r,
								g: o.skinColor.g,
								b: o.skinColor.b,
								a: o.skinColor.a
							},
							n = {
								point: o.center.slice(),
								radius: o.radius,
								offset: o.offset.slice(),
								color: a
							};
						t = t.concat(n)
					}
					return i.MLPLActionBlemish(t)
				}, t.exports = o
			}, {
				"../actionlist/MoaliteActionlistGenerator": 21,
				"./MoaBlemish": 43
			}],
			45: [function(e, t, r) {
				"use strict"; {
					var o = {},
						a = e("../processors/MoaSharpen");
					e("../core/MoaAllocAndCopy")
				}
				o.renderEffect = function(e) {
					a.sharpen(e, -100, 1, "normal"), e.moaGL && (e.textureID = e.moaGL.glRenderingObjects.readTexture)
				}, t.exports = o
			}, {
				"../core/MoaAllocAndCopy": 34,
				"../processors/MoaSharpen": 96
			}],
			46: [function(e, t, r) {
				"use strict";

				function o(e) {
					this.radius = e, this.pointList = [], this.pointCount = 0, this.lastProcessedPoint = 0
				}
				o.prototype.markAllPointsAsProcessed = function() {
					this.pointCount > 0 && (this.lastProcessedPoint = this.pointCount - 1)
				}, o.prototype.addPoints = function(e) {
					this.pointList = this.pointList.concat(e), this.pointCount += e.length
				}, o.prototype.getUnprocessedPoints = function() {
					return this.pointList.slice(this.lastProcessedPoint)
				}, o.prototype.getFirstPoint = function() {
					return this.pointList[0]
				}, o.prototype.getPointCount = function() {
					return this.pointCount
				}, o.prototype.getRadius = function() {
					return this.radius
				}, t.exports = o
			}, {}],
			47: [function(e, t, r) {
				"use strict"; {
					var o = {},
						a = e("../processors/MoaColorMatrixTransform");
					e("../core/MoaAllocAndCopy")
				}
				o.renderEffect = function(e) {
					var t = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0];
					a.adjSaturation(t, 0), a.colorMatrixTransform(e, t), e.moaGL && (e.textureID = e.moaGL.glRenderingObjects.readTexture)
				}, t.exports = o
			}, {
				"../core/MoaAllocAndCopy": 34,
				"../processors/MoaColorMatrixTransform": 76
			}],
			48: [function(e, t, r) {
				"use strict";

				function o(e, t, r, o, i) {
					this.radius = e, this.pointList = [], this.pointCount = 0, this.lastUnprocessedPoint = 0, this.strokeColor = new a, this._convertColorToPremultipliedAndSet(t), this.brushMode = r, this.zoomFactor = o, this.filterer = i
				}
				var a = e("../core/MoaColor"),
					i = e("./MoaDrawBrushStroke"),
					n = e("./MoaToolDataTypes"),
					s = n.MoaDrawBrushPoint;
				o.prototype = new i, o.prototype.addPoints = function(e) {
					for (var t = 0; t < e.length; t++) {
						var r = e[t],
							o = new s(r[0], r[1], r[2], this.radius),
							a = this.filterer.addPointToStrokeAndFilter(this.pointList, o, this.zoomFactor);
						a && this.pointCount++
					}
				}, o.prototype.endStroke = function(e) {
					this.filterer.endFilteredStroke(this.pointList, e), this.pointCount++
				}, o.prototype._convertColorToPremultipliedAndSet = function(e) {
					this.strokeColor.r = (e.r * e.a | 0) / 255 | 0, this.strokeColor.g = (e.g * e.a | 0) / 255 | 0, this.strokeColor.b = (e.b * e.a | 0) / 255 | 0, this.strokeColor.a = e.a
				}, t.exports = o
			}, {
				"../core/MoaColor": 36,
				"./MoaDrawBrushStroke": 51,
				"./MoaToolDataTypes": 64
			}],
			49: [function(e, t, r) {
				"use strict";
				var o = {};
				o.calcLineEdges = function(e, t, r, o, a) {
					e.x = r.x + o * Math.cos(a), e.y = r.y + o * Math.sin(a), t.x = r.x - o * Math.cos(a), t.y = r.y - o * Math.sin(a)
				}, o.calcLineAntiAliasEdge = function(e, t, r, o) {
					e.x = t.x + r * Math.cos(o), e.y = t.y + r * Math.sin(o)
				}, o.calcMidpoint = function(e, t, r) {
					r.x = .5 * (e.x + t.x), r.y = .5 * (e.y + t.y), r.radius = .5 * (e.radius + t.radius)
				}, o.calcDistance = function(e, t) {
					var r = t.x - e.x,
						o = t.y - e.y;
					return Math.sqrt(r * r + o * o)
				}, o.calcAngleTwoPoints = function(e, t) {
					return Math.atan2(t.y - e.y, t.x - e.x)
				}, t.exports = o
			}, {}],
			50: [function(e, t, r) {
				"use strict";

				function o(e, t) {
					this.width = e.width, this.height = e.height, "undefined" != typeof e.moaGL ? this.moaGL = e.moaGL : "undefined" != typeof t.moaGL && (this.moaGL = t.moaGL), this.processedStrokes = [], this.unprocessedStrokes = [], this.currentStroke = null, this.processedFilteredStrokes = [], this.unprocessedFilteredStrokes = [], this.currentFilteredStroke = null, this.filterer = new l(e), this.originalBitmap = e, this.previewBitmap = t, this.mask = new u(e), this.mask.initTransparent(), this.brushManager = new s(this.mask), this.moaGL && (this.copyOfSrcTexture = this.moaGL.createTexture(this.width, this.height), this.moaGL.copyLastRender(this.copyOfSrcTexture)), this._resetBoundingBox()
				}
				var a = e("./MoaDrawBrushStroke"),
					i = e("./MoaDrawBrushFilteredStroke"),
					n = e("../actionlist/MoaliteActionlistGenerator"),
					s = e("./MoaDrawNormalBrushManager"),
					l = e("./MoaDrawNormalBrushFilterer"),
					u = e("./MoaOverlayMask"),
					h = e("../core/MoaColor");
				o.prototype.destroy = function() {
					this.mask.destroy(), this.moaGL && (this.moaGL.destroyTexture(this.copyOfSrcTexture), this.moaGL = null), this.processedFilteredStrokes = null, this.unprocessedFilteredStrokes = null, this.currentFilteredStroke = null
				}, o.prototype.startNewStroke = function(e, t, r, o) {
					if (null !== this.currentStroke || null !== this.currentFilteredStroke) return !1;
					var n;
					return n = "erase" == r ? new h(0, 0, 0, 255) : new h(t.r, t.g, t.b, t.a), this.currentStroke = new a(e, n, r, o), this.currentFilteredStroke = new i(e * this.width, n, r, o, this.filterer), !0
				}, o.prototype.addPointsToCurrentStroke = function(e) {
					if (null === this.currentStroke || null === this.currentFilteredStroke) return !1;
					this.currentStroke.addPoints(e);
					for (var t = [], r = 0; r < e.length; r++) {
						var o = e[r].slice();
						o[0] *= this.width, o[1] *= this.height, t[r] = o
					}
					return this.currentFilteredStroke.addPoints(t), !0
				}, o.prototype.endCurrentStroke = function() {
					if (null === this.currentStroke || null === this.currentFilteredStroke) return !1;
					var e = this.currentStroke.getLastPoint(),
						t = e.copy();
					t.scale(this.width, this.height, this.width), this.currentFilteredStroke.endStroke(t), this.unprocessedStrokes = this.unprocessedStrokes.concat(this.currentStroke), this.unprocessedFilteredStrokes = this.unprocessedFilteredStrokes.concat(this.currentFilteredStroke), this.currentStroke = null, this.currentFilteredStroke = null
				}, o.prototype.renderPreview = function(e) {
					return "boolean" != typeof e && (e = !1), this._resetBoundingBox(), this._renderUnprocessedStrokes(), this._compositeImages(e), !0
				}, o.prototype.getActionlistObject = function() {
					for (var e = [], t = 0; t < this.processedStrokes.length; t++) e.push(this.processedStrokes[t].getActionlistObject());
					return n.MLPLActionBrush("draw", e)
				}, o.prototype._renderUnprocessedStrokes = function() {
					for (var e = 0; e < this.unprocessedFilteredStrokes.length; e++) this.brushManager.renderStroke(this.unprocessedFilteredStrokes[e], this.boundingBox, !0), this.processedFilteredStrokes = this.processedFilteredStrokes.concat(this.unprocessedFilteredStrokes[e]), this.processedStrokes = this.processedStrokes.concat(this.unprocessedStrokes[e]);
					this.unprocessedFilteredStrokes = [], this.unprocessedStrokes = [], null !== this.currentFilteredStroke && (this.brushManager.renderStroke(this.currentFilteredStroke, this.boundingBox, !1), this.currentFilteredStroke.markAllPointsAsProcessed(), this.currentStroke.markAllPointsAsProcessed())
				}, o.prototype._resetBoundingBox = function() {
					this.boundingBox = [1, 1, 0, 0]
				}, o.prototype._updateBoundingBox = function(e, t) {
					e < this.boundingBox[0] && (this.boundingBox[0] = e), e > this.boundingBox[2] && (this.boundingBox[2] = e), t < this.boundingBox[1] && (this.boundingBox[1] = t), t > this.boundingBox[3] && (this.boundingBox[3] = t)
				}, o.prototype._compositeImages = function(e) {
					if (this.moaGL) return this.moaGL.glRenderingObjects.readTexture == this.moaGL.glImageData.sourceTexture && this.moaGL.renderIdentity(), void this.moaGL.drawMaskOverOriginalImagePreMultipliedAlpha(this.mask.getTexture(), this.copyOfSrcTexture);
					var t, r, o, a, i = this.width,
						n = this.height;
					e ? (t = this.boundingBox[0] * (i - 1), r = this.boundingBox[1] * (n - 1), o = this.boundingBox[2] * (i - 1), a = this.boundingBox[3] * (n - 1)) : (t = 0, r = 0, o = i - 1, a = n - 1), t = 0 > t ? 0 : t > i - 1 ? i - 1 : Math.round(t), r = 0 > r ? 0 : r > n - 1 ? n - 1 : Math.round(r), o = 0 > o ? 0 : o > i - 1 ? i - 1 : Math.round(o), a = 0 > a ? 0 : a > n - 1 ? n - 1 : Math.round(a);
					for (var s, l, u = this.previewBitmap.data, h = this.originalBitmap.data, d = this.mask.data, c = r; a >= c; c++)
						for (var f = t; o >= f; f++) s = 4 * (c * i + f), l = d[s + 3] / 255, u[s] = d[s] + (1 - l) * h[s], u[s + 1] = d[s + 1] + (1 - l) * h[s + 1], u[s + 2] = d[s + 2] + (1 - l) * h[s + 2]
				}, t.exports = o
			}, {
				"../actionlist/MoaliteActionlistGenerator": 21,
				"../core/MoaColor": 36,
				"./MoaDrawBrushFilteredStroke": 48,
				"./MoaDrawBrushStroke": 51,
				"./MoaDrawNormalBrushFilterer": 52,
				"./MoaDrawNormalBrushManager": 53,
				"./MoaOverlayMask": 57
			}],
			51: [function(e, t, r) {
				"use strict";

				function o(e, t, r, o) {
					this.radius = e, this.pointList = [], this.pointCount = 0, this.lastProcessedPoint = 0, this.strokeColor = t, this.brushMode = r, this.zoomFactor = o
				}
				var a = e("./MoaBrushStroke"),
					i = e("./MoaToolDataTypes"),
					n = i.MoaDrawBrushPoint;
				o.prototype = new a, o.prototype.brushModes = {
					MoaBrushModeFree: "free",
					MoaBrushModeSmart: "smart",
					MoaBrushModeErase: "erase"
				}, o.prototype.addPoints = function(e) {
					for (var t = 0; t < e.length; t++) {
						var r = e[t];
						this.pointList[this.pointCount] = new n(r[0], r[1], r[2], this.radius), this.pointCount++
					}
				}, o.prototype.getPointList = function() {
					return this.pointList
				}, o.prototype.getStartIndex = function() {
					return this.lastProcessedPoint + 1
				}, o.prototype.getLastPoint = function() {
					return this.pointList[this.pointCount - 1]
				}, o.prototype.isEraseStroke = function() {
					return this.brushMode === this.brushModes.MoaBrushModeErase
				}, o.prototype.getActionlistObject = function() {
					for (var e = [], t = 0; t < this.pointList.length; t++) e.push(this.pointList[t].getActionlistObject());
					var r = {
						radius: this.radius,
						brushMode: this.brushMode,
						points: e,
						color: this.strokeColor,
						zoomFactor: this.zoomFactor
					};
					return r
				}, t.exports = o
			}, {
				"./MoaBrushStroke": 46,
				"./MoaToolDataTypes": 64
			}],
			52: [function(e, t, r) {
				"use strict";

				function o(e) {
					this.width = e.width, this.height = e.height, this.avgDim = .5 * (this.width + this.height), this.kLocationWeight = .675, this.kRadiusWeight = .45, this.kSamplingPeriod = 20, this.kMinDist = 10 * this.avgDim / 1e3, this.maxRadiusCoeff = 1.2, this.minRadiusCoeff = .75, this.rBaseCoeff = 0, this.rRateChange = .35
				}
				var a = e("./MoaDrawBrushGeometry"),
					i = e("./MoaToolDataTypes"),
					n = i.MoaDrawBrushPoint;
				o.prototype.addPointToStrokeAndFilter = function(e, t, r) {
					var o = e.length;
					if (o > 0) {
						var i = t.t - e[o - 1].t,
							n = r * a.calcDistance(t, e[o - 1]);
						if (!(i >= this.kSamplingPeriod && n > this.kMinDist)) return !1;
						e.push(t.copy()), this._filterPointLocations(e), this._findPointRadius(e, r)
					} else e[o] = t.copy();
					return !0
				}, o.prototype.endFilteredStroke = function(e, t) {
					var r = t.copy(),
						o = e.length;
					r.radius = e[o - 1].radius, e.push(r)
				}, o.prototype._filterPointLocations = function(e) {
					var t = e.length,
						r = e[t - 1],
						o = this._calcLastPointForSamplingPeriod(e, r.t);
					r.x = (1 - this.kLocationWeight) * r.x + this.kLocationWeight * o.x, r.y = (1 - this.kLocationWeight) * r.y + this.kLocationWeight * o.y
				}, o.prototype._findPointRadius = function(e, t) {
					var r = e.length,
						o = e[r - 1],
						i = this._calcLastPointForSamplingPeriod(e, o.t),
						n = a.calcDistance(i, o),
						s = 1e3 * t * n / this.avgDim,
						l = o.t - i.t,
						u = s / (l + 1e-7),
						h = this._calcVelocityRadiusCoeff(u);
					o.radius = o.radius * h, 2 == r ? e[0].radius = o.radius : 3 == r ? (e[0].radius = o.radius, e[1].radius = o.radius) : r > 3 && (o.radius = (1 - this.kRadiusWeight) * o.radius + this.kRadiusWeight * i.radius)
				}, o.prototype._calcVelocityRadiusCoeff = function(e) {
					var t = this.rBaseCoeff + this.rRateChange * e;
					return t = t > this.maxRadiusCoeff ? this.maxRadiusCoeff : t, t = t < this.minRadiusCoeff ? this.minRadiusCoeff : t
				}, o.prototype._calcLastPointForSamplingPeriod = function(e, t) {
					for (var r, o, a = e.length - 1; a > 0; a--) {
						var o = e[a],
							r = e[a - 1],
							i = t - o.t,
							s = t - r.t;
						if (i < this.kSamplingPeriod && s > this.kSamplingPeriod) {
							var l = (s - this.kSamplingPeriod) / (s - i),
								u = (1 - l) * r.radius + l * o.radius,
								h = (1 - l) * r.x + l * o.x,
								d = (1 - l) * r.y + l * o.y,
								c = t - this.kSamplingPeriod,
								f = new n(h, d, c, u);
							return f
						}
					}
					var f = r.copy();
					return f.t = t - this.kSamplingPeriod, f
				}, t.exports = o
			}, {
				"./MoaDrawBrushGeometry": 49,
				"./MoaToolDataTypes": 64
			}],
			53: [function(e, t, r) {
				"use strict";

				function o(e) {
					this.mask = e, "undefined" != typeof e.moaGL && (this.moaGL = e.moaGL), this.antiAliasing = !0, this.renderer = new i(e, this.antiAliasing)
				}
				var a = e("./MoaDrawBrushGeometry"),
					i = e("./MoaDrawNormalBrushRenderer");
				o.prototype.renderStroke = function(e, t, r) {
					var o = e.getPointList(),
						a = o.length,
						i = e.getStartIndex(),
						n = !1,
						s = e.isEraseStroke();
					this.moaGL && this.moaGL.drawToolStartEffect(this.mask, s);
					for (var l = i; a > l; l++) 2 == l ? (this._updateMinMaxPointsForStrokeStartEnd(o[0], o[1], t), this._updateMinMaxPointsForStrokeMid(o[0], o[1], o[2], t), this._drawStrokeStart(o[0], o[1], e.strokeColor, s), this._drawStrokeMid(o[0], o[1], o[2], e.strokeColor, s), n = !0) : l > 2 && (this._updateMinMaxPointsForStrokeMid(o[l - 2], o[l - 1], o[l], t), this._drawStrokeMid(o[l - 2], o[l - 1], o[l], e.strokeColor, s), n = !0);
					if (r && (1 == a ? (this._updateMinMaxPointsForPoint(o[0], t), this._drawPoint(o[0], e.strokeColor, s)) : 2 == a ? (this._updateMinMaxPointsForStrokeStartEnd(o[0], o[1], t), this._drawStrokeStart(o[0], o[1], e.strokeColor, s), this._drawStrokeEnd(o[0], o[1], e.strokeColor, s)) : a > 2 && (this._updateMinMaxPointsForStrokeStartEnd(o[a - 2], o[a - 1], t), this._drawStrokeEnd(o[a - 2], o[a - 1], e.strokeColor, s)), n = !0), n) {
						var u = 2 * e.radius + 1 / this.mask.width;
						t[0] -= u, t[1] -= u, t[2] += u, t[3] += u, t[0] = Math.min(this.mask.width - 1, Math.max(0, t[0])), t[1] = Math.min(this.mask.height - 1, Math.max(0, t[1])), t[2] = Math.min(this.mask.width - 1, Math.max(0, t[2])), t[3] = Math.min(this.mask.height - 1, Math.max(0, t[3]))
					} else t[0] = 0, t[1] = 0, t[2] = 0, t[3] = 0;
					this.moaGL && this.moaGL.drawToolEndEffect()
				}, o.prototype._drawStrokeStart = function(e, t, r, o) {
					var i = a.calcAngleTwoPoints(e, t),
						n = i + Math.PI / 2,
						s = {};
					a.calcMidpoint(e, t, s), this.renderer.drawSemicircle(e, r, n, o), this.renderer.drawStraightSegment(e, s, r, n, o)
				}, o.prototype._drawStrokeMid = function(e, t, r, o, i) {
					var n = {};
					a.calcMidpoint(e, t, n), this.renderer.drawNormalBrushStrokeSegment(e, t, r, o, i)
				}, o.prototype._drawStrokeEnd = function(e, t, r, o) {
					var i = a.calcAngleTwoPoints(e, t),
						n = i + Math.PI / 2,
						s = {};
					a.calcMidpoint(e, t, s), this.renderer.drawStraightSegment(s, t, r, n, o), this.renderer.drawSemicircle(t, r, n + Math.PI, o)
				}, o.prototype._drawPoint = function(e, t, r) {
					this.renderer.drawSemicircle(e, t, 0, r), this.renderer.drawSemicircle(e, t, Math.PI, r)
				}, o.prototype._updateMinMaxPointsForPoint = function(e, t) {
					this._updateMinMaxPoints(e, t)
				}, o.prototype._updateMinMaxPointsForStrokeStartEnd = function(e, t, r) {
					this._updateMinMaxPoints(e, r), this._updateMinMaxPoints(t, r)
				}, o.prototype._updateMinMaxPointsForStrokeMid = function(e, t, r, o) {
					var i = {},
						n = {};
					a.calcMidpoint(e, t, i), a.calcMidpoint(t, r, n), this._updateMinMaxPoints(i, o), this._updateMinMaxPoints(t, o), this._updateMinMaxPoints(n, o)
				}, o.prototype._updateMinMaxPoints = function(e, t) {
					e.x < t[0] && (t[0] = e.x), e.y < t[1] && (t[1] = e.y), e.x > t[2] && (t[2] = e.x), e.y > t[3] && (t[3] = e.y)
				}, t.exports = o
			}, {
				"./MoaDrawBrushGeometry": 49,
				"./MoaDrawNormalBrushRenderer": 54
			}],
			54: [function(e, t, r) {
				"use strict";

				function o(e, t) {
					this.mask = e, "undefined" != typeof e.moaGL && (this.moaGL = e.moaGL), this.triangleRender = new i(e), this.kAntiAliasingWidth = 1, this.kNumVerticesForSemiCircle = 21, this.antiAliasing = t
				}
				var a = e("../core/MoaColor"),
					i = e("./MoaTriangleRenderer"),
					n = e("./MoaDrawBrushGeometry"),
					s = e("./MoaToolDataTypes"),
					l = s.MoaVertex,
					u = s.MoaDrawBrushPoint,
					h = s.generateMoaVertexArray;
				o.prototype.drawNormalBrushStrokeSegment = function(e, t, r, o, i) {
					var s, d, c, f, m, p, g, v, _, x, M, y, b, C = new u,
						T = new u,
						A = new u,
						S = new a(0, 0, 0, 0);
					n.calcMidpoint(e, t, C), n.calcMidpoint(t, r, T);
					var w = n.calcAngleTwoPoints(C, t),
						P = n.calcAngleTwoPoints(t, T),
						F = P - w;
					if (F = Math.abs(F), F = F > Math.PI ? 2 * Math.PI - F : F, e.x == t.x && e.y == t.y) return void this.drawLine(C, T, o, i);
					if (t.x == r.x && t.y == r.y) return void this.drawLine(C, T, o, i);
					if (F >= .85 * Math.PI) return this.drawStraightSegment(C, t, o, w + .5 * Math.PI, i), this.drawSemicircle(t, o, w - .5 * Math.PI, i), this.drawSemicircle(t, o, P + .5 * Math.PI, i), void this.drawStraightSegment(t, T, o, P + .5 * Math.PI, i);
					x = 2 * (T.x - 2 * t.x + C.x), M = 2 * (T.y - 2 * t.y + C.y), y = Math.max(Math.abs(x), Math.abs(M));
					var E = Math.round(2 * y * F);
					s = 5, d = 25, E = Math.max(s, Math.min(d, E));
					for (var D = h(2 * E), L = a.prototype.generateMoaColorArray(2 * E), R = [], B = [], O = 0; E > O; O++) c = 1 / (E - 1) * O, m = 1 - c, f = c * c, g = m * c, p = m * m, A.x = p * C.x + 2 * g * t.x + f * T.x, A.y = p * C.y + 2 * g * t.y + f * T.y, A.radius = p * C.radius + 2 * g * t.radius + f * T.radius, 0 === O ? (v = t.x - e.x, _ = t.y - e.y) : O >= E - 1 ? (v = r.x - t.x, _ = r.y - t.y) : (v = 2 * m * (t.x - C.x) + 2 * c * (T.x - t.x), _ = 2 * m * (t.y - C.y) + 2 * c * (T.y - t.y)), b = Math.atan2(_, v) + .5 * Math.PI, n.calcLineEdges(D[2 * O], D[2 * O + 1], A, A.radius, b), L[O].copy(o), D[2 * O].color = L[O], D[2 * O + 1].color = L[O], this.antiAliasing && (R[2 * O] = new l, B[2 * O + 1] = new l, R[2 * O].color = S, B[2 * O + 1].color = S, n.calcLineAntiAliasEdge(B[2 * O + 1], D[2 * O], this.kAntiAliasingWidth, b), n.calcLineAntiAliasEdge(R[2 * O], D[2 * O + 1], this.kAntiAliasingWidth, b + Math.PI), R[2 * O + 1] = D[2 * O + 1], B[2 * O] = D[2 * O]);
					this.antiAliasing && (this.triangleRender.drawTriangleStrip(R, i), this.triangleRender.drawTriangleStrip(B, i)), this.triangleRender.drawTriangleStrip(D, i)
				}, o.prototype.drawSemicircle = function(e, t, r, o) {
					var i = h(this.kNumVerticesForSemiCircle),
						n = [],
						s = this.kNumVerticesForSemiCircle - 2,
						u = Math.PI / s,
						d = r,
						c = e.radius + this.kAntiAliasingWidth,
						f = new a(0, 0, 0, 0);
					i[0].x = e.x + 2 * Math.cos(d - .5 * Math.PI), i[0].y = e.y + 2 * Math.sin(d - .5 * Math.PI), i[0].color = t;
					for (var m = 1; m < this.kNumVerticesForSemiCircle; m++) i[m] = new l, i[m].x = e.x + e.radius * Math.cos(d), i[m].y = e.y + e.radius * Math.sin(d), i[m].color = t, this.antiAliasing && (n[2 * m - 2] = i[m], n[2 * m - 1] = new l, n[2 * m - 1].x = e.x + c * Math.cos(d), n[2 * m - 1].y = e.y + c * Math.sin(d), n[2 * m - 1].color = f), d += u;
					this.triangleRender.drawTriangleFan(i, o), this.antiAliasing && this.triangleRender.drawTriangleStrip(n, o)
				}, o.prototype.drawStraightSegment = function(e, t, r, o, i) {
					var s = h(4),
						l = h(4),
						u = h(4);
					if (n.calcLineEdges(s[0], s[1], e, e.radius, o), n.calcLineEdges(s[2], s[3], t, t.radius, o), s[0].color = r, s[1].color = r, s[2].color = r, s[3].color = r, this.antiAliasing) {
						var d = new a(0, 0, 0, 0),
							c = o,
							f = o;
						n.calcLineAntiAliasEdge(l[0], s[0], this.kAntiAliasingWidth, c), n.calcLineAntiAliasEdge(u[1], s[1], this.kAntiAliasingWidth, c + Math.PI), n.calcLineAntiAliasEdge(l[2], s[2], this.kAntiAliasingWidth, f), n.calcLineAntiAliasEdge(u[3], s[3], this.kAntiAliasingWidth, f + Math.PI), l[0].color = d, l[2].color = d, u[1].color = d, u[3].color = d, l[1] = s[0], l[3] = s[2], u[0] = s[1], u[2] = s[3], this.triangleRender.drawTriangleStrip(l, i), this.triangleRender.drawTriangleStrip(u, i)
					}
					this.triangleRender.drawTriangleStrip(s, i)
				}, o.prototype.drawLine = function(e, t, r, o) {
					var a = n.calcAngleTwoPoints(e, t),
						i = a + .5 * Math.PI;
					this.drawSemicircle(e, r, i, o), this.drawStraightSegment(e, t, r, i, o), this.drawSemicircle(t, r, i + Math.PI, o)
				}, t.exports = o
			}, {
				"../core/MoaColor": 36,
				"./MoaDrawBrushGeometry": 49,
				"./MoaToolDataTypes": 64,
				"./MoaTriangleRenderer": 65
			}],
			55: [function(e, t, r) {
				"use strict";

				function o(e, t) {
					this.vertex0 = e, this.vertex1 = t, this.hasInfiniteSlope = e.x == t.x, this.slope = (t.y - e.y) / (t.x - e.x), this.length = e.findDistance(t)
				}
				o.prototype.intersectsYVal = function(e) {
					return e <= this.vertex0.y && e <= this.vertex1.y ? !1 : e > this.vertex0.y && e > this.vertex1.y ? !1 : !0
				}, o.prototype.getXInterceptForYVal = function(e) {
					return this.inf ? this.vertex0.x : this.vertex0.x + (e - this.vertex0.y) / this.slope
				}, o.prototype.getSharedVertex = function(e) {
					return this.vertex0 == e.vertex0 || this.vertex0 == e.vertex1 ? this.vertex0 : this.vertex1 == e.vertex0 || this.vertex1 == e.vertex1 ? this.vertex1 : null
				}, t.exports = o
			}, {}],
			56: [function(e, t, r) {
				var o = {},
					a = .5;
				o.interpolateStrokePoints = function(e, t, r) {
					var o = [];
					if (e.length < 1 || 0 >= t) return o;
					o[0] = e[0];
					for (var a = 1; a < e.length; a++) {
						var u, h, d, c = e.length;
						if (1 == a && r && 2 === c) {
							u = e[0], h = e[1];
							var f = [],
								m = [];
							i(u, h, t, f), l(u, h, t, m), o = o.concat(f).concat(m)
						} else 1 == a ? (u = e[0], h = e[1], i(u, h, t, o)) : r && a == c - 1 && c > 2 ? (u = e[a - 2], h = e[a - 1], d = e[a], s(u, h, d, t, o)) : r && a == c - 1 ? (u = e[a - 2], h = e[a - 1], l(u, h, t, o)) : c > 2 && (u = e[a - 2], h = e[a - 1], d = e[a], n(u, h, d, t, o))
					}
					return o
				};
				var i = function(e, t, r, o) {
						for (var i, n, s, l = [(t[0] + e[0]) / 2, (t[1] + e[1]) / 2], u = Math.sqrt((l[0] - e[0]) * (l[0] - e[0]) + (l[1] - e[1]) * (l[1] - e[1])), h = a * r, d = Math.floor(1 + u / h), c = o.length, f = 1; d > f; f++) i = f / d, n = (1 - i) * e[0] + i * l[0], s = (1 - i) * e[1] + i * l[1], o[c] = [n, s], c++;
						o[c] = [l[0], l[1]]
					},
					n = function(e, t, r, o, i) {
						var n, s, l, u, h = [(t[0] + e[0]) / 2, (t[1] + e[1]) / 2],
							d = [(t[0] + r[0]) / 2, (t[1] + r[1]) / 2],
							c = Math.sqrt((h[0] - t[0]) * (h[0] - t[0]) + (h[1] - t[1]) * (h[1] - t[1])) + Math.sqrt((d[0] - t[0]) * (d[0] - t[0]) + (d[1] - t[1]) * (d[1] - t[1])),
							f = a * o,
							m = Math.floor(1 + c / f),
							p = i.length;
						for (u = 1; m > u; u++) n = u / m, s = (1 - n) * (1 - n) * h[0] + 2 * (1 - n) * n * t[0] + n * n * d[0], l = (1 - n) * (1 - n) * h[1] + 2 * (1 - n) * n * t[1] + n * n * d[1], i[p] = [s, l], p++;
						i[p] = [d[0], d[1]]
					},
					s = function(e, t, r, o, i) {
						var n, s, l, u, h = [(t[0] + e[0]) / 2, (t[1] + e[1]) / 2],
							d = [(t[0] + r[0]) / 2, (t[1] + r[1]) / 2],
							c = Math.sqrt((h[0] - t[0]) * (h[0] - t[0]) + (h[1] - t[1]) * (h[1] - t[1])) + Math.sqrt((d[0] - t[0]) * (d[0] - t[0]) + (d[1] - t[1]) * (d[1] - t[1])),
							f = a * o,
							m = Math.floor(1 + c / f),
							p = Math.sqrt((d[0] - t[0]) * (d[0] - t[0]) + (d[1] - t[1]) * (d[1] - t[1])),
							g = 1 + p / f,
							v = i.length;
						for (u = 1; m > u; u++) n = u / m, s = (1 - n) * (1 - n) * h[0] + 2 * (1 - n) * n * t[0] + n * n * d[0], l = (1 - n) * (1 - n) * h[1] + 2 * (1 - n) * n * t[1] + n * n * d[1], i[v] = [s, l], v++;
						for (i[v++] = [d[0], d[1]], u = 1; g > u; u++) n = u / g, s = n * r[0] + (1 - n) * d[0], l = n * r[1] + (1 - n) * d[1], i[v] = [s, l], v++;
						i[v] = [r[0], r[1]]
					},
					l = function(e, t, r, o) {
						var i, n, s, l, u = [(t[0] + e[0]) / 2, (t[1] + e[1]) / 2],
							h = Math.sqrt((u[0] - t[0]) * (u[0] - t[0]) + (u[1] - t[1]) * (u[1] - t[1])),
							d = a * r,
							c = Math.floor(1 + h / d),
							f = o.length;
						for (l = 1; c > l; l++) i = l / c, n = i * u[0] + (1 - i) * t[0], s = i * u[1] + (1 - i) * t[1], o[f] = [n, s], f++;
						o[f] = [t[0], t[1]]
					};
				t.exports = o
			}, {}],
			57: [function(e, t, r) {
				"use strict";

				function o(e) {
					this.width = e.width, this.height = e.height, this.data, this.originalBitmap = e, e.moaGL ? (this.moaGL = e.moaGL, this.texture = this.moaGL.createMask(this.width, this.height)) : this.data = a.makeData(4 * this.width * this.height)
				} {
					var a = e("../core/MoaAllocAndCopy");
					e("../processors/MoaColorConversion")
				}
				o.prototype.destroy = function() {
					this.moaGL ? (this.moaGL.destroyTexture(this.texture), this.moaGL = null) : this.data = null
				}, o.prototype.getTexture = function() {
					return this.texture
				}, o.prototype.initTransparent = function() {
					if ("undefined" != typeof this.moaGL) return void this.moaGL.setMaskTransparent(this.texture);
					for (var e = 0; e < this.data.length; e++) this.data[e] = 0
				}, o.prototype.initOpaque = function() {
					if ("undefined" != typeof this.moaGL) return void this.moaGL.setMaskOpaque(this.texture);
					for (var e = 0; e < this.data.length; e++) this.data[e] = 255
				}, o.prototype.drawPoint = function(e, t, r, o, a) {
					for (var i, n, s, l, s, u = this.width, h = (this.height, .5 * r), d = this.width * e, c = this.height * t, f = Math.pow(r + h * (1 - Math.sqrt(5 / 255)), 2), m = Math.sqrt(f), p = Math.max(0, Math.min(this.width - 1, Math.round(d - m))), g = Math.max(0, Math.min(this.width - 1, Math.round(d + m))), v = Math.max(0, Math.min(this.height - 1, Math.round(c - m))), _ = Math.max(0, Math.min(this.height - 1, Math.round(c + m))), x = v; _ >= x; x++)
						for (var M = p; g >= M; M++)
							if (i = 4 * (x * u + M), n = (M - d) * (M - d) + (x - c) * (x - c), f > n) {
								if (r * r > n) s = 1;
								else {
									var y = 1 - (Math.sqrt(n) - r) / h;
									s = y * y
								}
								s *= o, a ? (l = 255 * (0 * s + (1 - s) * this.data[i] / 255),
									l = 0 > l ? 0 : l > 255 ? 255 : l + .5 | 0, this.data[i] = l) : (l = 255 * (1 * s + (1 - s) * this.data[i] / 255), l = 0 > l ? 0 : l > 255 ? 255 : l + .5 | 0, this.data[i] = l)
							}
				}, t.exports = o
			}, {
				"../core/MoaAllocAndCopy": 34,
				"../processors/MoaColorConversion": 74
			}],
			58: [function(e, t, r) {
				"use strict"; {
					var o = {};
					e("../core/MoaAllocAndCopy")
				}
				o.renderEffect = function(e) {
					var t, r, o, a, i, n, s = e.width,
						l = e.height;
					if (e.moaGL) return e.moaGL.renderRedeye(), void(e.textureID = e.moaGL.glRenderingObjects.readTexture);
					var u = 0,
						h = 0,
						d = 0;
					for (r = 0; l > r; r++)
						for (t = 0; s > t; t++) {
							o = 4 * (t + s * r), a = e.data[o], i = e.data[o + 1], n = e.data[o + 2];
							var c = Math.max(a, Math.max(i, n)) - Math.min(a, Math.min(i, n)),
								f = .2 * a + .7 * i + .1 * n;
							c > 175 ? u = 1 : (u = Math.exp(-(c - 175) * (c - 175) / 11250), u = u > 1 ? 1 : u), h = n - i, h = 0 > h ? Math.exp(-h * h / 800) : 1, d = a - f, d = 0 > d ? 0 : 1 - Math.exp(-d * d / (.02 * 255 * 255));
							var m = u * d * h;
							m = m > 1 ? 1 : 0 > m ? 0 : m;
							var p = 1 - m,
								g = (i + n) / 2;
							g = p * a + m * g, e.data[o] = Math.min(255, Math.max(0, g + .5 | 0))
						}
				}, t.exports = o
			}, {
				"../core/MoaAllocAndCopy": 34
			}],
			59: [function(e, t, r) {
				var o = {};
				o.findClosestPatch = function(e, t, r) {
					var o, a;
					o = 0 | t[0], a = 0 | t[1];
					var i = e.width,
						n = e.height,
						s = e.data,
						l = -2.5 * r | 0,
						u = 2.5 * r | 0,
						h = u - l + 1,
						d = h,
						c = o + l | 0,
						f = a + l | 0;
					r > c && (c = 0 | r), r > f && (f = 0 | r), c + h > i - 1 - r && (h = i - 1 - r - c + 1 | 0), f + d > n - 1 - r && (d = n - 1 - r - f + 1 | 0);
					var m = h / 2 | 0,
						p = d / 2 | 0;
					if (e.moaGL) {
						var g = e.moaGL.gl,
							v = new Uint8Array(4 * h * d);
						g.bindFramebuffer(g.FRAMEBUFFER, e.moaGL.glRenderingObjects.offscreenFramebuffer), g.framebufferTexture2D(g.FRAMEBUFFER, g.COLOR_ATTACHMENT0, g.TEXTURE_2D, e.moaGL.glRenderingObjects.readTexture, 0), g.readPixels(c, f, h, d, g.RGBA, g.UNSIGNED_BYTE, v)
					}
					for (var _, x, M = 0, y = 0, b = -1, C = 1.3 * 1.3 * r * r, T = 0 | r, A = 0 | Math.max(1, r / 10), S = 0 | Math.max(1, r / 25), w = T; d - T > w; w += A)
						for (var P = T; h - T > P; P += A)
							if (!(C > (P - m) * (P - m) + (w - p) * (w - p))) {
								for (var F = Number.MIN_VALUE, E = Number.MAX_VALUE, D = 0, L = -r - 1 | 0; r > L; L += S)
									for (var R = -r - 1 | 0; r > R; R += S)
										if (0 > L + w || L + w >= d || 0 > R + P || R + P >= h) D += 65025;
										else if (0 > L + p || L + p >= d || 0 > R + m || R + m >= h) D += 65025;
								else {
									var B = i * (L + f + p) + R + c + m,
										O = i * (L + f + w) + R + c + P;
									e.moaGL ? (B = h * (L + p) + R + m, O = h * (L + w) + R + P, _ = v[4 * B + 1], x = v[4 * O + 1]) : (_ = s[4 * B + 1], x = s[4 * O + 1]);
									var I = (_ - x) * (_ - x);
									F = I > F ? I : F, E = E > I ? I : E, D += I
								}
								D *= F - E, (0 > b || b > D) && (b = D, M = P - m, y = w - p)
							}
					e.moaGL && (v = null), r > M + o && (M = r - o | 0), r > y + a && (y = r - a | 0), M + o > i - 1 - r && (M = i - 1 - r - o | 0), y + a > n - 1 - r && (y = n - 1 - r - a | 0);
					var N = [M, y];
					return N
				}, o.findAvgSkinColor = function(e, t, r) {
					var o = 0 | t[0],
						a = 0 | t[1];
					e.moaGL && (e.moaGL.glImageData.width != e.width || e.moaGL.glImageData.height != e.height) && (o = e.moaGL.glImageData.width * o / e.width, a = e.moaGL.glImageData.height * a / e.height);
					var i = e.width,
						n = e.height,
						s = e.data,
						l = -1 * r | 0,
						u = 1 * r | 0,
						h = u - l + 1,
						d = h,
						c = h / 2 | 0,
						f = d / 2 | 0,
						m = o + l | 0,
						p = a + l | 0;
					if (0 > m && (m = 0), 0 > p && (p = 0), m + h > i - 1 && (h = i - 1 - m + 1), p + d > n - 1 && (d = n - 1 - p + 1), e.moaGL) {
						var g = e.moaGL.gl,
							v = new Uint8Array(4 * h * d);
						g.bindFramebuffer(g.FRAMEBUFFER, e.moaGL.glRenderingObjects.offscreenFramebuffer), g.framebufferTexture2D(g.FRAMEBUFFER, g.COLOR_ATTACHMENT0, g.TEXTURE_2D, e.moaGL.glRenderingObjects.readTexture, 0), g.readPixels(m, p, h, d, g.RGBA, g.UNSIGNED_BYTE, v)
					}
					for (var _, x, M, y, b = 0, C = 0, T = 0, A = 0, S = (gCenterSum = bCenterSum = pCenterSum = 0, .4), w = 0; d > w; w++)
						for (var P = 0; h > P; P++) {
							var F = P - c,
								E = w - f,
								D = F * F + E * E,
								L = Math.sqrt(D),
								R = P + m,
								B = w + p;
							R = R > i - 1 ? i - 1 : R, B = B > n - 1 ? n - 1 : B, e.moaGL ? (_ = 4 * (w * h + P), x = v[_], M = v[_ + 1], y = v[_ + 2]) : (_ = 4 * (B * i + R), x = s[_], M = s[_ + 1], y = s[_ + 2]);
							var O = 1,
								I = (3 * x - 1.5 * M - 1.5 * y) / 255;
							I = 0 > I ? .2 : I > 1 ? 1 : .2 + .8 * I;
							var N = L - S * r,
								G = .25 * r,
								U = G * G;
							N = N * Math.exp(-N * N / U) / U, O = N > 0 ? N : 0, O *= I, O = 0 > O ? 0 : O > 1 ? 1 : O, b += O * x, C += O * M, T += O * y, A += O
						}
					e.moaGL && (v = null);
					var V;
					if (A > 0) {
						var k = b / A,
							j = C / A,
							W = T / A;
						k = 0 > k ? 0 : k > 255 ? 255 : k, j = 0 > j ? 0 : j > 255 ? 255 : j, W = 0 > W ? 0 : W > 255 ? 255 : W, V = {
							r: k,
							g: j,
							b: W,
							a: 255
						}
					} else V = {
						r: 0,
						g: 0,
						b: 0,
						a: 255
					};
					return V
				}, t.exports = o
			}, {}],
			60: [function(e, t, r) {
				"use strict";

				function o(e, t, r) {
					this.width = e.width, this.height = e.height, this.processedStrokes = [], this.unprocessedStrokes = [], this.currentStroke = null, this.toolType = r, this.originalBitmap = e, this.previewBitmap = t, this.processedBitmap = null, this.mask = new i(e), r == this.toolTypes.SelectiveBrushToolTypeColorSplash ? this.mask.initOpaque() : this.mask.initTransparent(), this.processedBitmap = l.copy(this.originalBitmap), this.renderEffect(), this._resetBoundingBox()
				}
				var a = e("./MoaSelectiveBrushStroke"),
					i = e("./MoaSelectiveMask"),
					n = e("../core/MoaColor"),
					s = e("../actionlist/MoaliteActionlistGenerator"),
					l = e("../core/MoaAllocAndCopy"),
					u = e("./MoaInterpolation"),
					h = e("./MoaBlur"),
					d = e("./MoaColorSplash"),
					c = e("./MoaRedeye"),
					f = e("./MoaWhiten");
				o.prototype.destroy = function() {
					this.mask.destroy(), this.processedBitmap.data = null, this.processedBitmap = null
				}, o.prototype.toolTypes = {
					SelectiveBrushToolTypeBlur: "blur",
					SelectiveBrushToolTypeColorSplash: "splash",
					SelectiveBrushToolTypeRedeye: "redeye",
					SelectiveBrushToolTypeWhiten: "whiten"
				}, o.prototype.renderEffect = function() {
					var e;
					switch (this.toolType) {
						case this.toolTypes.SelectiveBrushToolTypeBlur:
							e = h;
							break;
						case this.toolTypes.SelectiveBrushToolTypeColorSplash:
							e = d;
							break;
						case this.toolTypes.SelectiveBrushToolTypeRedeye:
							e = c;
							break;
						case this.toolTypes.SelectiveBrushToolTypeWhiten:
							e = f;
							break;
						default:
							return
					}
					e.renderEffect(this.processedBitmap)
				}, o.prototype.startNewStroke = function(e, t, r) {
					return null != this.currentStroke ? !1 : (("undefined" == typeof t || null === t) && (t = "free"), "smart" == t && this.toolType != this.toolTypes.SelectiveBrushToolTypeColorSplash && (t = "free"), this.currentStroke = new a(e, t), this.toolType == this.toolTypes.SelectiveBrushToolTypeColorSplash && "smart" == t && "undefined" != typeof r && this.currentStroke.setSmartColor(r), !0)
				}, o.prototype.addPointsToCurrentStroke = function(e) {
					return null == this.currentStroke ? !1 : (this.currentStroke.addPoints(e), this.currentStroke.getBrushMode() == this.currentStroke.brushModes.MoaBrushModeSmart && "undefined" == typeof this.currentStroke.getSmartColor() && this._findSmartColor(this.currentStroke), !0)
				}, o.prototype.endCurrentStroke = function() {
					return null == this.currentStroke ? !1 : (this.unprocessedStrokes = this.unprocessedStrokes.concat(this.currentStroke), void(this.currentStroke = null))
				}, o.prototype.getActionlistObject = function() {
					for (var e = [], t = 0; t < this.processedStrokes.length; t++) {
						var r = this.toolType == this.toolTypes.SelectiveBrushToolTypeColorSplash && "smart" == this.processedStrokes[t].brushMode;
						e.push(this.processedStrokes[t].getActionlistObject(r))
					}
					return s.MLPLActionBrush(this.toolType, e)
				}, o.prototype._findSmartColor = function(e) {
					switch (this.toolType) {
						case this.toolTypes.SelectiveBrushToolTypeColorSplash:
							e.setSmartColor(this.findColorAtPoint(e.getFirstPoint()))
					}
				}, o.prototype.findColorAtPoint = function(e) {
					if ("undefined" == typeof e[0]) return new n(0, 0, 0, 0);
					var t = e[0] * this.width,
						r = e[1] * this.height,
						t = Math.max(0, Math.min(this.width - 1, Math.round(t))),
						r = Math.max(0, Math.min(this.width - 1, Math.round(r)));
					if (this.originalBitmap.moaGL) return this.originalBitmap.moaGL.getColorAtPoint(t, r);
					var o = 4 * (r * this.width + t),
						a = this.originalBitmap.data;
					return new n(a[o], a[o + 1], a[o + 2], a[o + 3])
				}, o.prototype.renderPreview = function(e) {
					return "boolean" != typeof e && (e = !1), this._resetBoundingBox(), this._renderUnprocessedStrokes(), this._compositeImages(e), !0
				}, o.prototype._renderUnprocessedStrokes = function() {
					for (var e = 0; e < this.unprocessedStrokes.length; e++) this._renderStroke(this.unprocessedStrokes[e], !0), this.processedStrokes = this.processedStrokes.concat(this.unprocessedStrokes[e]);
					this.unprocessedStrokes = [], null != this.currentStroke && this._renderStroke(this.currentStroke, !1)
				}, o.prototype._renderStroke = function(e, t) {
					var r = e.getUnprocessedPoints(),
						o = e.getRadius(),
						a = this.width,
						i = this.height,
						n = o * a,
						s = r.map(function(e) {
							return [e[0] * a, e[1] * i]
						}),
						l = u.interpolateStrokePoints(s, n, t),
						h = l.map(function(e) {
							return [e[0] / a, e[1] / i]
						}),
						d = e.isEraseStroke();
					this.toolType == this.toolTypes.SelectiveBrushToolTypeColorSplash && (d = !d);
					var c = e.isSmartStroke() && "object" == typeof e.getSmartColor(),
						f = {};
					if (c && (f.rgbColor = e.getSmartColor(), f.considerLuminosity = !1, f.sigmaC = 10), this.originalBitmap.moaGL) return void this.originalBitmap.moaGL.maskAddPoints(this.mask.getTexture(), this.width, this.height, h, e.radius, f.sigmaC, 1, c ? "splash" : "normal", f.rgbColor, d);
					for (var m = 0; m < h.length; m++) {
						var p = h[m][0],
							g = h[m][1];
						this._updateBoundingBox(p - e.radius, g - e.radius), this._updateBoundingBox(p + e.radius, g + e.radius), c ? this.mask.maskSimilarColors(p, g, e.getRadius(), 1, d, f) : this.mask.maskPoint(p, g, e.getRadius(), 1, d)
					}
					e.markAllPointsAsProcessed()
				}, o.prototype._resetBoundingBox = function() {
					this.boundingBox = [1, 1, 0, 0]
				}, o.prototype._updateBoundingBox = function(e, t) {
					e < this.boundingBox[0] && (this.boundingBox[0] = e), e > this.boundingBox[2] && (this.boundingBox[2] = e), t < this.boundingBox[1] && (this.boundingBox[1] = t), t > this.boundingBox[3] && (this.boundingBox[3] = t)
				}, o.prototype._compositeImages = function(e) {
					if (this.originalBitmap.moaGL) return void this.originalBitmap.moaGL.drawExistingProcessedTextureWithMaskTexture(this.processedBitmap.textureID, this.mask.getTexture());
					var t, r, o, a, i = this.width,
						n = this.height;
					e ? (t = this.boundingBox[0] * (i - 1), r = this.boundingBox[1] * (n - 1), o = this.boundingBox[2] * (i - 1), a = this.boundingBox[3] * (n - 1)) : (t = 0, r = 0, o = i - 1, a = n - 1), t = 0 > t ? 0 : t > i - 1 ? i - 1 : Math.round(t), r = 0 > r ? 0 : r > n - 1 ? n - 1 : Math.round(r), o = 0 > o ? 0 : o > i - 1 ? i - 1 : Math.round(o), a = 0 > a ? 0 : a > n - 1 ? n - 1 : Math.round(a);
					var s, l, u, h, d = this.previewBitmap.data,
						c = this.processedBitmap.data,
						f = this.originalBitmap.data,
						m = this.mask.data;
					for (l = r; a >= l; l++)
						for (s = t; o >= s; s++) u = 4 * (l * i + s), h = m[l * i + s] / 255, d[u] = h * c[u] + (1 - h) * f[u], d[u + 1] = h * c[u + 1] + (1 - h) * f[u + 1], d[u + 2] = h * c[u + 2] + (1 - h) * f[u + 2]
				}, t.exports = o
			}, {
				"../actionlist/MoaliteActionlistGenerator": 21,
				"../core/MoaAllocAndCopy": 34,
				"../core/MoaColor": 36,
				"./MoaBlur": 45,
				"./MoaColorSplash": 47,
				"./MoaInterpolation": 56,
				"./MoaRedeye": 58,
				"./MoaSelectiveBrushStroke": 61,
				"./MoaSelectiveMask": 62,
				"./MoaWhiten": 67
			}],
			61: [function(e, t, r) {
				"use strict";

				function o(e, t, r) {
					this.radius = e, this.pointList = [], this.pointCount = 0, this.lastProcessedPoint = 0, this.brushMode = t, r && (this.smartColor = r)
				}
				var a = e("./MoaBrushStroke");
				o.prototype = new a, o.prototype.brushModes = {
					MoaBrushModeFree: "free",
					MoaBrushModeSmart: "smart",
					MoaBrushModeErase: "erase"
				}, o.prototype.setSmartColor = function(e) {
					this.brushMode == this.brushModes.MoaBrushModeSmart && "undefined" == typeof this.smartColor && (this.smartColor = e)
				}, o.prototype.getBrushMode = function() {
					return this.brushMode
				}, o.prototype.getSmartColor = function() {
					return this.smartColor
				}, o.prototype.isSmartStroke = function() {
					return this.brushMode == this.brushModes.MoaBrushModeSmart
				}, o.prototype.isEraseStroke = function() {
					return this.brushMode == this.brushModes.MoaBrushModeErase
				}, o.prototype.getActionlistObject = function(e) {
					var t = {
						radius: this.radius,
						brushMode: this.brushMode,
						points: this.pointList
					};
					return e && (t.color = this._getActionlistColor()), t
				}, o.prototype._getActionlistColor = function() {
					var e;
					return e = this.brushMode == this.brushModes.MoaBrushModeSmart ? this.smartColor : {
						r: 0,
						g: 0,
						b: 0,
						a: 0
					}
				}, t.exports = o
			}, {
				"./MoaBrushStroke": 46
			}],
			62: [function(e, t, r) {
				"use strict";

				function o(e) {
					this.width = e.width, this.height = e.height, this.originalBitmap = e, e.moaGL ? (this.moaGL = e.moaGL, this.texture = this.moaGL.createMask(this.width, this.height)) : this.data = a.makeData(this.width * this.height)
				}
				var a = e("../core/MoaAllocAndCopy"),
					i = e("../processors/MoaColorConversion");
				o.prototype.destroy = function() {
					this.moaGL ? (this.moaGL.destroyTexture(this.texture), this.moaGL = null) : this.data = null
				}, o.prototype.getTexture = function() {
					return this.texture
				}, o.prototype.initTransparent = function() {
					if ("undefined" != typeof this.moaGL) return void this.moaGL.setMaskTransparent(this.texture);
					for (var e = 0; e < this.data.length; e++) this.data[e] = 0
				}, o.prototype.initOpaque = function() {
					if ("undefined" != typeof this.moaGL) return void this.moaGL.setMaskOpaque(this.texture);
					for (var e = 0; e < this.data.length; e++) this.data[e] = 255
				}, o.prototype.maskPoint = function(e, t, r, o, a) {
					for (var i, n, s, l, u, s, h = this.width, d = (this.height, r * h), c = .5 * d, f = this.width * e, m = this.height * t, p = d + c * (1 - Math.sqrt(.4 / 255)), g = p * p, v = Math.max(0, Math.min(this.width - 1, Math.round(f - p))), _ = Math.max(0, Math.min(this.width - 1, Math.round(f + p))), x = Math.max(0, Math.min(this.height - 1, Math.round(m - p))), M = Math.max(0, Math.min(this.height - 1, Math.round(m + p))), y = x; M >= y; y++)
						for (var b = v; _ >= b; b++)
							if (i = 4 * (y * h + b), l = y * h + b, n = (b - f) * (b - f) + (y - m) * (y - m), g > n) {
								if (d * d > n) s = 1;
								else {
									var C = 1 - (Math.sqrt(n) - d) / c;
									s = C * C
								}
								s *= o, a ? (u = 255 * (0 * s + (1 - s) * this.data[l] / 255), u = 0 > u ? 0 : u > 255 ? 255 : u + .5 | 0, this.data[l] = u) : (u = 255 * (1 * s + (1 - s) * this.data[l] / 255), u = 0 > u ? 0 : u > 255 ? 255 : u + .5 | 0, this.data[l] = u)
							}
				}, o.prototype.maskSimilarColors = function(e, t, r, o, a, n) {
					var s, l, u, h = this.originalBitmap.data,
						d = this.width,
						c = (this.height, e * this.width),
						f = t * this.height,
						m = n.sigmaC,
						p = n.labColor,
						g = n.rgbColor,
						v = n.considerLuminosity,
						_ = r * d,
						x = .5 * _;
					u = "object" != typeof p ? i.rgb2labwithcbrtmapping(g.r, g.g, g.b) : p;
					for (var M, y, b, C, T = -2 * m * m * Math.log(254.6 / 255), A = -2 * m * m * Math.log(.4 / 255), S = _ + x * (1 - Math.sqrt(.4 / 255)), w = S * S, P = Math.max(0, Math.min(this.width - 1, Math.round(c - S))), F = Math.max(0, Math.min(this.width - 1, Math.round(c + S))), E = Math.max(0, Math.min(this.height - 1, Math.round(f - S))), D = Math.max(0, Math.min(this.height - 1, Math.round(f + S))), L = E; D >= L; L++)
						for (var R = P; F >= R; R++) {
							var B = L * d + R,
								O = 4 * (L * d + R),
								I = (R - c) * (R - c) + (L - f) * (L - f);
							if (w > I) {
								if (y = i.rgb2labwithcbrtmapping(h[O], h[O + 1], h[O + 2]), l = v ? Math.pow(u[0] - y[0], 2) + Math.pow(u[1] - y[1], 2) + Math.pow(u[2] - y[2], 2) : Math.pow(u[1] - y[1], 2) + Math.pow(u[2] - y[2], 2), T > l) b = 1;
								else {
									if (l > A) {
										b = 0;
										continue
									}
									b = Math.exp(-l / (2 * m * m))
								}
								if (_ * _ > I) C = 1;
								else {
									var N = 1 - (Math.sqrt(I) - _) / x;
									C = N * N
								}
								s = b * C, s *= o, a ? (M = 255 * (0 * s + (1 - s) * this.data[B] / 255), M = 0 > M ? 0 : M > 255 ? 255 : M + .5 | 0, this.data[B] = M) : (M = 255 * (1 * s + (1 - s) * this.data[B] / 255), M = 0 > M ? 0 : M > 255 ? 255 : M + .5 | 0, this.data[B] = M)
							}
						}
				}, o.prototype.maskRadial = function(e, t, r) {
					var o = this.width,
						a = this.height,
						i = e * o,
						n = t * a,
						s = r * o;
					if (this.moaGL) {
						var l = {
							posX: i,
							posY: n,
							sigmaR: s
						};
						return void this.moaGL.maskFillRadial(this.getTexture(), this.width, this.height, l)
					}
					var u, h, d, c, f, m;
					c = s * s, f = -2 * c * Math.log(1 - 1 / 255), m = -2 * c * Math.log(1 - 254 / 255);
					for (var p, g = 0; a > g; g++) {
						p = (g - n) * (g - n);
						for (var v = 0; o > v; v++) u = g * o + v, d = (v - i) * (v - i) + p, f > d ? h = 0 : d > m ? h = 255 : (h = 1 - Math.exp(-d / (2 * c)), h = 255 * h + .5, h = h > 255 ? 255 : 0 > h ? 0 : 0 | h), this.data[u] = h
					}
				}, o.prototype.maskLinear = function(e, t, r, o) {
					var a = this.width,
						i = this.height,
						n = e * a,
						s = t * i,
						l = r * a;
					if (this.moaGL) {
						var u = {
							posX: n,
							posY: s,
							sigmaR: l,
							angle: o
						};
						return void this.moaGL.maskFillLinear(this.getTexture(), this.width, this.height, u)
					}
					var h, d, c, f, m, p, g, v;
					c = l * l, f = Math.sqrt(-2 * c * Math.log(1 - 1 / 255)), m = Math.sqrt(-2 * c * Math.log(1 - 254 / 255)), p = -Math.sin(o), g = Math.cos(o);
					for (var _ = this.data, x = 0; i > x; x++)
						for (var M = 0; a > M; M++) h = x * a + M, v = Math.abs(p * (n - M) + g * (x - s)), d = f > v ? 0 : v > m ? 1 : 1 - Math.exp(-v * v / (2 * c)), d = 255 * d + .5, d = d > 255 ? 255 : 0 > d ? 0 : 0 | d, _[h] = d
				}, t.exports = o
			}, {
				"../core/MoaAllocAndCopy": 34,
				"../processors/MoaColorConversion": 74
			}],
			63: [function(e, t, r) {
				"use strict";

				function o(e, t) {
					this.width = e.width, this.height = e.height, this.originalBitmap = e, this.previewBitmap = t, this.processedBitmap = null, "undefined" != typeof e.moaGL && (this.moaGL = e.moaGL), this.mask = new a(e), this.mask.initTransparent(), this.processedBitmap = i.copy(this.originalBitmap), n.renderEffect(this.processedBitmap)
				}
				var a = e("./MoaSelectiveMask"),
					i = e("../core/MoaAllocAndCopy"),
					n = e("./MoaBlur");
				o.prototype.destroy = function() {
					this.mask.destroy(), this.processedBitmap.data = null, this.processedBitmap = null
				}, o.prototype.renderRadialBlur = function(e, t, r) {
					this.mask.maskRadial(e, t, r)
				}, o.prototype.renderLinearBlur = function(e, t, r, o) {
					this.mask.maskLinear(e, t, r, o)
				}, o.prototype.renderPreview = function() {
					return this.compositeImages()
				}, o.prototype.compositeImages = function() {
					if (this.moaGL) return this.moaGL.drawExistingProcessedTextureWithMaskTexture(this.processedBitmap.textureID, this.mask.getTexture()), !0;
					for (var e, t, r = this.width, o = this.height, a = this.previewBitmap.data, i = this.processedBitmap.data, n = this.originalBitmap.data, s = this.mask.data, l = 0; o > l; l++)
						for (var u = 0; r > u; u++) e = 4 * (l * r + u), t = s[l * r + u] / 255, a[e] = t * i[e] + (1 - t) * n[e], a[e + 1] = t * i[e + 1] + (1 - t) * n[e + 1], a[e + 2] = t * i[e + 2] + (1 - t) * n[e + 2];
					return !0
				}, t.exports = o
			}, {
				"../core/MoaAllocAndCopy": 34,
				"./MoaBlur": 45,
				"./MoaSelectiveMask": 62
			}],
			64: [function(e, t, r) {
				"use strict";

				function o(e, t, r) {
					this.x = e, this.y = t, this.color = r
				}

				function a(e) {
					for (var t = [], r = 0; e > r; r++) t[r] = new o;
					return t
				}

				function i(e, t, r, o, a, i) {
					this.vertex0 = e, this.vertex1 = t, this.vertex2 = r, this.edge0 = o, this.edge1 = a, this.edge2 = i
				}

				function n(e, t, r, a, i) {
					var n, s = t.getSharedVertex(e);
					i > a && (n = a, a = i, i = n, n = e, e = t, t = n), this.color0 = s == e.vertex0 ? e.vertex1.color : e.vertex0.color, this.color1 = s.color, this.color2 = s == t.vertex0 ? t.vertex1.color : t.vertex0.color, n = new o, n.y = r, n.x = a, this.bterm = l.calcDistance(n, s) / e.length, this.bterm = Math.max(0, Math.min(1, this.bterm)), n.x = i, this.dterm = l.calcDistance(n, s) / t.length, this.dterm = Math.max(0, Math.min(1, this.dterm))
				}

				function s(e, t, r, o) {
					this.x = e, this.y = t, this.t = r, this.radius = o
				}
				var l = e("./MoaDrawBrushGeometry");
				o.prototype.findDistance = function(e) {
					return Math.sqrt((this.x - e.x) * (this.x - e.x) + (this.y - e.y) * (this.y - e.y))
				}, n.prototype.getBaryColor = function(e, t) {
					var r = t * this.bterm,
						o = (1 - t) * (1 - this.dterm) + t * (1 - this.bterm),
						a = (1 - t) * this.dterm;
					e.r = r * this.color0.r + o * this.color1.r + a * this.color2.r, e.g = r * this.color0.g + o * this.color1.g + a * this.color2.g, e.b = r * this.color0.b + o * this.color1.b + a * this.color2.b, e.a = r * this.color0.a + o * this.color1.a + a * this.color2.a
				}, s.prototype.copy = function() {
					return new s(this.x, this.y, this.t, this.radius)
				}, s.prototype.getActionlistObject = function() {
					var e = [this.x, this.y],
						t = {
							point: e,
							timeOffset: this.t
						};
					return t
				}, s.prototype.scale = function(e, t, r) {
					this.x *= e, this.y *= t, this.radius *= r
				}, t.exports = {
					MoaVertex: o,
					generateMoaVertexArray: a,
					MoaTriangle: i,
					MoaBaryInterpolator: n,
					MoaDrawBrushPoint: s
				}
			}, {
				"./MoaDrawBrushGeometry": 49
			}],
			65: [function(e, t, r) {
				"use strict";

				function o(e) {
					this.mask = e, this.maskData = e.data, "undefined" != typeof e.moaGL && (this.moaGL = e.moaGL), this.width = e.width, this.height = e.height
				}
				var a = e("../core/MoaColor"),
					i = (e("./MoaDrawBrushGeometry"), e("./MoaEdge")),
					n = e("./MoaToolDataTypes"),
					s = (n.MoaVertex, n.MoaTriangle),
					l = n.MoaBaryInterpolator,
					u = function(e, t) {
						var r = e;
						e = t, t = r
					};
				o.prototype.drawTriangle = function(e, t) {
					if (this.moaGL) return void this.moaGL.drawTrianglesWithColor(this.mask, e, "fan");
					var r = !t && 255 == e[0].color.a && e[0].color.isEqual(e[1].color) && e[0].color.isEqual(e[2].color),
						o = e[0],
						a = e[1],
						n = e[2];
					n.y < a.y && u(a, n), a.y < o.y && u(o, a), n.y < a.y && u(a, n), o.y == a.y && o.x > a.x && u(o, a), a.y == n.y && a.x > n.x && u(a, n);
					var l = new i(o, a),
						h = new i(o, n),
						d = new i(a, n),
						c = new s(o, a, n, l, h, d),
						f = Math.min(o.y, Math.min(a.y, n.y));
					f = Math.max(0, f);
					var m = Math.max(o.y, Math.max(a.y, n.y));
					m = Math.min(this.mask.height - 1, m);
					for (var p = Math.floor(f); p <= Math.floor(m); p++) r ? this.drawSingleColorScanlineWithAliasing(c, p) : this.drawScanlineWithAliasing(c, p, t)
				}, o.prototype.drawTriangleStrip = function(e, t) {
					if (!(e.length < 3)) {
						if (this.moaGL) return void this.moaGL.drawTrianglesWithColor(this.mask, e, "strip");
						for (var r = 2; r < e.length; r++) {
							var o = [e[r - 2], e[r - 1], e[r]];
							this.drawTriangle(o, t)
						}
					}
				}, o.prototype.drawTriangleFan = function(e, t) {
					if (!(e.length < 3)) {
						if (this.moaGL) return void this.moaGL.drawTrianglesWithColor(this.mask, e, "fan");
						for (var r = e[0], o = 2; o < e.length; o++) {
							var a = [r, e[o - 1], e[o]];
							this.drawTriangle(a, t)
						}
					}
				}, o.prototype.drawScanlineWithAliasing = function(e, t, r) {
					var o, i, n = t + .5,
						s = e.edge0.intersectsYVal(n),
						u = e.edge1.intersectsYVal(n),
						h = e.edge2.intersectsYVal(n),
						d = s ? e.edge0.getXInterceptForYVal(n) : -1,
						c = u ? e.edge1.getXInterceptForYVal(n) : -1,
						f = h ? e.edge2.getXInterceptForYVal(n) : -1;
					if (s || u || h) {
						var m = s ? d : c,
							p = h ? f : c;
						m = Math.min(m, p);
						var g = s ? d : c;
						p = h ? f : c, g = Math.max(g, p);
						var v, _ = new a,
							x = new a,
							M = new a;
						s && u && (v = new l(e.edge0, e.edge1, n, d, c, _, x, M), m = d, g = c), s && h && (v = new l(e.edge0, e.edge2, n, d, f, _, x, M), m = d, g = f), u && h && (v = new l(e.edge1, e.edge2, n, c, f, _, x, M), m = c, g = f), m > g && (p = m, m = g, g = p);
						var y = new a;
						o = Math.floor(.5 + Math.max(m, 0)), i = Math.floor(.5 + Math.min(g, this.width - 1));
						for (var b = o; i > b; b++) {
							var C = (b + .5 - m) / (g - m);
							C = Math.min(1, Math.max(0, C)), v.getBaryColor(y, C), r ? this.eraseFromMaskPremultipliedAlpha(y.a / 255, b, t) : this.drawToMaskPremultipliedAlpha(y, b, t)
						}
					}
				}, o.prototype.drawSingleColorScanlineWithAliasing = function(e, t) {
					var r, o, a = t + .5,
						i = e.edge0.intersectsYVal(a),
						n = e.edge1.intersectsYVal(a),
						s = e.edge2.intersectsYVal(a),
						l = i ? e.edge0.getXInterceptForYVal(a) : -1,
						u = n ? e.edge1.getXInterceptForYVal(a) : -1,
						h = s ? e.edge2.getXInterceptForYVal(a) : -1;
					if (i || n || s) {
						var d = i ? l : u,
							c = s ? h : u;
						d = Math.min(d, c);
						var f = i ? l : u;
						c = s ? h : u, f = Math.max(f, c);
						var m = 4 * Math.floor(this.width * t),
							p = e.vertex0.color;
						r = Math.max(0, Math.round(d)), o = Math.min(this.width, Math.round(f));
						for (var g = r; o > g; g++) {
							var v = 4 * g;
							this.maskData[m + v] = p.r, this.maskData[m + v + 1] = p.g, this.maskData[m + v + 2] = p.b, this.maskData[m + v + 3] = p.a
						}
					}
				}, o.prototype.drawToMaskPremultipliedAlpha = function(e, t, r) {
					if (!(0 > t || t >= this.width || 0 > r || r >= this.height)) {
						var o = 4 * (r * this.width + t),
							a = e.a / 255,
							i = 1 - a;
						this.maskData[o] = i * this.maskData[o] + e.r + .5 | 0, this.maskData[o + 1] = i * this.maskData[o + 1] + e.g + .5 | 0, this.maskData[o + 2] = i * this.maskData[o + 2] + e.b + .5 | 0, this.maskData[o + 3] = i * this.maskData[o + 3] + e.a + .5 | 0
					}
				}, o.prototype.eraseFromMaskPremultipliedAlpha = function(e, t, r) {
					if (!(0 > t || t >= this.width || 0 > r || r >= this.height)) {
						var o = 4 * (r * this.width + t);
						this.maskData[o] = (1 - e) * this.maskData[o] + .5 | 0, this.maskData[o + 1] = (1 - e) * this.maskData[o + 1] + .5 | 0, this.maskData[o + 2] = (1 - e) * this.maskData[o + 2] + .5 | 0, this.maskData[o + 3] = (1 - e) * this.maskData[o + 3] + .5 | 0
					}
				}, t.exports = o
			}, {
				"../core/MoaColor": 36,
				"./MoaDrawBrushGeometry": 49,
				"./MoaEdge": 55,
				"./MoaToolDataTypes": 64
			}],
			66: [function(e, t, r) {
				"use strict";

				function o(e, t) {
					this.width = e.width, this.height = e.height, this.originalBitmap = e, this.previewBitmap = t, this.processedBitmap = null, "undefined" != typeof e.moaGL ? this.moaGL = e.moaGL : "undefined" != typeof t.moaGL && (this.moaGL = t.moaGL), this.mask = new a(e), this.mask.initTransparent()
				}
				var a = e("./MoaOverlayMask"),
					i = e("../processors/MoaGradient"),
					n = e("../processors/MoaGradientFlare"),
					s = (e("../processors/MoaBitmapBlend"), .75),
					l = 1e-7;
				o.prototype.destroy = function() {
					this.mask.destroy()
				}, o.prototype.VIGNETTE_MODES = {
					MoaVignetteToolModeBlack: "black",
					MoaVignetteToolModeWhite: "white"
				}, o.prototype.applyVignetteToolWithDefaults = function(e, t, r) {
					this.applyVignetteTool(e, t, s, r, !1)
				}, o.prototype.applyVignetteTool = function(e, t, r, o, a) {
					var s, u, h, d, c, f = {},
						m = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],
						p = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
					s = 2, u = 2;
					var g = [e[0] + .5 * e[2], e[1] + .5 * e[3]],
						v = e[2],
						_ = e[3];
					v = Math.max(v, l), _ = Math.max(_, l), m[0] = 1 / v, m[5] = 1 / _, m[3] = .5 - g[0] / v, m[7] = .5 - g[1] / _;
					var x;
					switch (o) {
						case this.VIGNETTE_MODES.MoaVignetteToolModeBlack:
							x = 0;
							break;
						case this.VIGNETTE_MODES.MoaVignetteToolModeWhite:
							x = 255
					}
					var M = {
							r: x,
							g: x,
							b: x,
							a: 255
						},
						y = {
							color: M,
							location: 0
						},
						b = {
							color: M,
							location: 100
						};
					f.colors = [y, b];
					var C = {
							opacity: 0,
							location: 0 + 49.3 * (1 - r)
						},
						T = {
							opacity: 1,
							location: 100 - 49.3 * (1 - r)
						};
					f.opacities = [C, T], h = n.GradientFlareShapeCircle, d = n.GradientFlareAspectModeStretch, c = n.GradientFlareWrapModeClamp;
					var A = {
						gradientShapeType: h,
						gradientParams: p,
						gradientTransform: m,
						aspectMode: d,
						gradient: f,
						invertMap: !1,
						gradientWrapMode: c,
						blendMode: "normal",
						alpha: t,
						copyAlpha: a
					};
					if (this.moaGL) {
						var S = 4096,
							w = [];
						i.memoizeGradient(f, w, S), A.gradMap = w, A.alpha = t, this.moaGL.applyVignetteToolToMask(this.mask, A)
					} else n.gradientFlare(this.previewBitmap, A);
					return !0
				}, t.exports = o
			}, {
				"../processors/MoaBitmapBlend": 72,
				"../processors/MoaGradient": 84,
				"../processors/MoaGradientFlare": 85,
				"./MoaOverlayMask": 57
			}],
			67: [function(e, t, r) {
				"use strict"; {
					var o = {},
						a = e("../processors/MoaColorConversion");
					e("../core/MoaAllocAndCopy")
				}
				o.renderEffect = function(e) {
					var t = e.width,
						r = e.height;
					if (e.moaGL) return e.moaGL.renderWhiten(), void(e.textureID = e.moaGL.glRenderingObjects.readTexture);
					for (var o = new Array, i = 0; 256 > i; i++) o[i] = .04045 >= i / 255 ? 100 * i / 255 / 12.92 : 100 * Math.pow((i / 255 + .055) / 1.055, 2.4);
					var n, s, l, u, h, d, c, f;
					for (h = 0; r > h; h++)
						for (u = 0; t > u; u++) n = 4 * (u + t * h), c = a.rgb2lab(e.data[n], e.data[n + 1], e.data[n + 2], o), l = 0, l += Math.pow(c[1] - 132, 2), c[2] < 127 && (l += Math.pow(c[2] - 127, 2)), s = .65 * Math.exp(-l / 98), f = 255 * Math.pow(c[0] / 255, 1 / (.5 * s + 1)), d = a.lab2rgb([f, c[1], (1 - s) * (c[2] - 127) + 127]), e.data[n] = d[0], e.data[n + 1] = d[1], e.data[n + 2] = d[2]
				}, t.exports = o
			}, {
				"../core/MoaAllocAndCopy": 34,
				"../processors/MoaColorConversion": 74
			}],
			68: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("./MoaHistogramMapping"),
					i = e("./MoaBitmapBlend"),
					n = e("../core/MoaAllocAndCopy"),
					s = function(e) {
						e.r = [], e.g = [], e.b = []
					},
					l = function(e) {
						return e > 255 ? 255 : 0 > e ? 0 : e
					};
				o.kSaturation = "saturation", o.kWarmth = "warmth", o.kTint = "tint", o.kFade = "fade", o.kBlendMode = "blendMode", o.kAlpha = "alpha", o.adjustColor = function(e, t) {
					var r, u, h = !1,
						d = "normal",
						c = 1;
					e.moaGL || "normal" == d && 1 == c ? u = e.data : (r = n.makeBitmap(e.width, e.height), h = !0, u = r.data);
					var f = t[o.kSaturation],
						m = t[o.kWarmth],
						p = t[o.kTint],
						g = t[o.kFade],
						v = {},
						_ = {},
						x = {},
						M = {};
					s(v), s(_), s(x), s(M);
					for (var y = new Array(12), b = (new Array(12), 0 != f), C = 0; 256 > C; C++) M.r[C] = C, M.g[C] = C, M.b[C] = C;
					f = -100 > f ? -100 : f > 100 ? 100 : f;
					var T, A = 1.4,
						S = 0,
						w = f / 100 + 1;
					w -= 1, w = 0 > w ? (1 - S) * (Math.cos(Math.PI * w * .5) - 1) : (A - 1) * (1 - Math.cos(Math.PI * w * .5)), w += 1, T = 1 - w, y[0] = -0.787 * T + 1, y[1] = .715 * T, y[2] = .072 * T, y[3] = 0, y[4] = .213 * T, y[5] = (.715 - 1) * T + 1, y[6] = .072 * T, y[7] = 0, y[8] = .213 * T, y[9] = .715 * T, y[10] = -0.928 * T + 1, y[11] = 0;
					var w = g / 100,
						P = !1;
					0 > w && (P = !0, w = -.7 * w);
					for (var C = 0; 256 > C; C++) {
						var F;
						if (128 > C) {
							var E = .55 * w;
							F = 127.5 * Math.pow(C / 255 * 2, 1 + .95 * w), F = (1 - E) * F + .5 * E * 255
						} else {
							var E = .3 * w;
							F = 255 - 127.5 * Math.pow(Math.abs(2 - C / 255 * 2), 1 + .35 * w), F = (1 - E) * F + .5 * E * 255
						}
						x.r[C] = l(F + .5 | 0), x.g[C] = l(F + .5 | 0), x.b[C] = l(F + .5 | 0)
					}
					P && a.invertHistMap(x), a.combineMultiChannelHistMaps(M, x);
					var D, L, R, w = m / 100;
					w = w > 0 ? .7 * (1 - Math.cos(Math.PI * w * .5)) : Math.cos(Math.PI * w * .5) - 1;
					for (var C = 0; 255 >= C; C++) w > 0 ? (D = C + 48 * w * Math.sin(Math.PI * C / 255), L = C + 28 * w * Math.sin(Math.PI * C / 255), R = C - 6 * w * Math.sin(Math.PI * C / 255)) : (D = C + 16 * w * Math.sin(Math.PI * C / 255), L = C + -10 * w * Math.sin(Math.PI * C / 255), R = C + -48 * w * Math.sin(Math.PI * C / 255)), v.r[C] = l(D + .5 | 0), v.g[C] = l(L + .5 | 0), v.b[C] = l(R + .5 | 0);
					a.combineMultiChannelHistMaps(M, v);
					var D, L, R, w = p / 100;
					w = w > 0 ? .7 * (1 - Math.cos(Math.PI * w * .5)) : .5 * (Math.cos(Math.PI * w * .5) - 1);
					for (var C = 0; 255 >= C; C++) w > 0 ? (R = C + 48 * w * Math.sin(Math.PI * C / 255), D = C + 28 * w * Math.sin(Math.PI * C / 255), L = C - 6 * w * Math.sin(Math.PI * C / 255)) : (R = C + 16 * w * Math.sin(Math.PI * C / 255), D = C + -10 * w * Math.sin(Math.PI * C / 255), L = C + -48 * w * Math.sin(Math.PI * C / 255)), _.r[C] = l(D + .5 | 0), _.g[C] = l(L + .5 | 0), _.b[C] = l(R + .5 | 0);
					if (a.combineMultiChannelHistMaps(M, _), e.moaGL) return e.moaGL.renderColorMatrixTransform(y), e.moaGL.renderColorMap(M), !0;
					for (var B, O, I, N, G, U, C = 0; C < u.length;) B = e.data[C], O = e.data[C + 1], I = e.data[C + 2], b && (N = y[0] * B + y[1] * O + y[2] * I + .5, G = y[4] * B + y[5] * O + y[6] * I + .5, U = y[8] * B + y[9] * O + y[10] * I + .5, B = 0 | l(N), O = 0 | l(G), I = 0 | l(U)), B = M.r[B], O = M.g[O], I = M.b[I], u[C] = B, u[C + 1] = O, u[C + 2] = I, u[C + 3] = e.data[C + 3], C += 4;
					return h ? i.blendWithBitmap(e, e, r, t.blendMode, t.alpha) : !0
				}, t.exports = o
			}, {
				"../core/MoaAllocAndCopy": 34,
				"./MoaBitmapBlend": 72,
				"./MoaHistogramMapping": 90
			}],
			69: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("./MoaHistogramMapping"),
					i = e("./MoaBitmapBlend"),
					n = e("../core/MoaAllocAndCopy"),
					s = function(e) {
						e.r = [], e.g = [], e.b = []
					},
					l = function(e) {
						return e > 255 ? 255 : 0 > e ? 0 : e
					};
				o.kBrightness = "brightness", o.kContrast = "contrast", o.kHighlights = "highlights", o.kShadows = "shadows", o.kBlendMode = "blendMode", o.kAlpha = "alpha", o.adjustLighting = function(e, t) {
					var r, u, h = !1,
						d = "normal",
						c = 1;
					e.moaGL || "normal" == d && 1 == c ? u = e.data : (r = n.makeBitmap(e.width, e.height), h = !0, u = r.data);
					var f, m = t[o.kBrightness],
						p = t[o.kContrast],
						g = t[o.kHighlights],
						v = t[o.kShadows],
						_ = {},
						x = {},
						M = {};
					s(_), s(x), s(M);
					for (var y = new Array(256), b = new Array(256), C = new Array(9), T = new Array(9), A = (new Array(9), new Array(9), new Array(3)), S = 0 != m, w = 0 != p, P = 0 > p, F = 0 != g, E = 0 != v, D = 0; 256 > D; D++) M.r[D] = D, M.g[D] = D, M.b[D] = D;
					for (var L, m = Math.max(-100, Math.min(100, m)), R = m / 100, D = 0; 256 > D; D++) {
						if (0 > R) L = D + 50 * R * Math.sin(Math.PI * D / 255);
						else {
							var B = D / 255;
							L = Math.pow(B, 1 + .15 * Math.abs(R) - Math.abs(R) * Math.pow(B, .2)), 0 > R && (L = B * (1 - .25 * Math.abs(R)) - .7 * (L - B) * Math.sin(.5 * Math.PI * B)), L *= 255
						}
						y[D] = l(L + .5 | 0)
					}
					p = Math.max(-100, Math.min(100, p));
					var O, R = p / 100;
					f = Math.abs(R) + 1, R > 0 ? O = 110 : (R = Math.cos(Math.PI * Math.pow(Math.abs(R), .8) * .5) - 1, f = 1 / (Math.abs(R) + 1), O = 110);
					for (var D = 0; 256 > D; D++) {
						var I;
						I = O > D ? O * Math.pow(D / O, f) : 255 - (255 - O) * Math.pow((255 - D) / (255 - O), f), 0 > R && (I = D - Math.sin(Math.PI * D / 255) * (D - I)), b[D] = l(I + .5 | 0)
					}
					var N = .3 * Math.abs(R);
					C[0] = -0.787 * N + 1, C[3] = .715 * N, C[6] = .072 * N, C[1] = .213 * N, C[4] = (.715 - 1) * N + 1, C[7] = .072 * N, C[2] = .213 * N, C[5] = .715 * N, C[8] = -0.928 * N + 1, g = Math.max(-100, Math.min(100, g));
					var R = -.75 * g / 100,
						G = !1;
					0 > R && (G = !0, R = -R);
					for (var D = 0; 256 > D; D++) {
						var B = D / 255,
							L = -3.68113 + 4.829 * (D / 3 + 1) - .299125 * Math.pow(D / 3 + 1, 2) + .006449275 * Math.pow(D / 3 + 1, 3) - 474531e-10 * Math.pow(D / 3 + 1, 4);
						if (0 > L && (L = 0), .25 >= R) L = R * L + D;
						else {
							var U, V = (R - .25) / .75,
								k = 34 * V / 255;
							U = .5 > B ? 255 * ((1 - 2 * k) * B + k) : D, L = R * L + U
						}
						_.r[255 - D] = l(255 - L + .5 | 0), _.g[255 - D] = l(255 - L + .5 | 0), _.b[255 - D] = l(255 - L + .5 | 0)
					}
					G && a.invertHistMap(_), a.combineMultiChannelHistMaps(M, _);
					var v = Math.max(-100, Math.min(100, v)),
						R = .5 * v / 100,
						G = !1;
					0 > R && (G = !0, R = -R);
					for (var D = 0; 256 > D; D++) {
						var B = D / 255,
							L = -3.68113 + 4.829 * (D / 3 + 1) - .299125 * Math.pow(D / 3 + 1, 2) + .006449275 * Math.pow(D / 3 + 1, 3) - 474531e-10 * Math.pow(D / 3 + 1, 4);
						if (0 > L && (L = 0), .25 >= R) {
							var V = R / .25;
							L = V * L + D
						} else {
							var U, V = (R - .25) / .75,
								k = 34 * V / 255;
							U = .5 > B ? 255 * ((1 - 2 * k) * B + k) : D, L += U
						}
						x.r[D] = l(L + .5 | 0), x.g[D] = l(L + .5 | 0), x.b[D] = l(L + .5 | 0)
					}
					if (G && a.invertHistMap(x), a.combineMultiChannelHistMaps(M, x), e.moaGL) return e.moaGL.renderLegacyAdjustments(m, p, 0, 0, y, b, T, A, C, "normal", 1), e.moaGL.renderColorMap(M), !0;
					for (var j, W, H, X, z, Y, q, K, Z, $, Q, J, D = 0; D < e.data.length;) j = e.data[D], W = e.data[D + 1], H = e.data[D + 2], S && (j = y[j], W = y[W], H = y[H]), w && (q = -j + W + H, K = +j - W + H, Z = +j + W - H, X = b[j], z = b[W], Y = b[H], $ = -X + z + Y, Q = +X - z + Y, J = +X + z - Y, X += .2 * ($ - q) + ($ > q ? .5 : -.5), z += .2 * (Q - K) + (Q > K ? .5 : -.5), Y += .2 * (J - Z) + (J > Z ? .5 : -.5), X = 0 | X, z = 0 | z, Y = 0 | Y, P && (X = C[0] * X + C[3] * z + C[6] * Y, z = C[1] * X + C[4] * z + C[7] * Y, Y = C[2] * X + C[5] * z + C[8] * Y), j = l(X + .5 | 0), W = l(z + .5 | 0), H = l(Y + .5 | 0)), (F || E) && (j = M.r[j], W = M.g[W], H = M.b[H]), u[D] = j, u[D + 1] = W, u[D + 2] = H, u[D + 3] = e.data[D + 3], D += 4;
					return h ? i.blendWithBitmap(e, e, r, t.blendMode, t.alpha) : !0
				}, t.exports = o
			}, {
				"../core/MoaAllocAndCopy": 34,
				"./MoaBitmapBlend": 72,
				"./MoaHistogramMapping": 90
			}],
			70: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("./MoaHistogramMapping"),
					i = e("./MoaColorMap");
				o.brightnessToReplaceColorMatrix = function(e, t) {
					if (1 > t) var r = 0,
						o = 255 * t,
						n = [128 * (t * t + t) / 2];
					else var s = t - 1,
						r = 0,
						o = 255,
						l = 255 / 8,
						u = l * s,
						n = [l + u, 3 * l + 3 * u, 5 * l + 3 * u, 7 * l + 1.5 * u];
					var h = i.createColorMapFromListOfYValues(r, o, !0, n),
						d = [];
					d.r = h, d.g = h, d.b = h, a.mapHist(e, d)
				}, o.contrastCurve = function(e, t) {
					var r = 65 * (t - 1),
						o = 63.75,
						n = [o - r, 3 * o + .85 * r],
						s = i.createColorMapFromListOfYValues(0, 255, !0, n),
						l = [];
					l.r = s, l.g = s, l.b = s, a.mapHist(e, l)
				}, o.contrastToReplaceColorMatrix = function(e, t) {
					t -= 1;
					var r = 0,
						o = 255;
					if (0 > t) {
						r -= 128 * t, o += 128 * t, t = -(t * t);
						var n = 63.75,
							s = n * t,
							l = [n - s, 3 * n + s]
					} else {
						t = 2 * Math.sqrt(t / 2);
						var s = 20 * t,
							n = 255 / 8,
							l = [n - s, 3 * n - 1.75 * s, 5 * n + 1.5 * s, 7 * n + s]
					}
					var u = i.createColorMapFromListOfYValues(r, o, !0, l),
						h = [];
					h.r = u, h.g = u, h.b = u, a.mapHist(e, h)
				}, o.generateContrastCurveWithSatAdjust = function(e, t, r) {
					e = Math.max(-100, Math.min(100, e)), e /= 100;
					var o, a = e,
						i = Math.abs(a) + 1;
					a > 0 ? o = 110 : (a = Math.cos(Math.PI * Math.pow(Math.abs(a), .8) * .5) - 1, i = 1 / (Math.abs(a) + 1), o = 110);
					for (var n = 0; 256 > n; n++) {
						var s;
						s = o > n ? o * Math.pow(n / o, i) : 255 - (255 - o) * Math.pow((255 - n) / (255 - o), i), 0 > a && (s = n - Math.sin(Math.PI * n / 255) * (n - s)), t[n] = Math.max(0, Math.min(255, s + .5 | 0))
					}
					var l = .3 * Math.abs(a);
					r[0] = -0.787 * l + 1, r[3] = .715 * l, r[6] = .072 * l, r[1] = .213 * l, r[4] = (.715 - 1) * l + 1, r[7] = .072 * l, r[2] = .213 * l, r[5] = .715 * l, r[8] = -0.928 * l + 1
				}, o.generateExposureCurve = function(e, t) {
					e = Math.max(-100, Math.min(100, e));
					for (var r, o, a = e / 100, i = 0; 256 > i; i++) r = i / 255, o = Math.pow(r, 1 + .15 * Math.abs(a) - Math.abs(a) * Math.pow(r, .2)), 0 > a && (o = r * (1 - .25 * Math.abs(a)) - .7 * (o - r) * sin(.5 * Math.PI * r)), t[i] = Math.max(0, Math.min(255, 255 * o + .5 | 0))
				}, t.exports = o
			}, {
				"./MoaColorMap": 75,
				"./MoaHistogramMapping": 90
			}],
			71: [function(e, t, r) {
				"use strict";
				var o = e("./MoaColorMap"),
					a = e("./MoaColorMatrixTransform"),
					i = (e("./MoaHistogramMapping"), e("../core/MoaColor").prototype),
					n = (e("../core/MoaAllocAndCopy"), {}),
					s = 150;
				n.runAdjustments = function(e, t) {
					var r = t.brightness,
						n = t.exposure,
						x = t.contrast,
						M = t.shadows,
						y = t.highlights,
						b = t.saturation,
						C = t.vibrance,
						T = t.warmth,
						A = t.tint,
						S = t.fade,
						w = t.blendMode,
						P = t.alpha,
						F = 255 * P + .5 | 0,
						E = "normal" != w || 1 != P,
						D = 0 != r || 0 != n || 0 != x,
						L = 0 != M || 0 != y,
						R = 0 != b || 0 != C,
						B = 0 != T || 0 != A || 0 != S,
						O = o.createIdentityColorMap();
					if (0 != r) {
						var I = u(r);
						O = o.combineColorMaps(O, I)
					}
					if (0 != n) {
						var N = l(n);
						O = o.combineColorMaps(O, N)
					}
					if (0 != x) {
						var G = h(x);
						O = o.combineColorMaps(O, G)
					}
					var U = d(M),
						V = c(y),
						k = a.getIdentity();
					if (b + C > s) {
						var j = b + C;
						b = s * b / j, C = s * C / j
					}
					0 != C && g(k, C), 0 != b && v(k, b);
					var W = {
						r: o.createIdentityColorMap(),
						g: o.createIdentityColorMap(),
						b: o.createIdentityColorMap()
					};
					if (0 != S) {
						var H = p(S);
						W.r = o.combineColorMaps(W.r, H), W.g = o.combineColorMaps(W.g, H), W.b = o.combineColorMaps(W.b, H)
					}
					if (0 != T) {
						var X = f(T);
						W.r = o.combineColorMaps(W.r, X.r), W.g = o.combineColorMaps(W.g, X.g), W.b = o.combineColorMaps(W.b, X.b)
					}
					if (0 != A) {
						var z = m(A);
						W.r = o.combineColorMaps(W.r, z.r), W.g = o.combineColorMaps(W.g, z.g), W.b = o.combineColorMaps(W.b, z.b)
					}
					for (var Y = 0; 256 > Y; Y++) W.r[Y] = W.r[Y] < 0 ? 0 : W.r[Y] > 255 ? 255 : W.r[Y] + .5 | 0, W.g[Y] = W.g[Y] < 0 ? 0 : W.g[Y] > 255 ? 255 : W.g[Y] + .5 | 0, W.b[Y] = W.b[Y] < 0 ? 0 : W.b[Y] > 255 ? 255 : W.b[Y] + .5 | 0;

					if (D && _(O), B && (_(W.r), _(W.g), _(W.b)), D && (_(U), _(V)), e.moaGL) return e.moaGL.renderAdjustments(e, O, U, V, k, W, w, P), !0;
					for (var q = e.data, K = e.width * e.height, Y = 0; K > Y; Y++) {
						var Z = 4 * Y,
							$ = q[Z],
							Q = q[Z + 1],
							J = q[Z + 2];
						if (D && ($ = O[$], Q = O[Q], J = O[J]), L) {
							var ee = .3 * $ + .59 * Q + .11 * J,
								te = ee + .5 | 0,
								re = V[te] + U[te] - 2 * ee;
							$ += re, Q += re, J += re, $ = 0 > $ ? 0 : $ > 255 ? 255 : $, Q = 0 > Q ? 0 : Q > 255 ? 255 : Q, J = 0 > J ? 0 : J > 255 ? 255 : J
						}
						if (R) {
							var oe = $,
								ae = Q,
								ie = J;
							$ = k[0] * oe + k[1] * ae + k[2] * ie + k[3], Q = k[4] * oe + k[5] * ae + k[6] * ie + k[7], J = k[8] * oe + k[9] * ae + k[10] * ie + k[11], $ = 0 > $ ? 0 : $ > 255 ? 255 : $, Q = 0 > Q ? 0 : Q > 255 ? 255 : Q, J = 0 > J ? 0 : J > 255 ? 255 : J
						}
						if (B && ($ = $ + .5 | 0, Q = Q + .5 | 0, J = J + .5 | 0, $ = W.r[$], Q = W.g[Q], J = W.b[J]), $ = $ + .5 | 0, Q = Q + .5 | 0, J = J + .5 | 0, E) {
							var ne = {
								r: $,
								g: Q,
								b: J,
								a: F
							};
							i.blendEmbededAlphaFromArray(q, Z, ne, w)
						} else q[Z] = $, q[Z + 1] = Q, q[Z + 2] = J
					}
					return !0
				};
				var l = function(e) {
						e = -100 > e ? -100 : e > 100 ? 100 : e, e = 0 > e ? -e * e / 100 : e * e / 100;
						var t = e,
							r = 255 + t;
						return o.createColorMapFromListOfYValues(t, r, !1)
					},
					u = function(e) {
						e = -100 > e ? -100 : e > 100 ? 100 : e;
						var t = e / 100,
							r = 42.5,
							a = 2 * r * t,
							i = [r + .6 * a, 3 * r + a, 5 * r + .5 * a];
						return o.createColorMapFromListOfYValues(0, 255, !1, i)
					},
					h = function(e) {
						e = -100 > e ? -100 : e > 100 ? 100 : e;
						var t;
						t = 0 > e ? e / 200 : e / 100;
						var r = 63.75,
							a = r * t,
							i = [r - a, 3 * r + a];
						return o.createColorMapFromListOfYValues(0, 255, !1, i)
					},
					d = function(e) {
						if (0 != e) {
							e = -100 > e ? -100 : e > 100 ? 100 : e;
							var t = e / 100;
							0 > t && (t *= 1.25);
							var r = 25.5,
								a = t * r,
								i = [r + a, 3 * r + .75 * a, 5 * r, 7 * r, 9 * r],
								n = a;
							return o.createColorMapFromListOfYValues(n, 255, !1, i)
						}
						return o.createIdentityColorMap()
					},
					c = function(e) {
						if (0 != e) {
							e = -100 > e ? -100 : e > 100 ? 100 : e;
							var t = e / 100;
							t > 0 && (t *= 1.25);
							var r = 25.5,
								a = t * r,
								i = [r, 3 * r, 5 * r, 7 * r + a, 9 * r + a],
								n = 255 + .75 * a;
							return o.createColorMapFromListOfYValues(0, n, !1, i)
						}
						return o.createIdentityColorMap()
					},
					f = function(e) {
						e = -100 > e ? -100 : e > 100 ? 100 : e;
						var t, r, a, i = e / 100;
						if (-.6 > i) {
							var n = -(i + .6) / .4;
							t = -15 * (1 - n) + -90 * n, r = 5 * (1 - n) + -10 * n, a = 60 * (1 - n) + 100 * n
						} else if (0 > i) {
							var n = -i / .6;
							t = -15 * n, r = 5 * n, a = 60 * n
						} else if (i > .6) {
							var n = (i - .6) / .4;
							t = 30 * (1 - n) + 65 * n, r = 10 * (1 - n) + -5 * n, a = -30 * (1 - n) + -127.5 * n
						} else {
							var n = i / .6;
							t = 30 * n, r = 10 * n, a = -30 * n
						}
						var s = 127.5 + t,
							l = 127.5 + r,
							u = 127.5 + a,
							h = .35 * t,
							d = .35 * r,
							c = .35 * a,
							f = 0 > t ? 255 + t : 255 + .5 * t,
							m = 0 > r ? 255 + r : 255 + .5 * r,
							p = 0 > a ? 255 + a : 255 + .5 * a,
							g = o.createColorMapFromListOfYValues(h, f, !1, [s]),
							v = o.createColorMapFromListOfYValues(d, m, !1, [l]),
							_ = o.createColorMapFromListOfYValues(c, p, !1, [u]);
						return {
							r: g,
							g: v,
							b: _
						}
					},
					m = function(e) {
						e = -100 > e ? -100 : e > 100 ? 100 : e;
						var t, r, a, i = e / 100;
						if (-.6 > i) {
							var n = -(i + .6) / .4;
							t = -10 * (1 - n) + -90 * n, r = 45 * (1 - n) + 40 * n, a = -20 * (1 - n) + -70 * n
						} else if (0 > i) {
							var n = -i / .6;
							t = -10 * n, r = 45 * n, a = -20 * n
						} else if (i > .6) {
							var n = (i - .6) / .4;
							t = 15 * (1 - n) + 45 * n, r = -15 * (1 - n) + -75 * n, a = 25 * (1 - n) + 45 * n
						} else {
							var n = i / .6;
							t = 15 * n, r = -15 * n, a = 25 * n
						}
						var s = 127.5 + t,
							l = 127.5 + r,
							u = 127.5 + a,
							h = .35 * t,
							d = .35 * r,
							c = .35 * a,
							f = 0 > t ? 255 + t : 255 + .5 * t,
							m = 0 > r ? 255 + r : 255 + .5 * r,
							p = 0 > a ? 255 + a : 255 + .5 * a,
							g = o.createColorMapFromListOfYValues(h, f, !1, [s]),
							v = o.createColorMapFromListOfYValues(d, m, !1, [l]),
							_ = o.createColorMapFromListOfYValues(c, p, !1, [u]);
						return {
							r: g,
							g: v,
							b: _
						}
					},
					p = function(e) {
						e = -100 > e ? -100 : e > 100 ? 100 : e;
						var t, r = e / 100;
						t = 0 > r ? 128 * r : 72 * r;
						var a = 255 - .5 * t,
							i = 63.75,
							n = [i, 3 * i];
						return o.createColorMapFromListOfYValues(t, a, !1, n)
					},
					g = function(e, t) {
						t = -100 > t ? -100 : t > 100 ? 100 : t;
						var r = t / 100;
						r = 0 > t ? 1 - r * r : 1 + 1.8 * r * r, a.adjustVibrance(e, r)
					},
					v = function(e, t) {
						t = -100 > t ? -100 : t > 100 ? 100 : t;
						var r = t / 100;
						r = 0 > t ? 1 - r * r : 1 + 1.5 * r * r, a.adjSaturation(e, r)
					},
					_ = function(e) {
						for (var t = 0; t < e.length; t++) e[t] = e[t] + .5 | 0
					};
				t.exports = n
			}, {
				"../core/MoaAllocAndCopy": 34,
				"../core/MoaColor": 36,
				"./MoaColorMap": 75,
				"./MoaColorMatrixTransform": 76,
				"./MoaHistogramMapping": 90
			}],
			72: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../core/MoaEnums"),
					i = e("../core/MoaColor");
				o.blendWithBitmap = function(e, t, r, o, n) {
					{
						var s = a.getBlendModeIndex(o);
						t.data, r.data
					} - 1 == s && (s = a.getBlendModeIndex("normal"));
					var l, u, h, d, c = "normal" === o && 1 === l,
						f = e.data.length / 4,
						m = new i;
					for (u = 0; f > u; u++) {
						h = 4 * u;
						var p = {
							r: r.data[h],
							g: r.data[h + 1],
							b: r.data[h + 2],
							a: r.data[h + 3] * n | 0
						};
						if (c) e.data[h] = p.r, e.data[h + 1] = p.g, e.data[h + 2] = p.b;
						else {
							var d = [t.data[h], t.data[h + 1], t.data[h + 2], t.data[h + 3]];
							m.blendEmbededAlphaFromArray(d, 0, p, o), e.data[h] = d[0], e.data[h + 1] = d[1], e.data[h + 2] = d[2]
						}
						e.data[u + 3] + 255
					}
					return !0
				}, o.blendWithBitmapSeparate = function(e, t, r, o) {
					if (!e.glData) {
						var a, i, n, s, l, u, h, d = e.width,
							c = e.height,
							f = t.width,
							m = t.height;
						for (i = 0; c > i && m > i; i++)
							for (a = 0; d > a && f > a; a++) n = 4 * (a + d * i), s = 4 * (a + f * i), l = e.data[n] * r + t.data[s] * o | 0, u = e.data[n + 1] * r + t.data[s + 1] * o | 0, h = e.data[n + 2] * r + t.data[s + 2] * o | 0, e.data[n] = l > 255 ? 255 : 0 > l ? 0 : l, e.data[n + 1] = u > 255 ? 255 : 0 > u ? 0 : u, e.data[n + 2] = h > 255 ? 255 : 0 > h ? 0 : h
					}
				}, t.exports = o
			}, {
				"../core/MoaColor": 36,
				"../core/MoaEnums": 38
			}],
			73: [function(e, t, r) {
				"use strict";
				var o = {},
					a = (e("./MoaColorMatrixTransform"), e("./MoaHistogramMapping")),
					i = e("../core/MoaEnums"),
					n = e("../core/MoaColor"),
					s = function(e, t, r, o, a) {
						var i = [];
						i.r = [], i.g = [], i.b = [];
						var n = 1 - a;
						if ("normal" == e)
							for (var s = 0; 256 > s; s++) i.r[s] = n * s + a * t + .5 | 0, i.g[s] = n * s + a * r + .5 | 0, i.b[s] = n * s + a * o + .5 | 0, i.r[s] = i.r[s] > 255 ? 255 : i.r[s] < 0 ? 0 : i.r[s], i.g[s] = i.g[s] > 255 ? 255 : i.g[s] < 0 ? 0 : i.g[s], i.b[s] = i.b[s] > 255 ? 255 : i.b[s] < 0 ? 0 : i.b[s];
						else if ("overlay" == e)
							for (var s = 0; 256 > s; s++) 64 >= s ? (i.r[s] = n * s + 2 * a * s * t / 255 + .5 | 0, i.g[s] = n * s + 2 * a * s * r / 255 + .5 | 0, i.b[s] = n * s + 2 * a * s * o / 255 + .5 | 0) : s >= 192 ? (i.r[s] = n * s + a * (255 - (255 - s) * (255 - t) / 127.5) + .5 | 0, i.g[s] = n * s + a * (255 - (255 - s) * (255 - r) / 127.5) + .5 | 0, i.b[s] = n * s + a * (255 - (255 - s) * (255 - o) / 127.5) + .5 | 0) : (histmap.r[s] = n * s + a * (s * s * (510 - 4 * t) / 255 / 255 + s * (4 * t - 255) / 255 + (255 - 2 * t) / 8), histmap.g[s] = n * s + a * (s * s * (510 - 4 * r) / 255 / 255 + s * (4 * r - 255) / 255 + (255 - 2 * r) / 8), histmap.b[s] = n * s + a * (s * s * (510 - 4 * o) / 255 / 255 + s * (4 * o - 255) / 255 + (255 - 2 * o) / 8)), i.r[s] = i.r[s] > 255 ? 255 : i.r[s] < 0 ? 0 : i.r[s], i.g[s] = i.g[s] > 255 ? 255 : i.g[s] < 0 ? 0 : i.g[s], i.b[s] = i.b[s] > 255 ? 255 : i.b[s] < 0 ? 0 : i.b[s];
						else if ("multiply" == e)
							for (var s = 0; 256 > s; s++) i.r[s] = n * s + a * t * s / 255 + .5 | 0, i.g[s] = n * s + a * r * s / 255 + .5 | 0, i.b[s] = n * s + a * o * s / 255 + .5 | 0, i.r[s] = i.r[s] > 255 ? 255 : i.r[s] < 0 ? 0 : i.r[s], i.g[s] = i.g[s] > 255 ? 255 : i.g[s] < 0 ? 0 : i.g[s], i.b[s] = i.b[s] > 255 ? 255 : i.b[s] < 0 ? 0 : i.b[s];
						else if ("darken" == e)
							for (var s = 0; 256 > s; s++) i.r[s] = n * s + a * (t > s ? s : t) + .5 | 0, i.g[s] = n * s + a * (r > s ? s : r) + .5 | 0, i.b[s] = n * s + a * (o > s ? s : o) + .5 | 0, i.r[s] = i.r[s] > 255 ? 255 : i.r[s] < 0 ? 0 : i.r[s], i.g[s] = i.g[s] > 255 ? 255 : i.g[s] < 0 ? 0 : i.g[s], i.b[s] = i.b[s] > 255 ? 255 : i.b[s] < 0 ? 0 : i.b[s];
						else if ("screen" == e)
							for (var s = 0; 256 > s; s++) i.r[s] = n * s + a * (255 - (255 - s) * (255 - t) / 255) + .5 | 0, i.g[s] = n * s + a * (255 - (255 - s) * (255 - r) / 255) + .5 | 0, i.b[s] = n * s + a * (255 - (255 - s) * (255 - o) / 255) + .5 | 0, i.r[s] = i.r[s] > 255 ? 255 : i.r[s] < 0 ? 0 : i.r[s], i.g[s] = i.g[s] > 255 ? 255 : i.g[s] < 0 ? 0 : i.g[s], i.b[s] = i.b[s] > 255 ? 255 : i.b[s] < 0 ? 0 : i.b[s];
						else if ("soft" == e)
							for (var l, s = 0; 256 > s; s++) l = s * t >> 8, i.r[s] = n * s + opacityOrig * (l + (s * (255 - ((255 - s) * (255 - t) >> 8) - l) >> 8)) + .5 | 0, l = s * r >> 8, i.g[s] = n * s + opacityOrig * (l + (s * (255 - ((255 - s) * (255 - r) >> 8) - l) >> 8)) + .5 | 0, l = s * o >> 8, i.b[s] = n * s + opacityOrig * (l + (s * (255 - ((255 - s) * (255 - o) >> 8) - l) >> 8)) + .5 | 0, i.r[s] = i.r[s] > 255 ? 255 : i.r[s] < 0 ? 0 : i.r[s], i.g[s] = i.g[s] > 255 ? 255 : i.g[s] < 0 ? 0 : i.g[s], i.b[s] = i.b[s] > 255 ? 255 : i.b[s] < 0 ? 0 : i.b[s];
						return i
					};
				o.blendWithColor = function(e, t) {
					var r = (e.width, e.height, []);
					r.r = [], r.g = [], r.b = [];
					var o, s = i.getBlendModeIndex(t.blendMode),
						l = t.color;
					o = t.hasOwnProperty("alpha") ? t.alpha : 1;
					var u, h, d;
					u = l.r, h = l.g, d = l.b;
					var c, f = new n;
					if (2 == s) {
						var m = f.rgb2hsl(l.r, l.g, l.b);
						if (e.moaGL) return e.moaGL.renderColorBlendColor(m, l.a / 255, o), !0;
						for (var p = 0; p < e.data.length; p += 4) f.colorBlendColorFromArray(e.data, p, m, l.a, o)
					} else {
						var p;
						for (l.a = Math.floor(255 * o + .5), p = 0; 256 > p; p++) c = [p, p, p, 255], f.blendEmbededAlphaFromArray(c, 0, l, t.blendMode), r.r[p] = c[0], r.g[p] = c[1], r.b[p] = c[2];
						a.mapHist(e, r)
					}
				}, o.colorOverlay = function(e, t, r, o, i) {
					var n = s("overlay", t, r, o, i);
					a.mapHist(e, n)
				}, o.colorMultiply = function(e, t, r, o, i) {
					var n = s("multiply", t, r, o, i);
					a.mapHist(e, n)
				}, o.colorDarken = function(e, t, r, o, i) {
					var n = s("darken", t, r, o, i);
					a.mapHist(e, n)
				}, o.colorSoft = function(e, t, r, o, i) {
					var n = s("soft", t, r, o, i);
					a.mapHist(e, n)
				}, o.colorColor = function(e, t, r, o, a) {
					var i, n, s, l, u, h, d, c, f, m = e.width,
						p = e.height,
						g = 1 - a;
					d = t / 255, c = r / 255, f = o / 255;
					var v, _, x = Math.max(d, c, f),
						M = Math.min(d, c, f),
						y = (x + M) / 2;
					if (x == M) v = _ = 0;
					else {
						var b = x - M;
						switch (_ = y > .5 ? b / (2 - x - M) : b / (x + M), x) {
							case d:
								v = (c - f) / b + (f > c ? 6 : 0);
								break;
							case c:
								v = (f - d) / b + 2;
								break;
							case f:
								v = (d - c) / b + 4
						}
						v /= 6
					}
					if (e.moaGL) return e.moaGL.renderColorBlendColor([v, _, y], 1, a), !0;
					for (h = 0; p > h; h++)
						for (u = 0; m > u; u++) {
							l = 4 * (h * m + u), i = e.data[l], n = e.data[l + 1], s = e.data[l + 2];
							var C = i,
								T = n,
								A = s;
							y = (.212671 * i + .71516 * n + .072169 * s) / 255;
							var S = 6 * v,
								w = y > .5 ? 2 * _ * (1 - y) : 2 * _ * y,
								P = w * (1 - Math.abs(S % 2 - 1));
							1 > S ? (i = w, n = P, s = 0) : 2 > S ? (i = P, n = w, s = 0) : 3 > S ? (i = 0, n = w, s = P) : 4 > S ? (i = 0, n = P, s = w) : 5 > S ? (i = P, n = 0, s = w) : 6 > S && (i = w, n = 0, s = P);
							var F = y - .5 * w;
							i = 255 * (i + F) + .5 | 0, n = 255 * (n + F) + .5 | 0, s = 255 * (s + F) + .5 | 0, i = i > 255 ? 255 : 0 > i ? 0 : i, n = n > 255 ? 255 : 0 > n ? 0 : n, s = s > 255 ? 255 : 0 > s ? 0 : s, i = g * C + a * i, n = g * T + a * n, s = g * A + a * s, i = i > 255 ? 255 : 0 > i ? 0 : i, n = n > 255 ? 255 : 0 > n ? 0 : n, s = s > 255 ? 255 : 0 > s ? 0 : s, e.data[l] = i, e.data[l + 1] = n, e.data[l + 2] = s
						}
				}, o.colorScreen = function(e, t, r, o, i) {
					var n = s("screen", t, r, o, i);
					a.mapHist(e, n)
				}, o.normalBlend = function(e, t, r, o, i) {
					var n = s("normal", t, r, o, i);
					a.mapHist(e, n)
				}, t.exports = o
			}, {
				"../core/MoaColor": 36,
				"../core/MoaEnums": 38,
				"./MoaColorMatrixTransform": 76,
				"./MoaHistogramMapping": 90
			}],
			74: [function(e, t, r) {
				"use strict";
				var o = {};
				o.initalizeRGB2LABMapping = function() {
					for (var e = new Array, t = 0; 256 > t; t++) e[t] = .04045 >= t / 255 ? 100 * t / 255 / 12.92 : 100 * Math.pow((t / 255 + .055) / 1.055, 2.4);
					return e
				}, o.initializeCBRTMapping = function() {
					for (var e = new Array, t = 1024, r = 0; t > r; r++) e[r] = Math.pow(r / (t - 1), 1 / 3);
					return e
				}, o.rgb2lab = function(e, t, r, o) {
					"object" != typeof o && (o = [0, .030352698354883748, .060705396709767497, .09105809506465125, .12141079341953499, .15176349177441875, .1821161901293025, .21246888848418624, .24282158683906999, .27317428519395376, .3035269835488375, .3346535763899161, .3676507324047436, .40247170184963066, .43914420374102936, .4776953480693729, .5181516702338386, .5605391624202722, .6048833022857054, .6512090792594475, .6995410187265387, .7499032043226175, .8023192985384995, .8568125618069307, .9134058702220788, .9721217320237849, 1.0329823029626937, 1.0960094006488246, 1.1612245179743885, 1.2286488356915872, 1.2983032342173013, 1.3702083047289686, 1.4443843596092545, 1.520851442291271, 1.599629336550963, 1.6807375752887384, 1.7641954488384077, 1.8500220128379696, 1.9382360956935722, 2.02885630566524, 2.1219010376003555, 2.2173884793387386, 2.315336617811041, 2.4157632448504756, 2.518685962736163, 2.6241221894849898, 2.7320891639074896, 2.8426039504420793, 2.95568344378088, 3.0713443732993633, 3.1896033073011534, 3.3104766570885054, 3.433980680868217, 3.5601314875020345, 3.688945040110004, 3.82043715953465, 3.9546235276732835, 4.091519690685319, 4.231141062080967, 4.3735029256973466, 4.518620438567554, 4.666508633688009, 4.8171824226889415, 4.970656598412723, 5.126945837404324, 5.286064702318025, 5.448027644244237, 5.612849004960009, 5.780543019106723, 5.95112381629812, 6.124605423161761, 6.301001765316768, 6.480326669290577, 6.662593864377289, 6.8478169844400165, 7.036009569659588, 7.227185068231748, 7.421356838014963, 7.618538148130785, 7.818742180518632, 8.021982031446832, 8.22827071298148, 8.437621154414881, 8.650046203654977, 8.865558628577293, 9.084171118340768, 9.305896284668744, 9.53074666309647, 9.758734714186247, 9.989872824711389, 10.224173308810132, 10.461648409110419, 10.702310297826761, 10.946171077829932, 11.193242783690561, 11.443537382697373, 11.697066775851084, 11.953842798834561, 12.213877222960187, 12.47718175609505, 12.743768043564744, 13.013647669036429, 13.286832155381797, 13.563332965520566, 13.843161503245183, 14.126329114027165, 14.412847085805778, 14.702726649759498, 14.995978981060857, 15.292615199615017, 15.59264637078274, 15.89608350608804, 16.2029375639111, 16.513219450166762, 16.826940018969076, 17.14411007328226, 17.464740365558505, 17.78884159836291, 18.116424424986022, 18.4474994500441, 18.782077230067788, 19.120168274079138, 19.46178304415758, 19.806931955994887, 20.155625379439705, 20.507873639031693, 20.863687014525574, 21.223075741405523, 21.586050011389926, 21.95261997292692, 22.32279573168085, 22.696587351009835, 23.074004852434914, 23.45505821610052, 23.839757381227102, 24.228112246555487, 24.620132670783548, 25.015828472995345, 25.415209433082676, 25.818285292159583, 26.225065752969623, 26.635560480286248, 27.04977910130658, 27.467731206038465, 27.88942634768104, 28.31487404299921, 28.74408377269175, 29.17706498175359, 29.613827079832113, 30.05437944157765, 30.49873140698863, 30.946892281750856, 31.398871337571755, 31.854677812509184, 32.31432091129508, 32.777809805654215, 33.245153634617935, 33.71636150483304, 34.191442490866095, 34.67040563550296, 35.15325995004394, 35.640014414594354, 36.13067797835095, 36.62525955988395, 37.12376804741491, 37.62621229909065, 38.13260114325301, 38.6429433787049, 39.157247774972326, 39.67552307256268, 40.19777798321958, 40.72402119017367, 41.25426134839037, 41.788507084813745, 42.32676699860717, 42.86904966139066, 43.415363617474895, 43.96571738409188, 44.52011945162278, 45.078578283822345, 45.64110231804047, 46.20769996544071, 46.7783796112159, 47.353149614800955, 47.93201831008268, 48.514994005607036, 49.10208498478356, 49.693299506087044, 50.28864580325687, 50.888132085493375, 51.49176653765214, 52.09955732043543, 52.711512570581306, 53.32764040105052, 53.947948901210715, 54.57244613701866, 55.201140151200015, 55.83403896342679, 56.471150570492924, 57.11248294648731, 57.75804404296506, 58.40784178911641, 59.06188409193369, 59.720178836376334, 60.38273388553378, 61.04955708078648, 61.72065624196511, 62.39603916750761, 63.07571363461469, 63.75968739940326, 64.44796819705822, 65.14056374198242, 65.83748172794485, 66.5387298282272, 67.24431569576875, 67.95424696330939, 68.66853124353135, 69.38717612919899, 70.11018919329732, 70.83757798916868, 71.56935005064807, 72.30551289219693, 73.04607400903537, 73.79104087727309, 74.54042095403875, 75.29422167760778, 76.05245046752924, 76.8151147247507, 77.58222183174236, 78.35377915261935, 79.12979403326302, 79.9102738014409, 80.69522576692516, 81.48465722161012, 82.27857543962836, 83.07698767746547, 83.879901174074, 84.6873231509858, 85.49926081242339, 86.31572134541024, 87.13671191987972, 87.96223968878317, 88.79231178819663, 89.62693533742664, 90.46611743911495, 91.30986517934193, 92.15818562772947, 93.01108583754237, 93.8685728457888, 94.73065367331999, 95.59733532492861, 96.46862478944651, 97.34452903984125, 98.22505503331172, 99.11020971138298, 100]);
					var a, i, n, s, l, u;
					return e = o[e], t = o[t], r = o[r], s = .00433891 * e + .00376234915 * t + .0018990604648 * r, l = .002126 * e + .007152 * t + 722e-6 * r, u = 177255e-9 * e + .00109475308 * t + .0087295537 * r, s = s > .008856 ? Math.pow(s, 1 / 3) : 7.787 * s + 16 / 116, l = l > .008856 ? Math.pow(l, 1 / 3) : 7.787 * l + 16 / 116, u = u > .008856 ? Math.pow(u, 1 / 3) : 7.787 * u + 16 / 116, a = 116 * l - 16, i = 500 * (s - l), n = 200 * (l - u), [2.55 * a, i + 127, n + 127]
				};
				var a = [0, .030352698354883748, .060705396709767497, .09105809506465125, .12141079341953499, .15176349177441875, .1821161901293025, .21246888848418624, .24282158683906999, .27317428519395376, .3035269835488375, .3346535763899161, .3676507324047436, .40247170184963066, .43914420374102936, .4776953480693729, .5181516702338386, .5605391624202722, .6048833022857054, .6512090792594475, .6995410187265387, .7499032043226175, .8023192985384995, .8568125618069307, .9134058702220788, .9721217320237849, 1.0329823029626937, 1.0960094006488246, 1.1612245179743885, 1.2286488356915872, 1.2983032342173013, 1.3702083047289686, 1.4443843596092545, 1.520851442291271, 1.599629336550963, 1.6807375752887384, 1.7641954488384077, 1.8500220128379696, 1.9382360956935722, 2.02885630566524, 2.1219010376003555, 2.2173884793387386, 2.315336617811041, 2.4157632448504756, 2.518685962736163, 2.6241221894849898, 2.7320891639074896, 2.8426039504420793, 2.95568344378088, 3.0713443732993633, 3.1896033073011534, 3.3104766570885054, 3.433980680868217, 3.5601314875020345, 3.688945040110004, 3.82043715953465, 3.9546235276732835, 4.091519690685319, 4.231141062080967, 4.3735029256973466, 4.518620438567554, 4.666508633688009, 4.8171824226889415, 4.970656598412723, 5.126945837404324, 5.286064702318025, 5.448027644244237, 5.612849004960009, 5.780543019106723, 5.95112381629812, 6.124605423161761, 6.301001765316768, 6.480326669290577, 6.662593864377289, 6.8478169844400165, 7.036009569659588, 7.227185068231748, 7.421356838014963, 7.618538148130785, 7.818742180518632, 8.021982031446832, 8.22827071298148, 8.437621154414881, 8.650046203654977, 8.865558628577293, 9.084171118340768, 9.305896284668744, 9.53074666309647, 9.758734714186247, 9.989872824711389, 10.224173308810132, 10.461648409110419, 10.702310297826761, 10.946171077829932, 11.193242783690561, 11.443537382697373, 11.697066775851084, 11.953842798834561, 12.213877222960187, 12.47718175609505, 12.743768043564744, 13.013647669036429, 13.286832155381797, 13.563332965520566, 13.843161503245183, 14.126329114027165, 14.412847085805778, 14.702726649759498, 14.995978981060857, 15.292615199615017, 15.59264637078274, 15.89608350608804, 16.2029375639111, 16.513219450166762, 16.826940018969076, 17.14411007328226, 17.464740365558505, 17.78884159836291, 18.116424424986022, 18.4474994500441, 18.782077230067788, 19.120168274079138, 19.46178304415758, 19.806931955994887, 20.155625379439705, 20.507873639031693, 20.863687014525574, 21.223075741405523, 21.586050011389926, 21.95261997292692, 22.32279573168085, 22.696587351009835, 23.074004852434914, 23.45505821610052, 23.839757381227102, 24.228112246555487, 24.620132670783548, 25.015828472995345, 25.415209433082676, 25.818285292159583, 26.225065752969623, 26.635560480286248, 27.04977910130658, 27.467731206038465, 27.88942634768104, 28.31487404299921, 28.74408377269175, 29.17706498175359, 29.613827079832113, 30.05437944157765, 30.49873140698863, 30.946892281750856, 31.398871337571755, 31.854677812509184, 32.31432091129508, 32.777809805654215, 33.245153634617935, 33.71636150483304, 34.191442490866095, 34.67040563550296, 35.15325995004394, 35.640014414594354, 36.13067797835095, 36.62525955988395, 37.12376804741491, 37.62621229909065, 38.13260114325301, 38.6429433787049, 39.157247774972326, 39.67552307256268, 40.19777798321958, 40.72402119017367, 41.25426134839037, 41.788507084813745, 42.32676699860717, 42.86904966139066, 43.415363617474895, 43.96571738409188, 44.52011945162278, 45.078578283822345, 45.64110231804047, 46.20769996544071, 46.7783796112159, 47.353149614800955, 47.93201831008268, 48.514994005607036, 49.10208498478356, 49.693299506087044, 50.28864580325687, 50.888132085493375, 51.49176653765214, 52.09955732043543, 52.711512570581306, 53.32764040105052, 53.947948901210715, 54.57244613701866, 55.201140151200015, 55.83403896342679, 56.471150570492924, 57.11248294648731, 57.75804404296506, 58.40784178911641, 59.06188409193369, 59.720178836376334, 60.38273388553378, 61.04955708078648, 61.72065624196511, 62.39603916750761, 63.07571363461469, 63.75968739940326, 64.44796819705822, 65.14056374198242, 65.83748172794485, 66.5387298282272, 67.24431569576875, 67.95424696330939, 68.66853124353135, 69.38717612919899, 70.11018919329732, 70.83757798916868, 71.56935005064807, 72.30551289219693, 73.04607400903537, 73.79104087727309, 74.54042095403875, 75.29422167760778, 76.05245046752924, 76.8151147247507, 77.58222183174236, 78.35377915261935, 79.12979403326302, 79.9102738014409, 80.69522576692516, 81.48465722161012, 82.27857543962836, 83.07698767746547, 83.879901174074, 84.6873231509858, 85.49926081242339, 86.31572134541024, 87.13671191987972, 87.96223968878317, 88.79231178819663, 89.62693533742664, 90.46611743911495, 91.30986517934193, 92.15818562772947, 93.01108583754237, 93.8685728457888, 94.73065367331999, 95.59733532492861, 96.46862478944651, 97.34452903984125, 98.22505503331172, 99.11020971138298, 100],
					i = [0, .09924488254695861, .12504071661525748, .14313588920856027, .1575414309575025, .16970636198605316, .18033991980928551, .18984863055466036, .19848976509391722, .20643767470661487, .21381661776730748, .2207186428753261, .22721406110407222, .2333579349114362, .2391942859295316, .24475892765281868, .2500814332305149, .25518653946003345, .2600951718542145, .26482520821552014, .26939205754235684, .27380910584090884, .27808806426285243, .2822392443945425, .28627177841712054, .2901937969941595, .2940125743549161, .2977346476408758, .3013659158571899, .30491172251223664, .3083769250994826, .311765953881872, .315082861915005, .31833136784577337, .32151489271552486, .3246365917579799, .3276993819951494, .33070596628701154, .3336588543735265, .336560381353843, .3394127239721063, .34221791501818183, .3449778561018543, .34769432901832303, .350369005889286, .3530034582361798, .3555991651191077, .35815752045576577, .360679839618571, .3631673653946448, .36562127338186107, .3680426768844678, .37043263136354043, .37279213849048415, .3751221498457724, .3774235702999315, .3796972611093207, .38194404275540383, .38416469755287136, .3863599720490726, .38853057923469275, .3906772005834086, .39280048793632477, .3949010652453065, .39697953018783444, .3990364556647021, .40107239119071786, .4030878641875543, .40508338118698156, .40705942895191655, .4090164755220073, .41095497118983254, .41287534941322973, .41477802766875577, .41666340825083015, .41853187902070177, .4203838141090141, .4222195745754141, .42403950902835275, .4258439542079576, .42763323553461496, .4294076676256808, .4311675547825421, .43291319145006824, .43464486265033075, .43636284439232104, .43806740405925904, .439758800774965, .44143728575065216, .4431031026133969, .44475648771744863, .4463976704394558, .44802687345860653, .4496443130226092, .45125019920037296, .4528447361221874, .45442812220814444, .4560005503854936, .45756220829557587, .4591132784909362, .46065393862317483, .46218436162206117, .4637047158663982, .4652151653470947, .46671586982287233, .46820698496900803, .4696886625194857, .4711610504029096, .47262429287250746, .4740785306305335, .4755239009473612, .4769605377755387, .47838857185906314, .4798081308381152, .48121933934948075, .48262231912287346, .4840171890733601, .4854040653900775, .4867830616214213, .4881542887568748, .4895178553056373, .4908738673722041, .4922224287290381, .4935636408864699, .4948976031599528, .496224412734793, .49754416472847035, .4988569522506557, .5001628664610298, .501461996624999, .5027544301674005, .5040402527242843, .5053195481928565, .5065923987796591, .5078588850470654, .5091190859581595, .5103730789200669, .5116209398258046, .5128627430947063, .514098561711485, .5153284672639881, .516552529979695, .5177708187610112, .5189834012194042, .520190343708429, .5213917113556842, .5225875680937435, .5237779766901, .524962998776162, .5261426948753368, .5273171244302366, .5284863458290399, .5296504164310403, .530809392591412, .5319633296852224, .5331122821307175, .5342563034119088, .5353954461004848, .5365297618770742, .5376593015518806, .5387841150847137, .5399042516044376, .5410197594278565, .5421306860780567, .5432370783022257, .5443389820889641, .5454364426851102, .5465295046120907, .5476182116818177, .5487026070121426, .5497827330418863, .5508586315454556, .5519303436470633, .5529979098345615, .5540613699729042, .555120763317248, .5561761285257049, .5572275036717572, .5582749262563468, .5593184332196459, .5603580609525242, .5613938453077163, .5624258216107048, .5634540246703222, .564478488789085, .5654992477732644, .5665163349427048, .5675297831403955, .5685396247418045, .5695458916639811, .5705486153744331, .5715478268997879, .5725435568342411, .5735358353478003, .5745246921943311, .5755101567194079, .5764922578679786, .577471024191847, .5784464838569776, .5794186646506286, .5803875939883189, .5813532989206311, .582315806139859, .5832751419864992, .5842313324555962, .5851844032029409, .5861343795511286, .5870812864954806, .5880251487098322, .5889659905521902, .5899038360702656, .5908387090068827, .5917706328052692, .5926996306142294, .5936257252932051, .5945489394172259, .5954692952817516, .5963868149074115, .5973015200446405, .5982134321782173, .599122572531705, .6000289620717986, .60093262151258, .6018335713196846, .6027318317143798, .6036274226775593, .6045203639536548, .6054106750544663, .606298375262915, .6071834836367179, .6080660190119893, .6089460000067677, .6098234450244732, .6106983722572941, .6115707996895061, .6124407451007265, .613308226069102, .6141732599744346, .6150358640012467, .6158960551417848, .6167538501989651, .6176092657892629, .6184623183455441, .6193130241198446, .620161399186094, .6210074594427897, .6218512206156173, .6226926982600246, .623531907763744, .6243688643492697, .6252035830762873, .6260360788440587, .626866366393762, .6276944603107898, .6285203750270028, .6293441248229434, .6301657238300099, .6309851860325884, .6318025252701481, .6326177552392989, .63343088949581, .6342419414565944, .6350509244016576, .6358578514760097, .6366627356915467, .6374655899288959, .6382664269392303, .6390652593460512, .6398620996469384, .6406569602152721, .6414498533019224, .6422407910369122, .6430297854310497, .6438168483775332, .6446019916535295, .6453852269217243, .6461665657318468, .646946019522169, .6477235996209785, .6484993172480279, .6492731835159596, .6500452094317067, .6508154058978702, .651583783714075, .6523503535783013, .6531151260881964, .653878111742364, .6546393209416315, .6553987639902987, .6561564510973654, .6569123923777382, .6576665978534199, .6584190774546778, .6591698410211952, .6599188983032032, .660666258962595, .6614119325740231, .6621559286259783, .6628982565218523, .6636389255809841, .6643779450396892, .6651153240522729, .665851071692029, .6665851969522216, .667317708747053, .6680486159126159, .6687779272078317, .6695056513153739, .6702317968425779, .6709563723223373, .6716793862139855, .6724008469041655, .673120762707686, .6738391418683641, .6745559925598569, .675271322886479, .6759851408840097, .6766974545204868, .6774082716969896, .67811760024841, .6788254479442125, .6795318224891835, .6802367315241687, .6809401826268009, .6816421833122166, .6823427410337628, .6830418631836931, .6837395570938545, .6844358300363635, .6851306892242741, .6858241418122343, .6865161948971349, .6872068555187488, .687896130660361, .6885840272493903, .689270552158001, .6899557122037085, .6906395141499742, .6913219647067927, .6920030705312724, .6926828382282061, .6933612743506347, .6940383854004035, .6947141778287103, .6953886580366461, .6960618323757292, .6967337071484312, .6974042886086962, .6980735829624533, .6987415963681218, .6994083349371105, .7000738047343085, .7007380117785719, .7014009620432023, .7020626614564196, .7027231159018287, .7033823312188793, .7040403132033212, .7046970676076518, .7053526001415594, .7060069164723595, .7066600222254262, .7073119229846179, .7079626242926972, .7086121316517457, .7092604505235738, .7099075863301242, .7105535444538713, .7111983302382154, .7118419489878712, .7124844059692523, .71312570641085, .7137658555036082, .7144048584012926, .7150427202208567, .7156794460428013, .7163150409115315, .7169495098357082, .7175828577885948, .7182150897084011, .718846210498622, .7194762250283715, .720105138132714, .7207329546129908, .721359679237142, .721985316740026, .7226098718237337, .7232333491578999, .7238557533800104, .7244770890957053, .7250973608790793, .7257165732729777, .7263347307892896, .7269518379092367, .7275678990836596, .7281829187333003, .728796901249081, .7294098509923802, .7300217722953055, .7306326694609626, .7312425467637221, .7318514084494824, .7324592587359297, .7330661018127955, .7336719418421106, .7342767829584559, .7348806292692114, .735483484854801, .7360853537689355, .7366862400388527, .737286147665554, .7378850806240391, .7384830428635379, .7390800383077395, .7396760708550189, .7402711443786605, .7408652627270808, .741458429724046, .7420506491688895, .7426419248367259, .7432322604786622, .7438216598220084, .7444101265704832, .7449976644044198, .7455842769809682, .7461699679342954, .7467547408757834, .7473385993942256, .7479215470560205, .748503587405363, .7490847239644346, .7496649602335902, .7502442996915447, .7508227457955557, .7514003019816053, .7519769716645798, .7525527582384471, .7531276650764331, .753701695531195, .7542748529349934, .754847140599863, .7554185618177804, .7559891198608314, .7565588179813753, .7571276594122083, .757695647366725, .7582627850390781, .7588290756043364, .7593945222186415, .7599591280193618, .7605228961252469, .7610858296365782, .7616479316353195, .7622092051852651, .7627696533321872, .7633292791039805, .7638880855108077, .7644460755452401, .7650032521824002, .7655596183801003, .7661151770789814, .7666699312026493, .7672238836578102, .7677770373344053, .7683293951057427, .7688809598286291, .7694317343435, .7699817214745477, .7705309240298498, .7710793448014944, .7716269865657057, .7721738520829675, .772719944098145, .7732652653406075, .7738098185243465, .7743536063480964, .7748966314954512, .775438896634981, .7759804044203481, .7765211574904205, .7770611584693855, .7776004099668616, .7781389145780099, .778676674883643, .7792136934503352, .7797499728305293, .7802855155626435, .7808203241711775, .7813544011668172, .7818877490465378, .7824203702937074, .782952267378188, .783483442756437, .7840138988716062, .7845436381536416, .7850726630193806, .7856009758726495, .7861285791043594, .7866554750926015, .7871816662027413, .7877071547875124, .7882319431871087, .7887560337292759, .7892794287294033, .7898021304906129, .7903241413038489, .7908454634479661, .7913660991898175, .7918860507843407, .7924053204746444, .7929239104920931, .7934418230563915, .7939590603756689, .7944756246465603, .7949915180542906, .7955067427727543, .7960213009645972, .7965351947812954, .7970484263632353, .7975609978397913, .7980729113294042, .7985841689396577, .7990947727673552, .799604724898595, .8001140274088461, .8006226823630215, .8011306918155525, .8016380578104618, .8021447823814357, .8026508675518954, .8031563153350691, .8036611277340616, .8041653067419244, .8046688543417252, .8051717725066162, .8056740631999023, .8061757283751086, .8066767699760472, .8071771899368835, .8076769901822017, .8081761726270704, .8086747391771066, .8091726917285403, .8096700321682774, .8101667623739631, .810662884214044, .81115839954783, .8116533102255556, .8121476180884412, .8126413249687521, .8131344326898597, .8136269430663002, .8141188579038331, .8146101789994995, .8151009081416802, .8155910471101533, .8160805976761496, .8165695616024108, .8170579406432438, .8175457365445769, .8180329510440145, .8185195858708919, .8190056427463286, .8194911233832824, .8199760294866028, .8204603627530825, .8209441248715112, .8214273175227265, .8219099423796651, .8223920011074144, .8228734953632629, .8233544267967502, .8238347970497164, .8243146077563521, .8247938605432471, .8252725570294385, .8257506988264595, .8262282875383863, .8267053247618866, .8271818120862655, .8276577510935128, .8281331433583488, .82860799044827, .8290822939235957, .8295560553375114, .8300292762361152, .830501958158461, .830974102636603, .8314457111956398, .831916785353757, .8323873266222709, .8328573365056704, .8333268165016603, .8337957681012022, .8342641927885572, .8347320920413266, .8351994673304931, .8356663201204616, .8361326518690991, .8365984640277758, .8370637580414035, .8375285353484762, .8379927973811084, .8384565455650747, .8389197813198476, .8393825060586361, .8398447211884238, .8403064281100062, .8407676282180282, .8412283229010212, .8416885135414399, .8421482015156988, .8426073881942083, .843066074941411, .8435242631158167, .8439819540700386, .8444391491508282, .8448958496991095, .8453520570500146, .8458077725329176, .8462629974714685, .8467177331836275, .8471719809816981, .8476257421723606, .8480790180567055, .8485318099302657, .8489841190830497, .8494359467995736, .8498872943588931, .8503381630346358, .8507885540950325, .8512384688029485, .8516879084159152, .8521368741861606, .85258536736064, .8530333891810667, .8534809408839426, .8539280237005873, .8543746388571686, .854820787574732, .8552664710692298, .8557116905515508, .8561564472275487, .856600742298071, .8570445769589876, .8574879524012193, .8579308698107657, .8583733303687329, .8588153352513616, .8592568856300545, .859697982671404, .8601386275372181, .8605788213845489, .8610185653657182, .8614578606283446, .8618967083153697, .8623351095650842, .8627730655111538, .8632105772826455, .8636476460040526, .8640842727953206, .8645204587718719, .8649562050446316, .8653915127200517, .8658263829001364, .8662608166824664, .866694815160223, .8671283794222129, .8675615105528918, .8679942096323882, .8684264777365276, .8688583159368556, .8692897253006614, .8697207068910011, .8701512617667205, .8705813909824783, .8710110955887687, .871440376631944, .8718692351542368, .8722976721937826, .872725688784642, .8731532859568221, .8735804647362989, .8740072261450385, .8744335712010189, .8748595009182516, .8752850163068022, .8757101183728118, .876134808118518, .8765590865422758, .8769829546385779, .8774064133980755, .8778294638075984, .8782521068501757, .8786743435050556, .879096174747725, .87951760154993, .8799386248796953, .8803592457013438, .8807794649755161, .8811992836591893, .8816187027056972, .8820377230647484, .8824563456824455, .8828745715013043, .8832924014602719, .8837098364947455, .884126877536591, .8845435255141612, .8849597813523133, .8853756459724286, .8857911202924285, .8862062052267938, .8866209016865818, .8870352105794438, .8874491328096428, .8878626692780711, .888275820882267, .8886885885164322, .8891009730714491, .8895129754348972, .8899245964910704, .8903358371209934, .8907466982024383, .8911571806099414, .8915672852148191, .8919770128851846, .8923863644859639, .8927953408789115, .8932039429226274, .8936121714725718, .8940200273810814, .8944275114973853, .8948346246676199, .895241367734845, .8956477415390587, .8960537469172131, .896459384703229, .8968646557280114, .8972695608194643, .8976741008025054, .8980782764990811, .8984820887281812, .8988855383058536, .8992886260452183, .8996913527564827, .9000937192469548, .9004957263210588, .9008973747803478, .9012986654235191, .9016995990464275, .9021001764420992, .9025003984007458, .9029002657097783, .9032997791538201, .9036989395147207, .9040977475715697, .9044962041007096, .9048943098757493, .9052920656675773, .9056894722443748, .906086530371629, .9064832408121458, .9068796043260627, .9072756216708617, .9076712936013822, .9080666208698333, .9084616042258066, .9088562444162888, .909250542185674, .909644498275776, .9100381134258407, .9104313883725582, .9108243238500753, .9112169205900067, .911609179321448, .9120011007709872, .912392685662716, .9127839347182426, .9131748486567027, .9135654281947713, .9139556740466742, .9143455869241996, .9147351675367098, .9151244165911517, .9155133347920691, .9159019228416131, .9162901814395539, .9166781112832916, .9170657130678669, .9174529874859728, .9178399352279649, .9182265569818724, .9186128534334087, .9189988252659826, .9193844731607087, .9197697977964173, .9201547998496661, .9205394799947498, .9209238389037109, .9213078772463497, .9216915956902347, .9220749949007134, .9224580755409214, .9228408382717931, .9232232837520717, .9236054126383193, .9239872255849265, .9243687232441223, .9247499062659842, .9251307752984477, .925511330987316, .9258915739762699, .9262715049068767, .9266511244186009, .9270304331488122, .9274094317327963, .9277881208037635, .9281665009928579, .9285445729291671, .9289223372397313, .9292997945495522, .9296769454816025, .9300537906568345, .9304303306941893, .9308065662106061, .9311824978210302, .931558126138423, .9319334517737698, .9323084753360892, .9326831974324412, .9330576186679365, .9334317396457447, .9338055609671028, .934179083231324, .934552307035806, .9349252329760395, .935297861645616, .935670193636237, .936042229537722, .936413969938016, .9367854154231987, .937156566577492, .9375274239832683, .9378979882210586, .9382682598695602, .938638239505645, .9390079277043673, .9393773250389714, .9397464320808999, .9401152493998012, .9404837775635372, .9408520171381909, .9412199686880747, .9415876327757369, .9419550099619702, .9423221008058192, .9426889058645871, .943055425693844, .9434216608474337, .9437876118774816, .9441532793344015, .9445186637669033, .944883765722, .9452485857450149, .9456131243795891, .945977382167688, .9463413596496092, .9467050573639889, .9470684758478091, .9474316156364045, .9477944772634701, .9481570612610669, .9485193681596299, .948881398487974, .9492431527733017, .9496046315412092, .9499658353156932, .950326764619158, .9506874199724215, .9510478018947224, .9514079109037265, .9517677475155331, .9521273122446822, .9524866056041599, .9528456281054056, .9532043802583186, .9535628625712634, .9539210755510774, .9542790197030759, .9546366955310597, .9549941035373201, .9553512442226458, .955708118086329, .9560647256261716, .956421067338491, .9567771437181263, .9571329552584446, .9574885024513466, .9578437857872732, .9581988057552107, .9585535628426971, .9589080575358283, .9592622903192632, .9596162616762304, .9599699720885332, .9603234220365561, .9606766119992698, .9610295424542377, .9613822138776207, .9617346267441839, .9620867815273011, .9624386786989614, .962790318729774, .9631417020889744, .9634928292444291, .963843700662642, .9641943168087592, .9645446781465745, .9648947851385351, .9652446382457469, .9655942379279795, .9659435846436719, .9662926788499377, .9666415210025703, .9669901115560479, .9673384509635392, .9676865396769084, .9680343781467202, .9683819668222451, .9687293061514642, .969076396581075, .9694232385564956, .9697698325218702, .970116178920074, .9704622781927181, .970808130780155, .9711537371214826, .9714990976545498, .9718442128159609, .9721890830410812, .972533708764041, .9728780904177409, .9732222284338563, .9735661232428426, .9739097752739395, .9742531849551758, .9745963527133741, .9749392789741559, .9752819641619453, .9756244086999749, .9759666130102891, .9763085775137494, .9766503026300392, .9769917887776673, .9773330363739738, .9776740458351333, .9780148175761602, .9783553520109127, .9786956495520978, .9790357106112746, .97937553559886, .9797151249241322, .9800544789952351, .9803935982191831, .9807324830018651, .9810711337480483, .9814095508613835, .9817477347444082, .9820856857985518, .9824234044241392, .9827608910203951, .9830981459854481, .9834351697163352, .9837719626090052, .9841085250583236, .9844448574580762, .984780960200973, .985116833678653, .9854524782816871, .9857878943995831, .9861230824207893, .9864580427326981, .9867927757216505, .9871272817729397, .9874615612708154, .987795614598487, .9881294421381279, .9884630442708796, .9887964213768549, .989129573835142, .9894625020238087, .9897952063199055, .9901276870994697, .9904599447375294, .9907919796081064, .9911237920842207, .9914553825378941, .9917867513401535, .9921178988610346, .992448825469586, .9927795315338723, .9931100174209779, .9934402834970106, .9937703301271053, .9941001576754271, .9944297665051756, .9947591569785874, .9950883294569406, .9954172843005578, .9957460218688093, .9960745425201175, .996402846611959, .9967309345008691, .997058806542445, .9973864630913489, .9977139045013114, .9980411311251348, .9983681433146974, .998694941420955, .9990215257939463, .9993478967827943, .999674054735711, 1];

				o.rgb2labwithcbrtmapping = function(e, t, r, o, n) {
					"object" != typeof o && (o = a), "object" != typeof n && (n = i);
					var s, l, u, h, d, c, f = n.length;
					return e = o[e], t = o[t], r = o[r], h = .00433891 * e + .00376234915 * t + .0018990604648 * r, d = .002126 * e + .007152 * t + 722e-6 * r, c = 177255e-9 * e + .00109475308 * t + .0087295537 * r, h = h > .008856 ? h >= 1 ? n[f - 1] : n[h * f | 0] : 7.787 * h + 16 / 116, d = d > .008856 ? d >= 1 ? n[f - 1] : n[d * f | 0] : 7.787 * d + 16 / 116, c = c > .008856 ? c >= 1 ? n[f - 1] : n[c * f | 0] : 7.787 * c + 16 / 116, s = 116 * d - 16, l = 500 * (h - d), u = 200 * (d - c), [2.55 * s, l + 127, u + 127]
				}, o.lab2rgb = function(e) {
					var t = (e[0] / 2.55 + 16) / 116,
						r = (e[1] - 127) / 500 + t,
						o = t - (e[2] - 127) / 200,
						a = t * t * t,
						i = r * r * r,
						n = o * o * o;
					t = a > .008856 ? a : (t - 16 / 116) / 7.787, r = i > .008856 ? i : (r - 16 / 116) / 7.787, o = n > .008856 ? n : (o - 16 / 116) / 7.787, r = .95047 * r, t = 1 * t, o = 1.08883 * o;
					var s = 3.2406 * r + -1.5372 * t + o * -.4986,
						l = r * -.9689 + 1.8758 * t + .0415 * o,
						u = .0557 * r + t * -.204 + 1.057 * o;
					return s = s > .0031308 ? 1.055 * Math.pow(s, .41666666666667) - .055 : 12.92 * s, l = l > .0031308 ? 1.055 * Math.pow(l, .41666666666667) - .055 : 12.92 * l, u = u > .0031308 ? 1.055 * Math.pow(u, .41666666666667) - .055 : 12.92 * u, s = 255 * s + .5 | 0, l = 255 * l + .5 | 0, u = 255 * u + .5 | 0, [s, l, u]
				};
				var n;
				o.releaseLazyMap = function() {
					n = null
				}, o.lab2rgbwithmapping = function(e, t) {
					"object" != typeof t && (t = n || (n = [0, .01262952101661779, .02525904203323558, .03788856304985337, .049711876377871826, .05991457469741709, .06898447286600867, .0772092360066284, .08477358579410943, .091804259875822, .09839255413111209, .10460674144643575, .11049941567981197, .116112082049842, .12147815731101994, .12662500399558943, .13157535287823224, .1363483240840589, .1409601768441825, .14542487095720244, .14975449458714327, .15395959525747982, .1580494394769152, .16203221890462635, .16591521589126665, .16970493774704687, .17340722665014255, .1770273503750349, .18057007776923878, .18403974199157158, .18744029384710506, .19077534704588353, .1940482168277028, .19726195310091915, .20041936901604623, .20352306571797985, .2065754538818233, .20957877252746188, .21253510552056065, .21544639609752403, .21831445969536206, .2211409953214818, .2239275956609244, .22667575608780954, .22938688272237368, .2320622996539648, .2347032554328511, .2373109289190679, .2398864345642407, .24243082719196402, .24494510633355537, .24743022016856214, .2498870691130589, .25231650909335385, .25471935453807176, .25709638111758565, .2594483282563151, .2617759014404253, .26407977434087276, .2663605907694862, .26861896648381073, .27085549085472227, .2730707284093175, .2752652202602596, .2774394854315987, .27959402209005907, .2817293086898797, .28384580503848866, .2859439532895821, .2880241788695442, .29008689134257926, .2921324852194264, .2941613407140744, .296173824452494, .29817029013704466, .30015107916988515, .30211652123843086, .3040669348656343, .3060026279276311, .30792389814107823, .3098310335223196, .3117243128203384, .3136040059252957, .3154703742543138, .3173236711160275, .3191641420553126, .32099202517948666, .3228075514671829, .32461094506100485, .32640242354498716, .328182198207814, .3299504742926743, .331707451234572, .33345332288585067, .3351882777306368, .33691249908885884, .33862616531045336, .3403294499603252, .3420225219945948, .3437055459286266, .34537868199729943, .34704208630795363, .3486959109864158, .3503403043164812, .3519754108732058, .35360137165034033, .3552183241822174, .3568264026603817, .35842573804523775, .3600164581729729, .3615986878579945, .36317254899111157, .36473816063367165, .3662956391078557, .36784509808331944, .3693866486603606, .37092039944977906, .37244645664958986, .3739649241187381, .37547590344795784, .37697949402790815, .3784757931147127, .3799648958930234, .3814468955367197, .3829218832673514, .3843899484104266, .38585117844964034, .3873056590791346, .38875347425387746, .39019470623824154, .3916294356528607, .39305774151983813, .3944797013063766, .3958953909668962, .3973048849837052, .398708256406281, .4001055768892218, .40149691672892146, .40288234489901914, .4042619290846755, .40563573571572004, .40700382999871526, .4083662759479818, .409723136415623, .4110744731205898, .41242034667682187, .4137608166205015, .41509594143645334, .41642577858372254, .41775038452036234, .41906981472746097, .420384123732435, .4216933651316181, .4229975916121692, .42429685497332564, .4255912061470252, .4268806952179194, .4281653714427998, .42944528326945836, .43072047835500143, .4319910035836372, .43325690508395387, .43451822824570774, .43577501773613614, .43702731751581336, .43827517085406376, .4395186203439474, .44075770791683294, .4419924748565711, .44322296181328236, .4444492088167707, .445671255289577, .4468891400596831, .4481029013728773, .44931257690479337, .45051820377263313, .4517198185465818, .45291745726092675, .4541111554248895, .4553009480331786, .45648686957627277, .4576689540504429, .45884723496752006, .46002174536441914, .46119251781242304, .4623595844262362, .46352297687281546, .46468272637998137, .46583886374482125, .46699141934188554, .46814042313118737, .469285904666008, .47042789310051664, .47156641719720765, .4727015053341615, .4738331855121353, .47496148536148547, .47608643214893004, .4772080527841532, .47832637382625737, .479441421490067, .4805532216522879, .4816617998575264, .482767181324172, .48386939095014764, .48496845331853117, .4860643927030504, .4871572330734569, .48824699810078104, .48933371116247054, .4904173953474175, .4914980734608752, .4925757680292682, .49365050130489957, .49472229527055495, .49579117164401115, .49685715188244534, .49792025718675353, .4989805085057765, .5000379265404378, .5010925317477942, .5021443443450035, .5031933843132081, .5042396714013406, .5052832251298499, .5063240647943513, .5073622094692027, .5083976780110088, .5094304890620533, .5104606610536634, .5114882122095067, .512513160548822, .5135355238895871, .514555319851623, .5155725658596376, .5165872791462103, .5175994767547175, .518609175542202, .5196163921821871, .5206211431674361, .5216234448126594, .522623313257169, .5236207644674844, .5246158142398872, .5256084782029289, .5265987718198912, .5275867103912004, .5285723090567965, .5295555827984594, .5305365464420905, .5315152146599541, .5324916019728768, .533465722752407, .5344375912229347, .5354072214637743, .5363746274112078, .5373398228604933, .5383028214678364, .5392636367523269, .5402222820978414, .5411787707549106, .5421331158425572, .5430853303500971, .5440354271389132, .5449834189441957, .545929318376653, .5468731379241937, .5478148899535785, .5487545867120445, .5496922403289016, .550627862817102, .5515614660747821, .5524930618867796, .5534226619261247, .5543502777555052, .5552759208287091, .5561996024920415, .5571213339857184, .5580411264452384, .5589589909027302, .5598749382882796, .5607889794312336, .5617011250614838, .5626113858107291, .5635197722137174, .5644262947094677, .5653309636424726, .5662337892638817, .5671347817326651, .5680339511167598, .5689313073941972, .5698268604542126, .5707206200983378, .5716125960414764, .5725027979129619, .5733912352575995, .5742779175366926, .5751628541290517, .5760460543319896, .5769275273622997, .5778072823572206, .5786853283753848, .5795616743977544, .5804363293285412, .5813093019961135, .5821806011538895, .5830502354812169, .5839182135842398, .5847845439967515, .5856492351810363, .5865122955286974, .5873737333614738, .5882335569320437, .5890917744248176, .5899483939567188, .5908034235779529, .5916568712727662, .5925087449601928, .5933590524947909, .5942078016673694, .5950550002057023, .5959006557752352, .5967447759797787, .5975873683621958, .5984284404050756, .5992679995314003, .6001060531052015, .6009426084322078, .601777672760483, .6026112532810554, .6034433571285388, .6042739913817439, .6051031630642828, .6059308791451635, .6067571465393772, .6075819721084775, .6084053626611514, .6092273249537822, .6100478656910059, .6108669915262589, .6116847090623188, .6125010248518375, .6133159453978685, .614129477154385, .6149416265267927, .6157523998724356, .6165618035010941, .6173698436754775, .6181765266117102, .6189818584798096, .6197858454041609, .6205884934639824, .621389808693787, .6221897970838367, .6229884645805916, .6237858170871525, .6245818604636987, .6253766005279194, .6261700430554399, .6269621937802424, .627753058395081, .628542642551892, .6293309518621987, .6301179918975115, .6309037681897214, .6316882862314913, .6324715514766395, .6332535693405202, .6340343452003991, .6348138843958234, .6355921922289883, .6363692739650979, .6371451348327226, .6379197800241517, .6386932146957418, .6394654439682601, .6402364729272251, .6410063066232419, .6417749500723333, .6425424082562685, .6433086861228857, .6440737885864122, .6448377205277801, .645600486794939, .6463620922031635, .6471225415353585, .6478818395423597, .6486399909432315, .6493970004255614, .6501528726457492, .650907612229295, .6516612237710832, .6524137118356617, .6531650809575201, .6539153356413631, .6546644803623813, .6554125195665185, .6561594576707364, .6569052990632761, .6576500481039163, .6583937091242286, .6591362864278302, .6598777842906337, .6606182069610937, .6613575586604503, .6620958435829714, .6628330658961898, .6635692297411403, .664304339232592, .665038398459279, .6657714114841288, .6665033823444867, .6672343150523395, .6679642135945361, .6686930819330041, .6694209240049673, .6701477437231571, .6708735449760244, .6715983316279475, .6723221075194388, .6730448764673485, .6737666422650662, .6744874086827211, .6752071794673781, .6759259583432347, .6766437490118126, .6773605551521499, .6780763804209894, .6787912284529659, .6795051028607908, .6802180072354358, .6809299451463133, .6816409201414555, .6823509357476922, .6830599954708256, .6837681027958041, .684475261186894, .6851814740878487, .6858867449220779, .6865910770928132, .6872944739832727, .6879969389568239, .6886984753571457, .6893990865083861, .6900987757153224, .6907975462635155, .6914954014194653, .692192344430764, .6928883785262472, .6935835069161438, .6942777327922245, .694971059327949, .6956634896786107, .6963550269814812, .6970456743559527, .6977354349036788, .6984243117087141, .6991123078376528, .699799426339765, .7004856702471326, .7011710425747831, .7018555463208224, .7025391844665666, .7032219599766716, .7039038757992623, .7045849348660602, .7052651400925095, .7059444943779024, .7066230006055029, .7073006616426692, .707977480340976, .7086534595363333, .7093286020491069, .7100029106842357, .7106763882313484, .7113490374648795, .7120208611441837, .7126918620136494, .7133620428028108, .7140314062264597, .7146999549847549, .7153676917633327, .7160346192334134, .7167007400519098, .7173660568615324, .7180305722908951, .7186942889546185, .719357209453434, .720019336374285, .7206806722904288, .7213412197615364, .7220009813337923, .7226599595399918, .7233181568996399, .7239755759190464, .724632219091423, .7252880888969768, .7259431878030049, .7265975182639874, .727251082721679, .7279038836052013, .7285559233311324, .7292072043035966, .7298577289143543, .7305074995428886, .7311565185564938, .7318047883103603, .7324523111476625, .7330990893996414, .7337451253856901, .7343904214134368, .7350349797788271, .7356788027662066, .7363218926484012, .7369642516867986, .7376058821314261, .7382467862210323, .7388869661831627, .7395264242342394, .7401651625796365, .7408031834137572, .741440488920109, .7420770812713791, .7427129626295076, .7433481351457623, .7439826009608107, .744616362204793, .7452494209973932, .7458817794479106, .7465134396553299, .7471444037083915, .7477746736856601, .7484042516555937, .7490331396766116, .749661339797162, .7502888540557885, .7509156844811968, .75154183309232, .7521673018983844, .7527920928989733, .7534162080840919, .7540396494342302, .7546624189204263, .7552845185043287, .7559059501382585, .7565267157652705, .7571468173192143, .7577662567247944, .7583850358976305, .7590031567443164, .7596206211624794, .7602374310408384, .7608535882592614, .7614690946888241, .7620839521918652, .7626981626220444, .7633117278243974, .7639246496353923, .7645369298829836, .7651485703866682, .7657595729575378, .766369939398335, .7669796715035041, .7675887710592457, .7681972398435691, .768805079626343, .7694122921693485, .7700188792263292, .7706248425430432, .7712301838573123, .7718349048990725, .7724390073904231, .773042493045677, .7736453635714078, .7742476206664997, .7748492660221942, .7754503013221389, .7760507282424334, .776650548451678, .7772497636110178, .7778483753741909, .7784463853875732, .7790437952902235, .7796406067139292, .7802368212832507, .7808324406155657, .781427466321113, .7820219000030365, .7826157432574284, .7832089976733718, .7838016648329837, .7843937463114573, .7849852436771035, .7855761584913932, .7861664923089979, .7867562466778316, .7873454231390905, .787934023227294, .7885220484703245, .7891095003894674, .78969638049945, .7902826903084814, .790868431318291, .7914536050241666, .7920382129149933, .7926222564732914, .7932057371752538, .7937886564907835, .7943710158835304, .7949528168109292, .7955340607242347, .7961147490685586, .7966948832829057, .7972744648002096, .7978534950473676, .7984319754452766, .7990099074088677, .7995872923471412, .8001641316632006, .8007404267542867, .8013161790118125, .8018913898213956, .8024660605628923, .8030401926104308, .8036137873324438, .8041868460917015, .8047593702453443, .8053313611449138, .8059028201363865, .806473748560204, .8070441477513057, .8076140190391593, .808183363747792, .8087521831958219, .8093204786964877, .8098882515576799, .8104555030819705, .8110222345666428, .811588447303722, .8121541425800035, .8127193216770835, .8132839858713867, .8138481364341967, .8144117746316832, .8149749017249316, .8155375189699711, .816099627617802, .8166612289144245, .8172223241008661, .8177829144132087, .8183430010826165, .8189025853353624, .819461668392856, .8200202514716689, .8205783357835622, .821135922535513, .8216930129297397, .8222496081637287, .8228057094302597, .8233613179174317, .8239164348086886, .8244710612828438, .8250251985141056, .8255788476721027, .8261320099219078, .8266846864240632, .8272368783346047, .827788586805086, .8283398129826024, .8288905580098155, .829440823024976, .8299906091619481, .8305399175502322, .8310887493149887, .8316371055770607, .8321849874529976, .8327323960550771, .8332793324913279, .833825797865553, .8343717932773512, .8349173198221393, .835462378591175, .8360069706715774, .83655109714635, .8370947590944016, .8376379575905678, .8381806937056326, .8387229685063494, .8392647830554617, .8398061384117246, .8403470356299247, .8408874757609016, .8414274598515679, .8419669889449293, .8425060640801054, .8430446862923493, .8435828566130675, .84412057606984, .84465784568644, .8451946664828526, .8457310394752956, .8462669656762376, .8468024460944176, .8473374817348641, .8478720735989141, .8484062226842315, .8489399299848259, .8494731964910713, .8500060231897245, .8505384110639432, .8510703610933044, .8516018742538222, .8521329515179663, .852663593854679, .8531938022293939, .8537235776040522, .8542529209371217, .854781833183613, .8553103152950976, .8558383682197243, .8563659929022369, .8568931902839906, .8574199613029695, .8579463068938025, .8584722279877803, .8589977255128725, .8595228003937431, .8600474535517671, .860571685905047, .8610954983684285, .8616188918535168, .8621418672686924, .8626644255191268, .8631865675067983, .8637082941305079, .8642296062858937, .864750504865448, .8652709907585314, .8657910648513881, .8663107280271617, .8668299811659093, .8673488251446174, .867867260837216, .8683852891145937, .8689029108446124, .8694201268921217, .8699369381189732, .8704533453840357, .8709693495432085, .8714849514494362, .8720001519527227, .8725149519001453, .8730293521358685, .873543353501158, .8740569568343945, .8745701629710876, .8750829727438886, .8755953869826052, .8761074065142143, .8766190321628751, .8771302647499432, .8776411050939833, .8781515540107819, .8786616123133618, .8791712808119936, .8796805603142088, .8801894516248137, .8806979555459011, .8812060728768631, .8817138044144045, .882221150952554, .8827281132826775, .883234692193491, .8837408884710714, .8842467028988698, .8847521362577235, .8852571893258682, .8857618628789493, .8862661576900348, .8867700745296263, .8872736141656715, .8877767773635756, .8882795648862128, .8887819774939383, .8892840159445996, .8897856809935476, .8902869733936489, .8907878938952963, .8912884432464204, .8917886221925007, .8922884314765765, .8927878718392589, .8932869440187404, .8937856487508071, .8942839867688488, .8947819588038698, .8952795655845005, .8957768078370067, .8962736862853018, .8967702016509559, .8972663546532074, .8977621460089725, .8982575764328569, .8987526466371646, .899247357331909, .8997417092248232, .90023570302137, .9007293394247513, .9012226191359196, .9017155428535865, .9022081112742335, .9027003250921215, .9031921849993009, .9036836916856209, .90417484583874, .9046656481441341, .9051560992851082, .9056461999428044, .9061359507962115, .9066253525221751, .9071144057954066, .9076031112884924, .9080914696719034, .9085794816140041, .9090671477810619, .9095544688372559, .9100414454446862, .9105280782633834, .9110143679513163, .911500315164402, .9119859205565143, .9124711847794927, .9129561084831508, .9134406923152851, .9139249369216844, .9144088429461374, .9148924110304419, .915375641814413, .9158585359358921, .9163410940307543, .9168233167329184, .9173052046743536, .9177867584850888, .9182679787932209, .9187488662249219, .9192294214044485, .9197096449541494, .9201895374944735, .9206690996439783, .9211483320193369, .9216272352353475, .9221058099049397, .9225840566391834, .9230619760472966, .9235395687366524, .9240168353127874, .9244937763794097, .9249703925384051, .9254466843898465, .9259226525320003, .9263982975613347, .9268736200725265, .9273486206584685, .9278232999102779, .9282976584173026, .9287716967671293, .9292454155455901, .9297188153367703, .9301918967230154, .9306646602849383, .9311371066014265, .9316092362496491, .9320810498050639, .9325525478414245, .9330237309307874, .9334945996435183, .9339651545483003, .9344353962121393, .9349053252003717, .9353749420766716, .9358442474030564, .9363132417398943, .9367819256459111, .9372502996781967, .9377183643922115, .9381861203417932, .9386535680791633, .9391207081549341, .9395875411181145, .9400540675161166, .9405202878947628, .9409862027982911, .9414518127693627, .9419171183490671, .9423821200769295, .9428468184909163, .9433112141274416, .9437753075213736, .9442390992060405, .9447025897132368, .9451657795732294, .9456286693147632, .946091259465068, .946553550549864, .9470155430933681, .9474772376182993, .947938634645885, .9483997346958671, .9488605382865075, .9493210459345939, .9497812581554465, .9502411754629217, .9507007983694208, .9511601273858931, .9516191630218428, .9520779057853349, .9525363561829999, .9529945147200402, .9534523819002355, .9539099582259479, .9543672441981287, .9548242403163215, .9552809470786706, .9557373649819242, .9561934945214409, .9566493361911946, .9571048904837803, .957560157890419, .9580151389009636, .9584698340039032, .9589242436863693, .9593783684341407, .9598322087316485, .9602857650619817, .9607390379068922, .9611920277467992, .9616447350607958, .9620971603266527, .9625493040208236, .9630011666184514, .9634527485933709, .9639040504181161, .9643550725639237, .9648058155007385, .9652562796972185, .9657064656207391, .9661563737373994, .9666060045120247, .9670553584081741, .9675044358881427, .9679532374129683, .9684017634424352, .9688500144350788, .969297990848191, .9697456931378244, .9701931217587966, .9706402771646961, .9710871598078853, .9715337701395063, .9719801086094847, .9724261756665348, .9728719717581634, .9733174973306754, .9737627528291767, .9742077386975799, .9746524553786086, .9750969033138012, .9755410829435159, .9759849947069349, .9764286390420681, .976872016385759, .9773151271736872, .9777579718403738, .9782005508191854, .9786428645423387, .9790849134409042, .9795266979448097, .9799682184828468, .9804094754826725, .9808504693708154, .9812912005726785, .9817316695125434, .9821718766135753, .9826118222978263, .9830515069862399, .9834909310986545, .9839300950538076, .9843689992693404, .9848076441618009, .9852460301466487, .9856841576382579, .9861220270499221, .9865596387938579, .9869969932812083, .9874340909220475, .9878709321253837, .9883075172991641, .9887438468502779, .9891799211845601, .9896157407067957, .9900513058207229, .9904866169290382, .9909216744333976, .9913564787344237, .9917910302317056, .9922253293238062, .9926593764082635, .9930931718815946, .9935267161393003, .9939600095758677, .9943930525847745, .9948258455584919, .9952583888884886, .9956906829652349, .9961227281782049, .9965545249158808, .9969860735657569, .9974173745143414, .9978484281471626, .9982792348487693, .9987097950027365, .9991401089916675, .9995701771971982, 1]));
					var r = t.length,
						o = (e[0] / 2.55 + 16) / 116,
						a = (e[1] - 127) / 500 + o,
						i = o - (e[2] - 127) / 200,
						s = o * o * o,
						l = a * a * a,
						u = i * i * i;
					o = s > .008856 ? s : (o - 16 / 116) / 7.787, a = l > .008856 ? l : (a - 16 / 116) / 7.787, i = u > .008856 ? u : (i - 16 / 116) / 7.787, a = .95047 * a, o = 1 * o, i = 1.08883 * i;
					var h = 3.2406 * a + -1.5372 * o + i * -.4986,
						d = a * -.9689 + 1.8758 * o + .0415 * i,
						c = .0557 * a + o * -.204 + 1.057 * i;
					return h = 0 >= h ? 0 : h >= 1 ? 1 : t[h * r | 0], d = 0 >= d ? 0 : d >= 1 ? 1 : t[d * r | 0], c = 0 >= c ? 0 : c >= 1 ? 1 : t[c * r | 0], h = 255 * h + .5 | 0, d = 255 * d + .5 | 0, c = 255 * c + .5 | 0, [h, d, c]
				}, t.exports = o
			}, {}],
			75: [function(e, t, r) {
				"use strict";
				var o = {},
					a = 256;
				o.createColorMapFromListOfYValues = function(e, t, r, n) {
					if ("number" != typeof e || "number" != typeof t) return o.createIdentityColorMap();
					if ("object" != typeof n || n.length < 1) return i(e, t, r);
					var s = n.length,
						l = [],
						u = (a - 1) / s,
						h = 0;
					if (1 == s) {
						for (var d = e, c = n[0], f = t, m = 0; a - 1 > m; m++) {
							var p = m / (a - 1),
								g = 1 - p,
								v = g * g * d + 2 * g * p * c + p * p * f;
							l[m] = 0 > v ? 0 : v > 255 ? 255 : v
						}
						if (l[0] = 0 > e ? 0 : e > 255 ? 255 : e, l.push(0 > t ? 0 : t > 255 ? 255 : t), r)
							for (var m = 0; a > m; m++) l[m] = l[m] + .5 | 0;
						return l
					}
					for (var _ = 0, x = u, d = e, c = n[h], f = .5 * (n[h] + n[h + 1]), m = 0; u > m && a > m;) {
						var p = m / u,
							g = 1 - p,
							v = g * g * d + 2 * g * p * c + p * p * f;
						l[m++] = 0 > v ? 0 : v > 255 ? 255 : v
					}
					for (; s - 2 > h;)
						for (h++, _ = h * u, x += u, d = .5 * (n[h - 1] + n[h]), c = n[h], f = .5 * (n[h] + n[h + 1]); x >= m && a > m;) {
							var p = (m - _) / u,
								g = 1 - p,
								v = g * g * d + 2 * g * p * c + p * p * f;
							l[m++] = 0 > v ? 0 : v > 255 ? 255 : v
						}
					for (_ = (h + 1) * u, d = .5 * (n[h] + n[h + 1]), c = n[h + 1], f = t; a - 1 > m;) {
						var p = (m - _) / u,
							g = 1 - p,
							v = g * g * d + 2 * g * p * c + p * p * f;
						l[m++] = 0 > v ? 0 : v > 255 ? 255 : v
					}
					if (l[0] = 0 > e ? 0 : e > 255 ? 255 : e, l.push(0 > t ? 0 : t > 255 ? 255 : t), r)
						for (var m = 0; a > m; m++) l[m] = l[m] + .5 | 0;
					return l
				}, o.createIdentityColorMap = function() {
					for (var e = [], t = 0; a > t; t++) e[t] = t;
					return e
				}, o.combineColorMaps = function(e, t) {
					for (var r = [], o = t.length - 1, a = 0; a < e.length; a++) {
						var i = e[a];
						if (0 >= i) r[a] = t[0];
						else if (i >= o) r[a] = t[o];
						else {
							var n = 0 | i,
								s = i - n;
							r[a] = (1 - s) * t[n] + s * t[n + 1]
						}
					}
					return r
				};
				var i = function(e, t, r) {
					for (var o = [], i = 0; a > i;) {
						var n = i / a,
							s = 1 - n;
						o[i] = n * t + s * e, o[i] = o[i] < 0 ? 0 : o[i] > 255 ? 255 : o[i], r && (o[i] = o[i] + .5 | 0), i++
					}
					return o
				};
				t.exports = o
			}, {}],
			76: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("./MoaHistogramMapping"),
					i = e("./MoaBitmapBlend"),
					n = e("../core/MoaAllocAndCopy"),
					s = e("../core/MoaColor"),
					l = e("../../../src/js/processors/MoaAdjustmentCurves"),
					u = (e("./MoaColorConversion"), e("../core/MoaTransform"));
				o.mulcm = function(e, t) {
					var r = new Array(12);
					r[0] = e[0] * t[0] + e[1] * t[4] + e[2] * t[8], r[1] = e[0] * t[1] + e[1] * t[5] + e[2] * t[9], r[2] = e[0] * t[2] + e[1] * t[6] + e[2] * t[10], r[4] = e[4] * t[0] + e[5] * t[4] + e[6] * t[8], r[5] = e[4] * t[1] + e[5] * t[5] + e[6] * t[9], r[6] = e[4] * t[2] + e[5] * t[6] + e[6] * t[10], r[8] = e[8] * t[0] + e[9] * t[4] + e[10] * t[8], r[9] = e[8] * t[1] + e[9] * t[5] + e[10] * t[9], r[10] = e[8] * t[2] + e[9] * t[6] + e[10] * t[10], r[3] = e[0] * t[3] + e[1] * t[7] + e[2] * t[11] + e[3], r[7] = e[4] * t[3] + e[5] * t[7] + e[6] * t[11] + e[7], r[11] = e[8] * t[3] + e[9] * t[7] + e[10] * t[11] + e[11];
					for (var o = 0; 12 > o; o++) e[o] = r[o]
				}, o.getIdentity = function() {
					return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0]
				}, o.adjBrightnessContrast = function(e, t, r) {
					var a = 128 * (1 - r),
						i = a * t,
						n = r * t,
						s = [n, 0, 0, i, 0, n, 0, i, 0, 0, n, i];
					o.mulcm(e, s)
				}, o.adjSaturation = function(e, t) {
					var r = .213 * (1 - t),
						a = .715 * (1 - t),
						i = .072 * (1 - t),
						n = [r + t, a, i, 0, r, a + t, i, 0, r, a, i + t, 0];
					o.mulcm(e, n)
				}, o.adjBrightness = function(e, t) {
					var r = [t, 0, 0, 0, 0, t, 0, 0, 0, 0, t, 0];
					o.mulcm(e, r)
				}, o.adjContrast = function(e, t) {
					var r = 128 * (1 - t),
						a = [t, 0, 0, r, 0, t, 0, r, 0, 0, t, r];
					o.mulcm(e, a)
				}, o.adjustVibrance = function(e, t) {
					var r = 1 + .7 * (t - 1),
						a = t,
						i = 45 * Math.PI / 180,
						n = 35.26 * Math.PI / 180,
						s = new u;
					s.preRotateX(i), s.preRotateY(-n), s.preScaleXY(r, a), s.preRotateY(n), s.preRotateX(-i);
					var l = s.transformMatrix.slice(0, 12);
					o.mulcm(e, l)
				}, o.adjustFade = function(e, t) {
					var r = 63.75 * t,
						a = 1 - .25 * t,
						i = [a, 0, 0, r, 0, a, 0, r, 0, 0, a, r];
					o.mulcm(e, i)
				}, o.runOperations = function(e, t, r, a) {
					if ("string" != typeof r && (r = "normal"), "number" != typeof a && (a = 1), "normal" != r) {
						var s = n.copy(e);
						if (e.moaGL) {
							var u = e.moaGL.createTexture(e.width, e.height);
							e.moaGL.copyLastRender(u)
						}
					}
					for (var h = !1, d = 0; d < t.length; d++) {
						var c = t[d],
							f = c.value;
						switch (c.operation) {
							case "hardSet":
								var m = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0],
									p = c.gain,
									g = c.entries;
								if (null == p || null == g) throw new ProcessorError("invalid entries val for hardSet operation.", "colorMatrixTransform");
								for (var v = 0; v < g.length; v++) m[v] = g[v] * p;
								o.colorMatrixTransform(e, m, "normal", 1), h = !0;
								break;
							case "saturation":
								var m = o.getIdentity();
								o.adjSaturation(m, f), o.colorMatrixTransform(e, m, "normal", 1), h = !0;
								break;
							case "brightness":
								l.brightnessToReplaceColorMatrix(e, f), h = !0;
								break;
							case "contrast":
								l.contrastToReplaceColorMatrix(e, f), h = !0;
								break;
							default:
								throw new ProcessorError("Operation " + (null != c ? c.operation : void 0) + " not found.", "colorMatrixTransform")
						}
						if (!h) return !1
					}
					if (!h) return !1;
					if ("normal" != r)
						if (e.moaGL) {
							var _ = e.moaGL.glRenderingObjects.writeTexture,
								x = e.moaGL.glRenderingObjects.readTexture;
							e.moaGL.bitmapBlendBitmap(_, u, x, r, a), e.moaGL._swapTextures(), e.moaGL.destroyTexture(u)
						} else i.blendWithBitmap(e, s, e, r, a), s.data = null;
					return h
				}, o.colorMatrixTransform = function(e, t, r, o) {
					if ("string" != typeof r && (r = "normal"), "number" != typeof o && (o = 1), e.moaGL) return void("normal" == r ? e.moaGL.renderColorMatrixTransform(t) : e.moaGL.renderColorMatrixTransformAndBlendWithOriginal(t, r, o));
					o = 255 * o | 0;
					var i, n, l, u = e.data,
						h = e.data.length,
						d = 0,
						c = "normal" === r && 1 === o,
						f = new s,
						m = 0 === t[1] && 0 === t[2] && 0 === t[4] && 0 === t[6] && 0 === t[8] && 0 === t[9];
					if (m && "color" !== r) {
						for (var p, g, v = [], _ = [], x = [], M = 0; 256 > M; M++) g = [M, M, M, 255], p = {
							r: t[0] * M + t[3] + .5 | 0,
							g: t[5] * M + t[7] + .5 | 0,
							b: t[10] * M + t[11] + .5 | 0,
							a: o
						}, p.r = p.r < 0 ? 0 : p.r > 255 ? 255 : p.r, p.g = p.g < 0 ? 0 : p.g > 255 ? 255 : p.g, p.b = p.b < 0 ? 0 : p.b > 255 ? 255 : p.b, f.blendEmbededAlphaFromArray(g, 0, p, r), v[M] = g[0], _[M] = g[1], x[M] = g[2];
						var y = {
							r: v,
							g: _,
							b: x
						};
						a.mapHist(e, y)
					} else
						for (; h > d;) {
							i = t[0] * u[d] + t[1] * u[d + 1] + t[2] * u[d + 2] + t[3] + .5 | 0, n = t[4] * u[d] + t[5] * u[d + 1] + t[6] * u[d + 2] + t[7] + .5 | 0, l = t[8] * u[d] + t[9] * u[d + 1] + t[10] * u[d + 2] + t[11] + .5 | 0;
							var b = {
								r: 0 > i ? 0 : i > 255 ? 255 : i,
								g: 0 > n ? 0 : n > 255 ? 255 : n,
								b: 0 > l ? 0 : l > 255 ? 255 : l,
								a: o
							};
							c ? (u[d] = b.r, u[d + 1] = b.g, u[d + 2] = b.b) : f.blendEmbededAlphaFromArray(u, d, b, r), d += 4
						}
				}, t.exports = o
			}, {
				"../../../src/js/processors/MoaAdjustmentCurves": 70,
				"../core/MoaAllocAndCopy": 34,
				"../core/MoaColor": 36,
				"../core/MoaTransform": 40,
				"./MoaBitmapBlend": 72,
				"./MoaColorConversion": 74,
				"./MoaHistogramMapping": 90
			}],
			77: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("./MoaResize"),
					i = (e("../core/MoaMipmap"), e("../core/MoaTransform")),
					n = e("../core/MoaColor"),
					s = e("../core/MoaAllocAndCopy");
				o.compositePremultipliedBitmap = function(e, t, r, n, s, l, u) {
					var h = new i,
						d = (t.width, t.height, r[0] + .5 * r[2]),
						c = r[1] + .5 * r[3],
						f = 1 / r[2],
						m = 1 / r[3],
						p = (e.width - 1) / (e.height - 1);
					s && h.postScaleXY(-1, 1);
					var g = r[2] * e.width + .5 | 0,
						v = r[3] * e.height + .5 | 0,
						_ = 0 == n && g == t.width && v == t.height && !s;
					return !e.moaGL && _ && "nearest" == l ? (o.compositeBitmapWithoutScalingOrRotation(e, t, r, u), !0) : (h.postScaleXY(f, m), h.postScaleXY(1, p), h.postRotateZ(-n * Math.PI / 180), h.postScaleXY(1, 1 / p), h.postTranslate(.5 - d, .5 - c), a.transformPremultipliedOverlay(e, t, h, l, u), !0)
				}, o.compositePremultipliedBitmapWithResize = function(e, t, r, i, n, l, u) {
					var h, d = !1,
						c = r[2] * e.width | 0,
						f = r[3] * e.height | 0,
						m = c < .5 * t.width || f < .5 * t.height,
						p = Math.min(c, t.width),
						g = Math.min(f, t.height);
					return m ? (h = s.makeBitmap(p, g), a.downscalePremultipliedImage(h, t)) : h = t, d = o.compositePremultipliedBitmap(e, h, r, i, n, l, u), m && (h.data = null), d
				}, o.compositeMipmap = function(e, t, r, o, n, s, l, u) {
					var h = new i,
						d = (t.originalWidth, t.originalHeight, r[0] + .5 * r[2]),
						c = r[1] + .5 * r[3],
						f = 1 / r[2],
						m = 1 / r[3],
						p = (e.width - 1) / (e.height - 1);
					return n && h.postScaleXY(-1, 1), h.postScaleXY(f, m), h.postScaleXY(1, p), h.postRotateZ(-o * Math.PI / 180), h.postScaleXY(1, 1 / p), h.postTranslate(.5 - d, .5 - c), a.transformOverlayUsingMipmap(e, t, h, s, l, u), !0
				}, o.compositeBitmapWithoutScalingOrRotation = function(e, t, r, o) {
					var a = (n.prototype.blendEmbededAlphaFromArray, e.data),
						i = t.data,
						s = e.width,
						l = e.height,
						u = t.width,
						h = (t.height, r[0] * s + .5 | 0),
						d = r[1] * l + .5 | 0,
						c = r[2] * s + .5 | 0,
						f = r[3] * l + .5 | 0;
					c = c > t.width ? t.width : c, f = f > t.height ? t.height : f;
					var m = h + c - 1,
						p = d + f - 1;
					h = 0 > h ? 0 : h, d = 0 > d ? 0 : d, m = m > s - 1 ? s - 1 : m, p = p > l - 1 ? l - 1 : p;
					for (var g, v, _, x, M = d; p >= M; M++)
						for (var y = h; m >= y; y++) {
							var b = 4 * (M * s + y),
								C = 4 * ((M - d) * u + (y - h));
							if (g = i[C], v = i[C + 1], _ = i[C + 2], x = i[C + 3], 0 != x) {
								var T = x * o / 255;
								a[b] = (1 - T) * a[b] + o * g, a[b + 1] = (1 - T) * a[b + 1] + o * v, a[b + 2] = (1 - T) * a[b + 2] + o * _, a[b + 3] = 255
							}
						}
				}, t.exports = o
			}, {
				"../core/MoaAllocAndCopy": 34,
				"../core/MoaColor": 36,
				"../core/MoaMipmap": 39,
				"../core/MoaTransform": 40,
				"./MoaResize": 94
			}],
			78: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("./MoaHistogram"),
					i = (e("./MoaColorConversion"), e("./MoaHistogramMapping")),
					n = e("../core/MoaAllocAndCopy"),
					s = (e("./MoaSharpen"), e("./legacy/auto_colors_fade_max_color")),
					l = e("./MoaAdjustmentCurves"),
					u = e("./MoaVignette"),
					h = e("./MoaColorMatrixTransform");
				o.portrait = function(e) {
					s.autocolorsfade(e, .125), l.contrastCurve(e, .775);
					var t = h.getIdentity();
					return h.adjustVibrance(t, 1.3), h.adjSaturation(t, 1.05), h.colorMatrixTransform(e, t, "normal", 1), !0
				}, o.food = function(e) {
					s.autocolorsfade(e, .25);
					var t = h.getIdentity();
					return h.adjustVibrance(t, 1.3), h.colorMatrixTransform(e, t, "normal", 1), l.contrastCurve(e, 1.25), u.vignette(e, .8, 180, 180, 180, 255, "multiply", "normal", !0, 0, 0), !0
				}, o.scenery = function(e) {
					s.autocolorsfade(e, .25), l.contrastCurve(e, 1.15);
					var t = {},
						r = [0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 117, 118, 119, 120, 121, 122, 123, 124, 124, 125, 126, 127, 128, 129, 129, 130, 131, 132, 133, 134, 134, 135, 136, 137, 138, 138, 139, 140, 141, 142, 143, 143, 144, 145, 146, 147, 147, 148, 149, 150, 151, 151, 152, 153, 154, 155, 155, 156, 157, 158, 159, 159, 160, 161, 162, 163, 164, 164, 165, 166, 167, 168, 169, 169, 170, 171, 172, 173, 174, 175, 176, 177, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 229, 230, 231, 232, 233, 234, 235, 236, 238, 239, 240, 241, 242, 243, 244, 245, 246, 248, 249, 250, 251, 252, 253, 254, 255];
					i.setHistMap(t, r, r, r);
					var o = {
						blurAmount: 18,
						sharpenVal: .4,
						gain: .6
					};
					d(e, t, o);
					var a = h.getIdentity();
					return h.adjSaturation(a, 1.1), h.adjustVibrance(a, 1.15), h.colorMatrixTransform(e, a, "normal", 1), !0
				}, o.night = function(e) {
					s.autocolorsfade(e, .125);
					var t = {},
						r = [0, 1, 5, 6, 8, 11, 13, 16, 18, 21, 23, 26, 27, 30, 32, 35, 36, 39, 40, 43, 45, 47, 49, 52, 53, 56, 57, 60, 61, 64, 65, 66, 69, 70, 73, 74, 75, 78, 79, 80, 82, 84, 85, 86, 88, 90, 91, 92, 94, 95, 97, 98, 99, 100, 101, 103, 104, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 118, 118, 119, 120, 121, 122, 123, 123, 124, 125, 126, 127, 127, 128, 129, 130, 130, 131, 132, 132, 133, 134, 134, 135, 135, 136, 137, 137, 138, 138, 139, 139, 140, 140, 141, 141, 142, 142, 143, 143, 144, 144, 145, 145, 146, 146, 147, 147, 147, 148, 148, 149, 149, 149, 150, 150, 151, 151, 151, 151, 151, 152, 152, 153, 153, 153, 154, 154, 155, 155, 156, 156, 157, 157, 157, 158, 158, 159, 159, 160, 160, 161, 162, 162, 163, 163, 163, 163, 164, 165, 165, 166, 166, 167, 168, 168, 169, 170, 171, 171, 171, 172, 172, 173, 174, 175, 176, 176, 177, 178, 178, 179, 180, 181, 182, 182, 183, 184, 184, 185, 186, 187, 188, 189, 189, 190, 192, 193, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 218, 218, 220, 221, 222, 223, 224, 225, 227, 227, 229, 229, 231, 232, 233, 234, 235, 237, 237, 239, 239, 241, 242, 243, 244, 245, 246, 247, 248, 250, 250, 252, 252, 253, 254, 255];
					i.setHistMap(t, r, r, r);
					var o = {
						blurAmount: 25,
						sharpenVal: .7,
						gain: .5
					};
					return d(e, t, o), !0
				}, o.illuminate = function(e) {
					var t = e.width,
						r = e.height,
						o = .8,
						i = t * r,
						n = 0,
						s = 1,
						l = 4,
						u = a.getHist(e),
						h = a.getcdf(u[0]),
						d = a.getcdf(u[1]),
						c = a.getcdf(u[2]),
						f = a.cdfinv(h, n),
						m = a.cdfinv(h, s),
						p = a.cdfinv(d, n),
						g = a.cdfinv(d, s),
						v = a.cdfinv(c, n),
						_ = a.cdfinv(c, s);
					f = Math.pow(f, .7), p = Math.pow(p, .7), v = Math.pow(v, .7), m = 255 - Math.pow(255 - m, .7), g = 255 - Math.pow(255 - g, .7), _ = 255 - Math.pow(255 - _, .7);
					var x, M, y = 255 / (m - f),
						b = 255 / (g - p),
						C = 255 / (_ - v),
						T = 0,
						A = [];
					for (M = 0; 256 > M; M++) T += .213 * u[0][M] + .715 * u[1][M] + .072 * u[2][M], x = T / i, x = 0 === M ? 0 : 255 * (x / M), A[M] = x > 1 ? Math.pow(x, .65) : 1;
					if (A = a.smooth1D(A, l), e.moaGL) return e.moaGL.renderAutoEnhance(o, y, b, C, f, p, v, A), !0;
					var S, w, P, F, E;
					for (M = t * r; M--;) P = e.data[4 * M], F = e.data[4 * M + 1], E = e.data[4 * M + 2], S = A[.213 * P + .715 * F + .072 * E | 0], w = S * F + .5 | 0, P = (P + (P * S - P) * o + (w - F) * (1 - o) - f) * y + .5 | 0, E = (E + (E * S - E) * o + (w - F) * (1 - o) - v) * C + .5 | 0, F = (w - p) * b + .5 | 0, P > 255 ? P = 255 : 0 > P && (P = 0), F > 255 ? F = 255 : 0 > F && (F = 0), E > 255 ? E = 255 : 0 > E && (E = 0), e.data[4 * M] = P, e.data[4 * M + 1] = F, e.data[4 * M + 2] = E, e.data[4 * M + 3] = e.data[4 * M + 3];
					return !0
				}, o.hidef = function(e) {
					var t, r = e.width,
						o = e.height,
						i = 15,
						n = 0,
						s = .33,
						l = a.getHist(e),
						u = [],
						h = r * o,
						c = 0;
					for (t = 0; 256 > t; t++) c += l[1][t], u[t] = c / h, u[t] = 0 === t ? 1 : u[t] / (t / 255), u[t] = u[t] > 1 ? Math.pow(u[t], s) : 1 / Math.pow(1 / u[t], n);
					for (u = a.smooth1D(u, i), t = 0; 256 > t; t++) u[t] *= t / 255, u[t] = 255 * u[t] + .5 | 0, u[t] = u[t] < 0 ? 0 : u[t] > 255 ? 255 : u[t];
					return d(e, {
						r: u,
						g: u,
						b: u
					}, {
						blurAmount: 50,
						sharpenVal: .3,
						gain: .6
					}), !0
				}, o.colorfix = function(e) {
					var t = e.width,
						r = e.height,
						o = 0,
						i = 0,
						n = [],
						s = [],
						l = [],
						u = [];
					for (i = 0; 256 > i; i++) n[i] = 0, s[i] = 0, l[i] = 0;
					var u = [0, .030352698354883748, .060705396709767497, .09105809506465125, .12141079341953499, .15176349177441875, .1821161901293025, .21246888848418624, .24282158683906999, .27317428519395376, .3035269835488375, .3346535763899161, .3676507324047436, .40247170184963066, .43914420374102936, .4776953480693729, .5181516702338386, .5605391624202722, .6048833022857054, .6512090792594475, .6995410187265387, .7499032043226175, .8023192985384995, .8568125618069307, .9134058702220788, .9721217320237849, 1.0329823029626937, 1.0960094006488246, 1.1612245179743885, 1.2286488356915872, 1.2983032342173013, 1.3702083047289686, 1.4443843596092545, 1.520851442291271, 1.599629336550963, 1.6807375752887384, 1.7641954488384077, 1.8500220128379696, 1.9382360956935722, 2.02885630566524, 2.1219010376003555, 2.2173884793387386, 2.315336617811041, 2.4157632448504756, 2.518685962736163, 2.6241221894849898, 2.7320891639074896, 2.8426039504420793, 2.95568344378088, 3.0713443732993633, 3.1896033073011534, 3.3104766570885054, 3.433980680868217, 3.5601314875020345, 3.688945040110004, 3.82043715953465, 3.9546235276732835, 4.091519690685319, 4.231141062080967, 4.3735029256973466, 4.518620438567554, 4.666508633688009, 4.8171824226889415, 4.970656598412723, 5.126945837404324, 5.286064702318025, 5.448027644244237, 5.612849004960009, 5.780543019106723, 5.95112381629812, 6.124605423161761, 6.301001765316768, 6.480326669290577, 6.662593864377289, 6.8478169844400165, 7.036009569659588, 7.227185068231748, 7.421356838014963, 7.618538148130785, 7.818742180518632, 8.021982031446832, 8.22827071298148, 8.437621154414881, 8.650046203654977, 8.865558628577293, 9.084171118340768, 9.305896284668744, 9.53074666309647, 9.758734714186247, 9.989872824711389, 10.224173308810132, 10.461648409110419, 10.702310297826761, 10.946171077829932, 11.193242783690561, 11.443537382697373, 11.697066775851084, 11.953842798834561, 12.213877222960187, 12.47718175609505, 12.743768043564744, 13.013647669036429, 13.286832155381797, 13.563332965520566, 13.843161503245183, 14.126329114027165, 14.412847085805778, 14.702726649759498, 14.995978981060857, 15.292615199615017, 15.59264637078274, 15.89608350608804, 16.2029375639111, 16.513219450166762, 16.826940018969076, 17.14411007328226, 17.464740365558505, 17.78884159836291, 18.116424424986022, 18.4474994500441, 18.782077230067788, 19.120168274079138, 19.46178304415758, 19.806931955994887, 20.155625379439705, 20.507873639031693, 20.863687014525574, 21.223075741405523, 21.586050011389926, 21.95261997292692, 22.32279573168085, 22.696587351009835, 23.074004852434914, 23.45505821610052, 23.839757381227102, 24.228112246555487, 24.620132670783548, 25.015828472995345, 25.415209433082676, 25.818285292159583, 26.225065752969623, 26.635560480286248, 27.04977910130658, 27.467731206038465, 27.88942634768104, 28.31487404299921, 28.74408377269175, 29.17706498175359, 29.613827079832113, 30.05437944157765, 30.49873140698863, 30.946892281750856, 31.398871337571755, 31.854677812509184, 32.31432091129508, 32.777809805654215, 33.245153634617935, 33.71636150483304, 34.191442490866095, 34.67040563550296, 35.15325995004394, 35.640014414594354, 36.13067797835095, 36.62525955988395, 37.12376804741491, 37.62621229909065, 38.13260114325301, 38.6429433787049, 39.157247774972326, 39.67552307256268, 40.19777798321958, 40.72402119017367, 41.25426134839037, 41.788507084813745, 42.32676699860717, 42.86904966139066, 43.415363617474895, 43.96571738409188, 44.52011945162278, 45.078578283822345, 45.64110231804047, 46.20769996544071, 46.7783796112159, 47.353149614800955, 47.93201831008268, 48.514994005607036, 49.10208498478356, 49.693299506087044, 50.28864580325687, 50.888132085493375, 51.49176653765214, 52.09955732043543, 52.711512570581306, 53.32764040105052, 53.947948901210715, 54.57244613701866, 55.201140151200015, 55.83403896342679, 56.471150570492924, 57.11248294648731, 57.75804404296506, 58.40784178911641, 59.06188409193369, 59.720178836376334, 60.38273388553378, 61.04955708078648, 61.72065624196511, 62.39603916750761, 63.07571363461469, 63.75968739940326, 64.44796819705822, 65.14056374198242, 65.83748172794485, 66.5387298282272, 67.24431569576875, 67.95424696330939, 68.66853124353135, 69.38717612919899, 70.11018919329732, 70.83757798916868, 71.56935005064807, 72.30551289219693, 73.04607400903537, 73.79104087727309, 74.54042095403875, 75.29422167760778, 76.05245046752924, 76.8151147247507, 77.58222183174236, 78.35377915261935, 79.12979403326302, 79.9102738014409, 80.69522576692516, 81.48465722161012, 82.27857543962836, 83.07698767746547, 83.879901174074, 84.6873231509858, 85.49926081242339, 86.31572134541024, 87.13671191987972, 87.96223968878317, 88.79231178819663, 89.62693533742664, 90.46611743911495, 91.30986517934193, 92.15818562772947, 93.01108583754237, 93.8685728457888, 94.73065367331999, 95.59733532492861, 96.46862478944651, 97.34452903984125, 98.22505503331172, 99.11020971138298, 100],
						h = [0, .09924488254695861, .12504071661525748, .14313588920856027, .1575414309575025, .16970636198605316, .18033991980928551, .18984863055466036, .19848976509391722, .20643767470661487, .21381661776730748, .2207186428753261, .22721406110407222, .2333579349114362, .2391942859295316, .24475892765281868, .2500814332305149, .25518653946003345, .2600951718542145, .26482520821552014, .26939205754235684, .27380910584090884, .27808806426285243, .2822392443945425, .28627177841712054, .2901937969941595, .2940125743549161, .2977346476408758, .3013659158571899, .30491172251223664, .3083769250994826, .311765953881872, .315082861915005, .31833136784577337, .32151489271552486, .3246365917579799, .3276993819951494, .33070596628701154, .3336588543735265, .336560381353843, .3394127239721063, .34221791501818183, .3449778561018543, .34769432901832303, .350369005889286, .3530034582361798, .3555991651191077, .35815752045576577, .360679839618571, .3631673653946448, .36562127338186107, .3680426768844678, .37043263136354043, .37279213849048415, .3751221498457724, .3774235702999315, .3796972611093207, .38194404275540383, .38416469755287136, .3863599720490726, .38853057923469275, .3906772005834086, .39280048793632477, .3949010652453065, .39697953018783444, .3990364556647021, .40107239119071786, .4030878641875543, .40508338118698156, .40705942895191655, .4090164755220073, .41095497118983254, .41287534941322973, .41477802766875577, .41666340825083015, .41853187902070177, .4203838141090141, .4222195745754141, .42403950902835275, .4258439542079576, .42763323553461496, .4294076676256808, .4311675547825421, .43291319145006824, .43464486265033075, .43636284439232104, .43806740405925904, .439758800774965, .44143728575065216, .4431031026133969, .44475648771744863, .4463976704394558, .44802687345860653, .4496443130226092, .45125019920037296, .4528447361221874, .45442812220814444, .4560005503854936, .45756220829557587, .4591132784909362, .46065393862317483, .46218436162206117, .4637047158663982, .4652151653470947, .46671586982287233, .46820698496900803, .4696886625194857, .4711610504029096, .47262429287250746, .4740785306305335, .4755239009473612, .4769605377755387, .47838857185906314, .4798081308381152, .48121933934948075, .48262231912287346, .4840171890733601, .4854040653900775, .4867830616214213, .4881542887568748, .4895178553056373, .4908738673722041, .4922224287290381, .4935636408864699, .4948976031599528, .496224412734793, .49754416472847035, .4988569522506557, .5001628664610298, .501461996624999, .5027544301674005, .5040402527242843, .5053195481928565, .5065923987796591, .5078588850470654, .5091190859581595, .5103730789200669, .5116209398258046, .5128627430947063, .514098561711485, .5153284672639881, .516552529979695, .5177708187610112, .5189834012194042, .520190343708429, .5213917113556842, .5225875680937435, .5237779766901, .524962998776162, .5261426948753368, .5273171244302366, .5284863458290399, .5296504164310403, .530809392591412, .5319633296852224, .5331122821307175, .5342563034119088, .5353954461004848, .5365297618770742, .5376593015518806, .5387841150847137, .5399042516044376, .5410197594278565, .5421306860780567, .5432370783022257, .5443389820889641, .5454364426851102, .5465295046120907, .5476182116818177, .5487026070121426, .5497827330418863, .5508586315454556, .5519303436470633, .5529979098345615, .5540613699729042, .555120763317248, .5561761285257049, .5572275036717572, .5582749262563468, .5593184332196459, .5603580609525242, .5613938453077163, .5624258216107048, .5634540246703222, .564478488789085, .5654992477732644, .5665163349427048, .5675297831403955, .5685396247418045, .5695458916639811, .5705486153744331, .5715478268997879, .5725435568342411, .5735358353478003, .5745246921943311, .5755101567194079, .5764922578679786, .577471024191847, .5784464838569776, .5794186646506286, .5803875939883189, .5813532989206311, .582315806139859, .5832751419864992, .5842313324555962, .5851844032029409, .5861343795511286, .5870812864954806, .5880251487098322, .5889659905521902, .5899038360702656, .5908387090068827, .5917706328052692, .5926996306142294, .5936257252932051, .5945489394172259, .5954692952817516, .5963868149074115, .5973015200446405, .5982134321782173, .599122572531705, .6000289620717986, .60093262151258, .6018335713196846, .6027318317143798, .6036274226775593, .6045203639536548, .6054106750544663, .606298375262915, .6071834836367179, .6080660190119893, .6089460000067677, .6098234450244732, .6106983722572941, .6115707996895061, .6124407451007265, .613308226069102, .6141732599744346, .6150358640012467, .6158960551417848, .6167538501989651, .6176092657892629, .6184623183455441, .6193130241198446, .620161399186094, .6210074594427897, .6218512206156173, .6226926982600246, .623531907763744, .6243688643492697, .6252035830762873, .6260360788440587, .626866366393762, .6276944603107898, .6285203750270028, .6293441248229434, .6301657238300099, .6309851860325884, .6318025252701481, .6326177552392989, .63343088949581, .6342419414565944, .6350509244016576, .6358578514760097, .6366627356915467, .6374655899288959, .6382664269392303, .6390652593460512, .6398620996469384, .6406569602152721, .6414498533019224, .6422407910369122, .6430297854310497, .6438168483775332, .6446019916535295, .6453852269217243, .6461665657318468, .646946019522169, .6477235996209785, .6484993172480279, .6492731835159596, .6500452094317067, .6508154058978702, .651583783714075, .6523503535783013, .6531151260881964, .653878111742364, .6546393209416315, .6553987639902987, .6561564510973654, .6569123923777382, .6576665978534199, .6584190774546778, .6591698410211952, .6599188983032032, .660666258962595, .6614119325740231, .6621559286259783, .6628982565218523, .6636389255809841, .6643779450396892, .6651153240522729, .665851071692029, .6665851969522216, .667317708747053, .6680486159126159, .6687779272078317, .6695056513153739, .6702317968425779, .6709563723223373, .6716793862139855, .6724008469041655, .673120762707686, .6738391418683641, .6745559925598569, .675271322886479, .6759851408840097, .6766974545204868, .6774082716969896, .67811760024841, .6788254479442125, .6795318224891835, .6802367315241687, .6809401826268009, .6816421833122166, .6823427410337628, .6830418631836931, .6837395570938545, .6844358300363635, .6851306892242741, .6858241418122343, .6865161948971349, .6872068555187488, .687896130660361, .6885840272493903, .689270552158001, .6899557122037085, .6906395141499742, .6913219647067927, .6920030705312724, .6926828382282061, .6933612743506347, .6940383854004035, .6947141778287103, .6953886580366461, .6960618323757292, .6967337071484312, .6974042886086962, .6980735829624533, .6987415963681218, .6994083349371105, .7000738047343085, .7007380117785719, .7014009620432023, .7020626614564196, .7027231159018287, .7033823312188793, .7040403132033212, .7046970676076518, .7053526001415594, .7060069164723595, .7066600222254262, .7073119229846179, .7079626242926972, .7086121316517457, .7092604505235738, .7099075863301242, .7105535444538713, .7111983302382154, .7118419489878712, .7124844059692523, .71312570641085, .7137658555036082, .7144048584012926, .7150427202208567, .7156794460428013, .7163150409115315, .7169495098357082, .7175828577885948, .7182150897084011, .718846210498622, .7194762250283715, .720105138132714, .7207329546129908, .721359679237142, .721985316740026, .7226098718237337, .7232333491578999, .7238557533800104, .7244770890957053, .7250973608790793, .7257165732729777, .7263347307892896, .7269518379092367, .7275678990836596, .7281829187333003, .728796901249081, .7294098509923802, .7300217722953055, .7306326694609626, .7312425467637221, .7318514084494824, .7324592587359297, .7330661018127955, .7336719418421106, .7342767829584559, .7348806292692114, .735483484854801, .7360853537689355, .7366862400388527, .737286147665554, .7378850806240391, .7384830428635379, .7390800383077395, .7396760708550189, .7402711443786605, .7408652627270808, .741458429724046, .7420506491688895, .7426419248367259, .7432322604786622, .7438216598220084, .7444101265704832, .7449976644044198, .7455842769809682, .7461699679342954, .7467547408757834, .7473385993942256, .7479215470560205, .748503587405363, .7490847239644346, .7496649602335902, .7502442996915447, .7508227457955557, .7514003019816053, .7519769716645798, .7525527582384471, .7531276650764331, .753701695531195, .7542748529349934, .754847140599863, .7554185618177804, .7559891198608314, .7565588179813753, .7571276594122083, .757695647366725, .7582627850390781, .7588290756043364, .7593945222186415, .7599591280193618, .7605228961252469, .7610858296365782, .7616479316353195, .7622092051852651, .7627696533321872, .7633292791039805, .7638880855108077, .7644460755452401, .7650032521824002, .7655596183801003, .7661151770789814, .7666699312026493, .7672238836578102, .7677770373344053, .7683293951057427, .7688809598286291, .7694317343435, .7699817214745477, .7705309240298498, .7710793448014944, .7716269865657057, .7721738520829675, .772719944098145, .7732652653406075, .7738098185243465, .7743536063480964, .7748966314954512, .775438896634981, .7759804044203481, .7765211574904205, .7770611584693855, .7776004099668616, .7781389145780099, .778676674883643, .7792136934503352, .7797499728305293, .7802855155626435, .7808203241711775, .7813544011668172, .7818877490465378, .7824203702937074, .782952267378188, .783483442756437, .7840138988716062, .7845436381536416, .7850726630193806, .7856009758726495, .7861285791043594, .7866554750926015, .7871816662027413, .7877071547875124, .7882319431871087, .7887560337292759, .7892794287294033, .7898021304906129, .7903241413038489, .7908454634479661, .7913660991898175, .7918860507843407, .7924053204746444, .7929239104920931, .7934418230563915, .7939590603756689, .7944756246465603, .7949915180542906, .7955067427727543, .7960213009645972, .7965351947812954, .7970484263632353, .7975609978397913, .7980729113294042, .7985841689396577, .7990947727673552, .799604724898595, .8001140274088461, .8006226823630215, .8011306918155525, .8016380578104618, .8021447823814357, .8026508675518954, .8031563153350691, .8036611277340616, .8041653067419244, .8046688543417252, .8051717725066162, .8056740631999023, .8061757283751086, .8066767699760472, .8071771899368835, .8076769901822017, .8081761726270704, .8086747391771066, .8091726917285403, .8096700321682774, .8101667623739631, .810662884214044, .81115839954783, .8116533102255556, .8121476180884412, .8126413249687521, .8131344326898597, .8136269430663002, .8141188579038331, .8146101789994995, .8151009081416802, .8155910471101533, .8160805976761496, .8165695616024108, .8170579406432438, .8175457365445769, .8180329510440145, .8185195858708919, .8190056427463286, .8194911233832824, .8199760294866028, .8204603627530825, .8209441248715112, .8214273175227265, .8219099423796651, .8223920011074144, .8228734953632629, .8233544267967502, .8238347970497164, .8243146077563521, .8247938605432471, .8252725570294385, .8257506988264595, .8262282875383863, .8267053247618866, .8271818120862655, .8276577510935128, .8281331433583488, .82860799044827, .8290822939235957, .8295560553375114, .8300292762361152, .830501958158461, .830974102636603, .8314457111956398, .831916785353757, .8323873266222709, .8328573365056704, .8333268165016603, .8337957681012022, .8342641927885572, .8347320920413266, .8351994673304931, .8356663201204616, .8361326518690991, .8365984640277758, .8370637580414035, .8375285353484762, .8379927973811084, .8384565455650747, .8389197813198476, .8393825060586361, .8398447211884238, .8403064281100062, .8407676282180282, .8412283229010212, .8416885135414399, .8421482015156988, .8426073881942083, .843066074941411, .8435242631158167, .8439819540700386, .8444391491508282, .8448958496991095, .8453520570500146, .8458077725329176, .8462629974714685, .8467177331836275, .8471719809816981, .8476257421723606, .8480790180567055, .8485318099302657, .8489841190830497, .8494359467995736, .8498872943588931, .8503381630346358, .8507885540950325, .8512384688029485, .8516879084159152, .8521368741861606, .85258536736064, .8530333891810667, .8534809408839426, .8539280237005873, .8543746388571686, .854820787574732, .8552664710692298, .8557116905515508, .8561564472275487, .856600742298071, .8570445769589876, .8574879524012193, .8579308698107657, .8583733303687329, .8588153352513616, .8592568856300545, .859697982671404, .8601386275372181, .8605788213845489, .8610185653657182, .8614578606283446, .8618967083153697, .8623351095650842, .8627730655111538, .8632105772826455, .8636476460040526, .8640842727953206, .8645204587718719, .8649562050446316, .8653915127200517, .8658263829001364, .8662608166824664, .866694815160223, .8671283794222129, .8675615105528918, .8679942096323882, .8684264777365276, .8688583159368556, .8692897253006614, .8697207068910011, .8701512617667205, .8705813909824783, .8710110955887687, .871440376631944, .8718692351542368, .8722976721937826, .872725688784642, .8731532859568221, .8735804647362989, .8740072261450385, .8744335712010189, .8748595009182516, .8752850163068022, .8757101183728118, .876134808118518, .8765590865422758, .8769829546385779, .8774064133980755, .8778294638075984, .8782521068501757, .8786743435050556, .879096174747725, .87951760154993, .8799386248796953, .8803592457013438, .8807794649755161, .8811992836591893, .8816187027056972, .8820377230647484, .8824563456824455, .8828745715013043, .8832924014602719, .8837098364947455, .884126877536591, .8845435255141612, .8849597813523133, .8853756459724286, .8857911202924285, .8862062052267938, .8866209016865818, .8870352105794438, .8874491328096428, .8878626692780711, .888275820882267, .8886885885164322, .8891009730714491, .8895129754348972, .8899245964910704, .8903358371209934, .8907466982024383, .8911571806099414, .8915672852148191, .8919770128851846, .8923863644859639, .8927953408789115, .8932039429226274, .8936121714725718, .8940200273810814, .8944275114973853, .8948346246676199, .895241367734845, .8956477415390587, .8960537469172131, .896459384703229, .8968646557280114, .8972695608194643, .8976741008025054, .8980782764990811, .8984820887281812, .8988855383058536, .8992886260452183, .8996913527564827, .9000937192469548, .9004957263210588, .9008973747803478, .9012986654235191, .9016995990464275, .9021001764420992, .9025003984007458, .9029002657097783, .9032997791538201, .9036989395147207, .9040977475715697, .9044962041007096, .9048943098757493, .9052920656675773, .9056894722443748, .906086530371629, .9064832408121458, .9068796043260627, .9072756216708617, .9076712936013822, .9080666208698333, .9084616042258066, .9088562444162888, .909250542185674, .909644498275776, .9100381134258407, .9104313883725582, .9108243238500753, .9112169205900067, .911609179321448, .9120011007709872, .912392685662716, .9127839347182426, .9131748486567027, .9135654281947713, .9139556740466742, .9143455869241996, .9147351675367098, .9151244165911517, .9155133347920691, .9159019228416131, .9162901814395539, .9166781112832916, .9170657130678669, .9174529874859728, .9178399352279649, .9182265569818724, .9186128534334087, .9189988252659826, .9193844731607087, .9197697977964173, .9201547998496661, .9205394799947498, .9209238389037109, .9213078772463497, .9216915956902347, .9220749949007134, .9224580755409214, .9228408382717931, .9232232837520717, .9236054126383193, .9239872255849265, .9243687232441223, .9247499062659842, .9251307752984477, .925511330987316, .9258915739762699, .9262715049068767, .9266511244186009, .9270304331488122, .9274094317327963, .9277881208037635, .9281665009928579, .9285445729291671, .9289223372397313, .9292997945495522, .9296769454816025, .9300537906568345, .9304303306941893, .9308065662106061, .9311824978210302, .931558126138423, .9319334517737698, .9323084753360892, .9326831974324412, .9330576186679365, .9334317396457447, .9338055609671028, .934179083231324, .934552307035806, .9349252329760395, .935297861645616, .935670193636237, .936042229537722, .936413969938016, .9367854154231987, .937156566577492, .9375274239832683, .9378979882210586, .9382682598695602, .938638239505645, .9390079277043673, .9393773250389714, .9397464320808999, .9401152493998012, .9404837775635372, .9408520171381909, .9412199686880747, .9415876327757369, .9419550099619702, .9423221008058192, .9426889058645871, .943055425693844, .9434216608474337, .9437876118774816, .9441532793344015, .9445186637669033, .944883765722, .9452485857450149, .9456131243795891, .945977382167688, .9463413596496092, .9467050573639889, .9470684758478091, .9474316156364045, .9477944772634701, .9481570612610669, .9485193681596299, .948881398487974, .9492431527733017, .9496046315412092, .9499658353156932, .950326764619158, .9506874199724215, .9510478018947224, .9514079109037265, .9517677475155331, .9521273122446822, .9524866056041599, .9528456281054056, .9532043802583186, .9535628625712634, .9539210755510774, .9542790197030759, .9546366955310597, .9549941035373201, .9553512442226458, .955708118086329, .9560647256261716, .956421067338491, .9567771437181263, .9571329552584446, .9574885024513466, .9578437857872732, .9581988057552107, .9585535628426971, .9589080575358283, .9592622903192632, .9596162616762304, .9599699720885332, .9603234220365561, .9606766119992698, .9610295424542377, .9613822138776207, .9617346267441839, .9620867815273011, .9624386786989614, .962790318729774, .9631417020889744, .9634928292444291, .963843700662642, .9641943168087592, .9645446781465745, .9648947851385351, .9652446382457469, .9655942379279795, .9659435846436719, .9662926788499377, .9666415210025703, .9669901115560479, .9673384509635392, .9676865396769084, .9680343781467202, .9683819668222451, .9687293061514642, .969076396581075, .9694232385564956, .9697698325218702, .970116178920074, .9704622781927181, .970808130780155, .9711537371214826, .9714990976545498, .9718442128159609, .9721890830410812, .972533708764041, .9728780904177409, .9732222284338563, .9735661232428426, .9739097752739395, .9742531849551758, .9745963527133741, .9749392789741559, .9752819641619453, .9756244086999749, .9759666130102891, .9763085775137494, .9766503026300392, .9769917887776673, .9773330363739738, .9776740458351333, .9780148175761602, .9783553520109127, .9786956495520978, .9790357106112746, .97937553559886, .9797151249241322, .9800544789952351, .9803935982191831, .9807324830018651, .9810711337480483, .9814095508613835, .9817477347444082, .9820856857985518, .9824234044241392, .9827608910203951, .9830981459854481, .9834351697163352, .9837719626090052, .9841085250583236, .9844448574580762, .984780960200973, .985116833678653, .9854524782816871, .9857878943995831, .9861230824207893, .9864580427326981, .9867927757216505, .9871272817729397, .9874615612708154, .987795614598487, .9881294421381279, .9884630442708796, .9887964213768549, .989129573835142, .9894625020238087, .9897952063199055, .9901276870994697, .9904599447375294, .9907919796081064, .9911237920842207, .9914553825378941, .9917867513401535, .9921178988610346, .992448825469586, .9927795315338723, .9931100174209779, .9934402834970106, .9937703301271053, .9941001576754271, .9944297665051756, .9947591569785874, .9950883294569406, .9954172843005578, .9957460218688093, .9960745425201175, .996402846611959, .9967309345008691, .997058806542445, .9973864630913489, .9977139045013114, .9980411311251348, .9983681433146974, .998694941420955, .9990215257939463, .9993478967827943, .999674054735711, 1],
						d = [0, .01262952101661779, .02525904203323558, .03788856304985337, .049711876377871826, .05991457469741709, .06898447286600867, .0772092360066284, .08477358579410943, .091804259875822, .09839255413111209, .10460674144643575, .11049941567981197, .116112082049842, .12147815731101994, .12662500399558943, .13157535287823224, .1363483240840589, .1409601768441825, .14542487095720244, .14975449458714327, .15395959525747982, .1580494394769152, .16203221890462635, .16591521589126665, .16970493774704687, .17340722665014255, .1770273503750349, .18057007776923878, .18403974199157158, .18744029384710506, .19077534704588353, .1940482168277028, .19726195310091915, .20041936901604623, .20352306571797985, .2065754538818233, .20957877252746188, .21253510552056065, .21544639609752403, .21831445969536206, .2211409953214818, .2239275956609244, .22667575608780954, .22938688272237368, .2320622996539648, .2347032554328511, .2373109289190679, .2398864345642407, .24243082719196402, .24494510633355537, .24743022016856214, .2498870691130589, .25231650909335385, .25471935453807176, .25709638111758565, .2594483282563151, .2617759014404253, .26407977434087276, .2663605907694862, .26861896648381073, .27085549085472227, .2730707284093175, .2752652202602596, .2774394854315987, .27959402209005907, .2817293086898797, .28384580503848866, .2859439532895821, .2880241788695442, .29008689134257926, .2921324852194264, .2941613407140744, .296173824452494, .29817029013704466, .30015107916988515, .30211652123843086, .3040669348656343, .3060026279276311, .30792389814107823, .3098310335223196, .3117243128203384, .3136040059252957, .3154703742543138, .3173236711160275, .3191641420553126, .32099202517948666, .3228075514671829, .32461094506100485, .32640242354498716, .328182198207814, .3299504742926743, .331707451234572, .33345332288585067, .3351882777306368, .33691249908885884, .33862616531045336, .3403294499603252, .3420225219945948, .3437055459286266, .34537868199729943, .34704208630795363, .3486959109864158, .3503403043164812, .3519754108732058, .35360137165034033, .3552183241822174, .3568264026603817, .35842573804523775, .3600164581729729, .3615986878579945, .36317254899111157, .36473816063367165, .3662956391078557, .36784509808331944, .3693866486603606, .37092039944977906, .37244645664958986, .3739649241187381, .37547590344795784, .37697949402790815, .3784757931147127, .3799648958930234, .3814468955367197, .3829218832673514, .3843899484104266, .38585117844964034, .3873056590791346, .38875347425387746, .39019470623824154, .3916294356528607, .39305774151983813, .3944797013063766, .3958953909668962, .3973048849837052, .398708256406281, .4001055768892218, .40149691672892146, .40288234489901914, .4042619290846755, .40563573571572004, .40700382999871526, .4083662759479818, .409723136415623, .4110744731205898, .41242034667682187, .4137608166205015, .41509594143645334, .41642577858372254, .41775038452036234, .41906981472746097, .420384123732435, .4216933651316181, .4229975916121692, .42429685497332564, .4255912061470252, .4268806952179194, .4281653714427998, .42944528326945836, .43072047835500143, .4319910035836372, .43325690508395387, .43451822824570774, .43577501773613614, .43702731751581336, .43827517085406376, .4395186203439474, .44075770791683294, .4419924748565711, .44322296181328236, .4444492088167707, .445671255289577, .4468891400596831, .4481029013728773, .44931257690479337, .45051820377263313, .4517198185465818, .45291745726092675, .4541111554248895, .4553009480331786, .45648686957627277, .4576689540504429, .45884723496752006, .46002174536441914, .46119251781242304, .4623595844262362, .46352297687281546, .46468272637998137, .46583886374482125, .46699141934188554, .46814042313118737, .469285904666008, .47042789310051664, .47156641719720765, .4727015053341615, .4738331855121353, .47496148536148547, .47608643214893004, .4772080527841532, .47832637382625737, .479441421490067, .4805532216522879, .4816617998575264, .482767181324172, .48386939095014764, .48496845331853117, .4860643927030504, .4871572330734569, .48824699810078104, .48933371116247054, .4904173953474175, .4914980734608752, .4925757680292682, .49365050130489957, .49472229527055495, .49579117164401115, .49685715188244534, .49792025718675353, .4989805085057765, .5000379265404378, .5010925317477942, .5021443443450035, .5031933843132081, .5042396714013406, .5052832251298499, .5063240647943513, .5073622094692027, .5083976780110088, .5094304890620533, .5104606610536634, .5114882122095067, .512513160548822, .5135355238895871, .514555319851623, .5155725658596376, .5165872791462103, .5175994767547175, .518609175542202, .5196163921821871, .5206211431674361, .5216234448126594, .522623313257169, .5236207644674844, .5246158142398872, .5256084782029289, .5265987718198912, .5275867103912004, .5285723090567965, .5295555827984594, .5305365464420905, .5315152146599541, .5324916019728768, .533465722752407, .5344375912229347, .5354072214637743, .5363746274112078, .5373398228604933, .5383028214678364, .5392636367523269, .5402222820978414, .5411787707549106, .5421331158425572, .5430853303500971, .5440354271389132, .5449834189441957, .545929318376653, .5468731379241937, .5478148899535785, .5487545867120445, .5496922403289016, .550627862817102, .5515614660747821, .5524930618867796, .5534226619261247, .5543502777555052, .5552759208287091, .5561996024920415, .5571213339857184, .5580411264452384, .5589589909027302, .5598749382882796, .5607889794312336, .5617011250614838, .5626113858107291, .5635197722137174, .5644262947094677, .5653309636424726, .5662337892638817, .5671347817326651, .5680339511167598, .5689313073941972, .5698268604542126, .5707206200983378, .5716125960414764, .5725027979129619, .5733912352575995, .5742779175366926, .5751628541290517, .5760460543319896, .5769275273622997, .5778072823572206, .5786853283753848, .5795616743977544, .5804363293285412, .5813093019961135, .5821806011538895, .5830502354812169, .5839182135842398, .5847845439967515, .5856492351810363, .5865122955286974, .5873737333614738, .5882335569320437, .5890917744248176, .5899483939567188, .5908034235779529, .5916568712727662, .5925087449601928, .5933590524947909, .5942078016673694, .5950550002057023, .5959006557752352, .5967447759797787, .5975873683621958, .5984284404050756, .5992679995314003, .6001060531052015, .6009426084322078, .601777672760483, .6026112532810554, .6034433571285388, .6042739913817439, .6051031630642828, .6059308791451635, .6067571465393772, .6075819721084775, .6084053626611514, .6092273249537822, .6100478656910059, .6108669915262589, .6116847090623188, .6125010248518375, .6133159453978685, .614129477154385, .6149416265267927, .6157523998724356, .6165618035010941, .6173698436754775, .6181765266117102, .6189818584798096, .6197858454041609, .6205884934639824, .621389808693787, .6221897970838367, .6229884645805916, .6237858170871525, .6245818604636987, .6253766005279194, .6261700430554399, .6269621937802424, .627753058395081, .628542642551892, .6293309518621987, .6301179918975115, .6309037681897214, .6316882862314913, .6324715514766395, .6332535693405202, .6340343452003991, .6348138843958234, .6355921922289883, .6363692739650979, .6371451348327226, .6379197800241517, .6386932146957418, .6394654439682601, .6402364729272251, .6410063066232419, .6417749500723333, .6425424082562685, .6433086861228857, .6440737885864122, .6448377205277801, .645600486794939, .6463620922031635, .6471225415353585, .6478818395423597, .6486399909432315, .6493970004255614, .6501528726457492, .650907612229295, .6516612237710832, .6524137118356617, .6531650809575201, .6539153356413631, .6546644803623813, .6554125195665185, .6561594576707364, .6569052990632761, .6576500481039163, .6583937091242286, .6591362864278302, .6598777842906337, .6606182069610937, .6613575586604503, .6620958435829714, .6628330658961898, .6635692297411403, .664304339232592, .665038398459279, .6657714114841288, .6665033823444867, .6672343150523395, .6679642135945361, .6686930819330041, .6694209240049673, .6701477437231571, .6708735449760244, .6715983316279475, .6723221075194388, .6730448764673485, .6737666422650662, .6744874086827211, .6752071794673781, .6759259583432347, .6766437490118126, .6773605551521499, .6780763804209894, .6787912284529659, .6795051028607908, .6802180072354358, .6809299451463133, .6816409201414555, .6823509357476922, .6830599954708256, .6837681027958041, .684475261186894, .6851814740878487, .6858867449220779, .6865910770928132, .6872944739832727, .6879969389568239, .6886984753571457, .6893990865083861, .6900987757153224, .6907975462635155, .6914954014194653, .692192344430764, .6928883785262472, .6935835069161438, .6942777327922245, .694971059327949, .6956634896786107, .6963550269814812, .6970456743559527, .6977354349036788, .6984243117087141, .6991123078376528, .699799426339765, .7004856702471326, .7011710425747831, .7018555463208224, .7025391844665666, .7032219599766716, .7039038757992623, .7045849348660602, .7052651400925095, .7059444943779024, .7066230006055029, .7073006616426692, .707977480340976, .7086534595363333, .7093286020491069, .7100029106842357, .7106763882313484, .7113490374648795, .7120208611441837, .7126918620136494, .7133620428028108, .7140314062264597, .7146999549847549, .7153676917633327, .7160346192334134, .7167007400519098, .7173660568615324, .7180305722908951, .7186942889546185, .719357209453434, .720019336374285, .7206806722904288, .7213412197615364, .7220009813337923, .7226599595399918, .7233181568996399, .7239755759190464, .724632219091423, .7252880888969768, .7259431878030049, .7265975182639874, .727251082721679, .7279038836052013, .7285559233311324, .7292072043035966, .7298577289143543, .7305074995428886, .7311565185564938, .7318047883103603, .7324523111476625, .7330990893996414, .7337451253856901, .7343904214134368, .7350349797788271, .7356788027662066, .7363218926484012, .7369642516867986, .7376058821314261, .7382467862210323, .7388869661831627, .7395264242342394, .7401651625796365, .7408031834137572, .741440488920109, .7420770812713791, .7427129626295076, .7433481351457623, .7439826009608107, .744616362204793, .7452494209973932, .7458817794479106, .7465134396553299, .7471444037083915, .7477746736856601, .7484042516555937, .7490331396766116, .749661339797162, .7502888540557885, .7509156844811968, .75154183309232, .7521673018983844, .7527920928989733, .7534162080840919, .7540396494342302, .7546624189204263, .7552845185043287, .7559059501382585, .7565267157652705, .7571468173192143, .7577662567247944, .7583850358976305, .7590031567443164, .7596206211624794, .7602374310408384, .7608535882592614, .7614690946888241, .7620839521918652, .7626981626220444, .7633117278243974, .7639246496353923, .7645369298829836, .7651485703866682, .7657595729575378, .766369939398335, .7669796715035041, .7675887710592457, .7681972398435691, .768805079626343, .7694122921693485, .7700188792263292, .7706248425430432, .7712301838573123, .7718349048990725, .7724390073904231, .773042493045677, .7736453635714078, .7742476206664997, .7748492660221942, .7754503013221389, .7760507282424334, .776650548451678, .7772497636110178, .7778483753741909, .7784463853875732, .7790437952902235, .7796406067139292, .7802368212832507, .7808324406155657, .781427466321113, .7820219000030365, .7826157432574284, .7832089976733718, .7838016648329837, .7843937463114573, .7849852436771035, .7855761584913932, .7861664923089979, .7867562466778316, .7873454231390905, .787934023227294, .7885220484703245, .7891095003894674, .78969638049945, .7902826903084814, .790868431318291, .7914536050241666, .7920382129149933, .7926222564732914, .7932057371752538, .7937886564907835, .7943710158835304, .7949528168109292, .7955340607242347, .7961147490685586, .7966948832829057, .7972744648002096, .7978534950473676, .7984319754452766, .7990099074088677, .7995872923471412, .8001641316632006, .8007404267542867, .8013161790118125, .8018913898213956, .8024660605628923, .8030401926104308, .8036137873324438, .8041868460917015, .8047593702453443, .8053313611449138, .8059028201363865, .806473748560204, .8070441477513057, .8076140190391593, .808183363747792, .8087521831958219, .8093204786964877, .8098882515576799, .8104555030819705, .8110222345666428, .811588447303722, .8121541425800035, .8127193216770835, .8132839858713867, .8138481364341967, .8144117746316832, .8149749017249316, .8155375189699711, .816099627617802, .8166612289144245, .8172223241008661, .8177829144132087, .8183430010826165, .8189025853353624, .819461668392856, .8200202514716689, .8205783357835622, .821135922535513, .8216930129297397, .8222496081637287, .8228057094302597, .8233613179174317, .8239164348086886, .8244710612828438, .8250251985141056, .8255788476721027, .8261320099219078, .8266846864240632, .8272368783346047, .827788586805086, .8283398129826024, .8288905580098155, .829440823024976, .8299906091619481, .8305399175502322, .8310887493149887, .8316371055770607, .8321849874529976, .8327323960550771, .8332793324913279, .833825797865553, .8343717932773512, .8349173198221393, .835462378591175, .8360069706715774, .83655109714635, .8370947590944016, .8376379575905678, .8381806937056326, .8387229685063494, .8392647830554617, .8398061384117246, .8403470356299247, .8408874757609016, .8414274598515679, .8419669889449293, .8425060640801054, .8430446862923493, .8435828566130675, .84412057606984, .84465784568644, .8451946664828526, .8457310394752956, .8462669656762376, .8468024460944176, .8473374817348641, .8478720735989141, .8484062226842315, .8489399299848259, .8494731964910713, .8500060231897245, .8505384110639432, .8510703610933044, .8516018742538222, .8521329515179663, .852663593854679, .8531938022293939, .8537235776040522, .8542529209371217, .854781833183613, .8553103152950976, .8558383682197243, .8563659929022369, .8568931902839906, .8574199613029695, .8579463068938025, .8584722279877803, .8589977255128725, .8595228003937431, .8600474535517671, .860571685905047, .8610954983684285, .8616188918535168, .8621418672686924, .8626644255191268, .8631865675067983, .8637082941305079, .8642296062858937, .864750504865448, .8652709907585314, .8657910648513881, .8663107280271617, .8668299811659093, .8673488251446174, .867867260837216, .8683852891145937, .8689029108446124, .8694201268921217, .8699369381189732, .8704533453840357, .8709693495432085, .8714849514494362, .8720001519527227, .8725149519001453, .8730293521358685, .873543353501158, .8740569568343945, .8745701629710876, .8750829727438886, .8755953869826052, .8761074065142143, .8766190321628751, .8771302647499432, .8776411050939833, .8781515540107819, .8786616123133618, .8791712808119936, .8796805603142088, .8801894516248137, .8806979555459011, .8812060728768631, .8817138044144045, .882221150952554, .8827281132826775, .883234692193491, .8837408884710714, .8842467028988698, .8847521362577235, .8852571893258682, .8857618628789493, .8862661576900348, .8867700745296263, .8872736141656715, .8877767773635756, .8882795648862128, .8887819774939383, .8892840159445996, .8897856809935476, .8902869733936489, .8907878938952963, .8912884432464204, .8917886221925007, .8922884314765765, .8927878718392589, .8932869440187404, .8937856487508071, .8942839867688488, .8947819588038698, .8952795655845005, .8957768078370067, .8962736862853018, .8967702016509559, .8972663546532074, .8977621460089725, .8982575764328569, .8987526466371646, .899247357331909, .8997417092248232, .90023570302137, .9007293394247513, .9012226191359196, .9017155428535865, .9022081112742335, .9027003250921215, .9031921849993009, .9036836916856209, .90417484583874, .9046656481441341, .9051560992851082, .9056461999428044, .9061359507962115, .9066253525221751, .9071144057954066, .9076031112884924, .9080914696719034, .9085794816140041, .9090671477810619, .9095544688372559, .9100414454446862, .9105280782633834, .9110143679513163, .911500315164402, .9119859205565143, .9124711847794927, .9129561084831508, .9134406923152851, .9139249369216844, .9144088429461374, .9148924110304419, .915375641814413, .9158585359358921, .9163410940307543, .9168233167329184, .9173052046743536, .9177867584850888, .9182679787932209, .9187488662249219, .9192294214044485, .9197096449541494, .9201895374944735, .9206690996439783, .9211483320193369, .9216272352353475, .9221058099049397, .9225840566391834, .9230619760472966, .9235395687366524, .9240168353127874, .9244937763794097, .9249703925384051, .9254466843898465, .9259226525320003, .9263982975613347, .9268736200725265, .9273486206584685, .9278232999102779, .9282976584173026, .9287716967671293, .9292454155455901, .9297188153367703, .9301918967230154, .9306646602849383, .9311371066014265, .9316092362496491, .9320810498050639, .9325525478414245, .9330237309307874, .9334945996435183, .9339651545483003, .9344353962121393, .9349053252003717, .9353749420766716, .9358442474030564, .9363132417398943, .9367819256459111, .9372502996781967, .9377183643922115, .9381861203417932, .9386535680791633, .9391207081549341, .9395875411181145, .9400540675161166, .9405202878947628, .9409862027982911, .9414518127693627, .9419171183490671, .9423821200769295, .9428468184909163, .9433112141274416, .9437753075213736, .9442390992060405, .9447025897132368, .9451657795732294, .9456286693147632, .946091259465068, .946553550549864, .9470155430933681, .9474772376182993, .947938634645885, .9483997346958671, .9488605382865075, .9493210459345939, .9497812581554465, .9502411754629217, .9507007983694208, .9511601273858931, .9516191630218428, .9520779057853349, .9525363561829999, .9529945147200402, .9534523819002355, .9539099582259479, .9543672441981287, .9548242403163215, .9552809470786706, .9557373649819242, .9561934945214409, .9566493361911946, .9571048904837803, .957560157890419, .9580151389009636, .9584698340039032, .9589242436863693, .9593783684341407, .9598322087316485, .9602857650619817, .9607390379068922, .9611920277467992, .9616447350607958, .9620971603266527, .9625493040208236, .9630011666184514, .9634527485933709, .9639040504181161, .9643550725639237, .9648058155007385, .9652562796972185, .9657064656207391, .9661563737373994, .9666060045120247, .9670553584081741, .9675044358881427, .9679532374129683, .9684017634424352, .9688500144350788, .969297990848191, .9697456931378244, .9701931217587966, .9706402771646961, .9710871598078853, .9715337701395063, .9719801086094847, .9724261756665348, .9728719717581634, .9733174973306754, .9737627528291767, .9742077386975799, .9746524553786086, .9750969033138012, .9755410829435159, .9759849947069349, .9764286390420681, .976872016385759, .9773151271736872, .9777579718403738, .9782005508191854, .9786428645423387, .9790849134409042, .9795266979448097, .9799682184828468, .9804094754826725, .9808504693708154, .9812912005726785, .9817316695125434, .9821718766135753, .9826118222978263, .9830515069862399, .9834909310986545, .9839300950538076, .9843689992693404, .9848076441618009, .9852460301466487, .9856841576382579, .9861220270499221, .9865596387938579, .9869969932812083, .9874340909220475, .9878709321253837, .9883075172991641, .9887438468502779, .9891799211845601, .9896157407067957, .9900513058207229, .9904866169290382, .9909216744333976, .9913564787344237, .9917910302317056, .9922253293238062, .9926593764082635, .9930931718815946, .9935267161393003, .9939600095758677, .9943930525847745, .9948258455584919, .9952583888884886, .9956906829652349, .9961227281782049, .9965545249158808, .9969860735657569, .9974173745143414, .9978484281471626, .9982792348487693, .9987097950027365, .9991401089916675, .9995701771971982, 1],
						c = [];

					if (e.moaGL) e.moaGL.renderConvertRGBToLAB(), c = a.getHist(e);
					else {
						var f, m, p = [];
						for (f = 0; r > f; f += 2)
							for (m = 0; t > m; m += 2) {
								o = 4 * m + 4 * f * t;
								var g, v, _, x, M, y, b, C, T, A = h.length;
								b = u[e.data[o]], C = u[e.data[o + 1]], T = u[e.data[o + 2]], x = .00433891 * b + .00376234915 * C + .0018990604648 * T, M = .002126 * b + .007152 * C + 722e-6 * T, y = 177255e-9 * b + .00109475308 * C + .0087295537 * T, x = x > .008856 ? x >= 1 ? h[A - 1] : h[x * A | 0] : 7.787 * x + 16 / 116, M = M > .008856 ? M >= 1 ? h[A - 1] : h[M * A | 0] : 7.787 * M + 16 / 116, y = y > .008856 ? y >= 1 ? h[A - 1] : h[y * A | 0] : 7.787 * y + 16 / 116, g = 116 * M - 16, v = 500 * (x - M), _ = 200 * (M - y), p[0] = 2.55 * g, p[1] = v + 127, p[2] = _ + 127, n[p[0] + .5 | 0] ++, s[p[1] + .5 | 0] ++, l[p[2] + .5 | 0] ++
							}
						c[0] = n, c[1] = s, c[2] = l
					}
					var S, w = a.getcdf(c[1]),
						P = a.getcdf(c[2]),
						F = .1,
						E = .9,
						D = a.cdfinv(w, F),
						L = a.cdfinv(P, F),
						R = a.cdfinv(w, E),
						B = a.cdfinv(P, E),
						O = (D + R) / 2 - 127,
						I = (L + B) / 2 - 127,
						N = 0,
						G = 1,
						U = .5;
					S = 0 > O ? -Math.pow(-U * O, G) : Math.pow(U * O, G), N = 0 > I ? -Math.pow(-U * I, G) : Math.pow(U * I, G);
					var V = 127 / (127 + S),
						k = 127 / (127 + N);
					if (e.moaGL) return e.moaGL.renderConvertLABToRGB(V, k), !0;
					for (f = 0; r > f; f++)
						for (m = 0; t > m; m++) {
							o = 4 * m + 4 * f * t;
							var g, v, _, x, M, y, b, C, T, A = h.length;
							b = u[e.data[o]], C = u[e.data[o + 1]], T = u[e.data[o + 2]], x = .00433891 * b + .00376234915 * C + .0018990604648 * T, M = .002126 * b + .007152 * C + 722e-6 * T, y = 177255e-9 * b + .00109475308 * C + .0087295537 * T, x = x > .008856 ? x >= 1 ? h[A - 1] : h[x * A | 0] : 7.787 * x + 16 / 116, M = M > .008856 ? M >= 1 ? h[A - 1] : h[M * A | 0] : 7.787 * M + 16 / 116, y = y > .008856 ? y >= 1 ? h[A - 1] : h[y * A | 0] : 7.787 * y + 16 / 116, g = 116 * M - 16, v = 500 * (x - M), _ = 200 * (M - y), p[0] = 2.55 * g, p[1] = v + 127, p[2] = _ + 127, p[1] *= V, p[2] *= k;
							var j = d.length,
								W = (p[0] / 2.55 + 16) / 116,
								H = (p[1] - 127) / 500 + W,
								X = W - (p[2] - 127) / 200,
								z = W * W * W,
								Y = H * H * H,
								q = X * X * X;
							W = z > .008856 ? z : (W - 16 / 116) / 7.787, H = Y > .008856 ? Y : (H - 16 / 116) / 7.787, X = q > .008856 ? q : (X - 16 / 116) / 7.787, H = .95047 * H, W = 1 * W, X = 1.08883 * X;
							var K = 3.2406 * H + -1.5372 * W + X * -.4986,
								Z = H * -.9689 + 1.8758 * W + .0415 * X,
								$ = .0557 * H + W * -.204 + 1.057 * X;
							K = 0 >= K ? 0 : K >= 1 ? 1 : d[K * j | 0], Z = 0 >= Z ? 0 : Z >= 1 ? 1 : d[Z * j | 0], $ = 0 >= $ ? 0 : $ >= 1 ? 1 : d[$ * j | 0], K = 255 * K + .5 | 0, Z = 255 * Z + .5 | 0, $ = 255 * $ + .5 | 0;
							var Q, J, ee;
							Q = K + .5 | 0, J = Z + .5 | 0, ee = $ + .5 | 0, Q > 255 ? Q = 255 : 0 > Q && (Q = 0), J > 255 ? J = 255 : 0 > J && (J = 0), ee > 255 ? ee = 255 : 0 > ee && (ee = 0), e.data[o] = Q, e.data[o + 1] = J, e.data[o + 2] = ee
						}
					return !0
				};
				var d = function(e, t, r) {
						var o = e.width,
							a = e.height,
							s = r.blurAmount;
						s *= (o + a) / 1600;
						var l = r.gain,
							u = r.sharpenVal,
							h = Math.round(s / 5 / 2);
						if (e.moaGL) return void e.moaGL.renderClarity(t, h, l, u);
						var d = [];
						f(e, d);
						var m = n.copy(e),
							p = [];
						i.mapHist(m, t), f(m, p);
						var g, v, _, x, M, y, b, C, T, A, S, w, P, F, E, D;
						for (A = 0; a > A; A++)
							for (T = 0; o > T; T++) g = 4 * (o * A + T), S = e.data[g], w = e.data[g + 1], P = e.data[g + 2], M = T - h, y = A - h, b = T + h, C = A + h, M = 0 > M ? 0 : M > o - 1 ? o - 1 : M, y = 0 > y ? 0 : y > a - 1 ? a - 1 : y, b = 0 > b ? 0 : b > o - 1 ? o - 1 : b, C = 0 > C ? 0 : C > a - 1 ? a - 1 : C, D = (C - y + 1) * (b - M + 1), _ = c(d, o, a, M, y, b, C) / D, x = c(p, o, a, M, y, b, C) / D, E = x - _, F = 0 === _ ? x : x / _, v = .2 * S + .7 * w + .1 * P + .5 | 0, S += u * (v - _), w += u * (v - _), P += u * (v - _), S = l * S * F + (1 - l) * (S + E), w = l * w * F + (1 - l) * (w + E), P = l * P * F + (1 - l) * (P + E), e.data[g] = S > 255 ? 255 : 0 > S ? 0 : S + .5 | 0, e.data[g + 1] = w > 255 ? 255 : 0 > w ? 0 : w + .5 | 0, e.data[g + 2] = P > 255 ? 255 : 0 > P ? 0 : P + .5 | 0
					},
					c = function(e, t, r, o, a, i, n) {
						return 0 != o && 0 != a ? (o -= 1, a -= 1, e[n * t + i] - e[n * t + o] + e[a * t + o] - e[a * t + i]) : 0 == o && 0 == a ? e[n * t + i] : 0 == o ? (a -= 1, e[n * t + i] - e[a * t + i]) : (o -= 1, e[n * t + i] - e[n * t + o])
					},
					f = function(e, t) {
						var r, o, a, i, n, s, l = e.width,
							u = e.height;
						for (o = 0; u > o; o++)
							for (r = 0; l > r; r++) a = l * o + r, i = e.data[4 * a], n = e.data[4 * a + 1], s = e.data[4 * a + 2], t[a] = .2 * i + .7 * n + .1 * s + .5 | 0, r > 0 && (t[a] += t[l * o + r - 1]), o > 0 && (t[a] += t[l * (o - 1) + r]), o > 0 && r > 0 && (t[a] -= t[l * (o - 1) + r - 1])
					};
				t.exports = o
			}, {
				"../core/MoaAllocAndCopy": 34,
				"./MoaAdjustmentCurves": 70,
				"./MoaColorConversion": 74,
				"./MoaColorMatrixTransform": 76,
				"./MoaHistogram": 89,
				"./MoaHistogramMapping": 90,
				"./MoaSharpen": 96,
				"./MoaVignette": 98,
				"./legacy/auto_colors_fade_max_color": 100
			}],
			79: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("./MoaHistogramMapping");
				o.exposure = function(e, t) {
					"undefined" == typeof t && (t = 0), t /= 100;
					var r, o = [],
						i = [];
					for (r = 0; 256 > r; r++) {
						var n = r / 255,
							s = Math.pow(n, 1 + .15 * Math.abs(t) - Math.abs(t) * Math.pow(n, .2));
						0 > t && (s = n * (1 - .25 * Math.abs(t)) - .7 * (s - n) * Math.sin(.5 * Math.PI * n)), o[r] = 255 * s + .5 | 0
					}
					i.r = o, i.g = o, i.b = o, a.mapHist(e, i)
				}, t.exports = o
			}, {
				"./MoaHistogramMapping": 90
			}],
			80: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("./MoaHistogramMapping");
				o.fade = function(e, t) {
					"undefined" == typeof t && (t = 0), t /= 100;
					var r, o = [],
						i = [];
					for (r = 0; 256 > r; r++) {
						var n = 1;
						if (128 > r) {
							var s = .55 * t;
							n = 127.5 * Math.pow(r / 255 * 2, 1 + .95 * t), n = (1 - s) * n + .5 * s * 255
						} else {
							var s = .3 * t;
							n = 255 - 127.5 * Math.pow(Math.abs(2 - r / 255 * 2), 1 + .35 * t), n = (1 - s) * n + .5 * s * 255
						}
						o[r] = n + .5 | 0
					}
					i.r = o, i.g = o, i.b = o, a.mapHist(e, i)
				}, t.exports = o
			}, {
				"./MoaHistogramMapping": 90
			}],
			81: [function(e, t, r) {
				"use strict";
				var o = {};
				o.flare = function(e, t, r, o, a, i, n, s, l, u, h, d, c) {
					var f = e.width,
						m = e.height;
					"undefined" == typeof s && (s = 0), "undefined" == typeof l && (l = 0), "undefined" == typeof u && (u = 1), "undefined" == typeof h && (h = 1), "undefined" == typeof r ? r = 0 : 0 > r ? r = 0 : r > 255 && (r = 255), "undefined" == typeof o ? o = 0 : 0 > o ? o = 0 : o > 255 && (o = 255), "undefined" == typeof a ? a = 0 : 0 > a ? a = 0 : a > 255 && (a = 255), "undefined" == typeof i && (i = 1);
					var p = "sinc" === n,
						g = "gaussianThing" === n,
						v = "gaussianThing2" === n,
						_ = "gaussianThing3" === n,
						x = "gaussianThing4" === n,
						M = "angleGaussian" === n,
						y = "stardom" === n,
						b = "lobes" === n,
						C = "stripe" === n,
						T = "stripe2" === n,
						A = "dimondFlare" === n,
						S = "crossFlare" === n,
						w = "cornerFlares" === n,
						P = "fingerFlare" === n,
						F = "blobFlare" === n,
						E = "blah" === n,
						D = "blob" === n,
						L = "blob2" === n;
					if (0 != u && 0 != h && 0 != t && 0 != i) {
						var R = !1,
							B = !1;
						if ("overlay" === d ? B = !0 : R = !0, e.moaGL) return void e.moaGL.renderFlare(d, n, t, {
							r: r,
							g: o,
							b: a,
							a: 255 * i
						}, s, l, u, h, c);
						var O, I, N, G, U, V, k, j, W, H, X = (f - 1) / 2,
							z = (m - 1) / 2,
							Y = Math.log(1 / 255 / i),
							q = 0;
						s *= X, l *= z;
						var K = 1 / t / X / u,
							Z = 1 / t / z / h;
						for (p && (K = 2 / t / (X + z), Z = K), k = 0; m > k; k++)
							for (I = 4 * k * f, W = Z * (k - z - l), V = 0; f > V; V++)
								if (O = I + 4 * V, H = K * (V - X - s), G = 1, p ? (U = 80 * (H * H + W * W), G = 0 === U ? 1 : 1 - .4 * i * (Math.sin(U) / Math.sqrt(U))) : g ? (N = 2 * -(H * H + W * W) - 16 * (W + .5) * (W + .5) * (H + .5) * (H + .5), G = Y > N ? 1 : N > q ? 1 - i : 1 - i * Math.exp(N)) : v ? (N = 2 * -(H * H + W * W) - 16 * (W + 1) * (W + 1) * (H - .5) * (H - .5), G = Y > N ? 1 : N > q ? 1 - i : 1 - i * Math.exp(N)) : _ ? (U = H * H + W * W, N = 2 * -U - 1 * (W + 1.7) * (W + 1.7) * (H - .6) * (H - .6), G = Y > N ? 1 : N > q ? 1 - i : 1 - i * Math.exp(N)) : x ? (U = H * H + W * W, N = -.5 * (W - 1.7) * (W - 1.7) * (H + .6) * (H + .6) - .5 * (W + 1.7) * (W + 1.7) * (H - .6) * (H - .6), G = Y > N ? 1 : N > q ? 1 - i : 1 - i * Math.exp(N)) : M ? (N = 2 * -(H * H + W * W) - 5 * (H + .2) * (W + .2) * H * H, G = Y > N ? 1 : N > q ? 1 - .5 * i : 1 - .5 * i * Math.exp(N)) : y ? (U = H * H + W * W, j = Math.atan2(W, H), G = 1 - .2 * i * (1 - U * U * Math.sin(10 * j))) : b ? (U = H * H + W * W, j = Math.atan2(W, H), G = 1 - .5 * i * Math.exp(2 * -U) * (.5 + .5 * Math.sin(4 * j + 1))) : C ? (N = -(H * H) - W * W / 64, G = Y > N ? 1 : N > q ? 1 - i : 1 - i * Math.exp(N)) : T ? (N = -(W * W) - H * H / 64, G = Y > N ? 1 : N > q ? 1 - i : 1 - i * Math.exp(N)) : A ? (U = H * H + W * W, G = 1 - i * Math.exp(2 * -(U * U) + -8 * (W + .5) * (W - .5) * (H + .5) * (H - .5))) : S ? (U = H * H + W * W, N = 2 * -(U / 180) - 16 * (W + .5) * (W + .5) * (H + .5) * (H + .5), G = Y > N ? 1 : N > q ? 1 - i : 1 - i * Math.exp(N)) : w ? (U = H * H + W * W, G = 1 - i * Math.exp(2 * -(U / 180)) * Math.exp(-8 * (W + 1) * (W - 1) * (H + 1) * (H - 1))) : P ? (W = Z * (k - z - l) - 1, H = K * (V - X - s) - 1, U = (H + 1) * H + W * W, G = i * Math.exp(W / H + -U * Math.exp(Math.exp(W) * H)), G = 1 - c * (1 - G)) : F ? (U = H * H + W * W, G = 1 - i * Math.exp(-Math.pow(U, 2) + -.9 * (W - 1.7) * (W + .5) * (H - 1.5) * (H + .5))) : E ? (U = H * H + W * W, j = Math.atan2(W, H), G = Y > N ? 1 : N > q ? 1 - i : 1 - .2 * i * (1 - Math.sin(U) * Math.sin(10 * U) * Math.sin(10 * j))) : L ? (N = -10 * (W * W + H * H) * (W * W + H * H), G = Y > N ? 1 : N > q ? 1 - i : 1 - i * Math.exp(N)) : D && (N = 100 * -Math.pow(W * W + H * H, 4), G = Y > N ? 1 : N > q ? 1 - i : 1 - i * Math.exp(N)), G = 0 > G ? 0 : G > 1 ? 1 : G, B) {
									var $ = e.data[O],
										Q = e.data[O + 1],
										J = e.data[O + 2];
									$ = 64 >= $ ? G * $ + (1 - G) * (2 * $ * r / 255) : $ >= 192 ? G * $ + (1 - G) * (65025 - 2 * (255 - $) * (255 - r)) / 255 : G * $ + (1 - G) * ($ * $ * (510 - 4 * r) / 255 / 255 + $ * (4 * r - 255) / 255 + (255 - 2 * r) / 8), Q = 64 >= Q ? G * Q + (1 - G) * (2 * Q * o / 255) : Q >= 192 ? G * Q + (1 - G) * (65025 - 2 * (255 - Q) * (255 - o)) / 255 : G * Q + (1 - G) * (Q * Q * (510 - 4 * o) / 255 / 255 + Q * (4 * o - 255) / 255 + (255 - 2 * o) / 8), J = 64 >= J ? G * J + (1 - G) * (2 * J * a / 255) : J >= 192 ? G * J + (1 - G) * (65025 - 2 * (255 - J) * (255 - a)) / 255 : G * J + (1 - G) * (J * J * (510 - 4 * a) / 255 / 255 + J * (4 * a - 255) / 255 + (255 - 2 * a) / 8), e.data[O] = $, e.data[O + 1] = Q, e.data[O + 2] = J
								} else e.data[O] = e.data[O] * G + r * (1 - G) + .5 | 0, e.data[O + 1] = e.data[O + 1] * G + o * (1 - G) + .5 | 0, e.data[O + 2] = e.data[O + 2] * G + a * (1 - G) + .5 | 0
					}
				}, t.exports = o
			}, {}],
			82: [function(e, t, r) {
				"use strict";

				function o(e) {
					this.left = e.l, this.right = e.r, this.top = e.t, this.bottom = e.b, this.topLeft = e.tl, this.topRight = e.tr, this.bottomLeft = e.bl, this.bottomRight = e.br
				}

				function a() {
					for (var e = {}, t = ["top", "bottom", "left", "right", "topLeft", "bottomLeft", "topRight", "bottomRight"], r = 0; r < t.length; r++) e[t[r]] = {
						x: 0,
						y: 0,
						width: 0,
						height: 0,
						numTilesX: 0,
						numTilesY: 0
					};
					return e
				}

				function i(e, t, r, o) {
					var a = {},
						i = Math.min(e.width, e.height),
						n = .25 * (t.top.height + t.bottom.height + t.left.width + t.right.width);
					a.leftWidthPixels = r * i * t.left.width / n, a.rightWidthPixels = r * i * t.right.width / n, a.topHeightPixels = r * i * t.top.height / n, a.bottomHeightPixels = r * i * t.bottom.height / n, a.sideTileAreaHeightPixels = e.height - a.topHeightPixels - a.bottomHeightPixels, a.topTileAreaWidthPixels = e.width - a.leftWidthPixels - a.rightWidthPixels;
					var s = a.leftWidthPixels * t.left.height / t.left.width,
						l = a.rightWidthPixels * t.right.height / t.right.width,
						u = a.topHeightPixels * t.top.width / t.top.height,
						h = a.bottomHeightPixels * t.bottom.width / t.bottom.height,
						d = a.sideTileAreaHeightPixels / s,
						c = a.sideTileAreaHeightPixels / l,
						f = a.topTileAreaWidthPixels / u,
						p = a.topTileAreaWidthPixels / h;
					if (a.numLeftTiles = Math.round(d), a.numRightTiles = Math.round(c), a.numTopTiles = Math.round(f), a.numBottomTiles = Math.round(p), a.error = (d - a.numLeftTiles) * (d - a.numLeftTiles) + (c - a.numRightTiles) * (c - a.numRightTiles) + (f - a.numTopTiles) * (f - a.numTopTiles) + (p - a.numBottomTiles) * (p - a.numBottomTiles), 0 == a.numLeftTiles || 0 == a.numTopTiles || 0 == a.numBottomTiles || 0 == a.numRightTiles) {
						if (a.error = 1, 0 == a.numLeftTiles || 0 == a.numRightTiles) {
							var g = a.topHeightPixels / (a.topHeightPixels + a.bottomHeightPixels);
							a.topHeightPixels = g * e.height, a.bottomHeightPixels = e.height - a.topHeightPixels, a.sideTileAreaHeightPixels = 0, a.numLeftTiles = 0, a.numRightTiles = 0
						}
						if (0 == a.numTopTiles || 0 == a.numBottomTiles) {
							var v = a.leftWidthPixels / (a.leftWidthPixels + a.rightWidthPixels);
							a.leftWidthPixels = v * e.width, a.rightWidthPixels = e.width - a.leftWidthPixels, a.topTileAreaWidthPixels = 0, a.numTopTiles = 0, a.numBottomTiles = 0
						}
					}
					return a.error += (r - o) * (r - o) * m, a
				}
				var n = e("./MoaComposite"),
					s = e("../core/MoaDataTypes"),
					l = (s.MoaPoint, e("../core/MoaMipmap"), e("./MoaResize")),
					u = e("../core/MoaAllocAndCopy"),
					h = .03,
					d = .5,
					c = .04,
					f = 100,
					m = 16,
					p = {};
				p.applyFrame = function(e, t, r, a, i) {
					if (!p.validateFrameSegments(t)) return !1;
					var n = new o(t),
						s = p.getSegmentAttributes(e, n, r, a);
					return p.applySegment(e, n.topLeft, s.topLeft, i), p.applySegment(e, n.top, s.top, i), p.applySegment(e, n.topRight, s.topRight, i), p.applySegment(e, n.left, s.left, i), p.applySegment(e, n.right, s.right, i), p.applySegment(e, n.bottomLeft, s.bottomLeft, i), p.applySegment(e, n.bottom, s.bottom, i), p.applySegment(e, n.bottomRight, s.bottomRight, i), !0
				}, p.getOptimalWidth = function(e, t, r) {
					if (0 == t.left.width || 0 == t.right.width || 0 == t.top.height || 0 == t.bottom.height) return r();
					for (var o, a, n = r, s = (d - h) / f, a = i(e, t, r, r), l = h; d >= l; l += s) {
						var o = i(e, t, l, r);
						o.error < a.error && (a = o, n = l)
					}
					var u = Math.max(h, n - c),
						m = Math.min(d, n + c);
					s = (m - u) / f;
					for (var l = u; m >= l; l += s) {
						var o = i(e, t, l, r);
						o.error < a.error && (a = o, n = l)
					}
					return n
				}, p.validateFrameSegments = function(e) {
					for (var t = 0; t < e.length; t++) {
						var r = e[t];
						if ("object" != typeof r.data || "number" != typeof r.width || "number" != typeof r.height) return !1
					}
					return !0
				}, p.getSegmentAttributes = function(e, t, r, o) {
					if (0 == t.left.width || 0 == t.right.width || 0 == t.top.height || 0 == t.bottom.height) return a();
					var n = {
							width: e.width,
							height: e.height
						},
						s = r;
					o.width > 0 && o.height > 0 && (s = p.getOptimalWidth(o, t, r), n = o);
					var l = i(n, t, s),
						u = l.topHeightPixels / n.height,
						h = l.bottomHeightPixels / n.height,
						d = l.leftWidthPixels / n.width,
						c = l.rightWidthPixels / n.width,
						f = l.sideTileAreaHeightPixels / n.height,
						m = l.topTileAreaWidthPixels / n.width,
						g = {};
					return g.left = {
						x: 0,
						y: u,
						width: d,
						height: f,
						numTilesX: 1,
						numTilesY: l.numLeftTiles
					}, g.right = {
						x: 1 - c,
						y: u,
						width: c,
						height: f,
						numTilesX: 1,
						numTilesY: l.numRightTiles
					}, g.top = {
						x: d,
						y: 0,
						width: m,
						height: u,
						numTilesX: l.numTopTiles,
						numTilesY: 1
					}, g.bottom = {
						x: d,
						y: 1 - h,
						width: m,
						height: h,
						numTilesX: l.numBottomTiles,
						numTilesY: 1
					}, g.topLeft = {
						x: 0,
						y: 0,
						width: d,
						height: u,
						numTilesX: 1,
						numTilesY: 1
					}, g.topRight = {
						x: 1 - c,
						y: 0,
						width: c,
						height: u,
						numTilesX: 1,
						numTilesY: 1
					}, g.bottomLeft = {
						x: 0,
						y: 1 - h,
						width: d,
						height: h,
						numTilesX: 1,
						numTilesY: 1
					}, g.bottomRight = {
						x: 1 - c,
						y: 1 - h,
						width: c,
						height: h,
						numTilesX: 1,
						numTilesY: 1
					}, g
				}, p.applySegment = function(e, t, r, o) {
					if (0 != r.numTilesY && 0 != r.numTilesY && 0 != r.height && 0 != r.width) {
						var a, i = r.numTilesX,
							s = r.numTilesY,
							h = r.width / i,
							d = r.height / s,
							c = h * e.width | 0,
							f = d * e.height | 0,
							m = c < .5 * t.width || f < .5 * t.height;
						if (m) {
							var p = Math.min(c, t.width),
								g = Math.min(f, t.height);
							a = u.makeBitmap(p, g), l.downscalePremultipliedImage(a, t)
						} else a = t;
						for (var v = 0; s > v; v++)
							for (var _ = r.y + v * d, x = 0; i > x; x++) {
								var M = r.x + x * h,
									y = [M, _, h, d];
								n.compositePremultipliedBitmap(e, a, y, 0, !1, o, 1)
							}
						m && (a.data = null)
					}
				}, t.exports = p
			}, {
				"../core/MoaAllocAndCopy": 34,
				"../core/MoaDataTypes": 37,
				"../core/MoaMipmap": 39,
				"./MoaComposite": 77,
				"./MoaResize": 94
			}],
			83: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("./MoaHistogramMapping");
				o.gamma = function(e, t) {
					"undefined" == typeof t && (t = 1);
					var r, o = [],
						i = [];
					for (r = 0; 256 > r; r++) o[r] = 255 * Math.pow(r / 255, t) + .5 | 0;
					i.r = o, i.g = o, i.b = o, a.mapHist(e, i)
				}, t.exports = o
			}, {
				"./MoaHistogramMapping": 90
			}],
			84: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../core/MoaColor");
				o.memoizeGradient = function(e, t, r) {
					var o, a, i, n, s, l, u, h, d, c, f = r / 4;
					if (e.colors.length < 1)
						for (o = 0; f > o; o++) t[4 * o] = 255, t[4 * o + 1] = 255, t[4 * o + 2] = 255;
					else if (1 === e.colors.length)
						for (o = 0; f > o; o++) t[4 * o] = e.colors[0].color.r, t[4 * o + 1] = e.colors[0].color.g, t[4 * o + 2] = e.colors[0].color.b;
					else
						for (u = 0, h = 1, o = 0; f > o; o++) {
							for (n = 1 - (f - 1 - o) / (f - 1); e.colors[h].location <= 100 * n && "object" == typeof e.colors[h + 1];) h++, u++;
							e.colors[u].location == e.colors[h].location ? a = 1 : (a = (100 * n - e.colors[u].location) / (e.colors[h].location - e.colors[u].location), a = Math.max(0, Math.min(1, a))), a += 12 * (1 + 1.5 * Math.abs(a - .5)) * Math.sin(2 * Math.PI * (a - .5)) / 255, a = Math.max(0, Math.min(1, a)), s = e.colors[u].color, l = e.colors[h].color, i = 1 - a, t[4 * o] = Math.max(0, Math.min(255, Math.round(s.r * i + a * l.r))), t[4 * o + 1] = Math.max(0, Math.min(255, Math.round(s.g * i + a * l.g))), t[4 * o + 2] = Math.max(0, Math.min(255, Math.round(s.b * i + a * l.b)))
						}
					if (e.opacities.length < 1)
						for (o = 0; f > o; o++) t[4 * o + 3] = 255;
					else if (1 === e.opacities.length)
						for (o = 0; f > o; o++) t[4 * o + 3] = 255 * e.opacities[0].opacity + .5 | 0;
					else
						for (u = 0, h = 1, o = 0; f > o; o++) {
							for (n = 1 - (f - 1 - o) / (f - 1); e.opacities[h].location <= 100 * n && h + 1 < e.opacities.length;) h++, u++;
							e.opacities[u].location == e.opacities[h].location ? a = 1 : (a = (100 * n - e.opacities[u].location) / (e.opacities[h].location - e.opacities[u].location), a = Math.max(0, Math.min(1, a))), a += 12 * (1 + 1.5 * Math.abs(a - .5)) * Math.sin(2 * Math.PI * (a - .5)) / 255, a = Math.max(0, Math.min(1, a)), i = 1 - a, d = e.opacities[u].opacity, c = e.opacities[h].opacity, t[4 * o + 3] = 0 | Math.max(0, Math.min(255, 255 * (d * i + c * a)))
						}
				}, o.applyGradient = function(e, t, r, i, n, s, l, u, h, d) {
					if ("string" != typeof h && (h = "normal"), "number" != typeof d && (h = 1), 0 != i) {
						var c = e.width,
							f = e.height,
							m = [],
							p = 1024,
							g = 4 * p;
						o.memoizeGradient(t, m, g);
						var v, _, x, M, y, b = u.shapeMode,
							C = "sharp" === b,
							T = "ultraSharp" === b,
							A = "mediumSharp" === b,
							S = ("undefined" == typeof u.stretch ? !0 : u.stretch, u.dx),
							w = u.dy,
							P = u.vignetteScale,
							F = 1.15,
							E = Math.pow(P, 2) / F,
							D = 1 / E,
							L = (c - 1) / 2,
							R = (f - 1) / 2;
						S *= L, w *= R;
						var B, O, I, N, G, U, V, k, j, W, H = 5 / 3,
							X = 34 / 45,
							z = 13 / 63,
							Y = 514 / 14175,
							q = d,
							K = "linear" === r,
							Z = "linearVignette" === r,
							$ = "radial" === r;
						V = k = j = 0;
						var Q = new a,
							J = Math.sin(l),
							ee = Math.cos(l);
						if (e.moaGL) return u.gradientShape = r, u.xCenter = n, u.yCenter = s, u.scale = i, void e.moaGL.renderGradient(u, m, h, d, J, ee, D);
						for (U = 0; f > U; U++)
							for (B = (U / f - s) / i, G = 0; c > G; G++) {
								I = 4 * (U * c + G), O = (G / c - n) / i, K ? N = ee * O - J * B : $ ? N = Math.sqrt(O * O + B * B) : Z && (N = ee * O - J * B, v = ((G - L - S) * (G - L - S) / c / c + (U - R - w) * (U - R - w) / f / f) * D, C && (v *= v), T && (v *= v, v *= v), A && (v = Math.pow(v, 1.5)), v > F ? d = q : .04 > v ? d = 0 : (_ = v * v, x = _ * _, M = x * _, y = M * _, d = q * (1 - (1 - 2 * _ + H * x - X * M + z * y - Y * y * _)))), N = 0 > N ? 0 : N > 1 ? 1 : N, W = Math.floor(N * (p - 1) + .5);
								var te = {
									r: m[4 * W],
									g: m[4 * W + 1],
									b: m[4 * W + 2],
									a: m[4 * W + 3] * d | 0
								};
								Q.blendEmbededAlphaFromArray(e.data, I, te, h)
							}
					}
				}, t.exports = o
			}, {
				"../core/MoaColor": 36
			}],
			85: [function(e, t, r) {
				"use strict";

				function o(e, t) {
					var r = [];
					return r[0] = e[0] * t[0] + e[1] * t[4] + e[2] * t[8] + e[3] * t[12], r[1] = e[0] * t[1] + e[1] * t[5] + e[2] * t[9] + e[3] * t[13], r[2] = e[0] * t[2] + e[1] * t[6] + e[2] * t[10] + e[3] * t[14], r[3] = e[0] * t[3] + e[1] * t[7] + e[2] * t[11] + e[3] * t[15], r[4] = e[4] * t[0] + e[5] * t[4] + e[6] * t[8] + e[7] * t[12], r[5] = e[4] * t[1] + e[5] * t[5] + e[6] * t[9] + e[7] * t[13], r[6] = e[4] * t[2] + e[5] * t[6] + e[6] * t[10] + e[7] * t[14], r[7] = e[4] * t[3] + e[5] * t[7] + e[6] * t[11] + e[7] * t[15], r[8] = e[8] * t[0] + e[9] * t[4] + e[10] * t[8] + e[11] * t[12], r[9] = e[8] * t[1] + e[9] * t[5] + e[10] * t[9] + e[11] * t[13], r[10] = e[8] * t[2] + e[9] * t[6] + e[10] * t[10] + e[11] * t[14], r[11] = e[8] * t[3] + e[9] * t[7] + e[10] * t[11] + e[11] * t[15], r[12] = e[12] * t[0] + e[13] * t[4] + e[14] * t[8] + e[15] * t[12], r[13] = e[12] * t[1] + e[13] * t[5] + e[14] * t[9] + e[15] * t[13], r[14] = e[12] * t[2] + e[13] * t[6] + e[14] * t[10] + e[15] * t[14], r[15] = e[12] * t[3] + e[13] * t[7] + e[14] * t[11] + e[15] * t[15], r
				}

				function a(e) {
					var t = [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8], e[9], e[10], e[11], e[12], e[13], e[14], e[15]];
					return t
				}

				function i(e, t, r, i) {
					var n = a(e);
					"number" != typeof i && (i = 0);
					var s = [1, 0, 0, t, 0, 1, 0, r, 0, 0, 1, i, 0, 0, 0, 1];
					return n = o(n, s)
				}

				function n(e, t, r) {
					var a = i(e, .5, .5),
						n = [t, 0, 0, 0, 0, r, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
					return a = o(a, n), a = i(a, -.5, -.5)
				}
				var s = {},
					l = e("./MoaGradient"),
					u = (e("./MoaBitmapBlend"), e("../core/MoaEnums")),
					h = e("../core/MoaColor");
				s.GradientFlareShapeLine = "line", s.GradientFlareShapeCircle = "circle", s.GradientFlareShapeGaussian = "gaussian", s.GradientFlareShapeSquare = "square", s.GradientFlareShapeSquareRound = "squareRound", s.GradientFlareShapeStardom = "stardom", s.GradientFlareShapeLobes = "lobes", s.GradientFlareShapeRingLobes = "ringLobes", s.GradientFlareShapeHeart = "heart", s.GradientFlareShapeStar = "star", s.GradientFlareShapeCrescent = "crescent", s.GradientFlareShapeSquiggly = "squiggly", s.GradientFlareShapeZigzag = "zigzag", s.GradientFlareShapeSpiral = "spiral", s.GradientFlareAspectModeStretch = "stretch", s.GradientFlareAspectModeAverage = "average", s.GradientFlareAspectModeFite = "fit", s.GradientFlareAspectModeFill = "fill", s.GradientFlareWrapModeClamp = "clamp", s.GradientFlareWrapModeRepeat = "repeat", s.GradientFlareWrapModeMirroredRepeat = "mirroredRepeat", s.gradientFlare = function(t, r) {
					var o, a = (e("../core/MoaAllocAndCopy"), 4096),
						i = [];
					if (!t.moaGL) {
						var n;
						for (n = 0; n < r.gradient.opacities.length; n++) r.gradient.opacities[n].opacity *= r.alpha
					}
					l.memoizeGradient(r.gradient, i, a);
					var u = "true" === r.invertGradient;
					o = t;
					var h = {
						gradientTransform: r.gradientTransform.slice(0),
						gradientShapeType: r.gradientShapeType,
						gradientParams: r.gradientParams.slice(0),
						aspectMode: r.aspectMode,
						gradientWrapMode: r.gradientWrapMode
					};
					return h.gradMapLength = a, h.gradMap = i, h.blendMode = r.blendMode, h.alpha = r.alpha, h.invertGradient = u, t.moaGL ? void t.moaGL.renderGradientFlare(h) : void s.renderShape(o, h)
				}, s.copyAlpha = function(e, t) {
					var r, o = e.data.length;
					for (r = 0; o > r; r += 4) e.data[r + 3] = t.data[r + 3]
				}, s.renderShape = function(e, t) {
					var r, o, i, s, l, d, c, f = e.width,
						m = e.height,
						p = t.gradMapLength,
						g = (t.isMask, t.gradMap);
					c = u.getShapeModeIndex(t.gradientShapeType), l = a(t.gradientTransform), d = t.gradientParams;
					var i, s, v, _, x, M, y, b, C, T, A, S, w, P, F, E, D = "repeat" == t.gradientWrapMode,
						L = "mirroredRepeat" == t.gradientWrapMode,
						R = new h;
					if ("stretch" == t.aspectMode) l[3] -= .5, l[7] -= .5;
					else if ("average" == t.aspectMode) {
						l[3] -= .5, l[7] -= .5;
						var B = (f + m) / 2;
						l = n(l, f / B, m / B)
					} else if ("fill" == t.aspectMode) {
						l[3] -= .5, l[7] -= .5;
						var O = Math.max(f, m);
						l = n(l, f / O, m / O)
					} else if ("fit" == t.aspectMode) {
						l[3] -= .5, l[7] -= .5;
						var I = Math.min(f, m);
						l = n(l, f / I, m / I)
					}
					if (6 == c || 7 == c || 8 == c) var N = Math.floor(d[0]),
						G = d[1],
						U = d[2];
					if (10 == c) var N = Math.max(1, Math.floor(d[0]));
					if (14 == c) var V = Math.round(d[1]);
					for (o = 0; m > o; o++)
						for (s = o / (m - 1), v = l[1] * s + l[3], _ = l[5] * s + l[7], b = 4 * f * o, r = 0; f > r; r++) {
							if (C = b + 4 * r, i = r / (f - 1), x = v + l[0] * i, M = _ + l[4] * i, 12 == c) y = .5 + .5 * Math.sin(x + 2 * d[0] * Math.sin(M));
							else if (1 == c) y = .5 + .5 * x;
							else if (5 == c) {
								var k = d[0];
								y = 0 == k ? Math.max(x, M) : Math.pow(Math.pow(Math.abs(x), k) + Math.pow(Math.abs(M), k), 1 / k)
							} else if (2 == c) y = Math.sqrt(x * x + M * M);
							else if (3 == c) {
								var j = d[0] * ((M - d[2]) * (M - d[2]) + (x - d[3]) * (x - d[3])) + d[1] * (M - d[4]) * (M - d[4]) * (x - d[5]) * (x - d[5]);
								y = Math.exp(j)
							} else if (4 == c) y = Math.max(Math.abs(x), Math.abs(M));
							else if (6 == c) {
								var W = x * x + M * M,
									H = Math.atan2(M, x);
								y = W * W * Math.sin(N * H / 2)
							} else if (7 == c) {
								var W = x * x + M * M,
									H = Math.atan2(M, x);
								y = 1 - .5 * Math.exp(-W) * (1 + Math.sin(H * N))
							} else if (8 == c) {
								var W = x * x + M * M,
									H = Math.atan2(M, x);
								y = 1 - (1 - Math.sin(G * W + Math.PI / 2) * Math.sin(U * W + Math.PI / 2) * Math.sin(N * H / 2 + Math.PI / 2))
							} else if (9 == c) {
								var W = x * x + M * M,
									X = Math.sqrt(W),
									z = -M / X,
									Y = x / X,
									q = Y;
								0 > Y && (q = -Y);
								var K = 2 - 2 * z + d[0] * z * Math.sqrt(q) / (z + d[1]);
								y = X - K
							} else if (10 == c) {
								var W = x * x + M * M,
									X = Math.sqrt(W),
									Z = Math.PI / N,
									H = 2 * Math.PI - Math.atan2(M, x) - Math.PI / 2,
									$ = 1,
									Q = d[2],
									J = 0,
									A = H / Z - (H / Z | 0);
								if ((H / Z | 0) % 2 == 0) var ee = Z / 2,
									te = Math.PI - A - ee,
									re = $ * Math.sin(ee) / Math.sin(te);
								else {
									A = 1 - A;
									var ee = Z / 2,
										te = Math.PI - A - ee,
										re = $ * Math.sin(ee) / Math.sin(te)
								}
								var J = Q + ($ - Q) * ((1 - d[1]) * re + d[1] * (1 - A));
								y = X - J
							} else if (11 == c) {
								var oe = 1,
									ae = d[1],
									ie = d[0] * (oe + ae),
									X = Math.sqrt(x * x + M * M),
									ne = Math.sqrt((x - ie) * (x - ie) + M * M),
									y = 1;
								if (ne >= ae && X >= oe) y = 1;
								else if (ae >= ne && oe >= X) y = 1;
								else if (ae >= ne && X > oe) y = 1;
								else {
									y = X / oe;
									var se = 1 - X / oe,
										le = ne / ae - 1;
									y = 1 - Math.min(se, le)
								}
							} else if (0 == c) y = 1;
							else if (13 == c) {
								var H = 2 * (x - Math.floor(d[0] + x));
								y = 0 > H ? M + H / d[0] : M - H / (1 - d[0])
							} else if (14 == c) {
								var ue = x * x + M * M,
									he = Math.atan2(M, x);
								y = Math.sqrt(ue) + he * V / 2 / Math.PI
							} else y = 0;
							y = t.invertGradient ? 1 - y : y, D ? y -= Math.floor(y) : L && (Math.floor(y) % 2 != 0 ? (y -= Math.floor(y), y = 1 - y) : y -= Math.floor(y)), y = 0 > y ? 0 : y > 1 ? 1 : y, T = (p / 4 - 1) * y, A = T - (0 | T), S = 1 - A, T = 4 * (0 | T), 0 != A ? (w = S * g[0 + T] + A * g[4 + T], P = S * g[1 + T] + A * g[5 + T], F = S * g[2 + T] + A * g[6 + T], E = S * g[3 + T] + A * g[7 + T]) : (w = g[0 + T], P = g[1 + T], F = g[2 + T], E = g[3 + T]);
							var de = {
								r: w,
								g: P,
								b: F,
								a: E
							};
							R.blendEmbededAlphaFromArray(e.data, C, de, t.blendMode)
						}
				}, t.exports = s
			}, {
				"../core/MoaAllocAndCopy": 34,
				"../core/MoaColor": 36,
				"../core/MoaEnums": 38,
				"./MoaBitmapBlend": 72,
				"./MoaGradient": 84
			}],
			86: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("./MoaGradient"),
					i = (e("./MoaBitmapBlend"), e("../core/MoaColor"));
				o.gradientMap = function(e, t) {
					var r = 1024,
						i = [];
					if (a.memoizeGradient(t.gradient, i, r), e.moaGL) {
						var n = {
							transformGradient: t.gradientTransform,
							invertGradient: "true" === t.invertGradient ? 1 : 0,
							gradientParams: t.gradientParams,
							gradientVariable: t.gradientVariable,
							blendMode: t.blendMode,
							aspectMode: t.aspectMode,
							alpha: t.alpha,
							gradMap: i
						};
						return void e.moaGL.renderGradientMap(n)
					}
					o.applyGradientMap(e, t, r, i, t.blendMode, t.alpha)
				}, o.applyGradientMap = function(e, t, r, o, a, n) {
					for (var s = (e.width, e.height, e.data), l = e.data, u = t.gradientVariable, h = "true" === t.invertGradient, d = 0, c = new i; d < s.length;) {
						var f, m = s[d],
							p = s[d + 1],
							g = s[d + 2];
						f = "intensity" == u ? .2 * m + .7 * p + .1 * g : "chroma" == u ? Math.max(m, p, g) - Math.min(m, p, g) : "redChannel" == u ? m : "greenChannel" == u ? p : "blueChannel" == u ? g : "maxChannel" == u ? Math.max(m, p, g) : "minChannel" == u ? Math.min(m, p, g) : 0, f = 0 > f ? 0 : f > 255 ? 255 : f, h && (f = 255 - f), f = (r / 4 - 1) * (f / 255);
						var v = f - (0 | f),
							_ = 4 * (0 | f);
						if (_ == r - 4) var x = o[_],
							M = o[_ + 1],
							y = o[_ + 2],
							b = o[_ + 3];
						else var x = (1 - v) * o[_] + v * o[_ + 4],
							M = (1 - v) * o[_ + 1] + v * o[_ + 5],
							y = (1 - v) * o[_ + 2] + v * o[_ + 6],
							b = (1 - v) * o[_ + 3] + v * o[_ + 7];
						var C = {
								r: x,
								g: M,
								b: y,
								a: b
							},
							T = [m, p, g, 255];
						c.blendEmbededAlphaFromArray(T, 0, C, "normal"), C = {
							r: T[0],
							g: T[1],
							b: T[2],
							a: 255 * n
						}, c.blendEmbededAlphaFromArray(l, d, C, a), d += 4
					}
				}, o.copyAlpha = function(e, t) {
					var r, o = e.data.length;
					for (r = 0; o > r; r += 4) e.data[r + 3] = t.data[r + 3]
				}, t.exports = o
			}, {
				"../core/MoaColor": 36,
				"./MoaBitmapBlend": 72,
				"./MoaGradient": 84
			}],
			87: [function(e, t, r) {
				"use strict";

				function o(e, t, r, o) {
					var a, i, n, s = 30,
						l = 500,
						u = 1,
						h = 40,
						d = [],
						c = [];
					for (i = n = [], b = 0; l > b; b++) a = 4 * (Math.floor(Math.random() * t * 1 / 2 + 1 * t / 4) + t * Math.floor(Math.random() * r * 1 / 2 + 1 * r / 4)), n[0] = e[a], n[1] = e[a + 1], n[2] = e[a + 2], c[b] = n, s > b && (d[b] = c[b]);
					for (var f, m, p, g, v = !0, _ = 1, x = [], M = [], y = 0; v && h > _;) {
						_++, v = !1;
						for (var b = 0; l > b; b++) {
							for (g = 195075e6, f = 0, C = 0; s > C; C++) p = Math.abs(Math.abs(c[b][1] - d[C][1])), g > p && (g = p, f = C);
							"undefined" == typeof x[f] && (x[f] = []), x[f].push(b), d[f][3] = x[f].length
						}
						for (var C = 0; s > C; C++)
							if (M = [0, 0, 0, d[C][3]], "undefined" != typeof x[C] && 0 != x[C].length) {
								for (var T = 0; T < x[C].length; T++) m = c[x[C][T]], M[0] += m[0], M[1] += m[1], M[2] += m[2];
								x[C].length && (M[0] /= x[C].length, M[1] /= x[C].length, M[2] /= x[C].length), y = M, Math.pow(d[C][0] - y[0], 2) > u && Math.pow(d[C][1] - y[1], 2) > u && Math.pow(d[C][2] - y[2], 2) > u && (v = !0), d[C] = M
							} else x[C] = []
					}
				} {
					var a = {};
					e("../core/MoaAllocAndCopy"), e("../core/MoaEnums"), e("./MoaBitmapBlend"), e("./MoaBlendWithColor"), e("./MoaColorMatrixTransform"), e("./MoaSharpen")
				}
				a.halftone = function(e, t, r, o) {
					return e.moaGL ? !0 : void a.dotsOnePass(e, t, r, o)
				}, a.magazine = function(e, t, r, o) {
					return e.moaGL ? !0 : void a.dotsOnePass(e, t, r, o)
				}, a.dotsOnePass = function(e, t, r, a) {
					return void o(e, t, r, a)
				};
				t.exports = a
			}, {
				"../core/MoaAllocAndCopy": 34,
				"../core/MoaEnums": 38,
				"./MoaBitmapBlend": 72,
				"./MoaBlendWithColor": 73,
				"./MoaColorMatrixTransform": 76,
				"./MoaSharpen": 96
			}],
			88: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("./MoaHistogramMapping");
				o.highlights = function(e, t) {
					"undefined" == typeof t && (t = 0), t /= 100;
					var r, o = [],
						i = [];
					for (r = 0; 256 > r; r++) {
						var n = r / 255,
							s = -3.68113 + 4.829 * (r / 3 + 1) - .299125 * Math.pow(r / 3 + 1, 2) + .006449275 * Math.pow(r / 3 + 1, 3) - 474531e-10 * Math.pow(r / 3 + 1, 4);
						if (0 > s && (s = 0), .25 >= t) {
							var l = t;
							s = l * s + r
						} else {
							var u, l = (t - .25) / .75,
								h = 34 * l / 255;
							u = .5 > n ? 255 * ((1 - 2 * h) * n + h) : r, s = t * s + u
						}
						o[255 - r] = 255 - (s + .5 | 0), o[255 - r] = o[255 - r] < 0 ? 0 : o[255 - r] > 255 ? 255 : o[255 - r]
					}
					i.r = o, i.g = o, i.b = o, a.mapHist(e, i)
				}, t.exports = o
			}, {
				"./MoaHistogramMapping": 90
			}],
			89: [function(e, t, r) {
				var o = {};
				o.getHist = function(e) {
					var t, r, o, a = [],
						i = [],
						n = [],
						s = [];
					for (t = e.moaGL ? e.moaGL.getImageDataFromTexture(e.moaGL.glRenderingObjects.readTexture) : e.data, r = 0; 256 > r; r++) i[r] = 0, n[r] = 0, s[r] = 0;
					for (r = 0, o = t.length; o > r; r += 4) i[t[r]] ++, n[t[r + 1]] ++, s[t[r + 2]] ++;
					return a[0] = i, a[1] = n, a[2] = s, a
				}, o.getcdf = function(e) {
					for (var t = 0, r = 0; 256 > r; r++) t += e[r];
					var o = new Array(256);
					o[0] = e[0] / t;
					for (var a = 1; 256 > a; a++) o[a] = e[a] / t + o[a - 1];
					return o
				}, o.cdfinv = function(e, t) {
					if (0 >= t) return 0;
					if (t >= 1) return 255;
					for (var r = 0; t > e[r];) r++;
					if (0 === r) return t / e[r];
					var o = r - 1 + (t - e[r - 1]) / (e[r] - e[r - 1]);
					return o
				}, o.smooth1D = function(e, t) {
					for (var r = [], o = e.length, a = 0; o > a; a++) {
						for (var i = 0, n = 0, s = 0; o > s; s++) {
							var l = Math.exp(-(s - a) * (s - a) / (2 * t * t));
							i += l * e[s], n += l
						}
						i /= n, r[a] = i
					}
					return r
				}, o.getpdfSingleChannel = function(e) {
					for (var t, r = new Array(256), o = 0; o < r.length; o++) r[o] = 0;
					for (var o = 0; o < e.length; o++) t = e[o], r[t] = r[t] + 1;
					for (var o = 0; o < r.length; o++) r[o] = r[o] / e.length;
					return r
				}, o.getcdfSingleChannel = function(e, t) {
					var r = new Array(256);
					r[0] = t[0];
					for (var o = 1; o < r.length; o++) r[o] = t[o] + r[o - 1];
					return r
				}, o.getinvcdfSingleChannel = function(e, t) {
					for (var r = 0; t > e[r];) r++;
					return r
				}, o.equalizeSingleChannel = function(e) {
					for (var t, r = [], a = o.getpdfSingleChannel(e), i = o.getcdfSingleChannel(e, a), n = 0; n < e.length; n++) t = 255 * i[e[n]], r[n] = t > 255 ? 255 : Math.round(t);
					return r
				}, t.exports = o
			}, {}],
			90: [function(e, t, r) {
				"use strict";
				var o = {};
				o.fadeMapping = function(e, t) {
					for (var r = 0; 256 > r; r++) e.r[r] = r * (1 - t) + e.r[r] * t + .5 | 0, e.g[r] = r * (1 - t) + e.g[r] * t + .5 | 0, e.b[r] = r * (1 - t) + e.b[r] * t + .5 | 0, e.r[r] = e.r[r] < 0 ? 0 : e.r[r] > 255 ? 255 : e.r[r], e.g[r] = e.g[r] < 0 ? 0 : e.g[r] > 255 ? 255 : e.g[r], e.b[r] = e.b[r] < 0 ? 0 : e.b[r] > 255 ? 255 : e.b[r]
				}, o.mapHist = function(e, t) {
					if (e.moaGL) return void e.moaGL.renderColorMap(t);
					for (var r = e.data.length, o = 0; r > o;) e.data[o] = t.r[e.data[o]], e.data[o + 1] = t.g[e.data[o + 1]], e.data[o + 2] = t.b[e.data[o + 2]], o += 4
				}, o.combineSingleChannelHistMaps = function(e, t) {
					for (var r = 0; 256 > r; r++) e[r] = t[e[r]]
				}, o.combineMultiChannelHistMaps = function(e, t) {
					for (var r = 0; 256 > r; r++) e.r[r] = t.r[e.r[r]], e.g[r] = t.g[e.g[r]], e.b[r] = t.b[e.b[r]]
				}, o.copyHistMap = function(e, t) {
					e.r = new Array(256), e.g = new Array(256), e.b = new Array(256);
					for (var r = 0; 256 > r; r++) e.r[r] = t.r[r], e.g[r] = t.g[r], e.b[r] = t.b[r]
				}, o.invertHistMap = function(e) {
					var t = {};
					o.copyHistMap(t, e);
					for (var r = 0, a = 0, i = 0, n = 0; 256 > n; n++) {
						for (; t.r[r] < n && 255 > r;) r++;
						for (; t.g[a] < n && 255 > a;) a++;
						for (; t.b[i] < n && 255 > i;) i++;
						e.r[n] = r, e.g[n] = a, e.b[n] = i
					}
				}, o.setHistMapToIdentity = function(e) {
					for (var t = 0; 256 > t; t++) e.r[t] = t, e.g[t] = t, e.b[t] = t
				}, o.setHistMap = function(e, t, r, o) {
					e.r = t, e.g = r, e.b = o
				}, t.exports = o
			}, {}],
			91: [function(e, t, r) {
				"use strict";
				var o = {};
				o.mapIntensity = function(e, t, r, o) {
					if (e.moaGL) return void e.moaGL.renderIntensityMap(t, r, o);
					for (var a, i, n, s, l, u, h = e.data.length, d = 0, c = o, f = 1 - o, m = "overlay" === r, p = "multiply" === r; h > d;) {
						var g = .212671 * e.data[d] + .71516 * e.data[d + 1] + .072169 * e.data[d + 2],
							v = 0 | g,
							_ = g - v;
						255 == g ? (s = t.r[g], l = t.g[g], u = t.b[g]) : (s = (1 - _) * t.r[v] + _ * t.r[v + 1] + .5 | 0, l = (1 - _) * t.g[v] + _ * t.g[v + 1] + .5 | 0, u = (1 - _) * t.b[v] + _ * t.b[v + 1] + .5 | 0), m ? (a = e.data[d], i = e.data[d + 1], n = e.data[d + 2], a = 64 >= a ? f * a + c * (2 * a * s / 255) : a >= 192 ? f * a + c * (65025 - 2 * (255 - a) * (255 - s)) / 255 : f * a + c * (a * a * (510 - 4 * s) / 255 / 255 + a * (4 * s - 255) / 255 + (255 - 2 * s) / 8), i = 64 >= i ? f * i + c * (2 * i * l / 255) : i >= 192 ? f * i + c * (65025 - 2 * (255 - i) * (255 - l)) / 255 : f * i + c * (i * i * (510 - 4 * l) / 255 / 255 + i * (4 * l - 255) / 255 + (255 - 2 * l) / 8), n = 64 >= n ? f * n + c * (2 * n * u / 255) : n >= 192 ? f * n + c * (65025 - 2 * (255 - n) * (255 - u)) / 255 : f * n + c * (n * n * (510 - 4 * u) / 255 / 255 + n * (4 * u - 255) / 255 + (255 - 2 * u) / 8), a = 0 > a ? 0 : a > 255 ? 255 : a, i = 0 > i ? 0 : i > 255 ? 255 : i, n = 0 > n ? 0 : n > 255 ? 255 : n, e.data[d] = a, e.data[d + 1] = i, e.data[d + 2] = n) : p ? (a = e.data[d], i = e.data[d + 1], n = e.data[d + 2], a = f * a + c * a * s / 255 + .5 | 0, i = f * i + c * i * l / 255 + .5 | 0, n = f * n + c * n * u / 255 + .5 | 0, a = 0 > a ? 0 : a > 255 ? 255 : a, i = 0 > i ? 0 : i > 255 ? 255 : i, n = 0 > n ? 0 : n > 255 ? 255 : n, e.data[d] = a, e.data[d + 1] = i, e.data[d + 2] = n) : (e.data[d] = f * e.data[d] + c * s, e.data[d + 1] = f * e.data[d + 1] + c * l, e.data[d + 2] = f * e.data[d + 2] + c * u), d += 4
					}
				}, t.exports = o
			}, {}],
			92: [function(e, t, r) {
				"use strict";
				var o = e("../core/rng"),
					a = e("./MoaFlare"),
					i = 1e-9,
					n = e("./MoaVignette"),
					s = e("./legacy/auto_colors_fade_max_color"),
					l = e("./legacy/soft_focus"),
					u = {},
					h = {};
				h.maxpow2 = function(e) {
					for (var t = 1; e >= 2 * t;) t *= 2;
					return t
				}, h.getMPDRNG = function(e, t, r, o, a, i, n) {
					"undefined" == typeof i && (i = "uniform");
					var s = t + h.maxpow2(r - t);
					return e[s] = e[r], "uniform" === i ? h.getMPDU(e, t, s, o, a, n) : "normal" === i ? h.getMPDN(e, t, s, o, a, n) : "laplacian" === i && h.getMPDL(e, t, s, o, a, n), h.scaleLine(e, s, r), e
				}, h.scaleLine = function(e, t, r) {
					if (!(t >= r)) {
						var o, a, i, n = r / t;
						for (o = r; o >= 0; o--) a = o / n, i = a - (0 | a), e[o] = i ? (1 - i) * e[0 | a] + i * e[(0 | a) + 1] : e[a]
					}
				}, h.getMPDU = function(e, t, r, o, a, i) {
					for (var n, s = r - t, l = (r - t) / 2; s >= 2;) {
						for (var u = t; r > u; u += s) n = u + l, e[n] = (e[u] + e[u + s]) / 2 + o * (i.nextFloat() - .5);
						o *= Math.pow(2, -a), s = l, l /= 2
					}
				}, h.getMPDN = function(e, t, r, o, a, i) {
					for (var n, s = r - t, l = (r - t) / 2; s >= 2;) {
						for (var u = t; r > u; u += s) n = u + l, e[n] = (e[u] + e[u + s]) / 2 + o * i.nextFloatNormal();
						o *= Math.pow(2, -a), s = l, l /= 2
					}
				}, h.getMPDL = function(e, t, r, o, a, i) {
					for (var n, s = r - t, l = (r - t) / 2; s >= 2;) {
						for (var u = t; r > u; u += s) n = u + l, e[n] = (e[u] + e[u + s]) / 2 + o * i.nextFloatLaplace();
						o *= Math.pow(2, -a), s = l, l /= 2
					}
				}, h.getMPD = function(e, t, r, a, i, n, s) {
					var l = new o.RNG(s);
					return h.getMPDRNG(e, t, r, a, i, n, l), l.getState()
				};
				var d = function(e, t, r, a) {
						"undefined" == typeof r && (r = "");
						var i, n, s, l, u, h, d, c, f, m, p, g, v, _, x, M, y, b, C, T, A, S, w, P, F, E, D, L, R = e.width,
							B = e.height,
							O = 1;
						S = w = P = F = E = D = L = !1, n = (R + B) / 30, s = 0;
						var I = !0,
							N = 0,
							G = B / 2 | 0,
							U = R / 2 | 0,
							V = t[0],
							k = t[1],
							j = t[2],
							W = 255 * t[3];
						if ("halftone" === r) S = !0, n = (R + B) / 30, s = a[0], p = 1e3 / (R + B), "number" == typeof a[1] && (0 === a[1] ? p = 0 : p /= a[1]);
						else if ("smooth" === r) P = !0, n = a[0] * (R + B) / 30, "undefined" != typeof a[1] && (s = a[1] / n);
						else if ("rough" === r) D = !0, n = a[0] * (R + B) / 30, "undefined" != typeof a[1] && (s = a[1] / n), "undefined" != typeof a[2] && (N = a[2]), A = new o.RNG(N);
						else if ("viewfinder" === r) L = !0, n = (R + B) / 60, _ = x = y = M = 0, "undefined" != typeof a[0] && (y = a[0]), "undefined" != typeof a[1] && (M = a[1]), "undefined" != typeof a[2] && (_ = a[2]), "undefined" != typeof a[3] && (x = a[3]), "undefined" != typeof a[4] && (N = a[4]), A = new o.RNG(N);
						else if ("lines" === r) w = !0, n = a[0] * (R + B) / 30, T = a[1];
						else if ("shadow" === r) {
							F = !0, n = a[0] * (R + B) / 80, s = .3;
							var H = Math.PI / 180 * a[1],
								X = Math.sin(H),
								z = Math.cos(H);
							g = .5 * z * n, v = .5 * X * n
						} else "fade" === r && (E = !0, n = (R + B) / 80, "number" == typeof a[0] && (n *= a[0]), s = "number" == typeof a[1] ? a[1] : 1, "number" == typeof a[2] && (O = a[2]));
						if (s *= n, L || (_ = x = y = M = s), e.moaGL) {
							var Y = {
								r: t[0],
								g: t[1],
								b: t[2],
								a: 255 * t[3]
							};
							return void e.moaGL.renderThetaBorder(Y, r, n, O, _, x, y, M, g, v, T, p)
						}
						for (u = 0; B > u; u++)
							for (d = G > u ? u - y : B - 1 - u - M, l = 0; R > l; l++)
								if (i = 4 * (R * u + l), h = U > l ? l - _ : R - 1 - l - x, f = I && d < Math.SQRT2 * O * n && h < Math.SQRT2 * O * n ? Math.SQRT2 * O * n - Math.sqrt((d - Math.SQRT2 * O * n) * (d - Math.SQRT2 * O * n) + (h - Math.SQRT2 * O * n) * (h - Math.SQRT2 * O * n)) : h > d ? d : h, 0 > d || 0 > h) S ? (m = Math.cos((u - G) * p) * Math.cos((l - U) * p) + 1, c = 1 - 2 * m, c = 0 > c ? 0 : c > 1 ? 1 : c, e.data[i] = e.data[i] * c + V * (1 - c) + .5 | 0, e.data[i + 1] = e.data[i + 1] * c + k * (1 - c) + .5 | 0, e.data[i + 2] = e.data[i + 2] * c + j * (1 - c) + .5 | 0, e.data[i + 3] = e.data[i + 3] * c + W * (1 - c) + .5 | 0) : F ? (b = G > u ? u - s - v : B - 1 - u - s + v, C = U > l ? l - s - g : R - 1 - l - s + g, f = b < Math.SQRT2 * O * n && C < Math.SQRT2 * O * n ? Math.SQRT2 * O * n - Math.pow(Math.pow(b - Math.SQRT2 * O * n, 4) + Math.pow(C - Math.SQRT2 * O * n, 4), .25) : C > b ? b : C, -n > f && (f = -n), c = .6 * Math.pow((f / n + 1) / 2, 4), c = 0 > c ? 0 : c > 1 ? 1 : c, e.data[i] = V * (1 - c) + .5 | 0, e.data[i + 1] = k * (1 - c) + .5 | 0, e.data[i + 2] = j * (1 - c) + .5 | 0, e.data[i + 3] = W * (1 - c) + c * e.data[i + 3] + .5 | 0) : (e.data[i] = V, e.data[i + 1] = k, e.data[i + 2] = j, e.data[i + 3] = W);
								else if (n > f) {
							if (S) m = Math.cos((u - G) * p) * Math.cos((l - U) * p) + 1, c = 0 >= f ? 1 - 2 * m : 1 - 2 * m * Math.pow(1 - f / n, 4);
							else {
								if (F) {
									if (b = G > u ? u - s - v : B - 1 - u - s + v, C = U > l ? l - s - g : R - 1 - l - s + g, f = b < Math.SQRT2 * O * n && C < Math.SQRT2 * O * n ? Math.SQRT2 * O * n - Math.pow(Math.pow(b - Math.SQRT2 * O * n, 4) + Math.pow(C - Math.SQRT2 * O * n, 4), .25) : C > b ? b : C, h >= n && d >= n) continue; - n > f && (f = -n), f > n && (f = Math.sqrt(f / n) * n), c = .6 * Math.pow((f / n + 1) / 2, 4), c = 0 > c ? 0 : c > 1 ? 1 : c, e.data[i] = V * (1 - c) + .5 | 0, e.data[i + 1] = k * (1 - c) + .5 | 0, e.data[i + 2] = j * (1 - c) + .5 | 0, e.data[i + 3] = 255;
									continue
								}
								if (E) f = 0 > f ? 0 : f, c = Math.pow(f / n, 2);
								else if (P) c = 1 - 2 * Math.pow(1 - f / n, 4);
								else if (D) c = 1 - 2 * (.4 * A.nextFloat() + .6) * Math.pow(1 - f / n, 4);
								else if (L) c = 1 - 2 * (.4 * A.nextFloat() + .6) * Math.pow(1 - f / n, 4);
								else if (w) {
									var q = (.4 * Math.random() + .6) * (Math.cos(140 * Math.PI * ((u - G) / B) / T) + 1);
									c = 1 - 2 * q * Math.pow(1 - f / n, 4)
								}
							}
							c = 0 > c ? 0 : c > 1 ? 1 : c, e.data[i] = e.data[i] * c + V * (1 - c) + .5 | 0,
								e.data[i + 1] = e.data[i + 1] * c + k * (1 - c) + .5 | 0, e.data[i + 2] = e.data[i + 2] * c + j * (1 - c) + .5 | 0, e.data[i + 3] = e.data[i + 3] * c + W * (1 - c) + .5 | 0
						}
					},
					c = function(e, t, r, a) {
						"undefined" == typeof r && (r = "");
						var i, n, s, l, u = e.width,
							d = e.height;
						i = n = s = l = !1;
						var c, f, m, p, g, v, _, x, M, y, b, C, T, A, S, w, P, F, E = t[0],
							D = t[1],
							L = t[2],
							R = t[3],
							B = 1 !== R,
							O = 1 + (u + d) / 2 / 1024,
							I = new o.RNG;
						"torn" === r ? (n = !0, f = a[0] * (u + d) / 2, c = a[1] * (u + d) / 2, g = a[2], p = "uniform", "string" == typeof a[3] && (p = a[3]), m = a[4], v = "onlyout" === a[5], I = new o.RNG(m)) : "bulge" === r ? (i = !0, c = a[0] * (u + d) / 2, _ = a[1] * c, x = a[2] * c) : "rect" === r ? (s = !0, c = a[0] * (u + d) / 2, 1 === a[1] && (O = 0)) : "round" === r && (l = !0, c = a[0] * Math.min(u, d), y = a[1] * c, b = a[2] * c, C = a[3] * c, T = a[4] * c, M = c, "number" == typeof a[5] && (M *= a[5]));
						var N, G, U, V, k, j, W, H, X, z = Math.max(u, d),
							Y = [],
							q = [d, u, u, d],
							K = [u, d, d, u],
							Z = [1, 1, -1, -1],
							$ = [0, 0, d - 1, u - 1];
						if (e.moaGL) {
							var Q = {
								r: t[0],
								g: t[1],
								b: t[2],
								a: 255 * t[3]
							};
							e.moaGL.beginSideBorder(Q)
						}
						for (var J = 0; 4 > J; J++) {
							if (j = q[J], W = K[J], H = Z[J], X = $[J], z = j, n) {
								if (Y[z - 1] = X + H * c, Y[0] = X + H * c, h.getMPD(Y, 0, z - 1, f, g, p, I.nextInt()), v)
									for (N = 0; z > N; N++) Y[N] = H * Math.min(H * (X + H * c), H * Y[N])
							} else if (i)
								for (N = 0; z > N; N++) Y[N] = X - H * (_ * Math.sin(N * Math.PI / z) - x);
							else if (s)
								for (N = 0; z > N; N++) Y[N] = X + H * c;
							else if (l)
								for (F = M * (1 - 1 / Math.SQRT2), 0 === J && (w = b, S = y, P = C), 1 === J && (w = y, S = b, P = T), 2 === J && (w = C, S = b, P = T), 3 === J && (w = T, S = y, P = C), w -= O / 2, N = 0; z > N; N++) A = N, Y[N] = S + F > A ? X + H * (w + F) : S + M > A ? X + H * (w + M - Math.sqrt(M * M - Math.pow(A - S - M, 2))) : j - 1 - P - M > A ? X + H * w : j - 1 - P - F >= A ? X + H * (w + M - Math.sqrt(M * M - Math.pow(j - 1 - A - P - M, 2))) : X + H * (w + F);
							if (e.moaGL) e.moaGL.addSideBorder(Y, O, J);
							else
								for (N = 0; j > N; N++)
									for (U = Y[N], G = X; H * (U + H * O) > H * G; G += H) V = 0 === J || 3 === J ? 4 * (N * u + G) : 4 * (G * u + N), H * (U - H * O) > H * G ? B ? (e.data[V] = R * E + (1 - R) * e.data[V] + .5 | 0, e.data[V + 1] = R * D + (1 - R) * e.data[V + 1] + .5 | 0, e.data[V + 2] = R * L + (1 - R) * e.data[V + 2] + .5 | 0, e.data[V + 3] = 255 * R + (1 - R) * e.data[V + 3] + .5 | 0) : (e.data[V] = E, e.data[V + 1] = D, e.data[V + 2] = L, e.data[V + 3] = 255) : (k = R * (1 - (H * (G - U) + O) / (2 * O)), e.data[V] = k * E + (1 - k) * e.data[V] + .5 | 0, e.data[V + 1] = k * D + (1 - k) * e.data[V + 1] + .5 | 0, e.data[V + 2] = k * L + (1 - k) * e.data[V + 2] + .5 | 0, e.data[V + 3] = 255 * k + (1 - k) * e.data[V + 3] + .5 | 0)
						}
						e.moaGL && e.moaGL.endSideBorder()
					},
					f = function(e, t, r, a) {
						"undefined" == typeof r && (r = "");
						var i;
						i = !1;
						var n, s, l, u, d, c = e.width,
							f = e.height;
						"torn" === r && (i = !0, n = a[0] * (c + f) / 2, s = a[1] * (c + f) / 2, l = a[2], u = "uniform", "string" == typeof a[3] && (u = a[3]), d = a[4]);
						var m, p, g, v, _, x, M, y, b, C, T = t[0],
							A = t[1],
							S = t[2],
							w = t[3],
							P = 1 !== w,
							F = Math.max(c, f),
							E = [],
							D = [],
							L = Math.max(1, .001 * (c + f)),
							R = [f, c, c, f],
							B = [c, f, f, c],
							O = [1, 1, -1, -1],
							I = [0, 0, f - 1, c - 1],
							N = new o.RNG(d);
						if (e.moaGL) {
							var G = {
								r: t[0],
								g: t[1],
								b: t[2],
								a: 255 * t[3]
							};
							e.moaGL.beginSideBorder(G)
						}
						for (var U = 0; 4 > U; U++)
							if (M = R[U], y = B[U], b = O[U], C = I[U], F = M, E[F - 1] = C + b * s, E[0] = C + b * s, h.getMPD(E, 0, F - 1, n, l, u, N.nextInt()), D[F - 1] = C + b * s, D[0] = C + b * s, h.getMPD(D, 0, F - 1, n, l, u, N.nextInt()), e.moaGL) e.moaGL.addBorderDoubleSide(E, D, L, U);
							else
								for (m = 0; M > m; m++)
									for (g = E[m], v = D[m], p = C; b * (g + b * L) > b * p; p += b) _ = 0 === U || 3 === U ? 4 * (m * c + p) : 4 * (p * c + m), b * (g - b * L) > b * p && b * p > b * (v + b * L) ? P ? (e.data[_] = w * T + (1 - w) * e.data[_] + .5 | 0, e.data[_ + 1] = w * A + (1 - w) * e.data[_ + 1] + .5 | 0, e.data[_ + 2] = w * S + (1 - w) * e.data[_ + 2] + .5 | 0) : (e.data[_] = T, e.data[_ + 1] = A, e.data[_ + 2] = S) : b * (g + b * L) > b * p && b * p > b * (v - b * L) && (x = w * Math.min(b * (g - p) / L, b * (p - v) / L), x > 1 ? x = 1 : 0 > x && (x = 0), e.data[_] = x * T + (1 - x) * e.data[_] + .5 | 0, e.data[_ + 1] = x * A + (1 - x) * e.data[_ + 1] + .5 | 0, e.data[_ + 2] = x * S + (1 - x) * e.data[_ + 2] + .5 | 0);
						e.moaGL && e.moaGL.endSideBorder()
					},
					m = function(e, t) {
						"undefined" == typeof t.offset && (t.offset = 0), "undefined" == typeof t.corner && (t.corner = 0), "undefined" == typeof t.scale && (t.scale = 1), "undefined" == typeof t.seed && (t.seed = 0), "undefined" == typeof t.alpha && (t.alpha = 1), "undefined" == typeof t.color && (t.color = [0, 0, 0, 1]);
						var r = e.width,
							a = e.height,
							i = t.offset,
							n = t.corner,
							s = t.scale,
							l = t.seed,
							u = t.color,
							d = t.alpha,
							c = new o.RNG(l),
							f = u[0],
							m = u[1],
							p = u[2],
							g = u[3],
							v = new Array(a),
							_ = new Array(a),
							x = new Array(r),
							M = new Array(r);
						v[a - 1] = n, v[0] = 0, _[a - 1] = 0, _[0] = 0, x[r - 1] = 0, x[0] = 0, M[r - 1] = 0, M[0] = n, h.getMPD(v, 0, a - 1, .03 * r * d, .7, "uniform", c.nextInt()), h.getMPD(_, 0, a - 1, .03 * r * d, .7, "uniform", c.nextInt()), h.getMPD(x, 0, r - 1, .03 * a * d, .7, "uniform", c.nextInt()), h.getMPD(M, 0, r - 1, .03 * a * d, .7, "uniform", c.nextInt());
						var y, b, C, T, A, S, w, P, F, E = a / 2 | 0,
							D = r / 2 | 0,
							L = (r + a) / 30;
						if (e.moaGL) {
							var R = {
								r: u[0],
								g: u[1],
								b: u[2],
								a: 255 * u[3] + .5 | 0
							};
							return void e.moaGL.renderHardRandBorder(R, L, s, i, l, D, E, v, _, x, M)
						}
						for (F = 0; a > F; F++)
							for (P = 0; r > P; P++) T = 4 * (F * r + P), S = E > F ? F - x[P] - i : a - 1 - F - M[P] - i, A = D > P ? P - v[F] - i : r - 1 - P - _[F] - i, 0 > S || 0 > A ? (y = 1 - g, e.data[T] = e.data[T] * y + f * (1 - y) | 0, e.data[T + 1] = e.data[T + 1] * y + m * (1 - y) | 0, e.data[T + 2] = e.data[T + 2] * y + p * (1 - y) | 0, e.data[T + 3] = e.data[T + 3]) : (b = S < Math.SQRT2 * L && A < Math.SQRT2 * L ? Math.SQRT2 * L - Math.sqrt(Math.pow(S - Math.SQRT2 * L, 2) + Math.pow(A - Math.SQRT2 * L, 2)) : S > A ? A : S, L > b && (w = 2 * Math.pow(1 - b / L, 4 * s), w > 1 / 255 && (C = .4 * c.nextFloat() + .6, y = 1 - C * w, y > 1 ? y = 1 : 0 > y && (y = 0), y = 1 - g + g * y, e.data[T] = e.data[T] * y + f * (1 - y) + .5 | 0, e.data[T + 1] = e.data[T + 1] * y + m * (1 - y) + .5 | 0, e.data[T + 2] = e.data[T + 2] * y + p * (1 - y) + .5 | 0, e.data[T + 3] = e.data[T + 3])))
					},
					p = {};
				p.drawDot = function(e, t, r, o, a, i, n, s, l, u, h, d, c) {
					var f = e.width,
						m = e.height,
						p = f / 2 | 0,
						g = m / 2 | 0;
					d *= p, c *= g, i *= p, n *= p, i += d, n += c, l = 1;
					for (var v, _, x, M, y, b, C = 1 / l / p / u, T = 1 / l / p / h, A = s * s, S = Math.PI / (2 * A), w = Math.round(Math.min(m - 1, Math.max(0, g + n - 5 * s / T))), P = Math.round(Math.max(0, Math.min(m - 1, g + n + 5 * s / T))), F = Math.round(Math.min(f - 1, Math.max(0, p + i - 5 * s / C))), E = Math.round(Math.max(0, Math.min(f - 1, p + i + 5 * s / C))), D = w; P >= D; D++) {
						v = 4 * D * f, _ = T * (D - g - n);
						for (var L = F; E >= L; L++) x = v + 4 * L, M = C * (L - p - i), y = M * M + _ * _, y > 5 * A ? b = 1 : (b = 2.25 > y * S ? 1 - a * Math.max(Math.cos(y * S), Math.cos(Math.sqrt(y * S) / 1.8) / 2) : 1 - a * Math.cos(Math.sqrt(y * S) / 1.8) / 2, b > 1 && (b = 1), e.data[x] = e.data[x] * b + t * (1 - b) | 0, e.data[x + 1] = e.data[x + 1] * b + r * (1 - b) | 0, e.data[x + 2] = e.data[x + 2] * b + o * (1 - b) | 0)
					}
				}, p.drawChar = function(e, t, r, o, a, i, n, s, l, u, h, d) {
					d || (d = 0), u || (u = 0), h || (h = 1.3);
					var c = e.width,
						f = e.height;
					h *= r;
					var m = [],
						g = [
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 1, 1, 1, 1, 0]
						],
						v = [
							[0, 0, 0, 0, 0, 0, 0],
							[0, 0, 1, 1, 1, 0, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 0, 1, 1, 1, 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, 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]
						],
						x = [
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 0, 1, 0, 1, 0],
							[0, 1, 0, 1, 0, 1, 0],
							[0, 1, 0, 1, 0, 1, 0],
							[0, 1, 0, 1, 0, 1, 0]
						],
						M = [
							[1, 0, 1, 0, 1, 0, 1],
							[1, 0, 1, 0, 1, 0, 1],
							[1, 0, 1, 0, 1, 0, 1],
							[1, 0, 1, 0, 1, 0, 1],
							[0, 1, 1, 1, 1, 1, 1],
							[0, 1, 1, 1, 1, 1, 1],
							[0, 1, 1, 1, 1, 1, 1]
						],
						y = [
							[0, 1, 1, 1, 0, 1, 0],
							[0, 1, 1, 1, 0, 1, 0],
							[0, 1, 1, 1, 0, 1, 0],
							[0, 1, 0, 1, 0, 0, 0],
							[0, 1, 0, 1, 0, 0, 0],
							[0, 1, 0, 1, 0, 0, 0],
							[0, 1, 0, 1, 0, 0, 0]
						],
						b = [
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 1, 1, 1, 0, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[1, 1, 1, 1, 1, 1, 1],
							[0, 0, 0, 0, 0, 0, 0]
						],
						C = [
							[0, 0, 1, 1, 1, 0, 0],
							[0, 0, 1, 1, 1, 0, 0],
							[0, 0, 1, 1, 1, 0, 0],
							[0, 0, 1, 1, 1, 0, 0],
							[0, 0, 1, 1, 1, 0, 0],
							[0, 0, 1, 1, 1, 0, 0],
							[0, 0, 1, 1, 1, 0, 0]
						],
						T = [
							[0, 0, 0, 0, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 0, 0, 0, 0]
						],
						A = [
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0]
						],
						S = [
							[0, 0, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 0, 1, 0, 1, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 1, 0, 1, 0, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 0, 0, 0, 0, 0, 0]
						],
						w = [
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 1, 0, 0, 0, 0],
							[0, 1, 1, 1, 0, 0, 0],
							[0, 1, 1, 1, 1, 0, 0],
							[0, 1, 1, 1, 0, 0, 0],
							[0, 1, 1, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0]
						],
						P = [
							[0, 0, 0, 0, 0, 1, 0],
							[0, 0, 0, 0, 1, 1, 0],
							[0, 0, 0, 1, 1, 1, 0],
							[0, 0, 1, 1, 1, 1, 0],
							[0, 0, 0, 1, 1, 1, 0],
							[0, 0, 0, 0, 1, 1, 0],
							[0, 0, 0, 0, 0, 1, 0]
						],
						F = [
							[0, 0, 0, 0, 0, 0, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 0, 0, 0, 1, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 1, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 0, 0, 0, 0, 0, 0]
						],
						E = [
							[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, 0, 0, 0],
							[0, 0, 1, 1, 0, 0, 0],
							[0, 0, 1, 1, 0, 0, 0]
						],
						D = [
							[0, 0, 1, 1, 0, 0, 0],
							[0, 1, 0, 0, 1, 0, 0],
							[0, 1, 0, 0, 1, 0, 0],
							[0, 0, 1, 1, 0, 0, 0],
							[0, 0, 0, 0, 0, 0, 0],
							[0, 0, 0, 0, 0, 0, 0],
							[0, 0, 0, 0, 0, 0, 0]
						],
						L = [
							[0, 0, 0, 0, 0, 0, 0],
							[0, 0, 0, 0, 0, 0, 0],
							[0, 0, 0, 0, 0, 0, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 0, 0, 0, 0, 0, 0],
							[0, 0, 0, 0, 0, 0, 0],
							[0, 0, 0, 0, 0, 0, 0]
						],
						R = [
							[0, 0, 0, 0, 0, 0, 0],
							[0, 0, 0, 1, 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, 1, 0, 0, 0],
							[0, 0, 0, 0, 0, 0, 0]
						],
						B = [
							[0, 0, 0, 0, 0, 0, 0],
							[0, 0, 0, 1, 1, 1, 0],
							[0, 0, 1, 0, 0, 0, 0],
							[0, 0, 1, 0, 0, 0, 0],
							[0, 0, 1, 1, 1, 0, 0],
							[0, 0, 1, 0, 0, 0, 0],
							[0, 0, 1, 0, 0, 0, 0]
						],
						O = [
							[0, 0, 0, 0, 0, 0, 0],
							[0, 0, 0, 0, 0, 0, 0],
							[0, 0, 1, 1, 1, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 0, 1, 1, 1, 0, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 0, 1, 1, 1, 0, 0]
						],
						I = [
							[0, 0, 1, 1, 1, 0, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0]
						],
						N = [
							[0, 1, 1, 1, 1, 0, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 1, 1, 1, 0, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 1, 1, 1, 0, 0]
						],
						G = [
							[0, 0, 1, 1, 1, 0, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 0, 1, 1, 1, 0, 0]
						],
						U = [
							[0, 1, 1, 1, 1, 0, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 1, 1, 1, 0, 0]
						],
						V = [
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 1, 1, 1, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 1, 1, 1, 1, 0]
						],
						k = [
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 1, 1, 1, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0]
						],
						j = [
							[0, 0, 1, 1, 1, 0, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 1, 1, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 0, 1, 1, 1, 0, 0]
						],
						W = [
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0]
						],
						H = [
							[0, 0, 1, 1, 1, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 1, 1, 1, 0, 0]
						],
						X = [
							[0, 0, 0, 0, 0, 1, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 0, 1, 1, 1, 0, 0]
						],
						z = [
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 1, 0, 0],
							[0, 1, 0, 1, 0, 0, 0],
							[0, 1, 1, 0, 0, 0, 0],
							[0, 1, 0, 1, 0, 0, 0],
							[0, 1, 0, 0, 1, 0, 0],
							[0, 1, 0, 0, 0, 1, 0]
						],
						Y = [
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 1, 1, 1, 1, 0]
						],
						q = [
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 1, 0, 1, 1, 0],
							[0, 1, 0, 1, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0]
						],
						K = [
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 1, 0, 0, 1, 0],
							[0, 1, 0, 1, 0, 1, 0],
							[0, 1, 0, 0, 1, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0]
						],
						Z = [
							[0, 0, 1, 1, 1, 0, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 0, 1, 1, 1, 0, 0]
						],
						$ = [
							[0, 1, 1, 1, 1, 0, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 1, 1, 1, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0]
						],
						Q = [
							[0, 0, 1, 1, 1, 0, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 1, 0, 1, 0],
							[0, 1, 0, 0, 1, 1, 0],
							[0, 0, 1, 1, 1, 1, 0]
						],
						J = [
							[0, 1, 1, 1, 1, 0, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 1, 1, 1, 0, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0]
						],
						ee = [
							[0, 0, 1, 1, 1, 0, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 0, 1, 1, 1, 0, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 0, 1, 1, 1, 0, 0]
						],
						te = [
							[0, 1, 1, 1, 1, 1, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0]
						],
						re = [
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 0, 1, 1, 1, 0, 0]
						],
						oe = [
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 0, 1, 0, 1, 0, 0],
							[0, 0, 0, 1, 0, 0, 0]
						],
						ae = [
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 1, 0, 1, 0],
							[0, 1, 1, 0, 1, 1, 0],
							[0, 1, 0, 0, 0, 1, 0]
						],
						ie = [
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 0, 1, 0, 1, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 1, 0, 1, 0, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0]
						],
						ne = [
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 0, 1, 0, 1, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0]
						],
						se = [
							[0, 1, 1, 1, 1, 1, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 0, 0, 0, 1, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 1, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 1, 1, 1, 1, 0]
						],
						le = [
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 1, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0]
						],
						ue = [
							[0, 1, 1, 1, 1, 1, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 1, 1, 1, 1, 0]
						],
						he = [
							[0, 1, 1, 1, 1, 1, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 0, 1, 1, 1, 1, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 1, 1, 1, 1, 1, 0]
						],
						de = [
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 0, 0, 0, 0, 1, 0]
						],
						ce = [
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 1, 1, 1, 1, 1, 0]
						],
						fe = [
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 0, 0, 0, 0, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 1, 1, 1, 1, 0]
						],
						me = [
							[0, 1, 1, 1, 1, 1, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 0, 0, 0, 1, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0],
							[0, 0, 0, 1, 0, 0, 0]
						],
						pe = [
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 1, 1, 1, 1, 0]
						],
						ge = [
							[0, 1, 1, 1, 1, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 1, 1, 1, 1, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 0, 0, 0, 0, 1, 0],
							[0, 1, 1, 1, 1, 1, 0]
						],
						ve = [
							[0, 0, 1, 1, 1, 0, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 1, 0, 0, 1, 1, 0],
							[0, 1, 0, 1, 0, 1, 0],
							[0, 1, 1, 0, 0, 1, 0],
							[0, 1, 0, 0, 0, 1, 0],
							[0, 0, 1, 1, 1, 0, 0]
						];
					m[" "] = _, m["%"] = v, m["&"] = g, m["~"] = x, m["{"] = M, m["}"] = y, m["^"] = b, m[">"] = w, m["<"] = P, m[":"] = R, m["-"] = L, m["+"] = T, m["."] = E, m["/"] = F, m["?"] = D, m["*"] = S, m["|"] = A, m["@"] = C, m.A = I, m.B = N, m.C = G, m.D = U, m.E = V, m.F = k, m.G = j, m.H = W, m.I = H, m.J = X, m.K = z, m.L = Y, m.M = q, m.N = K, m.O = Z, m.P = $, m.Q = Q, m.R = J, m.S = ee, m.T = te, m.U = re, m.V = oe, m.W = ae, m.X = ie, m.Y = ne, m.Z = se, m.f = B, m.s = O, m[1] = le, m[2] = ue, m[3] = he, m[4] = de, m[5] = ce, m[6] = fe, m[7] = me, m[8] = pe, m[9] = ge, m[0] = ve;
					for (var _e, xe, Me = [], ye = [], be = 0, Ce = 0, Te = 0; Te < t.length; Te++)
						for (var Ae = 0; 7 > Ae; Ae++)
							for (var Se = 0; 7 > Se; Se++) m[t[Te]] && m[t[Te]][Se][Ae] && (xe = (7 * (Te + u) + Ae) * h * Math.cos(d) - Se * h * Math.sin(d), _e = (7 * (Te + u) + Ae) * h * Math.sin(d) + Se * h * Math.cos(d), "undefined" == typeof e.moaGL ? p.drawDot(e, i, n, s, l, xe, _e, r, 1, 1, 1, o, a) : (Me[be++] = o + xe, Me[be++] = a + _e * c / f, ye[Ce++] = c * r));
					if (e.moaGL) {
						var we = {
							r: i,
							g: n,
							b: s,
							a: 255 * l + .5 | 0
						};
						e.moaGL.renderDotMatrix(we, Me, r)
					}
				}, p.drawLine = function(e, t, r, o, a, i, n) {
					for (var s = e.width, l = e.height, u = 0; u < i.length - 1; u++) {
						var h, d, c, f, m, p, g, v, _, x, M, y = i[u][0],
							b = i[u][1],
							C = i[u + 1][0],
							T = i[u + 1][1],
							A = [b - T, C - y],
							S = Math.sqrt(A[0] * A[0] + A[1] * A[1]);
						A[0] /= S, A[1] /= S;
						var w = [C - y, T - b],
							P = w[0] * w[0] + w[1] * w[1],
							F = n * n,
							E = 2,
							D = (n + E) * (n + E),
							L = Math.round(Math.min(l - 1, Math.max(0, Math.min(b, T) - n - E))),
							R = Math.round(Math.max(0, Math.min(l - 1, Math.max(b, T) + n + E))),
							B = Math.round(Math.min(s - 1, Math.max(0, Math.min(y, C) - n - E))),
							O = Math.round(Math.max(0, Math.min(s - 1, Math.max(y, C) + n + E)));
						if (e.moaGL) {
							var I = {
								r: t,
								g: r,
								b: o,
								a: 255 * a + .5 | 0
							};
							e.moaGL.renderLine(I, A[0], A[1], y, C, b, T, n, F, E, a, D, P, B, L, O, R)
						} else
							for (var N = L; R >= N; N++) {
								p = 4 * N * s;
								for (var G = B; O >= G; G++) g = p + 4 * G, h = Math.abs(A[0] * (G - y) + A[1] * (N - b)), d = (G - y) * (G - y) + (N - b) * (N - b), c = (G - C) * (G - C) + (N - T) * (N - T), c > d ? (f = c, m = d) : (f = d, m = c), M = h > n + E ? 1 : f > m + P ? F > d || F > c ? 1 - a : D > d || D > c ? 1 - a + a * (Math.sqrt(m) - n) / E : 1 : h > n ? 1 - a + a * (h - n) / E : 1 - a, .995 > M && (v = e.data[g] * M + t * (1 - M) + .5 | 0, _ = e.data[g + 1] * M + r * (1 - M) + .5 | 0, x = e.data[g + 2] * M + o * (1 - M) + .5 | 0, v = 0 > v ? 0 : v > 255 ? 255 : v, _ = 0 > _ ? 0 : _ > 255 ? 255 : _, x = 0 > x ? 0 : x > 255 ? 255 : x, e.data[g] = v, e.data[g + 1] = _, e.data[g + 2] = x, e.data[g + 3] = e.data[g + 3])
							}
					}
				}, p.ringFlare = function(e, t, r, o, a, i, n, s, l) {
					var u, h, d, c, f, m, p, g, v, _ = e.width,
						x = e.height,
						M = (_ + x) / 2,
						y = .01 * a,
						b = a * a,
						C = o * o,
						T = Math.min(x, Math.max(0, Math.round(r - a * M - 4))),
						A = Math.min(x, Math.max(0, Math.round(r + a * M + 4))),
						S = Math.min(_, Math.max(0, Math.round(t - a * M - 4))),
						w = Math.min(_, Math.max(0, Math.round(t + a * M + 4)));
					if (e.moaGL) {
						var P = {
							r: i,
							g: n,
							b: s,
							a: l
						};
						return void e.moaGL.renderRingFlare(P, t, r, b, C, y, M, l)
					}
					for (var F = T; A > F; F++) {
						d = 4 * F * _, u = (F - r) / M;
						for (var E = S; w > E; E++) c = d + 4 * E, h = (E - t) / M, f = h * h + u * u, m = f > b + y ? 0 : f > b ? (b + y - f) / y : f > C ? 1 : f > C - y ? 1 - (C - f) / y : 0, m = 1 - m * m * l, .995 > m && (p = e.data[c] * m + i * (1 - m) + .5 | 0, g = e.data[c + 1] * m + n * (1 - m) + .5 | 0, v = e.data[c + 2] * m + s * (1 - m) + .5 | 0, p = 0 > p ? 0 : p > 255 ? 255 : p, g = 0 > g ? 0 : g > 255 ? 255 : g, v = 0 > v ? 0 : v > 255 ? 255 : v, e.data[c] = p, e.data[c + 1] = g, e.data[c + 2] = v, e.data[c + 3] = e.data[c + 3])
					}
				}, p.drawBasicDot = function(e, t, r, o, a, i, n, s) {
					var l = e.width,
						u = e.height,
						h = s * s,
						d = 2;
					d > 2 * s && (d = 2 * s);
					var c, f, m, p, g = Math.pow(s + d, 2);
					if (e.moaGL) {
						var v = {
								r: t,
								g: r,
								b: o,
								a: 255 * aC
							},
							_ = [i, n];
						e.moaGL.renderBasicDots(v, _, s, s, d)
					}
					for (var x = Math.round(Math.min(u - 1, Math.max(0, n - s - d))), M = Math.round(Math.max(0, Math.min(u - 1, n + s + d))), y = Math.round(Math.min(l - 1, Math.max(0, i - s - d))), b = Math.round(Math.max(0, Math.min(l - 1, i + s + d))), C = x; M >= C; C++) {
						c = 4 * C * l;
						for (var T = y; b >= T; T++) f = c + 4 * T, m = (i - T) * (i - T) + (n - C) * (n - C), m > g ? p = 1 : m > h ? (p = 1 - a + a * (Math.sqrt(m) - s) / d, e.data[f] = e.data[f] * p + t * (1 - p), e.data[f + 1] = e.data[f + 1] * p + r * (1 - p), e.data[f + 2] = e.data[f + 2] * p + o * (1 - p)) : (p = 1 - a, e.data[f] = e.data[f] * p + t * (1 - p), e.data[f + 1] = e.data[f + 1] * p + r * (1 - p), e.data[f + 2] = e.data[f + 2] * p + o * (1 - p))
					}
				}, p.dirtspec = function(e, t, r, a, i, n) {
					var s = e.width,
						l = e.height,
						u = new o.RNG(n),
						h = [],
						d = [t, r],
						c = [a];
					h[0] = [t, r, a];
					for (var f = 1; a > .2;) {
						a *= .97;
						var m = u.nextFloat() * (f - 1) | 0,
							g = h[m][0],
							v = h[m][1],
							_ = h[m][2],
							x = 2 * u.nextFloat() * Math.PI;
						t = g + .5 * (_ + a) * Math.cos(x), r = v + .5 * (_ + a) * Math.sin(x), "undefined" == typeof e.moaGL && p.drawBasicDot(e, i[0], i[1], i[2], i[3], t, r, a), h[f] = [t, r, a], d[2 * f - 2] = 2 * t / (s - 1) - 1, d[2 * f - 1] = 2 * r / (l - 1) - 1, c[f - 1] = 4 * a, f++
					}
					if (e.moaGL) {
						var M = {
								r: i[0],
								g: i[1],
								b: i[2],
								a: 255 * i[3] + .5 | 0
							},
							y = 2;
						y > 2 * a && (y = 2 * a), e.moaGL.renderBasicDots(M, d, c, c[0], y)
					}
				}, u.purpleBorder = function(e, t) {
					var r = t.intensity,
						o = [0, 0, 0, 1];
					c(e, o, "torn", [.02 * r, .02, .5, "uniform", t.seed]), c(e, o, "round", [.02, 1, 1, 1, 1, 1.5])
				}, u.san_carmenBorder = function(e, t) {
					var r, a = 225,
						i = 225,
						n = 200,
						s = new o.RNG(t.seed),
						l = t.intensity;
					for (c(e, [a, i, n, 1], "round", [.025, 1, 1, 1, 1, 1.5]), r = 4; 10 > r; r++) f(e, [a, i, n, .2], "torn", [.06 * l * (10 - r) / 10, .005 * r + .01, .4, "uniform", s.nextInt()])
				}, u.san_carmenAutoColors = function(e, t) {
					s.autocolorsfade(e, t.intensity, 251, 233, 194)
				}, u.threshBorder = function(e, t) {
					c(e, [0, 0, 0, 1], "round", [.025, 1, 1, 1, 1, 1.5])
				}, u.brownieBorder = function(e, t) {
					var r = e.width,
						a = e.height,
						i = t.intensity,
						n = t.seed,
						s = new o.RNG(n);
					c(e, [0, 0, 0, .2], "torn", [.03 * i, .02, .2, "uniform", s.nextInt()]), c(e, [0, 0, 0, .8], "torn", [.02 * i, .01, .5, "uniform", s.nextInt()]), m(e, {
						color: [0, 0, 0, 1],
						offset: -(r + a) / 150,
						corner: 0,
						scale: .5,
						seed: s.nextInt(),
						alpha: i
					})
				}, u.maya_unicornBorder = function(e, t) {
					var r = e.width,
						a = e.height,
						i = t.intensity,
						n = t.seed,
						s = new o.RNG(n);
					c(e, [0, 0, 0, 1], "torn", [0, .04 * a / Math.min(r, a), .2, "uniform", s.nextInt()]);
					var l = ["Abercrave", "Abilene", "Aith", "Banff", "Blean", "Caarnduncan", "Corrievorrie", "Cotterstock", "Dalrymple", "Draffan", "Dubuque", "Epsom", "Frolesworth", "Glassel", "Golant", "Harpenden", "Hassop", "Hove", "Popcastle", "Winkley"],
						u = "&  >| " + l[s.nextFloat() * l.length | 0].toUpperCase() + " |<  &",
						h = .8,
						d = .935,
						f = .003 * Math.min(r, a) / r;
					p.drawChar(e, u, f, h, d, 255, 255, 0, .3, -u.length), h = -.8, d = -.957, p.drawChar(e, u, f, h, d, 255, 255, 0, .3, 0, 0, 0);
					var m = [255, 255, 255, 1];
					c(e, m, "torn", [0, .01 * a / Math.min(r, a), .2, "uniform", s.nextInt()]), c(e, m, "torn", [.02 * i, .01 * a / Math.min(r, a), .5, "uniform", s.nextInt()]), c(e, m, "torn", [.008 * i, .01 * a / Math.min(r, a), .3, "normal", s.nextInt()])
				}, u.old_threshBorder = function(e, t) {
					var r = t.intensity,
						a = t.seed,
						i = new o.RNG(a);
					c(e, [255, 255, 255, 1], "round", [.025, 1, 1, 1, 1, 1.5]);
					for (var n = 4; 10 > n; n++) f(e, [255, 255, 255, .2], "torn", [.06 * r * (10 - n) / 10, .005 * n + .01, .4, "uniform", i.nextInt()])
				}, u.bordeauxBorder = function(e, t) {
					var r = t.seed,
						a = new o.RNG(r),
						i = e.width,
						n = e.height,
						s = (i + n) / 2,
						l = i / s;
					p.drawLine(e, 255, 255, 255, .3, [
						[.46 * i, .5 * n - .05 * i],
						[.54 * i, .5 * n - .05 * i]
					], 0), p.ringFlare(e, i / 2, n / 2 - .05 * i, .08 * l, .081 * l, 255, 255, 255, .3), p.drawLine(e, 255, 255, 255, .3, [
						[.5 * i, .5 * n - .18 * i - .05 * i],
						[.5 * i, .5 * n - .25 * i - .05 * i]
					], 0), p.drawLine(e, 255, 255, 255, .3, [
						[.5 * i, .5 * n + .18 * i - .05 * i],
						[.5 * i, .5 * n + .25 * i - .05 * i]
					], 0), p.drawLine(e, 255, 255, 255, .3, [
						[.5 * i - .18 * i, .5 * n - .05 * i],
						[.5 * i - .25 * i, .5 * n - .05 * i]
					], 0), p.drawLine(e, 255, 255, 255, .3, [
						[.5 * i + .18 * i, .5 * n - .05 * i],
						[.5 * i + .25 * i, .5 * n - .05 * i]
					], 0), p.drawLine(e, 255, 255, 255, 1, [
						[-i, n - .1 * i],
						[2 * i, n - .1 * i]
					], 0), p.drawLine(e, 0, 0, 0, 1, [
						[-i, n],
						[2 * i, n]
					], .1 * i);
					var u = "               ",
						h = u.length * a.nextFloat() | 0;
					h = Math.min(u.length - 1, Math.max(0, h)), u = u.substr(0, h) + "@" + u.substr(h + 1);
					var d = [255, 255, 255, .6],
						c = .005,
						f = .5 * (1 - 3 * .1 * i / n) + .5;
					p.drawChar(e, "+2..1..0..1..2-", c / 1.2, -.5, f, d[0], d[1], d[2], d[3], -7.5), p.drawChar(e, u, c / 1.2, -.5, f + 7 * c * 1.3 * i / n, d[0], d[1], d[2], d[3], -7.5);
					var m = .005 * i,
						g = .8 * i,
						v = n - 8 * m;
					p.drawLine(e, 255, 255, 255, 1, [
						[g, v],
						[g + 10 * m, v]
					], m / 4), p.drawLine(e, 255, 255, 255, 1, [
						[g, v - 6 * m],
						[g + 10 * m, v - 6 * m]
					], m / 4), p.drawLine(e, 255, 255, 255, 1, [
						[g, v],
						[g, v - 6 * m]
					], m / 4), p.drawLine(e, 255, 255, 255, 1, [
						[g + 10 * m, v],
						[g + 10 * m, v - 6 * m]
					], m / 4), p.drawLine(e, 255, 255, 255, 1, [
						[g - m, v - 2 * m],
						[g - m, v - 4 * m]
					], m / 4);
					var _ = 4 * a.nextFloat();
					_ > 0 && p.drawLine(e, 255, 255, 255, 1, [
						[g + 8 * m, v - 2 * m],
						[g + 8 * m, v - 4 * m]
					], m / 4), _ > 1 && p.drawLine(e, 255, 255, 255, 1, [
						[g + 6 * m, v - 2 * m],
						[g + 6 * m, v - 4 * m]
					], m / 4), _ > 2 && p.drawLine(e, 255, 255, 255, 1, [
						[g + 4 * m, v - 2 * m],
						[g + 4 * m, v - 4 * m]
					], m / 4), _ > 3 && p.drawLine(e, 255, 255, 255, 1, [
						[g + 2 * m, v - 2 * m],
						[g + 2 * m, v - 4 * m]
					], m / 4)
				}, u.covertBorder = function(e, t) {
					var r = t.seed,
						a = new o.RNG(r);
					a.nextInt(), a.nextInt();
					for (var i = e.width, n = e.height, s = .5, l = ["1.4", "2", "2.8", "4", "5.6", "8", "11", "16", "22", "32"], u = l[a.nextFloat() * l.length | 0]; u.length < 3;) u += " ";
					for (var h = ["100", "200", "400", "800", "1600"], c = h[a.nextFloat() * h.length | 0]; c.length < 4;) c += " ";
					for (var f = .015625, m = ["1", "2", "4", "8", "15", "30", "60", "125", "250", "500", "1000"], g = m[0], v = s * parseFloat(c) / (parseFloat(u) * parseFloat(u) * f), _ = 1; _ < m.length; _++) Math.abs(parseInt(m[_]) - v) < Math.abs(parseInt(g) - v) && (g = m[_]);
					for (; g.length < 4;) g = " " + g;
					var x = "               ",
						M = x.length * a.nextFloat();
					M = Math.min(x.length - 1, Math.max(0, M)), x = x.substr(0, M) + "@" + x.substr(M + 1);
					var y = new Date,
						b = "dfasdfsdf";
					b = y.toDateString(), b = b.toUpperCase();
					var C = [90, 250, 20, .6];
					d(e, [0, 0, 0, 1], "smooth", [.5, Math.max(i, n) / 15 * .6]);
					for (var T = .0043 * Math.min(i, n) / i, A = 0; A < m.length; A++) {
						var S = 1.1 / m.length,
							w = -S * A + .5;
						(g == m[A] || g == " " + m[A] || g == "  " + m[A] || g == "   " + m[A]) && p.drawLine(e, 90, 250, 20, .6, [
							[.97 * i, (w + S / 2 + 1) * n / 2],
							[2 * i, (w + 1) * n / 2]
						], T * i * .7), p.drawChar(e, m[A], .7 * T, 1, w, C[0], C[1], C[2], C[3], -2 - m[A].length / 2)
					}
					p.drawLine(e, 0, 0, 0, .1, [
						[0, n / 3],
						[i, n / 3]
					], 0), p.drawLine(e, 0, 0, 0, .1, [
						[0, 2 * n / 3],
						[i, 2 * n / 3]
					], 0), p.drawLine(e, 0, 0, 0, .1, [
						[i / 3, 0],
						[i / 3, n]
					], 0), p.drawLine(e, 0, 0, 0, .1, [
						[2 * i / 3, 0],
						[2 * i / 3, n]
					], 0), p.drawChar(e, "+2..1..0..1..2-", T / 1.2, -.5, .915, C[0], C[1], C[2], C[3], -7.5), p.drawChar(e, x, T / 1.2, -.5, .918 + 7 * T * 1.3 * i / n, C[0], C[1], C[2], C[3], -7.5), p.drawChar(e, b, T, .75, .92, C[0], C[1], C[2], C[3], -b.length)
				}, u.orcaBorder = function(e, t) {
					var r = t.seed,
						a = new o.RNG(r),
						i = e.width,
						n = e.height,
						s = ["1.4", "2", "2.8", "4", "5.6", "8", "11", "16", "22", "32"],
						l = s[a.nextFloat() * s.length | 0],
						u = [216, 193, 163, .6];
					d(e, [0, 0, 0, 1], "rough", [1, (i + n) / 30 * .6, r]);
					for (var h = .0043 * Math.min(i, n) / i, c = 0; c < s.length; c++) {
						var f = 1.1 / s.length * c - .5;
						(l == s[c] || l == s[c] + " " || l == s[c] + "  ") && p.drawLine(e, 230, 50, 40, .7, [
							[.95 * i, (f + 1) * n / 2],
							[2 * i, .5 * n]
						], h * i * .7), p.drawChar(e, s[c], .7 * h, 1, f, u[0], u[1], u[2], u[3], -2 - s[c].length / 2)
					}
					p.drawLine(e, 0, 0, 0, .1, [
						[i / 4, 0],
						[i / 4, n / 3]
					], 0), p.drawLine(e, 0, 0, 0, .1, [
						[0, n / 4],
						[i / 3, n / 4]
					], 0), p.drawLine(e, 0, 0, 0, .1, [
						[0, 3 * n / 4],
						[i / 3, 3 * n / 4]
					], 0), p.drawLine(e, 0, 0, 0, .1, [
						[i / 4, n],
						[i / 4, 2 * n / 3]
					], 0), p.drawLine(e, 0, 0, 0, .1, [
						[3 * i / 4, 0],
						[3 * i / 4, n / 3]
					], 0), p.drawLine(e, 0, 0, 0, .1, [
						[i, n / 4],
						[2 * i / 3, n / 4]
					], 0), p.drawLine(e, 0, 0, 0, .1, [
						[3 * i / 4, n],
						[3 * i / 4, 2 * n / 3]
					], 0), p.drawLine(e, 0, 0, 0, .1, [
						[i, 3 * n / 4],
						[2 * i / 3, 3 * n / 4]
					], 0), p.drawLine(e, 0, 0, 0, .1, [
						[0, n / 2],
						[i / 4, n / 2]
					], 0), p.drawLine(e, 0, 0, 0, .1, [
						[i / 2, 0],
						[i / 2, n / 4]
					], 0), p.drawLine(e, 0, 0, 0, .1, [
						[i / 2, n],
						[i / 2, 3 * n / 4]
					], 0), p.drawLine(e, 0, 0, 0, .1, [
						[i, n / 2],
						[3 * i / 4, n / 2]
					], 0), p.ringFlare(e, i / 2, n / 2, .08, .22, 255, 255, 255, .28)
				}, u.titanBorder = function(e, t) {
					var r = t.seed,
						a = new o.RNG(r),
						i = e.width,
						n = e.height,
						s = ["1.4", "2", "2.8", "4", "5.6", "8", "11", "16", "22", "32"],
						l = s[a.nextFloat() * s.length | 0],
						u = ["1", "2", "4", "8", "15", "30", "60", "125", "250", "500", "1000"],
						h = .005 * (i + n) / i / 2;
					d(e, [0, 0, 0, 1], "viewfinder", [.005 * (i + n), .035 * (i + n), .005 * (i + n), .035 * (i + n), r]), p.drawLine(e, 0, 0, 0, 1, [
						[i - .03 * (i + n), .8 * n - .035 * (i + n)],
						[i - .03 * (i + n), .2 * n]
					], (i + n) / 50);
					var c = .035 * (i + n),
						f = .5 * (1 - c / n * 2.5) + .5;
					p.drawLine(e, 255, 255, 255, .2, [
						[.4 * i, n - c / 2],
						[.45 * i, n - c / 2]
					], (i + n) / 100), p.drawChar(e, l, h, -.15, f, 255, 255, 255, 1, -l.length / 2);
					for (var m = [230, 230, 255, .8], g = 0; g < u.length; g++) {
						var v = 1.1 / u.length,
							_ = -v * g + .4;
						p.drawChar(e, u[g], .7 * h, 1, _, m[0], m[1], m[2], m[3], -3.5 - u[g].length / 2)
					}
				}, u.andyBorder = function(e, t) {
					var r = t.seed,
						a = new Date,
						i = a.toDateString();
					i = i.toUpperCase();
					for (var n = e.width, s = e.height, l = .5, u = new o.RNG(r), h = ["1.4", "2", "2.8", "4", "5.6", "8", "11", "16", "22", "32"], d = h[u.nextFloat() * h.length | 0]; d.length < 3;) d += " ";
					for (var f = ["100", "200", "400", "800", "1600"], m = f[u.nextFloat() * f.length | 0]; m.length < 4;) m += " ";
					for (var g = .015625, v = ["1", "2", "4", "8", "15", "30", "60", "125", "250", "500", "1000"], _ = v[0], x = l * parseFloat(m) / (parseFloat(d) * parseFloat(d) * g), M = 1; M < v.length; M++) Math.abs(parseInt(v[M], 10) - x) < Math.abs(parseInt(_, 10) - x) && (_ = v[M]);
					for (; _.length < 4;) _ = " " + _;
					var y = "               ",
						b = y.length * u.nextFloat();
					b = Math.min(y.length - 1, Math.max(0, b)), y = y.substr(0, b) + "@" + y.substr(b + 1);
					var C = _ + "/s f" + d + "  > |",
						T = "  | <     ISO:" + m;
					c(e, [0, 0, 0, 1], "round", [.008, 6, 4, 4, 4, 1.5]);
					var A = .0043 * Math.min(n, s) / n;
					p.drawChar(e, C, A, -.9, -.978, 180, 120, 0, 1), p.drawChar(e, T, A, .9, -.978, 180, 120, 0, 1, -T.length), p.drawChar(e, "+2..1..0..1..2-", A / 1.7, 0, -.985, 180, 120, 0, 1, -7.5), p.drawChar(e, y, A / 1.7, 0, -.988 + 7 * A * 1.3 * n / s, 180, 120, 0, 1, -7.5), p.drawChar(e, i, A, .85, .86, 230, 50, 40, 1, -i.length)
				}, u.aquaBorder = function(e, t) {
					c(e, [255, 255, 255, 1], "round", [.025, 1, 1, 1, 1, 1.5])
				}, u.edgewoodBorder = function(e, t) {
					var r, a = new o.RNG(t.seed),
						i = [255, 255, 255, 1];
					for (c(e, i, "round", [.025, 1, 1, 1, 1, 1.5]), r = 4; 10 > r; r++) f(e, i, "torn", [.03 * t.intensity * (10 - r) / 10, .005 * r + .01, .4, "uniform", a.nextInt()])
				}, u.joe_coolBorder = function(e, t) {
					c(e, [255, 255, 255, 1], "bulge", [.05, .28, .5])
				}, u.singeBorder = function(e, t) {
					d(e, [0, 0, 0, 1], "fade", 1)
				}, u.solarBorder = function(e, t) {
					for (var r, a, i = e.width, n = e.height, s = t.seed, l = new o.RNG(s), u = (i + n) / 2 / 50, h = [
							[141, 88, 46, .1],
							[70, 48, 26, .1]
						], d = .02, c = 0; 2 > c; c++)
						for (var f = 7; 10 > f; f++)
							for (var g = f; 10 > g; g += .4) r = i * d * l.nextFloatNormal(), a = n * l.nextFloat(), p.dirtspec(e, r, a, u / 3 * f / 15, h[c], l.nextInt()), r = i + i * d * l.nextFloatNormal(), a = n * l.nextFloat(), p.dirtspec(e, r, a, u / 3 * f / 15, h[c], l.nextInt()), r = i * l.nextFloat(), a = n * d * l.nextFloatNormal(), p.dirtspec(e, r, a, u / 3 * f / 15, h[c], l.nextInt()), r = i * l.nextFloat(), a = n + n * d * l.nextFloatNormal(), p.dirtspec(e, r, a, u / 3 * f / 15, h[c], l.nextInt());
					m(e, {
						color: [200, 140, 80, .3],
						offset: (i + n) / 80,
						corner: (i + n) / 40,
						seed: l.nextInt()
					}), m(e, {
						color: [113, 77, 40, .7],
						offset: (i + n) / 200,
						corner: (i + n) / 60,
						seed: l.nextInt()
					}), m(e, {
						color: [0, 0, 0, .9],
						offset: 0,
						corner: (i + n) / 80,
						seed: l.nextInt()
					})
				}, u.earthyBorder = function(e, t) {
					var r = t.seed,
						a = new o.RNG(r),
						i = [0, 15, 0, 1],
						n = t.intensity;
					c(e, i, "torn", [.02 * n, .02, .5, "uniform", a.nextInt()]), c(e, i, "torn", [.01 * n, .02, 0, "uniform", a.nextInt()]), m(e, {
						color: i,
						seed: a.nextInt(),
						alpha: n
					})
				}, u.ithacaFlare = function(e, t) {
					var r = t.intensity,
						i = new o.RNG(t.seed),
						n = .3 * (i.nextFloat() - .5),
						s = .3 * (i.nextFloat() - .5),
						l = .4 * i.nextFloat();
					a.flare(e, 1 + l, 255, 255, 255, .6 * r, "angleGaussian", n, s)
				}, u.ithacaBorder = function(e, t) {
					d(e, [255, 255, 255, 1], "smooth", [1])
				}, u.cherryBorder = function(e, t) {
					var r = e.width,
						a = e.height,
						i = new o.RNG(t.seed);
					c(e, [255, 255, 255, 1], "round", [.03, 1, 1, 1, 1, 1.5]);
					var n = .03 * Math.min(r, a) / r,
						s = ["ABERCRAVE", "ABILENE", "AITH", "BANFF", "BLEAN", "CAARNDUNCAN", "CORRIEVORRIE", "COTTERSTOCK", "DALRYMPLE", "DRAFFAN", "DUBUQUE", "EPSOM", "FROLESWORTH", "GLASSEL", "GOLANT", "HARPENDEN", "HASSOP", "HOVE", "POPCASTLE", "WINKLEY"],
						l = "<> <> " + s[i.nextFloat() * s.length | 0].toUpperCase() + " <> <>",
						u = 1 - 1.4 * n,
						h = .85,
						d = .003 * Math.min(r, a) / r,
						f = -Math.PI / 2;
					p.drawChar(e, l, d, u, h, 230, 50, 40, .4, 0, 0, f), u = -1 + .6 * n, p.drawChar(e, l, d, u, h, 230, 50, 40, .4, 0, 0, f), u = 1 - 1.4 * n, h = -.85, p.drawChar(e, l, d, u, h, 230, 50, 40, .4, -l.length, 0, f), u = -1 + .6 * n, p.drawChar(e, l, d, u, h, 230, 50, 40, .4, -l.length, 0, f)
				}, u.cross_processBorder = function(e, t) {
					c(e, [255, 255, 255, 1], "torn", [.015 * t.intensity, .02, .5, "uniform", t.seed])
				}, u.sunburnFlare = function(e, t) {
					var r = t.intensity,
						i = new o.RNG(t.seed),
						n = .1 * (i.nextFloat() - .5),
						s = .1 * (i.nextFloat() - .5),
						l = .1 * (i.nextFloat() - .5);
					a.flare(e, 1 + l, 255, 255, 255, 1 * r, "gaussianThing2", n, s)
				}, u.sunburnBorder = function(e, t) {
					d(e, [0, 0, 0, 1], "fade", [1, 0, 2.222])
				}, u.fadedBorder = function(e, t) {
					var r = t.intensity,
						a = new o.RNG(t.seed);
					c(e, [255, 255, 255, 1], "round", [.025, 1, 1, 1, 1, 1.5]);
					var i;
					for (i = 4; 10 > i; i++) f(e, [255, 255, 255, 1], "torn", [.03 * r, .005 * i + .01, 8, "uniform", a.nextInt()])
				}, u.chronoBorder = function(e, t) {
					var r = e.width,
						a = e.height,
						s = t.intensity,
						l = new o.RNG(t.seed);
					p.drawLine(e, 255, 255, 0, .2, [
						[.35 * r, a / 8],
						[.65 * r, a / 8]
					], (r + a) / 250), p.drawLine(e, 255, 255, 0, .2, [
						[.35 * r, 7 * a / 8],
						[.65 * r, 7 * a / 8]
					], (r + a) / 250), p.drawLine(e, 255, 255, 0, .2, [
						[.11 * r, .2 * a],
						[.11 * r, .8 * a]
					], (r + a) / 250), p.drawLine(e, 110, 110, 0, .85, [
						[.965 * r, 0],
						[.965 * r, a]
					], .07 * r), p.drawLine(e, 110, 0, 0, .85, [
						[.947 * r, .04 * a],
						[1.2 * r, .3 * a]
					], .05 * r), p.drawLine(e, 110, 0, 0, .85, [
						[.947 * r, .96 * a],
						[1.2 * r, .7 * a]
					], .05 * r), p.drawLine(e, 0, 0, 0, .5, [
						[.895 * r, 0],
						[.895 * r, a]
					], 0);
					for (var u = ["1.4", "2", "2.8", "4", "5.6", "8", "11", "16", "22", "32"], h = l.nextFloat() * u.length | 0, d = (u[h], .004), f = [0, 0, 0, .8], g = 0; g < u.length; g++) {
						var v = 2 / u.length,
							_ = .9 - v * g;
						h == g && p.drawLine(e, 255, 255, 0, .2, [
							[.86 * r, (_ / 2 - v / 10 + .5) * a],
							[.86 * r, (_ / 2 + v / 10 + .5) * a]
						], (r + a) / 250), p.drawChar(e, u[g], d, .95, _, f[0], f[1], f[2], f[3], -2 - u[g].length / 2), p.drawChar(e, "%", d, .95, _ + v / 2, f[0], f[1], f[2], f[3], -2.5)
					}
					var x = l.nextInt();
					m(e, {
						color: [0, 0, 0, 1],
						seed: x,
						alpha: 1,
						scale: .5
					}), n.vignette(e, (r + a) / 2 * 1.1 / (s + i), 0, 0, 150), c(e, [0, 0, 0, 1], "bulge", [.05, .28, .5])
				}, u.cabanaBorder = function(e, t) {
					var r = e.width,
						o = e.height,
						a = .0053 * Math.min(r, o) / r;
					p.drawLine(e, 255, 255, 255, .5, [
						[0, .1 * o],
						[.08 * r, .1 * o]
					], 0), p.drawChar(e, "0.5", a, -.8, -.8 - 2 * a, 255, 255, 255, .5), p.drawLine(e, 255, 255, 255, .5, [
						[0, .3 * o],
						[.08 * r, .3 * o]
					], 0), p.drawChar(e, "1.0", a, -.8, -.4 - 2 * a, 255, 255, 255, .5), p.drawLine(e, 255, 255, 255, .5, [
						[0, .5 * o],
						[.08 * r, .5 * o]
					], 0), p.drawChar(e, "1.5", a, -.8, -2 * a, 255, 255, 255, .5), p.drawLine(e, 255, 255, 255, .5, [
						[0, .7 * o],
						[.08 * r, .7 * o]
					], 0), p.drawChar(e, "2.0", a, -.8, .4 - 2 * a, 255, 255, 255, .5), p.drawLine(e, 255, 255, 255, .5, [
						[0, .9 * o],
						[.08 * r, .9 * o]
					], 0), p.drawChar(e, "2.5", a, -.8, .8 - 2 * a, 255, 255, 255, .5), c(e, [0, 0, 0, 1], "round", [.025, 1, 1, 1, 1, 1.5])
				}, u.soft_focus = function(e, t) {
					var r = t.intensity,
						o = .4 * r,
						a = 1 + .25 * r;
					l.softFocusConvolution(e, o, a)
				}, t.exports = u
			}, {
				"../core/rng": 42,
				"./MoaFlare": 81,
				"./MoaVignette": 98,
				"./legacy/auto_colors_fade_max_color": 100,
				"./legacy/soft_focus": 101
			}],
			93: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../core/rng");
				o.noise = function(e, t, r) {
					var o, i, n, s, l, u, h = new a.RNG(r);
					if (e.moaGL) return void e.moaGL.renderNoise(t, r);
					var d = e.width,
						c = e.height;
					for (t *= 255, u = 0; d * c > u; u++) o = 4 * u, l = t * (2 * h.nextFloat() - 1), i = e.data[o] + l + .5 | 0, n = e.data[o + 1] + l + .5 | 0, s = e.data[o + 2] + l + .5 | 0, i = 0 > i ? 0 : i > 255 ? 255 : i, n = 0 > n ? 0 : n > 255 ? 255 : n, s = 0 > s ? 0 : s > 255 ? 255 : s, e.data[o] = i, e.data[o + 1] = n, e.data[o + 2] = s
				}, t.exports = o
			}, {
				"../core/rng": 42
			}],
			94: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../core/MoaColor"),
					i = e("../core/MoaMipmap"),
					n = e("../core/MoaTransform"),
					s = e("../core/MoaDataTypes"),
					l = (s.MoaPoint, e("../core/MoaAllocAndCopy")),
					u = function(e, t, r) {
						if (0 == r) return [e, t];
						for (r = Math.abs(r); r > Math.PI / 2;) r -= Math.PI / 2;
						var o = Math.atan2(t, e),
							a = .5 * e,
							i = .5 * t,
							n = Math.sqrt(a * a + i * i),
							s = o - r,
							l = Math.PI - o - r,
							u = Math.cos(s),
							h = -Math.cos(l),
							d = Math.sin(s),
							c = Math.sin(l),
							f = u > 0 ? a / u : n,
							m = h > 0 ? a / h : n,
							p = d > 0 ? i / d : n,
							g = c > 0 ? i / c : n,
							v = Math.min(f, Math.min(m, Math.min(p, g))),
							_ = v / n,
							x = _ * e,
							M = _ * t;
						return [x, M]
					};
				o.renderOrientation = function(e, t, r, a, i, s) {
					var h = new n,
						d = e.width,
						c = e.height;
					Math.abs(a) % 180 == 90 && (d = e.height, c = e.width), h.postRotateZ(-a * Math.PI / 180);
					var f, m;
					t && h.postScaleXY(1, -1), r && h.postScaleXY(-1, 1);
					var p = u(d, c, i * Math.PI / 180);
					f = p[0], m = p[1];
					var g = d / f,
						v = d / c;
					if (h.postScaleXY(1, v), h.postRotateZ(-i * Math.PI / 180), h.postScaleXY(1, 1 / v), h.postScaleXY(1 / g, 1 / g), f = Math.floor(f), m = Math.floor(m), "undefined" != typeof s && null != s && s(f, m), e.moaGL) {
						var _ = e.moaGL.createTexture(e.width, e.height);
						return e.moaGL.copyLastRender(_), e.moaGL.transformAndResizeImage(e, _, h, f, m, "linear"), e.width = f, e.height = m, e.moaGL.destroyTexture(_), !0
					}
					var x = l.makeBitmap(f, m);
					return o.transformImage(x, e, h, "linear", "normal", 1), e.data = x.data, e.width = f, e.height = m, !0
				}, o.cropImage = function(e, t, r, a, i) {
					var s = e.width,
						u = e.height,
						h = r * e.width | 0,
						d = h / a + .5 | 0,
						c = t[0] * s + .5 | 0,
						f = t[1] * u + .5 | 0,
						m = c + h - 1 | 0,
						p = f + d - 1 | 0;
					c = Math.max(0, Math.min(s - 1, c)), m = Math.max(0, Math.min(s - 1, m)), f = Math.max(0, Math.min(u - 1, f)), p = Math.max(0, Math.min(u - 1, p));
					var g = c / (s - 1),
						v = f / (u - 1),
						_ = m / (s - 1),
						x = p / (u - 1),
						M = .5 * (_ - g) + g,
						y = .5 * (x - v) + v;
					h = m - c + 1 | 0, d = p - f + 1 | 0, h = Math.min(s, Math.max(1, h)), d = Math.min(u, Math.max(1, d));
					var b = new n;
					if ("undefined" != typeof i && null != i && i(h, d), e.moaGL) {
						var C = h / s,
							T = d / u;
						b.postTranslate(-(.5 - M), -(.5 - y)), b.postScaleXY(C, T);
						var A = e.moaGL.createTexture(e.width, e.height);
						return e.moaGL.copyLastRender(A), e.moaGL.transformAndResizeImage(e, A, b, h, d, "nearest"), e.width = h, e.height = d, e.moaGL.destroyTexture(A), !0
					}
					var C = (h - 1) / (s - 1),
						T = (d - 1) / (u - 1);
					b.postTranslate(-(.5 - M), -(.5 - y)), b.postScaleXY(C, T);
					var S = l.makeBitmap(h, d);
					return o.transformImage(S, e, b, "nearest", "normal", 1), e.data = S.data, e.width = h, e.height = d, !0
				}, o.resizeImage = function(e, t, r) {
					if (t = Math.floor(t), r = Math.floor(r), e.moaGL) {
						var a = new n;
						if (t >= .5 * e.width && r >= .5 * e.height) {
							var i = e.moaGL.createTexture(e.width, e.height);
							return e.moaGL.copyLastRender(i), e.moaGL.transformAndResizeImage(e, i, a, t, r, "linear"), e.width = t, e.height = r, e.moaGL.destroyTexture(i), !0
						}
						var s = e.moaGL.glRenderingObjects.readTexture,
							u = {
								width: e.width,
								height: e.height,
								data: e.moaGL.getImageDataFromTexture(s)
							},
							h = Math.min(t, e.width),
							d = Math.min(r, e.height),
							c = l.makeBitmap(h, d);
						o.downscalePremultipliedImage(c, u);
						var f = e.moaGL.createTextureFromBitmap(c);
						return e.moaGL.transformAndResizeImage(e, f, a, t, r, "linear"), e.width = t, e.height = r, e.moaGL.destroyTexture(f), !0
					}
					var c = l.makeBitmap(t, r);
					if (t >= .5 * e.width && r >= .5 * e.height) {
						var a = new n;
						o.transformImage(c, e, a, "linear", "normal", 1)
					} else if (t < .5 * e.width && r < .5 * e.height) o.downscalePremultipliedImage(c, e);
					else {
						var m = Math.min(t, e.width),
							p = Math.min(r, e.height),
							g = l.makeBitmap(m, p);

						o.downscalePremultipliedImage(g, e);
						var a = new n;
						o.transformImage(c, g, a, "linear", "normal", 1), g.data = null
					}
					return e.data = c.data, e.width = t, e.height = r, !0
				};
				var h = [0, .0003035269835, .0006070539671, .0009105809506, .001214107934, .001517634918, .001821161901, .002124688885, .002428215868, .002731742852, .003035269835, .003346535764, .003676507324, .004024717018, .004391442037, .004776953481, .005181516702, .005605391624, .006048833023, .006512090793, .006995410187, .007499032043, .008023192985, .008568125618, .009134058702, .00972121732, .01032982303, .01096009401, .01161224518, .01228648836, .01298303234, .01370208305, .0144438436, .01520851442, .01599629337, .01680737575, .01764195449, .01850022013, .01938236096, .02028856306, .02121901038, .02217388479, .02315336618, .02415763245, .02518685963, .02624122189, .02732089164, .0284260395, .02955683444, .03071344373, .03189603307, .03310476657, .03433980681, .03560131488, .0368894504, .0382043716, .03954623528, .04091519691, .04231141062, .04373502926, .04518620439, .04666508634, .04817182423, .04970656598, .05126945837, .05286064702, .05448027644, .05612849005, .05780543019, .05951123816, .06124605423, .06301001765, .06480326669, .06662593864, .06847816984, .0703600957, .07227185068, .07421356838, .07618538148, .07818742181, .08021982031, .08228270713, .08437621154, .08650046204, .08865558629, .09084171118, .09305896285, .09530746663, .09758734714, .09989872825, .1022417331, .1046164841, .107023103, .1094617108, .1119324278, .1144353738, .1169706678, .119538428, .1221387722, .1247718176, .1274376804, .1301364767, .1328683216, .1356333297, .138431615, .1412632911, .1441284709, .1470272665, .1499597898, .152926152, .1559264637, .1589608351, .1620293756, .1651321945, .1682694002, .1714411007, .1746474037, .177888416, .1811642442, .1844749945, .1878207723, .1912016827, .1946178304, .1980693196, .2015562538, .2050787364, .2086368701, .2122307574, .2158605001, .2195261997, .2232279573, .2269658735, .2307400485, .2345505822, .2383975738, .2422811225, .2462013267, .2501582847, .2541520943, .2581828529, .2622506575, .2663556048, .270497791, .2746773121, .2788942635, .2831487404, .2874408377, .2917706498, .2961382708, .3005437944, .3049873141, .3094689228, .3139887134, .3185467781, .3231432091, .3277780981, .3324515363, .337163615, .3419144249, .3467040564, .3515325995, .3564001441, .3613067798, .3662525956, .3712376805, .376262123, .3813260114, .3864294338, .3915724777, .3967552307, .4019777798, .4072402119, .4125426135, .4178850708, .42326767, .4286904966, .4341536362, .4396571738, .4452011945, .4507857828, .4564110232, .4620769997, .4677837961, .4735314961, .4793201831, .4851499401, .4910208498, .4969329951, .502886458, .5088813209, .5149176654, .5209955732, .5271151257, .533276404, .539479489, .5457244614, .5520114015, .5583403896, .5647115057, .5711248295, .5775804404, .5840784179, .5906188409, .5972017884, .6038273389, .6104955708, .6172065624, .6239603917, .6307571363, .637596874, .644479682, .6514056374, .6583748173, .6653872983, .672443157, .6795424696, .6866853124, .6938717613, .7011018919, .7083757799, .7156935005, .7230551289, .7304607401, .7379104088, .7454042095, .7529422168, .7605245047, .7681511472, .7758222183, .7835377915, .7912979403, .799102738, .8069522577, .8148465722, .8227857544, .8307698768, .8387990117, .8468732315, .8549926081, .8631572135, .8713671192, .8796223969, .8879231179, .8962693534, .9046611744, .9130986518, .9215818563, .9301108584, .9386857285, .9473065367, .9559733532, .9646862479, .9734452904, .9822505503, .9911020971, 1],
					d = [0, 1, 2, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 10, 11, 12, 13, 13, 14, 15, 15, 16, 16, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 27, 27, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 50, 50, 50, 50, 50, 51, 51, 51, 51, 51, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 54, 55, 55, 55, 55, 55, 55, 56, 56, 56, 56, 56, 57, 57, 57, 57, 57, 57, 58, 58, 58, 58, 58, 58, 59, 59, 59, 59, 59, 59, 60, 60, 60, 60, 60, 60, 61, 61, 61, 61, 61, 61, 62, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 64, 64, 64, 64, 64, 64, 64, 65, 65, 65, 65, 65, 65, 66, 66, 66, 66, 66, 66, 66, 67, 67, 67, 67, 67, 67, 67, 68, 68, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, 71, 71, 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, 72, 72, 72, 73, 73, 73, 73, 73, 73, 73, 74, 74, 74, 74, 74, 74, 74, 74, 75, 75, 75, 75, 75, 75, 75, 75, 76, 76, 76, 76, 76, 76, 76, 77, 77, 77, 77, 77, 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 80, 80, 80, 80, 80, 80, 80, 80, 81, 81, 81, 81, 81, 81, 81, 81, 81, 82, 82, 82, 82, 82, 82, 82, 82, 83, 83, 83, 83, 83, 83, 83, 83, 83, 84, 84, 84, 84, 84, 84, 84, 84, 84, 85, 85, 85, 85, 85, 85, 85, 85, 85, 86, 86, 86, 86, 86, 86, 86, 86, 86, 87, 87, 87, 87, 87, 87, 87, 87, 87, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 89, 89, 89, 89, 89, 89, 89, 89, 89, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
					c = function(e, t, r, o, a) {
						var i = 0,
							n = 0,
							s = 0,
							l = 0;
						t = Math.min(e.width - 1, t), o = Math.min(e.height - 1, o), r = Math.min(e.width - 1, r), a = Math.min(e.height - 1, a);
						for (var u = e.data, c = o; a >= c; c++)
							for (var f = t; r >= f; f++) {
								var m = 4 * (c * e.width + f);
								i += h[u[m]], n += h[u[m + 1]], s += h[u[m + 2]], l += h[u[m + 3]]
							}
						var p = (a - o + 1) * (r - t + 1),
							g = 4095 * i / p + .5 | 0,
							v = 4095 * n / p + .5 | 0,
							_ = 4095 * s / p + .5 | 0,
							x = 4095 * l / p + .5 | 0,
							M = d[g],
							y = d[v],
							b = d[_],
							C = d[x],
							T = {
								r: M,
								g: y,
								b: b,
								a: C
							};
						return T
					};
				o.downscalePremultipliedImage = function(e, t) {
					var r, o, a, i, n, s, l, u = e.data,
						h = e.width,
						d = e.height,
						f = (t.data, t.width),
						m = t.height,
						p = (f - 1) / h,
						g = (m - 1) / d;
					for (s = 0; d > s; s++)
						for (n = 0; h > n; n++) {
							r = n * p + .5 | 0, o = (n + 1) * p + .5 | 0, a = s * g + .5 | 0, i = (s + 1) * g + .5 | 0;
							var v = c(t, r, o, a, i);
							l = 4 * (s * h + n), u[l] = v.r, u[l + 1] = v.g, u[l + 2] = v.b, u[l + 3] = v.a
						}
				}, o.transformImage = function(e, t, r, o, n, s) {
					if (e.moaGL) return void e.moaGL.transformOverlay(e, t, r, o, n, s);
					var l, u = i.prototype.getBitmapSamplingFuncForSamplingMode(o),
						h = (a.prototype.blendEmbededAlphaFromArray, e.width),
						d = e.height,
						c = t.width,
						f = t.height,
						m = Math.max(1, h - 1),
						p = Math.max(1, d - 1);
					r.preTranslate(.5, .5), r.postTranslate(-.5, -.5);
					for (var g = [], l = {
							r: 0,
							g: 0,
							b: 0,
							a: 0
						}, v = 0; d > v; v++)
						for (var _ = 0; h > _; _++) {
							var x = 4 * (v * h + _),
								M = _ / m,
								y = v / p;
							g[0] = M, g[1] = y, r.postTransformPoint(g);
							var b = g[0] * (c - 1),
								C = g[1] * (f - 1);
							u(t, b, C, l), l.a *= s, a.prototype.blendEmbededAlphaFromArray(e.data, x, l, n), e.data[x + 3] = 255
						}
				}, o.transformPremultipliedOverlay = function(e, t, r, o, a) {
					if (e.moaGL) return void e.moaGL.transformPremultipliedOverlay(e, t, r, o, "normal", a);
					var s, l, u, h = i.prototype.interpolateBilinearPremultiplied,
						d = e.width,
						c = e.height,
						f = e.data,
						m = t.width,
						p = t.height,
						g = t.data,
						v = Math.max(1, d),
						_ = Math.max(1, c),
						x = new n(r.transformMatrix);
					x.invert();
					var M = {
							x: -.5,
							y: -.5,
							z: 0,
							w: 1
						},
						y = {
							x: 1,
							y: 0,
							z: 0,
							w: 0
						},
						b = {
							x: 0,
							y: 1,
							z: 0,
							w: 0
						};
					x.rightMultiplyVector(M), x.rightMultiplyVector(y), x.rightMultiplyVector(b), M.x += .5, M.y += .5, M.x *= d, M.y *= c, y.x *= d, y.y *= c, b.x *= d, b.y *= c;
					var C, T, A, S, w = {
						x: M.x + y.x + b.x,
						y: M.y + y.y + b.y
					};
					y.x += M.x, y.y += M.y, b.x += M.x, b.y += M.y, C = Math.min(M.x, Math.min(w.x, Math.min(y.x, b.x))) - 1, A = Math.min(M.y, Math.min(w.y, Math.min(y.y, b.y))) - 1, T = Math.max(M.x, Math.max(w.x, Math.max(y.x, b.x))) + 1, S = Math.max(M.y, Math.max(w.y, Math.max(y.y, b.y))) + 1, C = Math.max(0, 0 | C), A = Math.max(0, 0 | A), T = Math.min(d - 1, T + .5 | 0), S = Math.min(c - 1, S + .5 | 0);
					var P = new n(r.transformMatrix);
					P.preTranslate(.5, .5), P.preScaleXY(m, p), P.preTranslate(-.5, -.5), P.postTranslate(-.5, -.5), P.postScaleXY(1 / v, 1 / _), P.postTranslate(.5, .5);
					for (var F, E, D, L, R = P.transformMatrix, B = {
							r: 0,
							g: 0,
							b: 0,
							a: 0
						}, O = A; S >= O; O++) {
						s = 4 * O * d;
						for (var I = C; T >= I; I++)
							if (l = s + 4 * I, F = R[0] * I + R[1] * O + R[3], E = R[4] * I + R[5] * O + R[7], !(-.5 > F || F > m - .5 || -.5 > E || E > p - .5)) {
								{
									var N = f[l],
										G = f[l + 1],
										U = f[l + 2];
									f[l + 3]
								}
								if ("nearest" == o) {
									D = F + .5 | 0, L = E + .5 | 0, D = D > m - 1 ? m - 1 : D, L = L > p - 1 ? p - 1 : L, u = 4 * (L * m + D);
									var V = g[u],
										k = g[u + 1],
										j = g[u + 2],
										W = g[u + 3];
									if (0 == W) continue;
									var H = W * a / 255;
									f[l] = (1 - H) * N + a * V, f[l + 1] = (1 - H) * G + a * k, f[l + 2] = (1 - H) * U + a * j, f[l + 3] = 255
								} else {
									if (h(t, F, E, B), 0 == B.a) continue;
									var H = B.a * a / 255;
									f[l] = (1 - H) * N + a * B.r, f[l + 1] = (1 - H) * G + a * B.g, f[l + 2] = (1 - H) * U + a * B.b, f[l + 3] = 255
								}
							}
					}
				}, o.transformOverlay = function(e, t, r, o, s, l) {
					if (e.moaGL) return void e.moaGL.transformOverlay(e, t, r, s, l);
					var u, h = i.prototype.getBitmapSamplingFuncForSamplingMode(o),
						d = a.prototype.blendEmbededAlphaFromArray,
						c = e.width,
						f = e.height,
						m = t.width,
						p = t.height,
						g = Math.max(1, c),
						v = Math.max(1, f),
						_ = new n(r.transformMatrix);
					_.invert();
					var x = {
							x: -.5,
							y: -.5,
							z: 0,
							w: 1
						},
						M = {
							x: 1,
							y: 0,
							z: 0,
							w: 0
						},
						y = {
							x: 0,
							y: 1,
							z: 0,
							w: 0
						};
					_.rightMultiplyVector(x), _.rightMultiplyVector(M), _.rightMultiplyVector(y), x.x += .5, x.y += .5, x.x *= c, x.y *= f, M.x *= c, M.y *= f, y.x *= c, y.y *= f;
					var b, C, T, A, S = {
						x: x.x + M.x + y.x,
						y: x.y + M.y + y.y
					};
					M.x += x.x, M.y += x.y, y.x += x.x, y.y += x.y, b = Math.min(x.x, Math.min(S.x, Math.min(M.x, y.x))) - 1, T = Math.min(x.y, Math.min(S.y, Math.min(M.y, y.y))) - 1, C = Math.max(x.x, Math.max(S.x, Math.max(M.x, y.x))) + 1, A = Math.max(x.y, Math.max(S.y, Math.max(M.y, y.y))) + 1, b = Math.max(0, 0 | b), T = Math.max(0, 0 | T), C = Math.min(c - 1, C + .5 | 0), A = Math.min(f - 1, A + .5 | 0), r.preTranslate(.5, .5), r.postTranslate(-.5, -.5);
					for (var w = "nearest" == o ? 0 : .5, P = "nearest" == o ? 0 : .5, F = [], u = {
							r: 0,
							g: 0,
							b: 0,
							a: 0
						}, E = T; A >= E; E++)
						for (var D = b; C >= D; D++) {
							var L = 4 * (E * c + D),
								R = (D + w) / g,
								B = (E + P) / v;
							F[0] = R, F[1] = B, r.postTransformPoint(F);
							var O = F[0] * m - w,
								I = F[1] * p - P;
							h(t, O, I, u), u.a *= l, d(e.data, L, u, s), e.data[L + 3] = 255
						}
				}, o.transformOverlayUsingMipmap = function(e, t, r, o, i, s) {
					if (e.moaGL) return void e.moaGL.transformOverlayUsingMipmap(e, t, r, o, i, s);
					t.setOverlaySamplingFuncForSamplingMode(o);
					var l, u = a.prototype.blendEmbededAlphaFromArray,
						h = e.width,
						d = e.height,
						c = t.bitmapLevels[0].width,
						f = t.bitmapLevels[0].height,
						m = Math.max(1, h),
						p = Math.max(1, d),
						g = new n(r.transformMatrix);
					g.invert();
					var v = {
							x: -.5,
							y: -.5,
							z: 0,
							w: 1
						},
						_ = {
							x: 1,
							y: 0,
							z: 0,
							w: 0
						},
						x = {
							x: 0,
							y: 1,
							z: 0,
							w: 0
						};
					g.rightMultiplyVector(v), g.rightMultiplyVector(_), g.rightMultiplyVector(x), v.x += .5, v.y += .5, v.x *= h, v.y *= d, _.x *= h, _.y *= d, x.x *= h, x.y *= d;
					var M = Math.sqrt(_.x * _.x + _.y * _.y),
						y = Math.sqrt(x.x * x.x + x.y * x.y),
						b = M / c,
						C = y / f,
						T = Math.min(b, C),
						A = T > 1 ? 0 : Math.log(1 / T) / Math.log(2),
						S = t.numLevels - 1;
					A = Math.min(A, S);
					var w, P, F, E;
					if (t.wrapMode == t.WRAP_MODES.TransparentOutsideBounds) {
						var D = {
							x: v.x + _.x + x.x,
							y: v.y + _.y + x.y
						};
						_.x += v.x, _.y += v.y, x.x += v.x, x.y += v.y, w = Math.min(v.x, Math.min(D.x, Math.min(_.x, x.x))), F = Math.min(v.y, Math.min(D.y, Math.min(_.y, x.y))), P = Math.max(v.x, Math.max(D.x, Math.max(_.x, x.x))), E = Math.max(v.y, Math.max(D.y, Math.max(_.y, x.y))), w = Math.max(0, 0 | w), F = Math.max(0, 0 | F), P = Math.min(h - 1, P + .5 | 0), E = Math.min(d - 1, E + .5 | 0)
					} else w = 0, P = e.width - 1, F = 0, E = e.height - 1;
					r.preTranslate(.5, .5), r.postTranslate(-.5, -.5), t.setSamplingLevel(M, y);
					for (var L = "nearestNearest" == o ? 0 : .5, R = "nearestNearest" == o ? 0 : .5, B = [], l = {
							r: 0,
							g: 0,
							b: 0,
							a: 0
						}, O = F; E >= O; O++)
						for (var I = w; P >= I; I++) {
							var N = 4 * (O * h + I),
								G = (I + L) / m,
								U = (O + R) / p;
							B[0] = G, B[1] = U, r.postTransformPoint(B), t.sampleOverlay(B[0], B[1], l), l.a *= s, u(e.data, N, l, i), e.data[N + 3] = 255
						}
				}, t.exports = o
			}, {
				"../core/MoaAllocAndCopy": 34,
				"../core/MoaColor": 36,
				"../core/MoaDataTypes": 37,
				"../core/MoaMipmap": 39,
				"../core/MoaTransform": 40
			}],
			95: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("./MoaHistogramMapping");
				o.shadows = function(e, t) {
					"undefined" == typeof t && (t = 0), t /= 100;
					var r, o = [],
						i = [];
					for (r = 0; 256 > r; r++) {
						var n = r / 255,
							s = -3.68113 + 4.829 * (r / 3 + 1) - .299125 * Math.pow(r / 3 + 1, 2) + .006449275 * Math.pow(r / 3 + 1, 3) - 474531e-10 * Math.pow(r / 3 + 1, 4);
						if (0 > s && (s = 0), .25 >= t) {
							var l = t / .25;
							s = l * s + r
						} else {
							var u, l = (t - .25) / .75,
								h = 34 * l / 255;
							u = .5 > n ? 255 * ((1 - 2 * h) * n + h) : r, s += u
						}
						o[r] = s + .5 | 0, o[r] = o[r] < 0 ? 0 : o[r] > 255 ? 255 : o[r]
					}
					i.r = o, i.g = o, i.b = o, a.mapHist(e, i)
				}, t.exports = o
			}, {
				"./MoaHistogramMapping": 90
			}],
			96: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../core/MoaAllocAndCopy"),
					i = e("./MoaBitmapBlend");
				o.kAmount = "amount", o.kAlpha = "alpha", o.kBlendMode = "blendMode";
				var n = 5,
					s = 65536;
				o.sharpen = function(e, t, r, o) {
					"undefined" == typeof r && (r = 1), "undefined" == typeof o && (o = "normal");
					var n, s = !1,
						u = 0 != t,
						d = 1 != r || "normal" != o;
					if (0 == r) return !0;
					if (t > 0 ? s = !0 : (s = !1, t = -t), null != e.moaGL) {
						var c, f, m;
						if (d || s) {
							var m = e.moaGL.createTexture(e.width, e.height);
							e.moaGL.copyLastRender(m)
						}
					} else(d || s) && (n = a.copy(e));
					if (u && (l(e, t), h(e, t)), null != e.moaGL) {
						if (s) {
							var p = -.5;
							f = e.moaGL.glRenderingObjects.writeTexture, c = e.moaGL.glRenderingObjects.readTexture, e.moaGL.bitmapBlendBitmap(f, m, c, "normal", p), e.moaGL._swapTextures()
						}
						d && (f = e.moaGL.glRenderingObjects.writeTexture, c = e.moaGL.glRenderingObjects.readTexture, e.moaGL.bitmapBlendBitmap(f, m, c, o, r), e.moaGL._swapTextures()), (s || d) && e.moaGL.destroyTexture(m)
					} else s && i.blendWithBitmapSeparate(e, n, -.5, 1.5), d && (i.blendWithBitmap(e, n, e, o, r), n.data = null);
					return !0
				};
				var l = function(e, t) {
						if (e.moaGL) return void c(e, t);
						var r, o = [],
							a = [],
							i = e.width,
							l = e.height,
							h = 4 * t / 100 * (i + l) / 1600;
						if (0 != h) {
							0 > h && (h = -h);
							var d = Math.floor(2 * h) + 1,
								f = 1;
							d > n && (f = 2 * Math.ceil(d / n / 2) + 1, d = n), o[0] = 1, r = o[0] * f;
							for (var m = h * h / f / f, p = 1; d > p; p++) o[p] = Math.exp(-(p * p) / (2 * m)), r += 2 * o[p] * f;
							for (var p = 0; d > p; p++) o[p] /= r;
							for (var p = 0; d > p; p++) a[p] = Math.floor(s * o[p] + .5);
							for (var p = 0; d - 1 > p; p++) a[p] -= a[p + 1];
							u(e, a, f)
						}
					},
					u = function(e, t, r) {
						for (var o, a, i, n, l, u, h, d, c, f, p, g, v, _ = e.width, x = e.height, M = _ - 1, y = Math.floor(r / 2), b = t.length, C = [], T = 0; x > T; T++) {
							m(e, T, C), v = 4 * T * _;
							for (var A = 0; _ > A; A++) {
								o = s / 2, a = s / 2, i = s / 2;
								for (var S = 0; b > S; S++) {
									if (l = A + S * r + y, n = l - r * (2 * S + 1), u = t[S], 0 > n ? (h = (n + 1) * C[0], d = (n + 1) * C[1], c = (n + 1) * C[2]) : (h = C[4 * n], d = C[4 * n + 1], c = C[4 * n + 2]), l > M) {
										var w = l - M;
										f = C[4 * M] + w * (C[4 * M] - C[4 * (M - 1)]), p = C[4 * M + 1] + w * (C[4 * M + 1] - C[4 * (M - 1) + 1]), g = C[4 * M + 2] + w * (C[4 * M + 2] - C[4 * (M - 1) + 2])
									} else f = C[4 * l], p = C[4 * l + 1], g = C[4 * l + 2];
									o += u * (f - h), a += u * (p - d), i += u * (g - c)
								}
								o /= s, a /= s, i /= s, e.data[v + 4 * A] = o > 255 ? 255 : 0 > o ? 0 : 0 | o, e.data[v + 4 * A + 1] = a > 255 ? 255 : 0 > a ? 0 : 0 | a, e.data[v + 4 * A + 2] = i > 255 ? 255 : 0 > i ? 0 : 0 | i
							}
						}
					},
					h = function(e, t) {
						if (e.moaGL) return void f(e, t);
						var r, o = [],
							a = [],
							i = e.width,
							l = e.height,
							u = 4 * t / 100 * (i + l) / 1600;
						if (0 != u) {
							0 > u && (u = -u);
							var h = Math.floor(2 * u) + 1,
								c = 1;
							h > n && (c = 2 * Math.ceil(h / n / 2) + 1, h = n), o[0] = 1, r = o[0] * c;
							for (var m = u * u / c / c, p = 1; h > p; p++) o[p] = Math.exp(-(p * p) / (2 * m)), r += 2 * o[p] * c;
							for (var p = 0; h > p; p++) o[p] /= r;
							for (var p = 0; h > p; p++) a[p] = Math.floor(s * o[p] + .5);
							for (var p = 0; h - 1 > p; p++) a[p] -= a[p + 1];
							d(e, a, c)
						}
					},
					d = function(e, t, r) {
						for (var o, a, i, n, l, u, h, d, c, f, m, g, v, _ = e.width, x = e.height, M = x - 1, y = Math.floor(r / 2), b = t.length, C = [], T = 0; _ > T; T++) {
							p(e, T, C);
							for (var A = 0; x > A; A++) {
								v = 4 * (A * _ + T), o = s / 2, a = s / 2, i = s / 2;
								for (var S = 0; b > S; S++) {
									if (l = A + S * r + y, n = l - r * (2 * S + 1), u = t[S], 0 > n ? (h = (n + 1) * C[0], d = (n + 1) * C[1], c = (n + 1) * C[2]) : (h = C[4 * n], d = C[4 * n + 1], c = C[4 * n + 2]), l > M) {
										var w = l - M;
										f = C[4 * M] + w * (C[4 * M] - C[4 * (M - 1)]), m = C[4 * M + 1] + w * (C[4 * M + 1] - C[4 * (M - 1) + 1]), g = C[4 * M + 2] + w * (C[4 * M + 2] - C[4 * (M - 1) + 2])
									} else f = C[4 * l], m = C[4 * l + 1], g = C[4 * l + 2];
									o += u * (f - h), a += u * (m - d), i += u * (g - c)
								}
								o /= s, a /= s, i /= s, e.data[v] = o > 255 ? 255 : 0 > o ? 0 : 0 | o, e.data[v + 1] = a > 255 ? 255 : 0 > a ? 0 : 0 | a, e.data[v + 2] = i > 255 ? 255 : 0 > i ? 0 : 0 | i
							}
						}
					},
					c = function(e, t) {
						if (e.moaGL) {
							var r, o, a, i, n, s, l, u, h, d, c, f = e.width,
								m = e.height,
								p = 4096;
							if (r = 4, a = 4 * t / 100 * (f + m) / 1600, i = !0, 0 > a && (a = -a, i = !1), 0 == a) return;
							for (n = Math.floor(1.5 * a) + 1, l = 0, n > r && (l = Math.floor((n / r - 1) / 2) + 1, n = Math.floor(n / (2 * l + 1)) + 1), c = 0, h = 2 * l + 1, s = 2 * n + 1, u = [], d = 0, o = 0; s > o; o++) d += h * (_(o + .5 - n, a / h) - _(o - .5 - n, a / h));
							for (c = 0, o = 0; s > o; o++) u[o] = 1 / d * p * (_(o + .5 - n, a / h) - _(o - .5 - n, a / h)), c += u[o];
							var g = [],
								v = 4 - ((s - 1) / 2 | 0),
								x = 4 + ((s - 1) / 2 | 0);
							for (o = 0; 9 > o; o++) g[o] = v > o || o > x ? 0 : u[o - v] / c;
							return void e.moaGL.addConvolution(g, h, "horizontal")
						}
					},
					f = function(e, t) {
						if (e.moaGL) {
							var r, o, a, i, n, s, l, u, h, d, c, f = e.width,
								m = e.height,
								p = 4096;
							if (r = 4, a = 4 * t / 100 * (f + m) / 1600, i = !0, 0 > a && (a = -a, i = !1), 0 == a) return;
							for (n = Math.floor(1.5 * a) + 1, l = 0, n > r && (l = Math.floor((n / r - 1) / 2) + 1, n = Math.floor(n / (2 * l + 1)) + 1), c = 0, h = 2 * l + 1, s = 2 * n + 1, u = [], d = 0, o = 0; s > o; o++) d += h * (_(o + .5 - n, a / h) - _(o - .5 - n, a / h));
							for (c = 0, o = 0; s > o; o++) u[o] = .5 + 1 / d * p * (_(o + .5 - n, a / h) - _(o - .5 - n, a / h)), c += u[o];
							var g = [],
								v = 4 - ((s - 1) / 2 | 0),
								x = 4 + ((s - 1) / 2 | 0);
							for (o = 0; 9 > o; o++) g[o] = v > o || o > x ? 0 : u[o - v] / c;
							return void e.moaGL.addConvolution(g, h, "vertical")
						}
					},
					m = function(e, t, r) {
						var o, a, i, n, s, l = e.width;
						for (o = 0; l > o; o++) a = l * t + o, i = e.data[4 * a], n = e.data[4 * a + 1], s = e.data[4 * a + 2], r[4 * o] = i, r[4 * o + 1] = n, r[4 * o + 2] = s, r[4 * o + 3] = 0, o > 0 && (r[4 * o] += r[4 * (o - 1)], r[4 * o + 1] += r[4 * (o - 1) + 1], r[4 * o + 2] += r[4 * (o - 1) + 2])
					},
					p = function(e, t, r) {
						var o, a, i, n, s, l = e.width,
							u = e.height;
						for (o = 0; u > o; o++) a = l * o + t, i = e.data[4 * a], n = e.data[4 * a + 1], s = e.data[4 * a + 2], r[4 * o] = i, r[4 * o + 1] = n, r[4 * o + 2] = s, r[4 * o + 3] = 0, o > 0 && (r[4 * o] += r[4 * (o - 1)], r[4 * o + 1] += r[4 * (o - 1) + 1], r[4 * o + 2] += r[4 * (o - 1) + 2])
					},
					g = function(e) {
						var t, r, o, a, i, n, s = [-1.3026537197817094, .6419697923564902, .019476473204185836, -.00956151478680863, -.000946595344482036, .000366839497852761, 42523324806907e-18, -20278578112534e-18, -1624290004647e-18, 130365583558e-17, 1.5626441722e-8, -8.5238095915e-8, 6.529054439e-9, 5.059343495e-9, -9.91364156e-10, -2.27365122e-10, 9.6467911e-11, 2.394038e-12, -6.886027e-12, 8.94487e-13, 3.13092e-13, -1.12708e-13, 3.81e-16, 7.106e-15, -1.523e-15, -9.4e-17, 1.21e-16, -2.8e-17];
						if (0 > e) return 0;
						for (o = 0, a = 0, i = 2 / (2 + e), n = 4 * i - 2, t = 27; t > 0; t--) r = o, o = n * o - a + s[t], a = r;
						return i * Math.exp(-e * e + .5 * (s[0] + n * o) - a)
					},
					v = function(e) {
						return e >= 0 ? 1 - g(e) : g(-e) - 1
					},
					_ = function(e, t) {
						return (1 + v(e / Math.SQRT2 / t)) / 2
					};
				t.exports = o
			}, {
				"../core/MoaAllocAndCopy": 34,
				"./MoaBitmapBlend": 72
			}],
			97: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../core/rng"),
					i = e("../core/MoaColor"),
					n = e("./MoaHistogram"),
					s = 1.5;
				o.runSketch = function(e, t, r, o, a, s, c) {
					if (r = Math.floor(r), e.moaGL) return void e.moaGL.renderSketch(t, r, o, a, s, c);
					var f = new i,
						m = f.rgb2graySingleChannel(e),
						p = n.equalizeSingleChannel(m),
						g = l(e),
						v = e.width,
						_ = e.height,
						x = u(p, r),
						M = Math.floor(a / 100 * m.length);
					t = Math.min(v, _) * t / 1e3;
					for (var y = r - 1; y >= 0; y--) d(p, g, v, _, M, y, o, x[y], t);
					h(g, e, s, c)
				};
				var l = function(e) {
						for (var t, r = e.width, o = e.height, a = [], i = 0; o > i; i++)
							for (var n = 0; r > n; n++) t = i * r + n, a[t] = 255;
						return a
					},
					u = function(e, t) {
						for (var r = [], o = 0; t > o; o++) r[o] = 25 * (o + 1);
						return r
					},
					h = function(e, t, r, o) {
						for (var a, i, n = t.width, s = t.height, l = 0; s > l; l++)
							for (var u = 0; n > u; u++) {
								a = 4 * (l * n + u), i = l * n + u;
								var h = e[i] / 255;
								t.data[a] = (1 - h) * o.r + h * r.r, t.data[a + 1] = (1 - h) * o.g + h * r.g, t.data[a + 2] = (1 - h) * o.b + h * r.b, t.data[a + 3] = 255
							}
					},
					d = function(e, t, r, o, i, n, s, l, u) {
						for (var h, d = new a.RNG(n), f = 0; i > f; f++) {
							var m = d.nextFloat() * r,
								p = d.nextFloat() * o;
							m = m > r - 1 ? r - 1 : 0 > m ? 0 : m, p = p > o - 1 ? o - 1 : 0 > p ? 0 : p, h = (p + .5 | 0) * r + (m + .5 | 0), e[h] <= l && c(e, t, m, p, r, o, n, s, l, u)
						}
					},
					c = function(e, t, r, o, a, i, n, l, u, h) {
						var d = o - l + .5 | 0,
							c = o + l - .5 | 0;
						d = 0 > d ? 0 : d > i - 1 ? i - 1 : d, c = 0 > c ? 0 : c > i - 1 ? i - 1 : c;
						for (var f = d; c >= f; f++) {
							var m = r + (f - o),
								p = m - h - s | 0,
								g = m + h + s | 0;
							p = 0 > p ? 0 : p > a - 1 ? a - 1 : p, g = 0 > g ? 0 : g > a - 1 ? a - 1 : g;
							for (var v, _, x, M = 1 + h / s, y = p; g >= y; y++) _ = Math.abs(y - (m + h)), x = M - _ / s, x = x > 1 ? 1 : 0 > x ? 0 : x, v = f * a + y, e[v] <= u && (t[v] = (1 - x) * t[v] + x * u)
						}
					};
				t.exports = o;

			}, {
				"../core/MoaColor": 36,
				"../core/rng": 42,
				"./MoaHistogram": 89
			}],
			98: [function(e, t, r) {
				"use strict";
				var o = {},
					a = (e("./MoaBitmapBlend"), e("../core/MoaAllocAndCopy"), e("../core/MoaColor"));
				o.vignette = function(e, t, r, o, i, n, s, l, u, h, d) {
					if (e.moaGL) return void e.moaGL.renderVignette({
						blendMode: s,
						shapeMode: l,
						vignetteScale: t,
						color: {
							r: r,
							g: o,
							b: i,
							a: n
						},
						dx: h || 0,
						dy: d || 0,
						stretch: u
					});
					var c = e.width,
						f = e.height;
					"string" != typeof s && (s = "normal");
					var m = "sharp" === l,
						p = "ultraSharp" === l,
						g = "mediumSharp" === l;
					"boolean" != typeof u && (u = !1), "number" != typeof n && (n = 255), "number" != typeof h && (h = 0), "number" != typeof d && (d = 0);
					var v, _, x, M, y, b, C, T, A, S = 1.15,
						w = Math.pow(t, 2) / S,
						P = 1 / w,
						F = (c - 1) / 2,
						E = (f - 1) / 2,
						D = 5 / 3,
						L = 34 / 45,
						R = 13 / 63,
						B = 514 / 14175;
					h *= F, d *= E;
					var O, I, N = new a,
						G = {
							r: r,
							g: o,
							b: i,
							a: n
						};
					for (I = 0; f > I; I++)
						for (_ = 4 * I * c, x = (I - E - d) * (I - E - d), O = 0; c > O; O++) {
							if (v = _ + 4 * O, y = u ? ((O - F - h) * (O - F - h) / c / c + (I - E - d) * (I - E - d) / f / f) * P : ((O - F - h) * (O - F - h) + x) * P, m && (y *= y), p && (y *= y, y *= y), g && (y = Math.pow(y, 1.5)), y > S) G.a = n;
							else {
								if (.04 > y) continue;
								b = y * y, C = b * b, T = C * b, A = T * b, M = 1 - 2 * b + D * C - L * T + R * A - B * A * b, G.a = n * (1 - M)
							}
							N.blendEmbededAlphaFromArray(e.data, v, G, s)
						}
				}, t.exports = o
			}, {
				"../core/MoaAllocAndCopy": 34,
				"../core/MoaColor": 36,
				"./MoaBitmapBlend": 72
			}],
			99: [function(e, t, r) {
				"use strict"; {
					var o = {},
						a = (e("../MoaAdjustmentCurves"), e("../MoaGamma"), e("../MoaSharpen"), e("../MoaBitmapBlend"), e("../../core/MoaAllocAndCopy"), e("../../core/MoaColor")),
						i = e("../MoaColorMap");
					e("../MoaColorMatrixTransform"), e("../MoaHistogramMapping")
				}
				o.kBrightness = "brightness", o.kContrast = "contrast", o.kWarmth = "warmth", o.kSaturation = "saturation", o.kBlendMode = "blendMode", o.kAlpha = "alpha", o.adjustments = function(e, t) {
					var r = {},
						n = t[o.kBlendMode],
						s = t[o.kAlpha],
						l = e.data,
						r = "normal" === n && 1 === s,
						u = t[o.kBrightness],
						h = t[o.kContrast],
						d = t[o.kWarmth],
						c = t[o.kSaturation],
						f = 0 != u,
						m = 0 != h,
						p = 0 > h,
						g = 0 != d,
						v = 0 != c,
						_ = [],
						x = [],
						M = [],
						y = [],
						b = [],
						C = [],
						T = [],
						A = [],
						S = new a,
						w = Math.max(-100, Math.min(100, u)),
						P = w / 100;
					P = 0 > P ? .75 * P : P; {
						var F = 65 * P,
							E = 42.5,
							D = [E + .6 * F, 3 * E + F, 5 * E + .5 * F],
							_ = i.createColorMapFromListOfYValues(0, 255, !0, D),
							L = Math.max(-100, Math.min(100, h)),
							P = L / 100;
						Math.abs(P) + 1
					}
					0 > P && (P = .55 * (Math.cos(Math.PI * Math.pow(Math.abs(P), .8) * .5) - 1));
					var F = 35 * P,
						R = 255 / 8,
						B = [R - F, 3 * R - .75 * F, 5 * R + .75 * F, 7 * R + F],
						x = i.createColorMapFromListOfYValues(0, 255, !0, B),
						O = .3 * Math.abs(P);
					C[0] = -0.787 * O + 1, C[3] = .715 * O, C[6] = .072 * O, C[1] = .213 * O, C[4] = (.715 - 1) * O + 1, C[7] = .072 * O, C[2] = .213 * O, C[5] = .715 * O, C[8] = -0.928 * O + 1;
					var I, N, G, U = Math.max(-100, Math.min(100, d)),
						P = U / 100;
					P = P > 0 ? .7 * (1 - Math.cos(Math.PI * P * .5)) : Math.cos(Math.PI * P * .5) - 1, P > 0 ? (A[0] = 48 / 255 * P, A[1] = 28 / 255 * P, A[2] = -6 / 255 * P) : (A[0] = 16 / 255 * P, A[1] = -10 / 255 * P, A[2] = -48 / 255 * P);
					for (var V = 0; 255 >= V; V++) P > 0 ? (I = V + 48 * P * Math.sin(Math.PI * V / 255), N = V + 28 * P * Math.sin(Math.PI * V / 255), G = V - 6 * P * Math.sin(Math.PI * V / 255)) : (I = V + 16 * P * Math.sin(Math.PI * V / 255), N = V - 10 * P * Math.sin(Math.PI * V / 255), G = V - 48 * P * Math.sin(Math.PI * V / 255)), M[V] = I > 255 ? 255 : 0 > I ? 0 : I, y[V] = N > 255 ? 255 : 0 > N ? 0 : N, b[V] = G > 255 ? 255 : 0 > G ? 0 : G;
					var O, k = Math.max(-100, Math.min(100, c)),
						j = 1.4,
						W = 0,
						P = k / 100 + 1;
					if (P -= 1, P = 0 > P ? (1 - W) * (Math.cos(Math.PI * P * .5) - 1) : (j - 1) * (1 - Math.cos(Math.PI * P * .5)), P += 1, O = 1 - P, T[0] = -0.787 * O + 1, T[3] = .715 * O, T[6] = .072 * O, T[1] = .213 * O, T[4] = (.715 - 1) * O + 1, T[7] = .072 * O, T[2] = .213 * O, T[5] = .715 * O, T[8] = -0.928 * O + 1, e.moaGL) return e.moaGL.renderLegacyAdjustments(u, h, c, d, _, x, T, A, C, t.blendMode, t.alpha), !0;
					for (var H, X, z, Y, q, K, Z, $, Q, J, ee, te, V = 0; V < l.length;) {
						H = l[V], X = l[V + 1], z = l[V + 2], f && (H = _[H], X = _[X], z = _[z]), m && (Z = -H + X + z, $ = H - X + z, Q = H + X - z, Y = x[H], q = x[X], K = x[z], J = -Y + q + K, ee = Y - q + K, te = Y + q - K, Y += .2 * (J - Z) + (J > Z ? .5 : -.5), q += .2 * (ee - $) + (ee > $ ? .5 : -.5), K += .2 * (te - Q) + (te > Q ? .5 : -.5), Y = Y + .5 | 0, q = q + .5 | 0, K = K + .5 | 0, p && (Y = C[0] * Y + C[3] * q + C[6] * K, q = C[1] * Y + C[4] * q + C[7] * K, K = C[2] * Y + C[5] * q + C[8] * K), Y = Y + .5 | 0, q = q + .5 | 0, K = K + .5 | 0, H = Y > 255 ? 255 : 0 > Y ? 0 : Y, X = q > 255 ? 255 : 0 > q ? 0 : q, z = K > 255 ? 255 : 0 > K ? 0 : K), g && (H = M[H], X = y[X], z = b[z]), v && (Y = T[0] * H + T[3] * X + T[6] * z + .5, q = T[1] * H + T[4] * X + T[7] * z + .5, K = T[2] * H + T[5] * X + T[8] * z + .5, H = Y > 255 ? 255 : 0 > Y ? 0 : Y + .5 | 0, X = q > 255 ? 255 : 0 > q ? 0 : q + .5 | 0, z = K > 255 ? 255 : 0 > K ? 0 : K + .5 | 0);
						var re = {
							r: H + .5 | 0,
							g: X + .5 | 0,
							b: z + .5 | 0,
							a: 255 * s | 0
						};
						r ? (l[V] = re.r, l[V + 1] = re.g, l[V + 2] = re.b) : S.blendEmbededAlphaFromArray(l, V, re, t.blendMode), l[V + 3] = 255, V += 4
					}
					return !0
				}, t.exports = o
			}, {
				"../../core/MoaAllocAndCopy": 34,
				"../../core/MoaColor": 36,
				"../MoaAdjustmentCurves": 70,
				"../MoaBitmapBlend": 72,
				"../MoaColorMap": 75,
				"../MoaColorMatrixTransform": 76,
				"../MoaGamma": 83,
				"../MoaHistogramMapping": 90,
				"../MoaSharpen": 96
			}],
			100: [function(e, t, r) {
				"use strict";
				var o = e("../MoaColorMatrixTransform"),
					a = {};
				a.getcdf = function(e) {
					for (var t = 0, r = 0; 256 > r; r++) t += e[r];
					var o = new Array(256);
					o[0] = e[0] / t;
					for (var a = 1; 256 > a; a++) o[a] = e[a] / t + o[a - 1];
					return o
				}, a.cdfinv = function(e, t) {
					if (0 >= t) return 0;
					if (t >= 1) return 255;
					for (var r = 0; t > e[r];) r++;
					if (0 === r) return t / e[r];
					var o = r - 1 + (t - e[r - 1]) / (e[r] - e[r - 1]);
					return o
				}, a.getHist = function(e) {
					var t, r = new Array(256),
						o = new Array(256),
						a = new Array(256);
					t = e.moaGL ? e.moaGL.getImageDataFromFramebuffer() : e.data;
					for (var i = 0; 256 > i; i++) r[i] = 0, o[i] = 0, a[i] = 0;
					for (var i = 0; i < t.length; i += 4) r[t[i]] ++, o[t[i + 1]] ++, a[t[i + 2]] ++;
					return {
						r: r,
						g: o,
						b: a
					}
				}, a.autocolorsfade = function(e, t, r, i, n) {
					"undefined" == typeof t && (t = 1);
					var s, l, u, h = .005,
						d = .995;
					if (e.moaGL) {
						var c = e.moaGL.histogramBuild();
						s = a.getcdf(c.r), l = a.getcdf(c.g), u = a.getcdf(c.b)
					} else {
						var c = a.getHist(e);
						s = a.getcdf(c.r), l = a.getcdf(c.g), u = a.getcdf(c.b)
					}
					var f = t * a.cdfinv(s, h),
						m = t * a.cdfinv(l, h),
						p = t * a.cdfinv(u, h),
						g = 255 * (1 - t) + t * a.cdfinv(s, d),
						v = 255 * (1 - t) + t * a.cdfinv(l, d),
						_ = 255 * (1 - t) + t * a.cdfinv(u, d);
					"undefined" != typeof r && (g = Math.max(r, g) * t + g * (1 - t)), "undefined" != typeof i && (v = Math.max(i, v) * t + v * (1 - t)), "undefined" != typeof n && (_ = Math.max(n, _) * t + _ * (1 - t));
					var x = [1, 0, 0, -f, 0, 1, 0, -m, 0, 0, 1, -p],
						M = 255 / (g - f),
						y = 255 / (v - m),
						b = 255 / (_ - p),
						C = [M, 0, 0, 0, 0, y, 0, 0, 0, 0, b, 0];
					o.colorMatrixTransform(e, x), o.colorMatrixTransform(e, C)
				}, t.exports = a
			}, {
				"../MoaColorMatrixTransform": 76
			}],
			101: [function(e, t, r) {
				"use strict";
				var o = {},
					a = e("../../core/MoaAllocAndCopy"),
					i = e("../MoaSharpen"),
					n = (e("../MoaHistogramMapping"), e("../MoaBitmapBlend"));
				o.softFocusConvolution = function(e, t, r) {
					"undefined" == typeof t && (t = .4), "undefined" == typeof r && (r = 1.25);
					var o, s, l, u, h = 1 - t,
						d = r * t;
					return null != e.moaGL ? (u = e.moaGL.createTexture(e.width, e.height), e.moaGL.copyLastRender(u)) : o = a.copy(e), i.sharpen(e, -100, 1, "normal"), null != e.moaGL ? (l = e.moaGL.glRenderingObjects.writeTexture, s = e.moaGL.glRenderingObjects.readTexture, e.moaGL.bitmapBlendBitmapSeparate(l, u, s, d, h), e.moaGL._swapTextures(), e.moaGL.destroyTexture(u)) : (n.blendWithBitmapSeparate(e, o, d, h), o.data = null), !0
				}, t.exports = o
			}, {
				"../../core/MoaAllocAndCopy": 34,
				"../MoaBitmapBlend": 72,
				"../MoaHistogramMapping": 90,
				"../MoaSharpen": 96
			}],
			102: [function(e, t, r) {
				t.exports = {
					major: 3,
					minor: 1,
					patch: 0
				}
			}, {}]
		}, {}, [4]), AV.Actions = function() {
			this.actionList = [], this.index = -1
		}, AV.Actions.prototype.setPreventUndoCheckpoint = function() {
			this.preventUndoCheckpoint = this.index
		}, AV.Actions.prototype.canUndo = function() {
			return "undefined" != typeof this.preventUndoCheckpoint && this.index <= this.preventUndoCheckpoint ? !1 : this.index >= 0
		}, AV.Actions.prototype.undo = function(e) {
			var t, r, o;
			this.index < 0 || (t = this.actionList[this.index], !e && t && (r = t.undoHandler, r.call(t.context, t)), this.index > 0 ? (o = this.actionList[this.index].dimensions, o && (o = o.beforeDimensions, this.setDims(o.hiresWidth || o.width, o.hiresHeight || o.height))) : this.setDims(this._origHiresWidth, this._origHiresHeight), this.index--, this.evaluateUndoRedo())
		}, AV.Actions.prototype.evaluateUndoRedo = function() {
			AV.controlsWidgetInstance && AV.controlsWidgetInstance.layoutNotify(AV.launchData.openType, "updateUndoRedo", [this.canUndo(), this.canRedo()])
		}, AV.Actions.prototype.undoFake = function() {
			this.undo(!0)
		}, AV.Actions.prototype.canRedo = function() {
			return this.index < this.actionList.length - 1
		}, AV.Actions.prototype.redo = function(e, t) {
			var r, o, a;
			this.index >= this.actionList.length - 1 || (this.index++, r = this.actionList[this.index], !e && r && (o = r.redoHandler, o.call(r.context, r), t && r.context.commit(), a = this.actionList[this.index].dimensions, a && (a = a.afterDimensions, this.setDims(a.hiresWidth || a.width, a.hiresHeight || a.height))), this.evaluateUndoRedo())
		}, AV.Actions.prototype.redoFake = function() {
			this.redo(!0)
		}, AV.Actions.prototype.push = function(e) {
			this.truncate(!0), this.actionList.push(e)
		}, AV.Actions.prototype.truncate = function(e) {
			this.actionList.length = this.index + 1, !e && AV.controlsWidgetInstance && AV.controlsWidgetInstance.layoutNotify(AV.launchData.openType, "updateUndoRedo", [this.canUndo(), this.canRedo()])
		}, AV.Actions.prototype.getDims = function() {
			var e = null;
			return AV.paintWidgetInstance && (e = e || {}, e.width = AV.paintWidgetInstance.width, e.height = AV.paintWidgetInstance.height), this.hiresWidth && this.hiresHeight && (e = e || {}, e.hiresWidth = this.hiresWidth, e.hiresHeight = this.hiresHeight), e
		}, AV.Actions.prototype.setDims = function(e, t) {
			(this.hiresWidth !== e || this.hiresHeight !== t) && (this.hiresWidth = e, this.hiresHeight = t, AV.controlsWidgetInstance && AV.controlsWidgetInstance.imageSizeTracker.setImageScaledIndicator())
		}, AV.Actions.prototype.setOrigSize = function(e, t) {
			this._origHiresWidth = e, this._origHiresHeight = t, this.setDims(e, t)
		}, AV.Actions.prototype.exportJSON = function() {
			var e;
			AV.util.moaLite.Version && (e = AV.util.moaLite.Version.getVersion());
			var t, r, o, a, i = {
					actions: [],
					version: e
				},
				n = [];
			for (o = 0; o < this.index + 1; o++)
				if (t = this.actionList[o], r = t.action)
					if (r instanceof Array)
						for (a = 0; a < r.length; a++) n.push(r[a]);
					else n.push(r);
			return i.actions = n, AV.JSON.stringify(i)
		}, AV.Actions.prototype.getPreviousActionParameters = function() {
			if (this.actionList && this.actionList.length > 0) {
				var e = this.actionList[this.index];
				return e
			}
		}, AV.Actions.prototype.replayAllActions = function() {
			var e, t = this.index;
			for (this.index = -1; this.index < t;) e = this.actionList[this.index + 1], e && e.backingReference && (e.backingReference = {
				beforeBacking: AV.paintWidgetInstance.getCanvasBacking(),
				afterBacking: null
			}), this.redo(!1, !0)
		}, AV.Actions.prototype.hasMadeChanges = function() {
			return this.actionList.length && this.index > -1 ? !0 : !1
		}, AV.FilterManager = function() {
			var e = {},
				t = {},
				r = this,
				o = [],
				a = {};
			r.getPacksById = function() {
				return a
			}, r.getPacksInOrder = function() {
				return o
			};
			var i = function(r, i) {
				var n, s, l, u;
				if (i)
					for (n = 0; n < i.length; n++)
						if (s = i[n], o.push(s), a[s.identifier] = s, s) {
							if (l = s.items) {
								t[r] = l, u = l.length;
								for (var h = 0; u > h; h++) e[l[h].identifier] = l[h], e[l[h].identifier].packIdentifier = i[n].identifier
							}
							break
						}
			};
			return r.getEffectById = function(t) {
				return e[t]
			}, r.getClickableFiltersForPack = function(e) {
				return t[e]
			}, r.loadPack = function(e, t, r, o) {
				AV.controlsWidgetInstance.serverMessaging.sendMessage({
					id: "avpw_get_assets" + o,
					action: t,
					method: "GET",
					dataType: "json",
					announcer: AV.build.asyncFeatherTargetAnnounce,
					origin: AV.build.asyncImgrecvBase,
					callback: function(t) {
						i(e, [t]), r && r.call(this)
					}
				})
			}, r
		},
		function(e) {
			e.AV = e.AV || {};
			var t = e.AV;
			return t.ImageBorderManager = function() {
				var e = {},
					r = {},
					o = this,
					a = [],
					i = {};
				o.getPacksById = function() {
					return i
				}, o.getPacksInOrder = function() {
					return a
				};
				var n = function(o, n) {
					var s, l, u, h;
					if (n) {
						for (s = 0; s < n.length; s++)
							for (i[n[s].identifier] = n[s], a.push(n[s]), r[o] = n[s], u = n[s].items.length, l = 0; u > l; l++) h = n[s].items[l], e[h.identifier] = h, e[h.identifier].packIdentifier = n[s].identifier, e[h.identifier].safeAssetsBaseURL = t.util.getSafeAssetBaseURL(n[s].assetsBaseURL);
						n.splice(0, s + 1)
					}
				};
				return o.getEffectById = function(t) {
					return e[t]
				}, o.getClickableFiltersForPack = function(e) {
					return r[e]
				}, o.loadFrameResources = function(e, r, a) {
					t.controlsWidgetInstance.showWaitThrobber(!0);
					for (var i = o.getEffectById(e), n = i.images, s = new Image, l = new Image, u = new Image, h = new Image, d = new Image, c = new Image, f = new Image, m = new Image, p = ["tl", "tr", "br", "bl", "l", "t", "r", "b"], g = [s, l, u, h, d, c, f, m], v = [], _ = {}, x = 0; x < p.length; x++) {
						var M = p[x];
						_[M] = {
							w: 512,
							h: 512,
							img: g[x]
						}, v.push({
							img: g[x],
							src: i.safeAssetsBaseURL + n[M],
							mappingObject: _[M]
						})
					}
					t.util.loadImagesSync(v, function() {
						for (var e = {}, o = 0, a = p.length; a > o; o++) e[p[o]] = t.cnvs.convertToPremultipliedAlpha(t.cnvs.getBitmapForImage(_[p[o]].img));
						r && r.apply(this, [e]), t.controlsWidgetInstance.showWaitThrobber(!1)
					}, a)
				}, o.loadPack = function(e, r, o, a) {
					t.controlsWidgetInstance.serverMessaging.sendMessage({
						id: "avpw_get_assets" + a,
						action: r,
						method: "GET",
						dataType: "json",
						announcer: t.build.asyncFeatherTargetAnnounce,
						origin: t.build.asyncImgrecvBase,
						callback: function(t) {
							n(e, [t]), o && o.call(this)
						}
					})
				}, o
			}, e
		}(this), AV.OverlayRegistry = function() {
			var e = {},
				t = function(e, t) {
					var o = e,
						a = document.createElement("img");
					a.fullimageurl = o;
					var i = function(o) {
						avpw$(a).unbind("load", i), r.addElement(e, a), t && t.apply(this, [o])
					};
					avpw$(a).load(i), AV.util.doesSupportImageCORS() ? (a.crossOrigin = "Anonymous", avpw$(a).attr("src", e)) : avpw$.ajax({
						type: "GET",
						dataType: "json",
						url: AV.build.jsonp_imgserver + "?callback=?",
						data: {
							url: escape(e)
						},
						success: function(e) {
							avpw$(a).attr("src", e.data)
						}
					})
				},
				r = this;
			return r.add = function(t, r, o) {
				e[t] || (e[t] = {}), r && (e[t].hiresurl = r), o && (e[t].asset = o)
			}, r.addElement = function(t, o) {
				e[t] || r.add(t), e[t].element = o
			}, r.getElement = function(r, o) {
				var a = null;
				return e[r] && e[r].element ? (a = e[r].element, o && o.apply(this, [a])) : o && t(r, o), a
			}, r.getHiRes = function(t) {
				return e[t].hiresurl
			}, r.getAsset = function(t) {
				return e[t].asset
			}, r
		};
	var mediator = AV.Events;
	AV.ModeManager = function() {
			var e = this,
				t = function(t) {
					if (null !== e.active && void 0 !== e.active.deactivate && e.active.deactivate(), null !== t && void 0 !== t && "" !== t) {
						var r = e.module[t];
						void 0 !== r && (e.active = r, void 0 !== e.active.activate && e.active.activate(e))
					} else e.active = null
				},
				r = function(r) {
					r && (e = r), mediator.on("canvas:activate", t)
				},
				o = function() {
					mediator.off("canvas:activate", t)
				},
				a = {};
			return a.init = r, a.shutdown = o, a
		},
		function(e, t, r) {
			e.AV = e.AV || {};
			var o = e.AV,
				a = o.Events;
			return function(e) {
				e.support.touch = e.support.touch || "ontouchend" in r
			}(avpw_jQuery), o.PaintUI = function(e, r) {
				var i, n = avpw$(e),
					s = avpw$(r),
					l = {},
					u = ["mouseOutEvent", "mouseMoveEvent", "mouseDownEvent", "mouseUpEvent"],
					h = !0,
					d = 30,
					c = !0,
					f = !1,
					m = this,
					p = function() {},
					g = function(e) {
						i = i || n.offset();
						var t, r, a, s, l, u;
						return "internal" == e.type ? (t = e.x, r = e.y) : (l = o.util.getTouch(e), l ? (t = l.pageX, r = l.pageY) : (t = e.pageX, r = e.pageY)), a = t - i.left, s = r - i.top, canvasControlsX = a, canvasControlsY = s, u = m.viewport.getRatio(), a *= u, s *= u, {
							x: 0 | t,
							y: 0 | r,
							canvasX: 0 | a,
							canvasY: 0 | s,
							canvasControlsX: canvasControlsX,
							canvasControlsY: canvasControlsY
						}
					},
					v = function(e, t) {
						var r = m.viewport.getRatio(),
							o = n.offset(),
							a = o.left,
							i = a + n.width() / r,
							s = o.top,
							l = s + n.height() / r;
						return e > a && i > e && t > s && l > t
					};
				m.enablePan = function() {
					c = !0, m.viewport.clearAvailablePanDirections(), m.viewport.pan()
				}, m.disablePan = function() {
					c = !1, m.hidePan()
				}, m.showPan = function() {
					c && m.addCanvasClass("avpw_can_pan")
				}, m.hidePan = function() {
					m.removeCanvasClass("avpw_can_pan")
				};
				var _, x = 20,
					M = null,
					y = !1,
					b = function(e, r) {
						y = !0;
						var o = e - _.x,
							a = r - _.y;
						m.viewport.pan(o, a);
						var i = {
							x: e,
							y: r
						};
						t.clearTimeout(M), M = t.setTimeout(function() {
							y = !1, _ = i
						}, x)
					},
					C = 20,
					T = null,
					A = !1,
					S = function(e) {
						A = !0, m.viewport.gestureZoomUpdate(e), t.clearTimeout(T), T = t.setTimeout(function() {
							A = !1
						}, C)
					},
					w = function(e) {
						return e.scale && !A && S(e.scale), !1
					},
					P = function(e) {
						m.setMouseCursor(), avpw$.support.touch && (null == e ? s.bind("gesturechange", w).bind("gestureend", m.viewport.gestureZoomFinish) : s.unbind("gesturechange").unbind("gestureend"))
					},
					F = function(e) {
						l.mouseOutEvent && l.mouseOutEvent.apply(m, [{}, e])
					},
					E = function(e) {
						var r;
						if (h) {
							if (h = !1, t.setTimeout(function() {
									h = !0
								}, d), l.mouseMoveEvent) return r = g(e), l.mouseMoveEvent.apply(m, [r, e]);
							c && f && (r = g(e), e.preventDefault(), _ = _ || r, y || b(r.x, r.y))
						}
					},
					D = function(e) {
						if (l.mouseDownEvent) {
							var t = g(e);
							return l.mouseDownEvent.apply(m, [t, e, v(t.x, t.y)])
						}
						c && (_ = void 0, f = !0, m.canvasHasClass("avpw_can_pan") && m.addCanvasClass("avpw_is_panning"))
					},
					L = function(e) {
						if (l.mouseUpEvent) {
							var t = g(e);
							l.mouseUpEvent.apply(m, [t, e])
						} else c && (f = !1, m.viewport.isZoomed() && m.viewport.bounceBack(), m.removeCanvasClass("avpw_is_panning"))
					};
				return m.resetOffset = function() {
					i = void 0
				}, m.getCoordinatesFromEventWithinCanvasBounds = function(e) {
					var t = g(e);
					return v(t.x, t.y) ? t : null
				}, m.getCoordinatesFromEvent = function(e) {
					return g(e)
				}, m.getViewportCenter = function() {
					var e, t, r, a;
					return t = o.controlsWidgetInstance.layoutNotify(o.launchData.openType, "getEmbedElement"), t ? (t = avpw$(t), r = t.width(), a = t.height(), e = t.offset(), g({
						type: "internal",
						x: r / 2 + e.left,
						y: a / 2 + e.top
					})) : null
				}, m.subscribe = function(e) {
					for (var t = 0; t < u.length; t++) e[u[t]] && (l[u[t]] = e[u[t]].AV_bindInst(e));
					m.disablePan()
				}, m.unsubscribe = function(e) {
					l = {}, m.enablePan()
				}, m.shutdown = function() {
					a.off("layout:resize", m.resetOffset), s.unbind("mouseleave").unbind("mousedown"), avpw$(t).unbind("mousemove", E).unbind("mouseup", L).unbind("scroll", m.resetOffset), avpw$.support.touch && (s.unbind("touchmove").unbind("touchstart").unbind("touchend").unbind("gesturechange").unbind("gestureend"), avpw$(t).unbind("touchmove", p)), m.resetOffset(), m.viewport.shutdown(), l = {}, f = !1
				}, m.setMouseCursor = function(t) {
					void 0 === t && (t = ""), e.style.cursor = t
				}, m.addCanvasClass = function(e) {
					n.addClass(e)
				}, m.removeCanvasClass = function(e) {
					n.removeClass(e)
				}, m.canvasHasClass = function(e) {
					return n.hasClass(e)
				}, a.on("tool:open", P), a.on("layout:resize", m.resetOffset), s.bind("mouseleave", F).bind("mousedown", D), avpw$(t).bind("mouseup", L).bind("mousemove", E).bind("scroll", m.resetOffset), avpw$.support.touch && (avpw$(t).bind("touchmove", p), s.bind("touchstart", function(e) {
					return avpw$(t).unbind("mousemove", E), s.bind("touchmove", E), D(e)
				}).bind("touchend", function(e) {
					return s.unbind("touchmove", E), avpw$(t).bind("mousemove", E), L(e), !1
				}), s.bind("gesturechange", w).bind("gestureend", m.viewport.gestureZoomFinish)), m.viewport.setCanvas.apply(m, [e]), m
			}, o.PaintUI.prototype.viewport = function() {
				var e, t, r, i, n, s = {},
					l = null,
					u = null,
					h = 0,
					d = 1,
					c = function() {
						var t = u.x0 + u.w,
							r = u.y0 + u.h,
							o = !1,
							a = !1;
						return (t > l.w || u.x0 < l.x0) && (o = !0), (u.y0 < l.y0 || r > l.h) && (a = !0), o || a ? e.showPan() : e.hidePan(), {
							x: o,
							y: a
						}
					},
					f = o.support.getVendorProperty("transform"),
					m = function(e) {
						if (!f || "mobile" != o.launchData.openType && "aviary" != o.launchData.openType) t.style.width = u.w + "px", t.style.height = u.h + "px", t.style.marginLeft = "-" + (u.w / 2 + .5 | 0) + "px", t.style.marginTop = "-" + (u.h / 2 + .5 | 0) + "px";
						else {
							var r = e && e.scale ? e.scale : 1 / s.getRatio(),
								a = .5 * (1 * u.w / r - u.w) + .5 | 0,
								i = .5 * (1 * u.h / r - u.h) + .5 | 0,
								n = u.x0 - a,
								l = u.y0 - i,
								h = new o.TransformStyle(t.style[f]);
							h.set({
								translate: n + "px, " + l + "px",
								scale: r
							}), t.style[f] = h.serialize()
						}
					};
				s.setCanvas = function(r) {
					t = r, e = this, f && e.addCanvasClass("avpw_position_by_transform")
				}, s.shutdown = function() {
					r = i = void 0, l = u = null
				};
				var p = function() {
						i = Math.abs((r - u.w) / 2) + .5 | 0
					},
					g = function(e) {
						if (e) {
							var r = u.w + i * e,
								o = r * t.height / t.width + .5 | 0;
							if (0 > o || 0 > r) return !1;
							u.w = r, u.h = o, C(), y()
						}
					},
					v = 1,
					_ = !!o.support.getVendorProperty("transformStyle");
				s.gestureZoomUpdate = function(e) {
					v = e, e = 1 * e / s.getRatio(), m({
						scale: e
					})
				}, s.gestureZoomFinish = function() {
					if (v) {
						var e = u.w * v + .5 | 0,
							t = u.h * v + .5 | 0,
							r = e / t;
						e < l.w && t < l.h ? e > r * t ? (u.w = l.w, u.h = l.w * t / e + .5 | 0) : (u.h = l.h, u.w = l.h * r + .5 | 0) : (u.w = e, u.h = t), m()
					}
				}, s.setPadding = function(e) {
					h = e
				};
				var x = function(e, a, i) {
						var n, s = t.width,
							l = t.height;
						e = e || s, a = a || l, e -= h, a -= h, r = s, i && (n = o.util.getScaledDims(s, l, e, a), e = n.width, a = n.height), u = new o.Bbox(0, 0, e, a), p(), y()
					},
					M = function(e, t, r) {
						n = n || c();
						var o = !1;
						return (r || n.x) && (u.x0 += e, o = !0), (r || n.y) && (u.y0 += t, o = !0), o
					},
					y = function() {
						n = void 0
					},
					b = function() {
						var e, t = u.x0 + u.w,
							r = u.y0 + u.h;
						return t > l.w && u.x0 > l.x0 ? (e = l.w - u.w, u.x0 = e > 0 ? e : 0) : u.x0 < l.x0 && t < l.w && (e = l.w - u.w, u.x0 = 0 > e ? e : 0), r > l.h && u.y0 > l.y0 ? (e = l.h - u.h, u.y0 = e > 0 ? e : 0) : u.y0 < l.x0 && r < l.h && (e = l.h - u.h, u.y0 = 0 > e ? e : 0), M(0, 0)
					},
					C = function() {
						if (l) {
							var e = (l.w - u.w) / 2 + .5 | 0,
								t = (l.h - u.h) / 2 + .5 | 0;
							u.x0 = u.y0 = 0, M(e, t, !0)
						}
					},
					T = function(e) {
						if (e % 180 && !(e % 90)) {
							var t = u.w;
							return u.w = u.h, u.h = t, C(), !0
						}
						return !1
					},
					A = function() {
						var e = s.getRatio();
						a.trigger("canvas:resize", u, e, d), d = e
					};
				return s.isZoomed = function() {
					return 1 !== s.getRatio()
				}, s.getRatio = function() {
					return u ? r / u.w : 1
				}, s.zoomIn = function() {
					return u || x(), g(1), m(), e.resetOffset(), A(), !1
				}, s.zoomOut = function() {
					return u || x(), g(-1), m(), e.resetOffset(), A(), !1
				}, s.zoomByRatio = function(r) {
					var o = t.width * r,
						a = t.height * r,
						i = u.w,
						s = u.h,
						h = 0,
						d = 0;
					return u.w = o + .5 | 0, u.h = a + .5 | 0, n = c(), n.x ? h = -((o - i) / 2 + .5 | 0) : (h = (l.w - u.w) / 2 + .5 | 0, u.x0 = 0), n.y ? d = -((a - s) / 2 + .5 | 0) : (d = (l.h - u.h) / 2 + .5 | 0, u.y0 = 0), M(h, d, !0), b(), m(), e.resetOffset(), y(), A(), !1
				}, s.fitLayout = function(t, r) {
					l = new o.Bbox(0, 0, t, r), x(t, r, !0), C(), m(), e.resetOffset(), A()
				}, s.resize = function(t, r) {
					return x(t, r, !0), C(), m(), e.resetOffset(), A(), !1
				}, s.resizeFake = function(t, r) {
					return x(t, r), C(), m(), e.resetOffset(), !1
				}, s.pan = function(t, r, o) {
					M(t, r, o) && (m(), e.resetOffset())
				}, s.clearAvailablePanDirections = function() {
					y()
				}, s.bounceBack = function() {
					b() && (m(), e.resetOffset()), A()
				}, s.rotate = function(e, r, a) {
					e = e ? e + "deg" : "0", r = r ? r + "deg" : "0", a = a ? a + "deg" : "0";
					var i = new o.TransformStyle(t.style[f]);
					i.set(_ ? {
						rotateX: e,
						rotateY: r,
						rotateZ: a
					} : {
						rotate: e
					}), t.style[f] = i.serialize()
				}, s.rotateBoundsBy90 = function(e) {
					return T(e) ? (A(), !0) : !1
				}, s
			}(), e
		}(this, "undefined" != typeof window ? window : {}, "undefined" != typeof document ? document : {}), avpw$ = "undefined" != typeof avpw$ ? avpw$ : {}, AV.CropController = function(e, t, r) {
			var o, a, i, n, s, l, u, h, d, c = this,
				f = null,
				m = {},
				p = !1,
				g = 1,
				v = -1,
				_ = function() {
					a = new AV.Bbox(0, 0, t.width, t.height)
				},
				x = function() {
					a = null
				},
				M = function() {
					g = o ? Math.abs((o.x1 - o.x0) / (o.y1 - o.y0)) : 0
				},
				y = function(e, t) {
					var r, i;
					if (0 != g) {
						var n = 1 / g;
						p && (Math.abs((o.x1 - o.x0) / (o.y1 - o.y0)) > g ? (r = AV.math.sign(o.y1 - o.y0) * Math.abs(o.x1 - o.x0) * n + .5 | 0, o[t] = "y1" === t ? o.y0 + r : o.y1 - r) : (r = AV.math.sign(o.x1 - o.x0) * Math.abs(o.y1 - o.y0) * g + .5 | 0, o[e] = "x1" === e ? o.x0 + r : o.x1 - r)), i = a.constrain(o[e], o[t]), o[e] = i.x, o[t] = i.y, p && i.dirty && (Math.abs((o.x1 - o.x0) / (o.y1 - o.y0)) > g ? (r = AV.math.sign(o.x1 - o.x0) * Math.abs(o.y1 - o.y0) * g + .5 | 0, o[e] = "x1" === e ? o.x0 + r : o.x1 - r) : (r = AV.math.sign(o.y1 - o.y0) * Math.abs(o.x1 - o.x0) * n + .5 | 0, o[t] = "y1" === t ? o.y0 + r : o.y1 - r))
					}
				},
				b = function(e, t) {
					switch (v) {
						case 1:
							o.x1 = e + m.x, o.y0 = t - m.y, y("x1", "y0");
							break;
						case 2:
							o.x0 = e - m.x, o.y1 = t + m.y, y("x0", "y1");
							break;
						case 3:
							o.x1 = e + m.x, o.y1 = t + m.y, y("x1", "y1");
							break;
						case 0:
						default:
							o.x0 = e - m.x, o.y0 = t - m.y, y("x0", "y0")
					}
				},
				C = function(e, t) {
					var r, i;
					o.x0 += e, o.x1 += e, o.y0 += t, o.y1 += t, r = o.x1 - o.x0, i = o.y1 - o.y0;
					var n = a.constrain(o.x0, o.y0);
					n.dirty && (o.x0 = n.x, o.y0 = n.y, o.x1 = o.x0 + r, o.y1 = o.y0 + i);
					var s = a.constrain(o.x1, o.y1);
					s.dirty && (o.x1 = s.x, o.y1 = s.y, o.x0 = o.x1 - r, o.y0 = o.y1 - i)
				},
				T = function() {
					i = avpw$(AV.template[AV.launchData.layout].cropLayer()), e.layoutNotify(AV.launchData.openType, "getCanvasControlsElement").append(i), u = i.find("#avpw_crop_tooltip"), u && !r && u.hide(), h = u.find("#avpw_crop_tooltip_w"), d = u.find("#avpw_crop_tooltip_h")
				};
			c.setToolTipValues = function(e, t) {
				h && d && (h.html(e), d.html(t))
			};
			var A, S = function() {
					i.remove(), i = null, u = h = d = null
				},
				w = function(t, r) {
					var o, a, n, s, l = e.canvasUI.viewport.getRatio();
					t.x0 < t.x1 ? (o = t.x0, n = t.x1 - t.x0) : (o = t.x1, n = t.x0 - t.x1), t.y0 < t.y1 ? (a = t.y0, s = t.y1 - t.y0) : (a = t.y1, s = t.y0 - t.y1), A.trigger("tool:crop:change", n, s), o = o / l + .5 | 0, a = a / l + .5 | 0, n = n / l + .5 | 0, s = s / l + .5 | 0;
					var u = {
						left: o + "px",
						top: a + "px",
						width: n + "px",
						height: s + "px"
					};
					i.css(u)
				};
			c.activate = function(r) {
				o = new AV.Bbox, _(), n = new AV.OverlaySelectionModule(t), p = !1, T(), A = r, e.layoutNotify(AV.launchData.openType, "showCanvasControlsElement")
			}, c.deactivate = function() {
				o = null, x(), n = null, e.layoutNotify(AV.launchData.openType, "hideCanvasControlsElement"), S()
			};
			var P = 60,
				F = 60;
			return c.updateUIDown = function(t, a) {
				if (n) {
					u && r && u.show();
					var i, s = 99999999,
						l = 1;
					l = e.canvasUI.viewport.getRatio();
					var h = n.getHandleImageWidth(),
						d = l * (h / 2) * (h / 2) | 0;
					switch (f = null, v = -1, i = AV.math.sqrDist(o.x0, o.y0, t, a), s > i && d > i && (v = 0, s = i, u.css({
						top: -F,
						left: -P,
						right: "auto",
						bottom: "auto"
					})), i = AV.math.sqrDist(o.x1, o.y0, t, a), s > i && d > i && (v = 1, s = i, u.css({
						top: -F,
						left: "auto",
						right: -P,
						bottom: "auto"
					})), i = AV.math.sqrDist(o.x0, o.y1, t, a), s > i && d > i && (v = 2, s = i, u.css({
						top: "auto",
						left: -P,
						right: "auto",
						bottom: -F
					})), i = AV.math.sqrDist(o.x1, o.y1, t, a), s > i && d > i && (v = 3, s = i, u.css({
						top: "auto",
						left: "auto",
						right: -P,
						bottom: -F
					})), v) {
						case 0:
							m = {
								x: t - o.x0,
								y: a - o.y0
							};
							break;
						case 3:
							m = {
								x: o.x1 - t,
								y: o.y1 - a
							};
							break;
						case 1:
							m = {
								x: o.x1 - t,
								y: a - o.y0
							};
							break;
						case 2:
							m = {
								x: t - o.x0,
								y: o.y1 - a
							};
							break;
						default:
							if (u.hide(), !o.contains(t, a)) return !1;
							f = {
								x: t,
								y: a
							}
					}
					return !0
				}
			}, c.updateUIMove = function(e, t) {
				var r, a;
				null != f ? (r = e - f.x, a = t - f.y, C(r, a), f.x = e, f.y = t) : b(e, t), w(o)
			}, c.apply = function(e, t) {
				u.hide();
				var r;
				o.x0 > o.x1 && (r = o.x0, o.x0 = o.x1, o.x1 = r), o.y0 > o.y1 && (r = o.y0, o.y0 = o.y1, o.y1 = r)
			}, c.flipIt = function() {
				c.setInitialSelectionByRatio(l / s)
			}, c.setInitialSelectionTo = function(e, r) {
				o && (s = e, l = r, o.x0 = (t.canvas.width - e) / 2 + .5 | 0, o.x1 = o.x0 + e + .5 | 0, o.y0 = (t.canvas.height - r) / 2 + .5 | 0, o.y1 = o.y0 + r + .5 | 0, w(o, !0))
			}, c.setInitialSelectionByRatio = function(e) {
				var r, o, a = 0,
					i = t.canvas.width,
					n = t.canvas.height,
					s = a,
					l = a,
					u = i - 2 * l,
					h = n - 2 * s;
				return r = h * e, o = h, r > u && (r = u, o = u / e), c.setInitialSelectionTo(r, o)
			}, c.setInitialSelection = function() {
				if (o) {
					var e, r, a, i;
					p ? e = a = .12 : (e = .09, a = .18), r = 1 - e, i = 1 - a, o.x0 = t.canvas.width * e + .5 | 0, o.x1 = t.canvas.width * r + .5 | 0, o.y0 = t.canvas.height * a + .5 | 0, o.y1 = t.canvas.height * i + .5 | 0, w(o)
				}
			}, c.forceAspect = function(e) {
				e && M(), p = e
			}, c.isValidCrop = function() {
				return 0 === Math.abs(o.x0 - o.x1) || 0 === Math.abs(o.y0 - o.y1) ? !1 : !0
			}, c.crop = function() {
				return o
			}, c.getCropSettings = function() {
				var e = t.width,
					r = t.height,
					a = o.x1 - o.x0,
					i = o.y1 - o.y0,
					n = o.x0,
					s = o.y0;
				return {
					topLeft: [n / e, s / r],
					normWidth: a / e,
					aspectRatio: a / i
				}
			}, c
		};
	var mediator = AV.Events;
	avpw$ = "undefined" != typeof avpw$ ? avpw$ : {}, AV.OverlayController = function(e, t, r) {
		var o, a, i, n, s = r.modes || {
				OFF_STATE: 0
			},
			l = r.handlePosition || AV.OverlayController.HANDLE_POSITION.BOTTOM_LEFT,
			u = 5,
			h = r.minimumOverlaySize || 20,
			d = r.maximumOverlaySize || 99999999,
			c = r.enableFreeAspectRatioMode || !1,
			f = 10,
			m = "avpw_selection_overlay_selected avpw_selection_overlay_editing",
			p = "avpw_selection_overlay_selected avpw_selection_overlay_dragonly",
			g = AV.support.getVendorProperty("transform"),
			v = r.disableRotation || !1,
			_ = null,
			x = !1,
			M = !1,
			y = !1,
			b = !1,
			C = !1,
			T = r.forceDragMode || !1,
			A = function(e) {
				e && i === e || (i = null);
				for (var t in o) o.hasOwnProperty(t) && o[t] != e && E(o[t], s.OFF_STATE)
			},
			S = function(e, t, r) {
				var a, i, n;
				if (t !== r) {
					t = 1 / t, r = 1 / r, a = t / r;
					for (i in o) n = o[i], B(n, {
						x: n.topLeftX * a,
						y: n.topLeftY * a
					}), G(n, a)
				}
			},
			w = function() {
				a++, i && i.element && (i.zIndex = a, i.element.css("z-index", a))
			},
			P = function(e) {
				A(o[e]), i = o[e], w()
			},
			F = function(e) {
				var t, a, i = r.aspectRatio,
					n = o[e.id];
				t = e ? parseInt(e.style.width, 10) : 0, a = e ? avpw$(e).height() : 0;
				var s = e ? parseInt(e.style.left, 10) : 0,
					l = e ? parseInt(e.style.top, 10) : 0,
					u = s + f + t / 2,
					h = l + f + a / 2;
				c ? i = a / t : i || (i = 0 !== t && 0 !== a ? a / t : 1), n && AV.util.extend(n, {
					width: t,
					aspectRatio: i,
					topLeftX: parseInt(e.style.left || 0, 10),
					topLeftY: parseInt(e.style.top || 0, 10),
					centerX: u,
					centerY: h
				})
			},
			E = function(t, o) {
				t.mode = o, t.element.removeClass(p), t.element.removeClass(m), o === s.DRAG_STATE ? t.element.addClass(p) : o === s.EDIT_STATE ? t.element.addClass(m) : i && i == t && (i = null), r.onModeChange && r.onModeChange.apply(e, [t, o])
			},
			D = function(e, t) {
				e && (e.mode && e.mode !== s.OFF_STATE ? e.mode === s.DRAG_STATE ? t ? s.EDIT_STATE && E(e, s.EDIT_STATE) : E(e, s.OFF_STATE) : e.mode === s.EDIT_STATE && (t || (s.DRAG_STATE ? E(e, s.DRAG_STATE) : E(e, s.OFF_STATE))) : t && s.DRAG_STATE && E(e, s.DRAG_STATE))
			},
			L = function(e) {
				e && e.element && (e.element.remove(), delete o[e.id])
			},
			R = function() {
				avpw$.each(o, function(e) {
					L(o[e])
				})
			},
			B = function(e, t) {
				e.element.css({
					left: (t.x + .5 | 0) + "px",
					top: (t.y + .5 | 0) + "px"
				}), e.topLeftX = t.x, e.topLeftY = t.y
			},
			O = function(e, t) {
				var r, o, a, i, n = !1;
				return r = e.initialCoordsX, o = e.initialCoordsY, a = t.x - r, i = t.y - o, (Math.abs(a) > u || Math.abs(i) > u) && (n = !0), n && e.element.css({
					left: (e.topLeftX + a + .5 | 0) + "px",
					top: (e.topLeftY + i + .5 | 0) + "px"
				}), n
			},
			I = function() {
				i && i.element && i.element.show()
			},
			N = function() {
				i && i.element && i.element.hide()
			},
			G = function(e, t) {
				var r = e.width * t + .5 | 0,
					o = r * e.aspectRatio + .5 | 0;
				e.element.css({
					width: r + "px",
					height: o + "px"
				}), e.width = r + .5 | 0
			},
			U = function(t, r, o) {
				var a, i, n, s, l, u, c, m, p, g, v, _, x, M, y, b, C;
				u = t.topLeftX, c = t.topLeftY, a = t.initialCoordsX, i = t.initialCoordsY, M = e.layoutNotify(AV.launchData.openType, "getCanvasControlsElement").offset(), a -= M.left, i -= M.top, r.x -= M.left, r.y -= M.top, l = t.aspectRatio, n = t.width, s = n * l, o == AV.OverlayController.SCALE_TYPE.HORIZONTAL ? (g = u + n + f, v = c + s / 2 + f) : o == AV.OverlayController.SCALE_TYPE.VERTICAL && (g = u + n / 2 + f, v = c), m = t.centerX, p = t.centerY, _ = r.x, x = r.y, y = Math.sqrt(Math.pow(_ - m, 2) + Math.pow(x - p, 2)) / Math.sqrt(Math.pow(g - m, 2) + Math.pow(v - p, 2)), b = h / n, C = d / n, y = y > b ? y : b, y = C > y ? y : C;
				var T, A;
				if (o == AV.OverlayController.SCALE_TYPE.VERTICAL) {
					T = u, A = c - .5 * s * (y - 1) + .5 | 0;
					var S = s * y + .5 | 0;
					t.element.css({
						left: T + "px",
						top: A + "px",
						height: S + "px"
					})
				} else if (o == AV.OverlayController.SCALE_TYPE.HORIZONTAL) {
					T = u - .5 * n * (y - 1) + .5 | 0, A = c;
					var w = n * y + .5 | 0;
					t.element.css({
						left: T + "px",
						top: A + "px",
						width: w + "px"
					})
				}
			},
			V = function(t, r) {
				var o, a, i, n, s, u, c, m, p, _, x, M, y, b, C, T, A, S, w, P, F;
				return u = t.topLeftX, c = t.topLeftY, o = t.initialCoordsX, a = t.initialCoordsY, b = e.layoutNotify(AV.launchData.openType, "getCanvasControlsElement").offset(), o -= b.left, a -= b.top, r.x -= b.left, r.y -= b.top, s = t.aspectRatio, i = t.width, n = i * s, l == AV.OverlayController.HANDLE_POSITION.BOTTOM_LEFT ? (_ = u, x = c + n + f / 2) : l == AV.OverlayController.HANDLE_POSITION.BOTTOM_CENTER ? (_ = u + i / 2 + f, x = c + n + f) : l == AV.OverlayController.HANDLE_POSITION.BOTTOM_RIGHT && (_ = u + i + 2 * f, x = c + n + 2 * f), m = t.centerX, p = t.centerY, M = r.x, y = r.y, S = Math.sqrt(Math.pow(M - m, 2) + Math.pow(y - p, 2)) / Math.sqrt(Math.pow(_ - m, 2) + Math.pow(x - p, 2)), w = h / i, P = d / i, S = S > w ? S : w, S = P > S ? S : P, v || (C = t.rotation || 0, T = Math.atan2(x - p, _ - m), C && (T = C - (2 * Math.PI - T)), A = Math.atan2(y - p, M - m), F = A - T + C, t.rotation = F), t.element[0].style[g] = "rotate(" + F + "rad)", t.element.css({
					left: (u - .5 * i * (S - 1) + .5 | 0) + "px",
					top: (c - .5 * n * (S - 1) + .5 | 0) + "px",
					width: (i * S + .5 | 0) + "px",
					height: (n * S + .5 | 0) + "px"
				}), S
			},
			k = function(t, r) {
				var a, i;
				t.length && (a = t[0].id, i = o[a], i && (r && r.apply(e, [i]), L(i)))
			},
			j = function(t, r) {
				var a = o[t.attr("id")],
					n = !1;
				return a === i && (n = !0, M = !0), r && r.apply(e, [a, n]), n
			},
			W = function(t) {
				i && (y = !0, n = i.rotation, t && t.apply(e, [i]))
			},
			H = function(e) {
				e && (F(e[0]), P(e.attr("id")))
			},
			X = function(t, r) {
				t && t.element && (F(t.element[0]), r && r.apply(e, [t]))
			},
			z = function(e) {
				var t, r = a + 1,
					i = new Array(r);
				for (avpw$.each(o, function(e) {
						i[o[e].zIndex] = o[e]
					}), t = 0; r > t; t++) i[t] && X(i[t], e)
			},
			Y = this;
		return Y.activate = function() {
			a = 1, o = {}, _ = null, e.layoutNotify(AV.launchData.openType, "showCanvasControlsElement"), mediator.on("canvas:resize", S)
		}, Y.deactivate = function() {
			R(), o = {}, e.layoutNotify(AV.launchData.openType, "hideCanvasControlsElement"), mediator.off("canvas:resize", S)
		}, Y.updateUIDown = function(e, t, r, o, a, n) {
			var s = !1,
				l = avpw$(t.target),
				u = l.closest(".avpw_selection_overlay"),
				h = l.closest(".avpw_selection_overlay_size_handle"),
				d = l.closest(".avpw_selection_overlay_close_button");
			if (d && d.length) return k(u, a), t.preventDefault(), !1;
			u && u.length && (x = !0, s = j(u, r)), h && h.length && W(o);
			var c = l.closest(".avpw_skew_vertical");
			c && c.length && (b = !0);
			var f = l.closest(".avpw_skew_horizontal");
			f && f.length && (C = !0), s ? (AV.util.extend(i, {
				initialCoordsX: e.x,
				initialCoordsY: e.y
			}), F(u[0])) : i && i.element && (T || D(i, !1), n && n())
		}, Y.updateUIMove = function(t, r, o, a, n) {
			return M && i && i.element && (x && o && o.apply(e, [i]), y ? (scale = V(i, t), a && a.apply(e, [i, scale]), x = !1) : b ? (U(i, t, AV.OverlayController.SCALE_TYPE.VERTICAL), a && a.apply(e, [i])) : C ? (U(i, t, AV.OverlayController.SCALE_TYPE.HORIZONTAL), a && a.apply(e, [i])) : i.mode === s.DRAG_STATE && (x = !O(i, t), n && n())), !1
		}, Y.apply = function(t, r, a) {
			var n, s = !1,
				l = avpw$(r.target),
				u = l.closest(".avpw_selection_overlay");
			u && u.length && (H(u), s = !0, n = o[u.attr("id")]), a && a.apply(e, [n, s, y]), x && (x = !1, i && i.element && !T && D(i, !0)), M = !1, y = !1, b = !1, C = !1
		}, Y.newOverlay = function(t) {
			var r = t.element;
			A(), e.layoutNotify(AV.launchData.openType, "getCanvasControlsElement").append(r), D(t, !0), o[t.id] = t, F(r[0]), i = t, _ = t.id, w()
		}, Y.commit = function(e) {
			z(e)
		}, Y.currentOverlay = function() {
			return i
		}, Y.showCurrentOverlay = function() {
			I()
		}, Y.hideCurrentOverlay = function() {
			N()
		}, Y.saveDimensions = function(e) {
			e = e || i, F(e.element[0])
		}, Y.isLastOverlayAdded = function(e) {
			return _ && o[_] === e
		}, Y.setHandlePosition = function(e) {
			l = e
		}, Y.setRotation = function(e, t) {
			e.rotation = t, t = 180 * t / Math.PI + .5 | 0, e.element[0].style[g] = "rotate(" + t + "deg)"
		}, Y
	}, AV.OverlayController.SCALE_TYPE = {
		HORIZONTAL: 0,
		VERTICAL: 1
	}, AV.OverlayController.HANDLE_POSITION = {
		BOTTOM_LEFT: 0,
		BOTTOM_CENTER: 1,
		BOTTOM_RIGHT: 2,
		TOP_CENTER: 3
	};
	var mediator = AV.Events;
	avpw$ = "undefined" != typeof avpw$ ? avpw$ : {}, AV.math = {
		sign: function(e) {
			return 0 > e ? -1 : 1
		},
		sqrDist: function(e, t, r, o) {
			var a = r - e,
				i = o - t;
			return a * a + i * i
		},
		solveQuadratic: function(e, t, r) {
			var o = -t,
				a = t * t - 4 * e * r,
				i = 2 * e;
			return 0 > a ? [0, 0] : [(o - Math.sqrt(a)) / i, (o + Math.sqrt(a)) / i]
		},
		lowestPositiveQuadratic: function(e, t, r) {
			var o = AV.math.solveQuadratic(e, t, r),
				a = o[0],
				i = o[1];
			return 0 >= i && a > 0 ? a : 0 >= a && i > 0 ? i : Math.max(Math.min(a, i), 0)
		},
		lineSegmentIntersection: function(e, t, r, o, a, i, n, s, l) {
			var u, h, d, c, f, m, p;
			return e == r && t == o || a == n && i == s ? null : e == a && t == i || r == a && o == i || e == n && t == s || r == n && o == s ? null : (r -= e, o -= t, a -= e, i -= t, n -= e, s -= t, d = Math.sqrt(r * r + o * o), c = r / d, f = o / d, m = a * c + i * f, i = i * c - a * f, a = m, m = n * c + s * f, s = s * c - n * f, n = m, 0 > i && 0 > s || i >= 0 && s >= 0 ? null : (p = n + (a - n) * s / (s - i), 0 > p || p > d ? null : (u = e + p * c, h = t + p * f, l.x = u, l.y = h, !0)))
		}
	}, AV.cnvs = Aviary.util.cnvs, AV.Bbox = function(e, t, r, o, a) {
		void 0 !== o ? (this.x0 = e, this.y0 = t, this.x1 = r, this.y1 = o, this.w = this.x1 - this.x0, this.h = this.y1 - this.y0, this.margin = void 0 !== a ? a : 0) : this.reset();

	}, AV.Bbox.prototype.include = function(e, t) {
		var r = e - this.margin,
			o = t - this.margin,
			a = e + this.margin,
			i = t + this.margin;
		this.x0 > r && (this.x0 = r), this.y0 > o && (this.y0 = o), this.x1 < a && (this.x1 = a), this.y1 < i && (this.y1 = i), this.w = this.x1 - this.x0, this.h = this.y1 - this.y0
	}, AV.Bbox.prototype.reset = function() {
		this.x0 = 999999999, this.y0 = 999999999, this.x1 = -999999999, this.y1 = -999999999, this.w = 0, this.h = 0, this.margin = 0
	}, AV.Bbox.prototype.contains = function(e, t) {
		var r = e >= this.x0 && e <= this.x1,
			o = t >= this.y0 && t <= this.y1;
		return r && o
	}, AV.Bbox.prototype.constrain = function(e, t) {
		var r = !1;
		return e < this.x0 && (e = this.x0, r = !0), e > this.x1 && (e = this.x1, r = !0), t < this.y0 && (t = this.y0, r = !0), t > this.y1 && (t = this.y1, r = !0), {
			x: e,
			y: t,
			dirty: r
		}
	}, AV.OverlaySelectionModule = function(e) {
		var t = e,
			r = document.createElement("img");
		r.width = r.height = 50;
		var o = document.createElement("img");
		o.width = o.height = 50;
		var a = this;
		return a.getHandleImageWidth = function() {
			return o.width
		}, a.drawCropSelection = function(e) {
			if (e) {
				var r, a, i, n, s, l, u = 1;
				AV.controlsWidgetInstance && AV.controlsWidgetInstance.canvasUI && (u = AV.controlsWidgetInstance.canvasUI.viewport.getRatio());
				var h = t.getLayerByName("_ui");
				e.x0 < e.x1 ? (r = e.x0, i = e.x1) : (r = e.x1, i = e.x0), e.y0 < e.y1 ? (a = e.y0, n = e.y1) : (a = e.y1, n = e.y0), s = i - r, l = n - a;
				var d = h.canvas.getContext("2d");
				d.globalCompositeOperation = "copy", d.clearRect(0, 0, h.canvas.width, h.canvas.height), d.globalCompositeOperation = "source-over", d.fillStyle = "#000000", d.globalAlpha = .6, d.fillRect(0, 0, r, h.canvas.height), d.fillRect(i, 0, h.canvas.width, h.canvas.height), d.fillRect(r, 0, i - r, a - 0), d.fillRect(r, n, i - r, h.canvas.height - n), d.strokeStyle = "#f4f4f4", d.globalAlpha = 1, d.lineWidth = u, d.lineCap = "square", d.strokeRect(r, a, s, l), d.beginPath(), d.moveTo(r, a + .33 * l + .5 | 0), d.lineTo(i, a + .33 * l + .5 | 0), d.moveTo(r, a + .67 * l + .5 | 0), d.lineTo(i, a + .67 * l + .5 | 0), d.moveTo(r + .33 * s + .5 | 0, a), d.lineTo(r + .33 * s + .5 | 0, n), d.moveTo(r + .67 * s + .5 | 0, a), d.lineTo(r + .67 * s + .5 | 0, n), d.stroke(), d.closePath(), d.globalAlpha = 1;
				for (var c = [{
						x: r,
						y: a
					}, {
						x: i,
						y: a
					}, {
						x: r,
						y: n
					}, {
						x: i,
						y: n
					}], f = 0; f < c.length; f++) {
					var m = c[f];
					d.setTransform(1, 0, 0, 1, 0, 0), h.localToWorld(m), d.translate(m.x, m.y), d.translate(-1 * (u * o.width / 2 + .5 | 0), -1 * (u * o.height / 2 + .5 | 0)), d.scale(u, u), d.drawImage(o, 0, 0), d.scale(1, 1), d.setTransform(1, 0, 0, 1, 0, 0)
				}
			}
		}, a.drawCropSelectionBackground = function(e) {
			if (e) {
				var r, o, a, i, n, s, l = t.getLayerByName("_ui");
				e.x0 < e.x1 ? (r = e.x0, a = e.x1) : (r = e.x1, a = e.x0), e.y0 < e.y1 ? (o = e.y0, i = e.y1) : (o = e.y1, i = e.y0), n = a - r, s = i - o;
				var u = l.canvas.getContext("2d");
				u.globalCompositeOperation = "copy", u.clearRect(0, 0, l.canvas.width, l.canvas.height), u.globalCompositeOperation = "source-over", u.fillStyle = "#000000", u.globalAlpha = .6, u.fillRect(0, 0, r, l.canvas.height), u.fillRect(a, 0, l.canvas.width, l.canvas.height), u.fillRect(r, 0, a - r, o - 0), u.fillRect(r, i, a - r, l.canvas.height - i)
			}
		}, a
	}, AV.BrushCursor = function() {
		var e, t = {},
			r = function() {
				e = document.createElement("div"), e.className = "avpw_draw_cursor", e.style.display = "none", AV.controlsWidgetInstance.layoutNotify(AV.launchData.openType, "getCanvasControlsElement").append(e)
			};
		t.show = function() {
			e || r(), avpw$(e).fadeIn()
		}, t.hide = function() {
			e && avpw$(e).hide()
		};
		var o, a = AV.support.getVendorProperty("transform");
		return o = a && a.length ? function(t, o) {
			e || r();
			var i = AV.controlsWidgetInstance.canvasUI.viewport.getRatio();
			e.style[a] = "translate(" + (t / i + .5 | 0) + "px," + (o / i + .5 | 0) + "px)"
		} : function(t, o) {
			e || r();
			var a = AV.controlsWidgetInstance.canvasUI.viewport.getRatio();
			e.style.top = (o / a + .5 | 0) + "px", e.style.left = (t / a + .5 | 0) + "px"
		}, t.setSize = function(t) {
			e || r(), e.style.width = 2 * t + "px", e.style.height = 2 * t + "px", e.style.marginLeft = -t + "px", e.style.marginTop = -t + "px"
		}, t.shutdown = function(t) {
			e = null
		}, mediator.on("canvas:showBrushCursor", t.show), mediator.on("canvas:hideBrushCursor", t.hide), mediator.on("canvas:setBrushPosition", o), mediator.on("canvas:setBrushSize", t.setSize), t
	}(), AV.PaintWidget = function(e, t, r, o, a, i, n) {
		this.imgElementClean = null, this.busy = !1, this.moduleLoadedCallback = {}, this.canvasReadyCallback = avpw$.Deferred ? new avpw$.Deferred : null, this.active = null, this.layers = [], this.dirtyRect = {
			bbox: new AV.Bbox,
			dirty: !1
		}, this.canvas = document.createElement("canvas"), this.setDimensions(e, t), this.canvas.id = "avpw_canvas_element", this.dirty = !1, this.actions = r, o && o.init && (o.init(this), this.modeManager = o), this.filterManager = a, this.overlayRegistry = i, this.imageBorderManager = n, this.resourceProvider = new Aviary.util.resourceProvider, AV.featherGLEnabled || (this.resourceProvider.renderQuality = "fastest"), this.resourceProvider.updateViewDimensions = this.setDimensions.AV_bindInst(this)
	}, AV.PaintWidget.prototype.restoreStateToCurrentAction = function() {
		mediator.trigger("tool:close"), AV.resetImageControls(), this.actions.replayAllActions()
	}, AV.PaintWidget.prototype.setBackground = function(e) {
		var t, r;
		if (this.imgElementClean = e, AV.featherGLEnabled) {
			var o = new AV.util.moaLite.moaGL.MoaGL;
			this.moaGL = o;
			var a = document.createElement("canvas");
			a.width = this.width, a.height = this.height, a.getContext("2d").drawImage(e, 0, 0, this.width, this.height), this.canvas.width = this.width, this.canvas.height = this.height;
			var i = this.canvas.getContext("webgl", {
					preserveDrawingBuffer: !0
				}),
				n = this;
			this.canvas.addEventListener("webglcontextlost", function(e) {
				e.preventDefault()
			}, !1), this.canvas.addEventListener("webglcontextrestored", function(e) {
				e.preventDefault(), n.restoreStateToCurrentAction()
			}, !1), o.setup(i), o.setImage(a), o.createEffect(), o.renderIdentity(), o.finalizeEffect(), o.commit(), r = !0
		} else this.canvas.width = this.width, this.canvas.height = this.height, t = this.canvas.getContext("2d"), t.drawImage(e, 0, 0, this.width, this.height), r = AV.cnvs.isOriginClean(t);
		return this.canvasReadyCallback && this.canvasReadyCallback.resolve(), mediator.trigger("layout:resize"), r
	}, AV.PaintWidget.prototype.setOrigSize = function(e, t) {
		this._origWidth = e + .5 | 0, this._origHeight = t + .5 | 0
	}, AV.PaintWidget.prototype.getOrigSize = function() {
		return {
			width: this._origWidth,
			height: this._origHeight
		}
	}, AV.PaintWidget.prototype.c2a = function(e, t, r) {
		var o, a, i, n = this.getScaledSize();
		return n.hiresWidth && n.hiresHeight ? e != n.width || t != n.height ? (o = n.hiresWidth / n.width, a = e * o, r && (a = a + .5 | 0), o = n.hiresHeight / n.height, i = t * o, r && (i = i + .5 | 0), {
			width: e,
			height: t,
			hiresWidth: a,
			hiresHeight: i
		}) : n : {
			width: e,
			height: t
		}
	}, AV.PaintWidget.prototype.a2c = function(e, t, r) {
		var o, a, i, n = this.getScaledSize();
		return n.hiresWidth && n.hiresHeight ? e != n.width || t != n.height ? (o = n.width / n.hiresWidth, a = e * o, r && (a = a + .5 | 0), o = n.height / n.hiresHeight, i = t * o, r && (i = i + .5 | 0), {
			width: a,
			height: i,
			hiresWidth: e,
			hiresHeight: t
		}) : n : {
			width: e,
			height: t
		}
	}, AV.PaintWidget.prototype.shutdown = function() {
		this.setMode(null), this.modeManager && (this.modeManager.shutdown(), this.modeManager = null), this.actions = null, this.layers = null, this.currentLayer = null, this.canvas = null, this.moduleLoadedCallback = null, this.canvasReadyCallback = null, this.waitThrobberShow = null
	}, AV.PaintWidget.prototype.moduleLoaded = function(e, t) {
		var r, o = this,
			a = [],
			i = function() {
				r.done(function() {
					t && t.apply(this, [e])
				}), o.moduleLoadedCallback[e] = r
			},
			n = function(e, t) {
				var n, s;
				for (n = 0; n < e.length; n++) s = AV.controlsWidgetInstance.assetManager.getContentURLByVersionKey(e[n].versionKey), s && ! function() {
					var r = new avpw$.Deferred;
					t === AV.controlsWidgetInstance.assetManager.types.EFFECT ? o.filterManager.loadPack(e[n].identifier, s, function() {
						r.resolve()
					}, t) : t === AV.controlsWidgetInstance.assetManager.types.IMAGEBORDER ? o.imageBorderManager.loadPack(e[n].identifier, s, r.resolve, t) : r.resolve(), a.push(r)
				}();
				a.push(o.canvasReadyCallback), r = avpw$.when.apply(o, a), i()
			};
		return o.moduleLoadedCallback && (r = o.moduleLoadedCallback[e]), r ? i() : "effects" === e ? AV.controlsWidgetInstance.assetManager && AV.controlsWidgetInstance.assetManager.getAssets("EFFECT", n) : "frames" === e ? AV.controlsWidgetInstance.assetManager && AV.controlsWidgetInstance.assetManager.getAssets("IMAGEBORDER", n) : (r = avpw$.when(o.canvasReadyCallback), i()), r ? r.isResolved() : !1
	}, AV.PaintWidget.prototype.setDimensions = function(e, t) {
		this.canvas.width = this.width = e, this.canvas.height = this.height = t, AV.controlsWidgetInstance && (AV.controlsWidgetInstance.canvasUI && AV.controlsWidgetInstance.canvasUI.resetOffset(), AV.controlsWidgetInstance.layoutNotify(AV.launchData.openType, "scaleCanvas"))
	}, AV.PaintWidget.prototype.getScaledSize = function() {
		return this.actions ? this.actions.getDims() : {
			width: this.width,
			height: this.height
		}
	}, AV.PaintWidget.prototype.showWaitThrobber = function(e, t) {
		t && setTimeout(t, 5)
	}, AV.PaintWidget.prototype.uiLayerDrawCircleSelection = function(e, t, r, o) {
		var a = this.getLayerByName("_ui"),
			i = a.canvas.getContext("2d"),
			n = 1;
		o || (i.globalCompositeOperation = "copy", i.clearRect(0, 0, a.canvas.width, a.canvas.height));
		var s = 1;
		AV.controlsWidgetInstance.canvasUI && (s = AV.controlsWidgetInstance.canvasUI.viewport.getRatio()), n = n * s + .5 | 0, i.globalCompositeOperation = "source-over", i.lineWidth = n, i.globalAlpha = 1, i.beginPath(), i.strokeStyle = "#ffffff", i.arc(e, t, r, 0, 2 * Math.PI, !1), i.closePath(), i.stroke();
		var l = r - n;
		l > 0 && (i.beginPath(), i.strokeStyle = "#000000", i.arc(e, t, l, 0, 2 * Math.PI, !1), i.closePath(), i.stroke())
	}, AV.PaintWidget.prototype.dirtyRectEnable = function(e) {
		this.dirtyRect.dirty = e
	}, AV.PaintWidget.prototype.makeThumbFlat = function(e, t, r) {
		r || (r = this.canvas);
		var o = e.width,
			a = e.height,
			i = e.getContext("2d");
		i.globalCompositeOperation = "copy", i.clearRect(0, 0, e.width, e.height), i.globalCompositeOperation = "source-over";
		var n = o / r.width,
			s = a / r.height;
		if (t)
			if (n > s) {
				var l = r.width * s,
					u = (o - l) / 2;
				i.drawImage(r, 0, 0, r.width, r.height, u, 0, l, a)
			} else {
				var h = r.height * n,
					d = (a - h) / 2;
				i.drawImage(r, 0, 0, r.width, r.height, 0, d, o, h)
			} else if (s > n) {
			var l = r.width * s,
				u = -(l - o) / 2;
			i.drawImage(r, 0, 0, r.width, r.height, u, 0, l, a)
		} else {
			var h = r.height * n,
				d = -(h - a) / 2;
			i.drawImage(r, 0, 0, r.width, r.height, 0, d, o, h)
		}
		return e
	}, AV.PaintWidget.prototype.exportImage = function(e, t) {
		e = e || "image/png";
		var r, o = function() {
			var e = document.createElement("canvas"),
				t = e.toDataURL("image/png");
			return 0 == t.indexOf("data:image/png")
		};
		("image/jpg" === e || "image/jpeg" === e) && (e = "image/jpeg", r = AV.launchData.jpgQuality), r && "number" == typeof r ? r > 0 && 100 > r ? r /= 100 : r = .9 : r = null;
		var a;
		return o() && (a = this.canvas.toDataURL(e, r)), t && "function" == typeof t && t.apply(this, [a]), !0
	}, AV.PaintWidget.prototype.setMode = function(e) {
		if (null !== this.active && void 0 !== this.active.deactivate && this.active.deactivate(), null !== e && void 0 !== e && "" !== e) {
			var t = this.module[e];
			void 0 !== t && (this.active = t, void 0 !== this.active.activate && this.active.activate(this))
		} else this.active = null
	}, AV.PaintWidget.prototype.getCanvasBacking = function() {
		var e;
		return AV.featherGLEnabled ? (this.moaGL.createEffect(), this.moaGL.renderIdentity(), this.moaGL.finalizeEffect(), this.moaGL.commit(), e = this.moaGL.createTexture(this.width, this.height), this.moaGL.copyLastRender(e)) : e = AV.cnvs.copyCanvas(this.canvas), e
	}, AV.PaintWidget.prototype.undo = function() {
		this.active && void 0 !== this.active.userUndo && this.active.userUndo(), this.actions.undo(), this.active && void 0 !== this.active.userPostUndo && this.active.userPostUndo()
	}, AV.PaintWidget.prototype.redo = function() {
		this.active && void 0 !== this.active.userRedo && this.active.userRedo(), this.actions.redo(), this.active && void 0 !== this.active.userPostRedo && this.active.userPostRedo()
	}, AV.PaintWidget.prototype.module = {}, AV.PaintModule = function() {}, AV.PaintModule.prototype.activate = function(e, t) {
		this.paintWidget = e, this.isDirty = !1, this.origBacking = this.getPreviousActionBacking() || e.getCanvasBacking(), this.initialDims = t || this.paintWidget.getScaledSize(), AV.paintWidgetInstance.hasUncommittedChanges = !1, this.onActivate && this.onActivate.call(this)
	}, AV.PaintModule.prototype.deactivate = function() {
		this.isDirty = !1, this.backingReference = null, this.origBacking = null, this.onDeactivate && this.onDeactivate.call(this)
	}, AV.PaintModule.prototype.backingReference = null, AV.PaintModule.prototype.applyBackingToImage = function(e) {
		if (AV.featherGLEnabled) this.paintWidget.moaGL.setTextureAsSourceImage(e), this.paintWidget.moaGL.createEffect(), this.paintWidget.moaGL.renderIdentity(), this.paintWidget.moaGL.finalizeEffect(), this.paintWidget.moaGL.commit();
		else {
			var t = this.paintWidget.canvas.getContext("2d");
			t.drawImage(e, 0, 0)
		}
	}, AV.PaintModule.prototype.applyBackingToImageWithSizeChange = function(e, t) {
		var r = t.width,
			o = t.height;
		if (this.paintWidget.resourceProvider.updateViewDimensions(r, o), AV.featherGLEnabled) this.paintWidget.moaGL.setTextureAsSourceImage(e, r, o), this.paintWidget.moaGL.createEffect(), this.paintWidget.moaGL.renderIdentity(), this.paintWidget.moaGL.finalizeEffect(), this.paintWidget.moaGL.commit();
		else {
			var a = this.paintWidget.canvas.getContext("2d");
			a.drawImage(e, 0, 0)
		}
	}, AV.PaintModule.prototype.setUpSources = function() {
		AV.featherGLEnabled ? this.src = this.dst = {
			moaGL: this.paintWidget.moaGL,
			width: this.paintWidget.canvas.width,
			height: this.paintWidget.canvas.height
		} : (this.src = AV.cnvs.getCanvasPixelData(this.paintWidget.canvas), this.dst = AV.cnvs.getCanvasPixelData(this.paintWidget.canvas))
	}, AV.PaintModule.prototype.shouldSkipUndoBeforePreview = !1, AV.PaintModule.prototype.applyPreviewAction = function(e, t, r) {
		this.shouldSkipUndoBeforePreview || AV.paintWidgetInstance.hasUncommittedChanges && this.paintWidget.actions.undo(), this.backingReference = {
			beforeBacking: this.origBacking,
			afterBacking: null
		};
		var o, a;
		this.getWidthHeightToUseForAction && (this.initialDims && (a = this.initialDims), o = {
			beforeDimensions: a,
			afterDimensions: this.getWidthHeightToUseForAction(e)
		}), this.paintWidget.actions.push({
			undoHandler: this.undoHandler,
			redoHandler: this.redoHandler,
			redoMethod: t,
			context: this,
			action: e,
			backingReference: this.backingReference,
			dimensions: o
		}), r ? this.paintWidget.actions.redoFake() : this.paintWidget.actions.redo()
	}, AV.PaintModule.prototype.isDirty = !1, AV.PaintModule.prototype.undoHandler = function(e) {
		var t = e.backingReference,
			r = e.dimensions;
		t.beforeBacking && (r && r.beforeDimensions ? this.applyBackingToImageWithSizeChange(t.beforeBacking, r.beforeDimensions) : this.applyBackingToImage(t.beforeBacking)), AV.paintWidgetInstance.hasUncommittedChanges = !1
	}, AV.PaintModule.prototype.redoHandler = function(e) {
		var t = e.backingReference,
			r = e.redoMethod,
			o = e.action;
		t.afterBacking ? this.applyBackingToImage(t.afterBacking) : r.call(this, o, t), AV.paintWidgetInstance.hasUncommittedChanges = !0
	}, AV.PaintModule.prototype.commit = function() {
		this.onPreCommit && this.onPreCommit.call(this), AV.featherGLEnabled && this.paintWidget.moaGL.commit(), !this.shouldAvoidGeneratingAfterBacking && this.backingReference && (this.backingReference.afterBacking = this.paintWidget.getCanvasBacking()), AV.paintWidgetInstance.hasUncommittedChanges = !1
	}, AV.PaintModule.prototype.getPreviousActionBacking = function() {
		if (this.paintWidget && this.paintWidget.actions) {
			var e = this.paintWidget.actions.getPreviousActionParameters();
			if (e && e.backingReference && e.backingReference.afterBacking) {
				var t = e.backingReference;
				if (AV.featherGLEnabled && t.afterBacking instanceof WebGLTexture) return t.afterBacking
			}
		}
	}, AV.PaintModuleActionlist = function(e) {
		e || (e = {}), this.shouldSkipUndoBeforePreview = e.shouldSkipUndoBeforePreview || this.shouldSkipUndoBeforePreview || !1, this.actionGenerator = e.actionGenerator
	}, AV.PaintModuleActionlist.prototype = new AV.PaintModule, AV.PaintModuleActionlist.prototype._filterGL = function(e) {
		var t = {
			moaGL: this.paintWidget.moaGL,
			width: this.paintWidget.width,
			height: this.paintWidget.height
		};
		e = handleSpecialActionCases(e);
		AV.util.moaLite.MoaliteActionlistManager.MLPLRunAction(e, t, this.paintWidget.resourceProvider)
	}, AV.PaintModuleActionlist.prototype._filter = function(e, t) {
		var r = this.paintWidget.canvas,
			o = r.getContext("2d"),
			a = AV.cnvs.getCanvasPixelData(t),
			i = {
				data: a.data,
				width: a.width,
				height: a.height
			};
		e = handleSpecialActionCases(e);
		AV.util.moaLite.MoaliteActionlistManager.MLPLRunAction(e, i, this.paintWidget.resourceProvider);
		a = o.createImageData(i.width, i.height), window.ImageData && a.data.set ? a.data.set(i.data) : AV.util.moaLite.copyProcessor.copyTo(a, i), o.fillRect(0, 0, a.width, a.height), o.putImageData(a, 0, 0, 0, 0, a.width, a.height)
	}, AV.PaintModuleActionlist.prototype._filterRedo = function(e, t) {
		AV.featherGLEnabled ? this._filterGL(e) : this._filter(e, t.beforeBacking)
	}, AV.PaintModuleActionlist.prototype.reset = function() {
		AV.featherGLEnabled && (this.paintWidget.moaGL.createEffect(), this.paintWidget.moaGL.renderIdentity(), this.paintWidget.moaGL.commit())
	}, AV.PaintModuleActionlist.prototype.applyPreview = function() {
		var e = this.actionGenerator.apply(this, arguments);
		e && this.applyPreviewAction(e, this._filterRedo)
	}, AV.PaintModuleActionlist.prototype.generateAction = function() {
		return this.actionGenerator.apply(this, arguments)
	}, AV.PaintModuleActionlist.prototype.applyMultiple = function(e, t) {
		var r = AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionGroup(e, t);
		r && this.applyPreviewAction(r, this._filterRedo)
	};
	var handleSpecialActionCases = function(e) {
		if ("resize" === e.name && (e.parameters.size[0] > AV.launchData.maxSize || e.parameters.size[1] > AV.launchData.maxSize)) {
			var t, r;
			e.parameters.size[1] < e.parameters.size[0] ? (t = AV.launchData.maxSize, r = Math.round(AV.launchData.maxSize * e.parameters.size[1] / e.parameters.size[0])) : (r = AV.launchData.maxSize, t = Math.round(AV.launchData.maxSize * e.parameters.size[0] / e.parameters.size[1])), e = AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionResize([t, r])
		}
		return e
	};
	EffectsPaintModule.prototype = new AV.PaintModuleActionlist, EffectsPaintModule.prototype.makeThumb = function(e, t) {
		this.paintWidget.makeThumbFlat(t);
		var r = this.paintWidget.filterManager.getEffectById(e),
			o = t.getContext("2d"),
			a = AV.cnvs.getCanvasPixelData(t),
			i = AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionEffectJSON(r.processors, 1);
		AV.util.moaLite.MoaliteActionlistManager.MLPLRunAction(i, a, this.paintWidget.resourceProvider), o.putImageData(a, 0, 0)
	}, AV.PaintWidget.prototype.module.effects = new EffectsPaintModule({
		actionGenerator: AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionEffectIdentifier
	}), BrushTool.prototype = new AV.PaintModule, BrushTool.prototype.shouldSkipUndoBeforePreview = !0, BrushTool.prototype.src = void 0, BrushTool.prototype.dst = void 0, BrushTool.prototype.brushInstance = void 0, BrushTool.prototype.onActivate = function() {
		this.setUpSources(), this.brushInstance = new AV.util.moaLite.MoaDrawBrushState(this.src, this.dst)
	}, BrushTool.prototype.createStroke = function(e, t, r, o) {
		this.brushInstance.startNewStroke(e / this.dst.width, t, r, o)
	}, BrushTool.prototype.addPoints = function(e, t) {
		this.brushInstance.addPointsToCurrentStroke([
			[e / this.dst.width, t / this.dst.height, (new Date).getTime()]
		])
	}, BrushTool.prototype.finishStroke = function() {
		this.brushInstance.endCurrentStroke(), this.brushInstance.renderPreview()
	}, BrushTool.prototype.preview = function() {
		if (AV.featherGLEnabled) this.paintWidget.moaGL.createEffect(), this.brushInstance.renderPreview(), this.paintWidget.moaGL.finalizeEffect();
		else {
			var e = this.paintWidget.canvas,
				t = e.getContext("2d");
			this.brushInstance.renderPreview(), t.putImageData(this.dst, 0, 0)
		}
	}, BrushTool.prototype.setRadius = function(e) {
		this.radius = e
	}, BrushTool.prototype.getRadius = function() {
		return this.radius
	}, BrushTool.prototype.reset = function() {
		if (AV.featherGLEnabled) this.paintWidget.moaGL.createEffect(), this.paintWidget.moaGL.renderIdentity(), this.paintWidget.moaGL.finalizeEffect();
		else {
			var e = this.paintWidget.canvas,
				t = e.getContext("2d");
			t.putImageData(this.src, 0, 0)
		}
	}, BrushTool.prototype.getColorAtPosition = function(e, t) {
		if (this.brushInstance) {
			var r = this.brushInstance.findColorAtPoint([e / this.src.width, t / this.src.height]);
			return [r.r, r.g, r.b, r.a]
		}
	}, BrushTool.prototype.mindTheGap = function(e, t, r, o) {
		if (null != e) {
			var a = Math.sqrt(Math.pow(e.x - t, 2) + Math.pow(e.y - r, 2));
			if (.6 * o > a) return;
			for (var i, n, s = AV.util.generatePointList([
					[e.x, e.y],
					[t, r]
				], o), l = 0; l < s.length; l++) i = s[l][0] + .5 | 0, n = s[l][1] + .5 | 0, this.addPoints(t, r);
			this.preview()
		}
	}, BrushTool.prototype.commitDrawState = function() {
		var e = this.brushInstance.getActionlistObject();
		return this.shouldAllowEmptyStrokes || e && e.parameters.strokes.length ? (this.applyPreviewAction(e, null, !0), void this.commit()) : void this.reset()
	}, InteractiveBrushTool.prototype = new BrushTool, InteractiveBrushTool.prototype.onActivate = function() {
		mediator.trigger("showWaitThrobber", !0), this.setUpSources(), this.brushInstance = new AV.util.moaLite.MoaSelectiveBrushState(this.src, this.dst, this.module), mediator.trigger("showWaitThrobber", !1)
	}, InteractiveBrushTool.prototype.createStroke = function(e, t) {
		this.brushInstance.startNewStroke(e / this.dst.width, t)
	}, InteractiveBrushTool.prototype.addPoints = function(e, t) {
		this.brushInstance.addPointsToCurrentStroke([
			[e / this.dst.width, t / this.dst.height]
		])
	}, PaintModuleSizer.prototype = new AV.PaintModuleActionlist, PaintModuleSizer.prototype.shouldSkipUndoBeforePreview = !0, PaintModuleSizer.prototype.shouldAvoidGeneratingAfterBacking = !0, AV.PaintWidget.prototype.module.crop = new PaintModuleSizer({
		actionGenerator: AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionCrop
	}), AV.PaintWidget.prototype.module.crop.getWidthHeightToUseForAction = getWHForRect, AV.PaintWidget.prototype.module.crop.applyCropAndResize = function() {
		var e = this.getWidthHeightToUseForAction;
		this.getWidthHeightToUseForAction = AV.PaintWidget.prototype.module.resize.getWidthHeightToUseForAction;
		var t = this.actionGenerator;
		this.actionGenerator = AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionCropAndResize, this.applyPreview.apply(this, arguments), this.getWidthHeightToUseForAction = e, this.actionGenerator = t
	}, AV.PaintWidget.prototype.module.overlays = new PaintModuleSizer({
		actionGenerator: AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionOverlay
	}), AV.PaintWidget.prototype.module.overlays.getWidthHeightToUseForAction = getWHForRect, AV.PaintWidget.prototype.module.resize = new PaintModuleSizer({
		actionGenerator: AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionResize
	}), AV.PaintWidget.prototype.module.resize.getWidthHeightToUseForAction = function(e) {
		var t = this.paintWidget.getScaledSize(),
			r = e.parameters.size,
			o = {
				width: r[0],
				height: r[1]
			};
		return t.hiresWidth && t.hiresHeight && (o.hiresWidth = r[0], o.hiresHeight = r[1]), o
	};
	var orientationModule = new PaintModuleSizer({
		actionGenerator: AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionOrientation
	});
	orientationModule.set = function(e, t, r) {
		var o = t,
			a = r,
			i = o / 2,
			n = a / 2,
			s = 0,
			l = o,
			u = 0,
			h = a,
			d = new AV.Bbox(s, u, l, h, 0);
		if (e) {
			var c, f = Math.cos(e),
				m = Math.sin(e),
				p = Math.cos(-e),
				g = Math.sin(-e),
				v = i + f * (s - i) + m * (u - n),
				_ = i + f * (s - i) + m * (h - n),
				x = i + f * (l - i) + m * (u - n),
				M = i + f * (l - i) + m * (h - n),
				y = n + m * -(s - i) + f * (u - n),
				b = n + m * -(s - i) + f * (h - n),
				C = n + m * -(l - i) + f * (u - n),
				T = n + m * -(l - i) + f * (h - n),
				A = [
					[v, y, x, C],
					[x, C, M, T],
					[M, T, _, b],
					[_, b, v, y]
				],
				S = [0, 0, o, a],
				w = [o, 0, 0, a],
				P = [],
				F = function(e) {
					var t = i + p * (e.x - i) + g * (e.y - n),
						r = n + g * -(e.x - i) + p * (e.y - n);
					t = 0 | t, r = 0 | r, d.contains(t, r) && P.push({
						x: e.x,
						y: e.y
					})
				};
			for (c = 0; c < A.length; c++) {
				var E = A[c],
					D = {};
				AV.math.lineSegmentIntersection(E[0], E[1], E[2], E[3], S[0], S[1], S[2], S[3], D) && F(D), AV.math.lineSegmentIntersection(E[0], E[1], E[2], E[3], w[0], w[1], w[2], w[3], D) && F(D)
			}
			for (c = 0; c < P.length; c++) {
				var D = P[c];
				D.y > n ? D.y < d.y1 && (d.y1 = D.y) : D.y > d.y0 && (d.y0 = D.y), D.x > i ? D.x < d.x1 && (d.x1 = D.x) : D.x > d.x0 && (d.x0 = D.x)
			}
		}
		var L = d.x1 - d.x0;
		return L ? t / L : 1
	}, orientationModule.getWidthHeightToUseForAction = function(e) {
		var t = this.paintWidget.getScaledSize(),
			r = e.parameters.imageRotation,
			o = !1;
		(90 === r || 270 === r) && (o = !0);
		var a = {};
		if (o ? (a.width = t.height, a.height = t.width, a.hiresWidth = t.hiresHeight, a.hiresHeight = t.hiresWidth) : (a.width = t.width, a.height = t.height, a.hiresWidth = t.hiresWidth, a.hiresHeight = t.hiresHeight), 0 !== e.parameters.straightenRotation) {
			var i = this.set(e.parameters.straightenRotation, a.width, a.height);
			a.width = Math.ceil(t.width / i), a.height = Math.ceil(t.height / i), a.hiresWidth = Math.ceil(t.hiresWidth / i), a.hiresHeight = Math.ceil(t.hiresHeight / i)
		}
		return a
	}, AV.PaintWidget.prototype.module.orientation = orientationModule, AV.PaintWidget.prototype.module.vignette = new AV.PaintModuleActionlist({
		actionGenerator: AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionVignette
	}), AV.PaintWidget.prototype.module.focus = new AV.PaintModuleActionlist({
		actionGenerator: AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionTiltShift
	}), AV.PaintWidget.prototype.module.enhance = new AV.PaintModuleActionlist({
		actionGenerator: AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionEnhance
	}), AV.PaintWidget.prototype.module.frames = new AV.PaintModuleActionlist({
		actionGenerator: AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionFrame
	}), AV.PaintWidget.prototype.module.color = new AV.PaintModuleActionlist({
		actionGenerator: AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionColor
	}), AV.PaintWidget.prototype.module.lighting = new AV.PaintModuleActionlist({
		actionGenerator: AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionLighting
	}), AV.PaintWidget.prototype.module.sharpness = new AV.PaintModuleActionlist({
		actionGenerator: AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionSharpness
	}), AV.PaintWidget.prototype.module.overlay = new AV.PaintModuleActionlist({
		actionGenerator: AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionSticker
	}), AV.PaintWidget.prototype.module.textwithfont = new AV.PaintModuleActionlist({
		actionGenerator: AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionText
	}), AV.PaintWidget.prototype.module.meme = new AV.PaintModuleActionlist({
		actionGenerator: AV.util.moaLite.MoaliteActionlistGenerator.MLPLActionMeme
	}), AV.PaintWidget.prototype.module.drawing = new BrushTool;
	var MoaSelectiveBrushTypes = AV.util.moaLite.MoaSelectiveBrushState.prototype.toolTypes;
	AV.PaintWidget.prototype.module.colorsplash = new InteractiveBrushTool({
		module: MoaSelectiveBrushTypes.SelectiveBrushToolTypeColorSplash,
		shouldAllowEmptyStrokes: !0
	}), AV.PaintWidget.prototype.module.blemish = new InteractiveBrushTool({
		module: MoaSelectiveBrushTypes.SelectiveBrushToolTypeBlur
	}), AV.PaintWidget.prototype.module.whiten = new InteractiveBrushTool({
		module: MoaSelectiveBrushTypes.SelectiveBrushToolTypeWhiten
	}), AV.PaintWidget.prototype.module.redeye = new InteractiveBrushTool({
		module: MoaSelectiveBrushTypes.SelectiveBrushToolTypeRedeye
	});

}(window['AV'] || (window['AV'] = {}), window, document));