');
+ b.inline || (a.after(''), a.next(".minicolors-input-swatch").on("click", function (b) { b.preventDefault(); a.focus() })); e = a.parent().find(".minicolors-panel"); e.on("selectstart", function () { return !1 }).end(); if (b.swatches && 0 !== b.swatches.length) {
+ e.addClass("minicolors-with-swatches"); var l = c('
').appendTo(e); for (m = 0; m < b.swatches.length; ++m) {
+ if ("object" ===
+ c.type(b.swatches[m])) { e = b.swatches[m].name; var h = b.swatches[m].color } else e = "", h = b.swatches[m]; h = p(h) ? q(h, !0) : u(x(h, !0)); c('
').appendTo(l).data("swatch-color", b.swatches[m]).find(".minicolors-swatch-color").css({ backgroundColor: B(h), opacity: h.a }); b.swatches[m] = h
+ }
+ } b.inline && a.parent().addClass("minicolors-inline"); w(a, !1); a.data("minicolors-initialized", !0)
+ }
+ } function E(a) {
+ var b = a.parent();
+ a.removeData("minicolors-initialized").removeData("minicolors-settings").removeProp("size").removeClass("minicolors-input"); b.before(a).remove()
+ } function C(a) { c("#modeleditstyle").draggable("disable"); var b = a.parent(), d = b.find(".minicolors-panel"), e = a.data("minicolors-settings"); !a.data("minicolors-initialized") || a.prop("disabled") || b.hasClass("minicolors-inline") || b.hasClass("minicolors-focus") || (z(), b.addClass("minicolors-focus"), d.stop(!0, !0).fadeIn(e.showSpeed, function () { e.show && e.show.call(a.get(0)) })) }
+ function z() { c(".minicolors-focus").each(function () { var a = c(this), b = a.find(".minicolors-input"), d = a.find(".minicolors-panel"), e = b.data("minicolors-settings"); d.fadeOut(e.hideSpeed, function () { c("#modeleditstyle").draggable("enable"); e.hide && e.hide.call(b.get(0)); a.removeClass("minicolors-focus") }) }) } function F(a, b, d) {
+ var e = a.parents(".minicolors").find(".minicolors-input"), c = e.data("minicolors-settings"), l = a.find("[class$=-picker]"), h = a.offset().left, k = a.offset().top, g = Math.round(b.pageX - h), f = Math.round(b.pageY -
+ k); d = d ? c.animationSpeed : 0; b.originalEvent.changedTouches && (g = b.originalEvent.changedTouches[0].pageX - h, f = b.originalEvent.changedTouches[0].pageY - k); 0 > g && (g = 0); 0 > f && (f = 0); g > a.width() && (g = a.width()); f > a.height() && (f = a.height()); a.parent().is(".minicolors-slider-wheel") && l.parent().is(".minicolors-grid") && (h = 75 - g, k = 75 - f, b = Math.sqrt(h * h + k * k), h = Math.atan2(k, h), 0 > h && (h += 2 * Math.PI), 75 < b && (b = 75, g = 75 - 75 * Math.cos(h), f = 75 - 75 * Math.sin(h)), g = Math.round(g), f = Math.round(f)); a.is(".minicolors-grid") ? l.stop(!0).animate({
+ top: f +
+ "px", left: g + "px"
+ }, d, c.animationEasing, function () { G(e, a) }) : l.stop(!0).animate({ top: f + "px" }, d, c.animationEasing, function () { G(e, a) })
+ } function G(a, b) {
+ function d(a, b) { if (!a.length || !b) return null; var d = a.offset().left; var e = a.offset().top; return { x: d - b.offset().left + a.outerWidth() / 2, y: e - b.offset().top + a.outerHeight() / 2 } } var e = a.val(); var c = a.attr("data-opacity"); var l = a.parent(); var h = a.data("minicolors-settings"); var k = l.find(".minicolors-swatch"); var g = l.find(".minicolors-grid"); var r = l.find(".minicolors-slider"),
+ p = l.find(".minicolors-opacity-slider"); var n = g.find("[class$=-picker]"); var t = r.find("[class$=-picker]"), q = p.find("[class$=-picker]"); n = d(n, g); t = d(t, r); q = d(q, p); if (b.is(".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider")) {
+ switch (h.control) {
+ case "wheel": e = g.width() / 2 - n.x; l = g.height() / 2 - n.y; g = Math.sqrt(e * e + l * l); e = Math.atan2(l, e); 0 > e && (e += 2 * Math.PI); 75 < g && (g = 75, n.x = 69 - 75 * Math.cos(e), n.y = 69 - 75 * Math.sin(e)); c = f(g / .75, 0, 100); k = f(180 * e / Math.PI, 0, 360); n = f(100 - Math.floor(t.y * (100 / r.height())),
+ 0, 100); e = v({ h: k, s: c, b: n }); r.css("backgroundColor", v({ h: k, s: c, b: 100 })); break; case "saturation": k = f(parseInt(n.x * (360 / g.width()), 10), 0, 360); c = f(100 - Math.floor(t.y * (100 / r.height())), 0, 100); n = f(100 - Math.floor(n.y * (100 / g.height())), 0, 100); e = v({ h: k, s: c, b: n }); r.css("backgroundColor", v({ h: k, s: 100, b: n })); l.find(".minicolors-grid-inner").css("opacity", c / 100); break; case "brightness": k = f(parseInt(n.x * (360 / g.width()), 10), 0, 360); c = f(100 - Math.floor(n.y * (100 / g.height())), 0, 100); n = f(100 - Math.floor(t.y * (100 / r.height())),
+ 0, 100); e = v({ h: k, s: c, b: n }); r.css("backgroundColor", v({ h: k, s: c, b: 100 })); l.find(".minicolors-grid-inner").css("opacity", 1 - n / 100); break; default: k = f(360 - parseInt(t.y * (360 / r.height()), 10), 0, 360), c = f(Math.floor(n.x * (100 / g.width())), 0, 100), n = f(100 - Math.floor(n.y * (100 / g.height())), 0, 100), e = v({ h: k, s: c, b: n }), g.css("backgroundColor", v({ h: k, s: 100, b: 100 }))
+ } c = h.opacity ? parseFloat(1 - q.y / p.height()).toFixed(2) : 1; H(a, e, c)
+ } else k.find("span").css({ backgroundColor: e, opacity: c }), D(a, e, c)
+ } function H(a, b, d) {
+ var e = a.parent(),
+ c = a.data("minicolors-settings"); e = e.find(".minicolors-input-swatch"); c.opacity && a.attr("data-opacity", d); if ("rgb" === c.format) { b = p(b) ? q(b, !0) : u(x(b, !0)); d = "" === a.attr("data-opacity") ? 1 : f(parseFloat(a.attr("data-opacity")).toFixed(2), 0, 1); if (isNaN(d) || !c.opacity) d = 1; b = 1 >= a.minicolors("rgbObject").a && b && c.opacity ? "rgba(" + b.r + ", " + b.g + ", " + b.b + ", " + parseFloat(d) + ")" : "rgb(" + b.r + ", " + b.g + ", " + b.b + ")" } else p(b) && (b = I(b)), b = A(b, c.letterCase); a.val(b); e.find("span").css({ backgroundColor: b, opacity: d }); D(a,
+ b, d)
+ } function w(a, b) {
+ var d; var e = a.parent(); var m = a.data("minicolors-settings"); var l = e.find(".minicolors-input-swatch"); var h = e.find(".minicolors-grid"), k = e.find(".minicolors-slider"); var g = e.find(".minicolors-opacity-slider"); var r = h.find("[class$=-picker]"), u = k.find("[class$=-picker]"), n = g.find("[class$=-picker]"); if (p(a.val())) { var t = I(a.val()); (d = f(parseFloat(J(a.val())).toFixed(2), 0, 1)) && a.attr("data-opacity", d) } else t = A(x(a.val(), !0), m.letterCase); t || (t = A(K(m.defaultValue, !0), m.letterCase));
+ d = M(t); var w = m.keywords ? c.map(m.keywords.split(","), function (a) { return c.trim(a.toLowerCase()) }) : []; w = "" !== a.val() && -1 < c.inArray(a.val().toLowerCase(), w) ? A(a.val()) : p(a.val()) ? q(a.val()) : t; b || a.val(w); if (m.opacity) { var y = "" === a.attr("data-opacity") ? 1 : f(parseFloat(a.attr("data-opacity")).toFixed(2), 0, 1); isNaN(y) && (y = 1); a.attr("data-opacity", y); l.find("span").css("opacity", y); g = f(g.height() - g.height() * y, 0, g.height()); n.css("top", g + "px") } "transparent" === a.val().toLowerCase() && l.find("span").css("opacity",
+ 0); l.find("span").css("backgroundColor", t); switch (m.control) {
+ case "wheel": e = f(Math.ceil(.75 * d.s), 0, h.height() / 2); l = d.h * Math.PI / 180; m = f(75 - Math.cos(l) * e, 0, h.width()); g = f(75 - Math.sin(l) * e, 0, h.height()); r.css({ top: g + "px", left: m + "px" }); g = 150 - d.b / (100 / h.height()); "" === t && (g = 0); u.css("top", g + "px"); k.css("backgroundColor", v({ h: d.h, s: d.s, b: 100 })); break; case "saturation": m = f(5 * d.h / 12, 0, 150); g = f(h.height() - Math.ceil(d.b / (100 / h.height())), 0, h.height()); r.css({ top: g + "px", left: m + "px" }); g = f(k.height() - d.s * (k.height() /
+ 100), 0, k.height()); u.css("top", g + "px"); k.css("backgroundColor", v({ h: d.h, s: 100, b: d.b })); e.find(".minicolors-grid-inner").css("opacity", d.s / 100); break; case "brightness": m = f(5 * d.h / 12, 0, 150); g = f(h.height() - Math.ceil(d.s / (100 / h.height())), 0, h.height()); r.css({ top: g + "px", left: m + "px" }); g = f(k.height() - d.b * (k.height() / 100), 0, k.height()); u.css("top", g + "px"); k.css("backgroundColor", v({ h: d.h, s: d.s, b: 100 })); e.find(".minicolors-grid-inner").css("opacity", 1 - d.b / 100); break; default: m = f(Math.ceil(d.s / (100 / h.width())),
+ 0, h.width()), g = f(h.height() - Math.ceil(d.b / (100 / h.height())), 0, h.height()), r.css({ top: g + "px", left: m + "px" }), g = f(k.height() - d.h / (360 / k.height()), 0, k.height()), u.css("top", g + "px"), h.css("backgroundColor", v({ h: d.h, s: 100, b: 100 }))
+ } a.data("minicolors-initialized") && D(a, w, y)
+ } function D(a, b, d) {
+ var e = a.data("minicolors-settings"), c = a.data("minicolors-lastChange"), f; if (!c || c.value !== b || c.opacity !== d) {
+ a.data("minicolors-lastChange", { value: b, opacity: d }); if (e.swatches && 0 !== e.swatches.length) {
+ c = p(b) ? q(b, !0) : u(b);
+ var h = -1; for (f = 0; f < e.swatches.length; ++f) if (c.r === e.swatches[f].r && c.g === e.swatches[f].g && c.b === e.swatches[f].b && c.a === e.swatches[f].a) { h = f; break } a.parent().find(".minicolors-swatches .minicolors-swatch").removeClass("selected"); -1 !== h && a.parent().find(".minicolors-swatches .minicolors-swatch").eq(f).addClass("selected")
+ } e.change && (e.changeDelay ? (clearTimeout(a.data("minicolors-changeTimeout")), a.data("minicolors-changeTimeout", setTimeout(function () { e.change.call(a.get(0), b, d) }, e.changeDelay))) : e.change.call(a.get(0),
+ b, d)); a.trigger("change").trigger("input")
+ }
+ } function N(a) { var b = c(a).attr("data-opacity"); p(c(a).val()) ? a = q(c(a).val(), !0) : (a = x(c(a).val(), !0), a = u(a)); if (!a) return null; void 0 !== b && c.extend(a, { a: parseFloat(b) }); return a } function O(a, b) { var d = c(a).attr("data-opacity"); if (p(c(a).val())) var e = q(c(a).val(), !0); else e = x(c(a).val(), !0), e = u(e); if (!e) return null; void 0 === d && (d = 1); return b ? "rgba(" + e.r + ", " + e.g + ", " + e.b + ", " + parseFloat(d) + ")" : "rgb(" + e.r + ", " + e.g + ", " + e.b + ")" } function A(a, b) {
+ return "uppercase" ===
+ b ? a.toUpperCase() : a.toLowerCase()
+ } function x(a, b) { a = a.replace(/^#/g, ""); if (!a.match(/^[A-F0-9]{3,6}/ig) || 3 !== a.length && 6 !== a.length) return ""; 3 === a.length && b && (a = a[0] + a[0] + a[1] + a[1] + a[2] + a[2]); return "#" + a } function q(a, b) {
+ var d = a.replace(/[^\d,.]/g, "").split(","); d[0] = f(parseInt(d[0], 10), 0, 255); d[1] = f(parseInt(d[1], 10), 0, 255); d[2] = f(parseInt(d[2], 10), 0, 255); d[3] && (d[3] = f(parseFloat(d[3], 10), 0, 1)); return b ? d[3] ? { r: d[0], g: d[1], b: d[2], a: d[3] } : { r: d[0], g: d[1], b: d[2] } : "undefined" !== typeof d[3] && 1 >= d[3] ? "rgba(" +
+ d[0] + ", " + d[1] + ", " + d[2] + ", " + d[3] + ")" : "rgb(" + d[0] + ", " + d[1] + ", " + d[2] + ")"
+ } function K(a, b) { return p(a) ? q(a) : x(a, b) } function f(a, b, d) { a < b && (a = b); a > d && (a = d); return a } function p(a) { return (a = a.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i)) && 4 === a.length ? !0 : !1 } function J(a) { return (a = a.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+(\.\d{1,2})?|\.\d{1,2})[\s+]?/i)) && 6 === a.length ? a[4] : "1" } function I(a) {
+ return (a = a.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i)) &&
+ 4 === a.length ? "#" + ("0" + parseInt(a[1], 10).toString(16)).slice(-2) + ("0" + parseInt(a[2], 10).toString(16)).slice(-2) + ("0" + parseInt(a[3], 10).toString(16)).slice(-2) : ""
+ } function B(a) { var b = [a.r.toString(16), a.g.toString(16), a.b.toString(16)]; c.each(b, function (a, c) { 1 === c.length && (b[a] = "0" + c) }); return "#" + b.join("") } function v(a) {
+ var b, d; var c = Math.round(a.h); var f = Math.round(255 * a.s / 100); a = Math.round(255 * a.b / 100); if (0 === f) c = b = d = a; else {
+ f = (255 - f) * a / 255; var l = c % 60 * (a - f) / 60; 360 === c && (c = 0); 60 > c ? (c = a, d = f, b = f + l) :
+ 120 > c ? (b = a, d = f, c = a - l) : 180 > c ? (b = a, c = f, d = f + l) : 240 > c ? (d = a, c = f, b = a - l) : 300 > c ? (d = a, b = f, c = f + l) : 360 > c ? (c = a, b = f, d = a - l) : d = b = c = 0
+ } return B({ r: Math.round(c), g: Math.round(b), b: Math.round(d) })
+ } function M(a) { a = u(a); var b = { h: 0, s: 0, b: 0 }, c = Math.max(a.r, a.g, a.b), e = c - Math.min(a.r, a.g, a.b); b.b = c; b.s = 0 !== c ? 255 * e / c : 0; b.h = 0 !== b.s ? a.r === c ? (a.g - a.b) / e : a.g === c ? 2 + (a.b - a.r) / e : 4 + (a.r - a.g) / e : -1; b.h *= 60; 0 > b.h && (b.h += 360); b.s *= 100 / 255; b.b *= 100 / 255; 0 === b.s && (b.h = 360); return b } function u(a) {
+ a = parseInt(-1 < a.indexOf("#") ? a.substring(1) :
+ a, 16); return { r: a >> 16, g: (a & 65280) >> 8, b: a & 255 }
+ } c.minicolors = { defaults: { animationSpeed: 50, animationEasing: "swing", change: null, changeDelay: 0, control: "hue", defaultValue: "", format: "hex", hide: null, hideSpeed: 100, inline: !1, keywords: "", letterCase: "lowercase", opacity: !1, position: "bottom", show: null, showSpeed: 100, theme: "default", swatches: [] } }; c.extend(c.fn, {
+ minicolors: function (a, b) {
+ switch (a) {
+ case "destroy": return c(this).each(function () { E(c(this)) }), c(this); case "hide": return z(), c(this); case "opacity": if (void 0 ===
+ b) return c(this).attr("data-opacity"); c(this).each(function () { w(c(this).attr("data-opacity", b)) }); return c(this); case "rgbObject": return N(c(this), "rgbaObject" === a); case "rgbString": case "rgbaString": return O(c(this), "rgbaString" === a); case "settings": if (void 0 === b) return c(this).data("minicolors-settings"); c(this).each(function () { var a = c(this).data("minicolors-settings") || {}; E(c(this)); c(this).minicolors(c.extend(!0, a, b)) }); return c(this); case "show": return C(c(this).eq(0)), c(this); case "value": if (void 0 ===
+ b) return c(this).val(); c(this).each(function () { "object" === typeof b && null !== b ? (void 0 !== b.opacity && c(this).attr("data-opacity", f(b.opacity, 0, 1)), b.color && c(this).val(b.color)) : c(this).val(b); w(c(this)) }); return c(this); default: return "create" !== a && (b = a), c(this).each(function () { L(c(this), b) }), c(this)
+ }
+ }
+ }); c([document]).on("mousedown.minicolors touchstart.minicolors", function (a) { c(a.target).parents().add(a.target).hasClass("minicolors") || z() }).on("mousedown.minicolors touchstart.minicolors", ".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider",
+ function (a) { var b = c(this); a.preventDefault(); c(a.delegateTarget).data("minicolors-target", b); F(b, a, !0) }).on("mousemove.minicolors touchmove.minicolors", function (a) { var b = c(a.delegateTarget).data("minicolors-target"); b && F(b, a) }).on("mouseup.minicolors touchend.minicolors", function () { c(this).removeData("minicolors-target") }).on("click.minicolors", ".minicolors-swatches li", function (a) {
+ a.preventDefault(); var b = c(this); a = b.parents(".minicolors").find(".minicolors-input"); b = b.data("swatch-color"); H(a, b,
+ J(b)); w(a)
+ }).on("mousedown.minicolors touchstart.minicolors", ".minicolors-input-swatch", function (a) { var b = c(this).parent().find(".minicolors-input"); a.preventDefault(); C(b) }).on("focus.minicolors", ".minicolors-input", function () { var a = c(this); a.data("minicolors-initialized") && C(a) }).on("blur.minicolors", ".minicolors-input", function () {
+ var a = c(this), b = a.data("minicolors-settings"); if (a.data("minicolors-initialized")) {
+ var d = b.keywords ? c.map(b.keywords.split(","), function (a) { return c.trim(a.toLowerCase()) }) :
+ []; if ("" !== a.val() && -1 < c.inArray(a.val().toLowerCase(), d)) var e = a.val(); else d = p(a.val()) ? q(a.val(), !0) : (d = x(a.val(), !0)) ? u(d) : null, e = null === d ? b.defaultValue : "rgb" === b.format ? b.opacity ? q("rgba(" + d.r + "," + d.g + "," + d.b + "," + a.attr("data-opacity") + ")") : q("rgb(" + d.r + "," + d.g + "," + d.b + ")") : B(d); d = b.opacity ? a.attr("data-opacity") : 1; "transparent" === e.toLowerCase() && (d = 0); a.closest(".minicolors").find(".minicolors-input-swatch > span").css("opacity", d); a.val(e); "" === a.val() && a.val(K(b.defaultValue, !0)); a.val(A(a.val(),
+ b.letterCase))
+ }
+ }).on("keydown.minicolors", ".minicolors-input", function (a) { var b = c(this); if (b.data("minicolors-initialized")) switch (a.which) { case 9: z(); break; case 13: case 27: z(), b.blur() } }).on("keyup.minicolors", ".minicolors-input", function () { var a = c(this); a.data("minicolors-initialized") && w(a, !0) }).on("paste.minicolors", ".minicolors-input", function () { var a = c(this); a.data("minicolors-initialized") && setTimeout(function () { w(a, !0) }, 1) })
+});
\ No newline at end of file