(function(C,f,Ba){function sa(b,d,a){for(var c=[],N=0;N<b.length;N++){var k=tinycolor(b[N]),g=0.5>k.toHsl().l?"sp-thumb-el sp-thumb-dark":"sp-thumb-el sp-thumb-light",g=g+(tinycolor.equals(d,b[N])?" sp-thumb-active":""),e=ta?"background-color:"+k.toRgbString():"filter:"+k.toFilter();c.push('<span title="'+k.toRgbString()+'" data-color="'+k.toRgbString()+'" class="'+g+'"><span class="sp-thumb-inner" style="'+e+';" /></span>')}return"<div class='sp-cf "+a+"'>"+c.join("")+"</div>"}function Oa(b,d){var a=
b.outerWidth(),c=b.outerHeight(),N=d.outerHeight(),k=b[0].ownerDocument,g=k.documentElement,e=g.clientWidth+f(k).scrollLeft(),k=g.clientHeight+f(k).scrollTop(),g=d.offset();g.top+=N;g.left-=Math.min(g.left,g.left+a>e&&e>a?Math.abs(g.left+a-e):0);g.top-=Math.min(g.top,g.top+c>k&&k>c?Math.abs(c+N-0):0);return g}function D(){}function Pa(b){b.stopPropagation()}function Z(b,d){var a=Array.prototype.slice,c=a.call(arguments,2);return function(){return b.apply(d,c.concat(a.call(arguments)))}}function ja(b,
d,a,c){function e(b){b.stopPropagation&&b.stopPropagation();b.preventDefault&&b.preventDefault();b.returnValue=!1}function k(a){if(t){if($&&9>document.documentMode&&!a.button)return g();var c=a.originalEvent.touches,k=c?c[0].pageY:a.pageY,c=Math.max(0,Math.min((c?c[0].pageX:a.pageX)-n.left,r)),k=Math.max(0,Math.min(k-n.top,h));p&&e(a);d.apply(b,[c,k,a])}}function g(){t&&(f(j).unbind(q),f(j.body).removeClass("sp-dragging"),c.apply(b,arguments));t=!1}d=d||function(){};a=a||function(){};c=c||function(){};
var j=b.ownerDocument||document,t=!1,n={},h=0,r=0,p="ontouchstart"in C,q={};q.selectstart=e;q.dragstart=e;q[p?"touchmove":"mousemove"]=k;q[p?"touchend":"mouseup"]=g;f(b).bind(p?"touchstart":"mousedown",function(c){if(!(c.which?3==c.which:2==c.button)&&!t&&!1!==a.apply(b,arguments))t=!0,h=f(b).height(),r=f(b).width(),n=f(b).offset(),f(j).bind(q),f(j.body).addClass("sp-dragging"),p||k(c),e(c)})}var Ca={beforeShow:D,move:D,change:D,show:D,hide:D,color:!1,flat:!1,showInput:!1,showButtons:!0,clickoutFiresChange:!1,
showInitial:!1,showPalette:!1,showPaletteOnly:!1,showSelectionPalette:!0,localStorageKey:!1,appendTo:"body",maxSelectionSize:7,cancelText:"cancel",chooseText:"choose",preferredFormat:!1,className:"",showAlpha:!1,theme:"sp-light",palette:["fff","000"],selectionPalette:[],disabled:!1},O=[],$=!!/msie/i.exec(C.navigator.userAgent),ta,u=document.createElement("div").style;u.cssText="background-color:rgba(0,0,0,.5)";ta=!!~(""+u.backgroundColor).indexOf("rgba")||!!~(""+u.backgroundColor).indexOf("hsla");
var Da,u="";if($)for(var s=1;6>=s;s++)u+="<div class='sp-"+s+"'></div>";Da=["<div class='sp-container sp-hidden'><div class='sp-palette-container'><div class='sp-palette sp-thumb sp-cf'></div></div><div class='sp-picker-container'><div class='sp-top sp-cf'><div class='sp-fill'></div><div class='sp-top-inner'><div class='sp-color'><div class='sp-sat'><div class='sp-val'><div class='sp-dragger'></div></div></div></div><div class='sp-hue'><div class='sp-slider'></div>",u,"</div></div><div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div></div><div class='sp-input-container sp-cf'><input class='sp-input' type='text' spellcheck='false'  /></div><div class='sp-initial sp-thumb sp-cf'></div><div class='sp-button-container sp-cf'><a class='sp-cancel' href='#'></a><button class='sp-choose'></button></div></div></div>"].join("");
C.console&&Function.prototype.bind&&Function.prototype.bind.call(console.log,console);f.fn.spectrum=function(b,d){if("string"==typeof b){var a=this,c=Array.prototype.slice.call(arguments,1);this.each(function(){var d=O[f(this).data("spectrum.id")];if(d){var e=d[b];if(!e)throw Error("Spectrum: no such method: '"+b+"'");"get"==b?a=d.get():"container"==b?a=d.container:"option"==b?a=d.option.apply(d,c):"destroy"==b?(d.destroy(),f(this).removeData("spectrum.id")):e.apply(d,c)}});return a}return this.spectrum("destroy").each(function(){var a,
c=function(){m.toggleClass("sp-flat",s);m.toggleClass("sp-input-disabled",!l.showInput);m.toggleClass("sp-alpha-enabled",l.showAlpha);m.toggleClass("sp-buttons-disabled",!l.showButtons||s);m.toggleClass("sp-palette-disabled",!l.showPalette);m.toggleClass("sp-palette-only",l.showPaletteOnly);m.toggleClass("sp-initial-disabled",!l.showInitial);m.addClass(l.className);y()},d=function(a){if(L){a=tinycolor(a).toRgbString();if(-1===f.inArray(a,I))for(I.push(a);I.length>ra;)I.shift();if(V&&C.localStorage)try{C.localStorage[V]=
I.join(";")}catch(b){}}},e=function(){var a=[],b=I,c={},d;if(l.showPalette){for(var e=0;e<ka.length;e++)for(var g=0;g<ka[e].length;g++)d=tinycolor(ka[e][g]).toRgbString(),c[d]=!0;for(e=0;e<b.length;e++)d=tinycolor(b[e]).toRgbString(),c.hasOwnProperty(d)||(a.push(b[e]),c[d]=!0)}return a.reverse().slice(0,l.maxSelectionSize)},j=function(){var a=z(),b=f.map(ka,function(b,c){return sa(b,a,"sp-palette-row sp-palette-row-"+c)});I&&b.push(sa(e(),a,"sp-palette-row sp-palette-row-selection"));Ea.html(b.join(""))},
n=function(){if(l.showInitial){var a=J,b=z();Fa.html(sa([a,b],b,"sp-palette-row-initial"))}},h=function(){(0>=P||0>=aa||0>=la)&&y();m.addClass(ia)},r=function(){m.removeClass(ia)},p=function(){var a=tinycolor(K.val());a.ok?U(a):K.addClass("sp-validation-error")},q=function(){ba?H():x()},x=function(){var a=f.Event("beforeShow.spectrum");if(ba)y();else if(v.trigger(a,[z()]),!(!1===E.beforeShow(z())||a.isDefaultPrevented())){for(a=0;a<O.length;a++)O[a]&&O[a].hide();ba=!0;f(ua).bind("click.spectrum",
H);f(C).bind("resize.spectrum",G);W.addClass("sp-active");m.removeClass("sp-hidden");l.showPalette&&j();y();w();J=z();n();E.show(J);v.trigger("show-spectrum",[J])}},H=function(a){if((!a||!("click"==a.type&&2==a.button))&&ba&&!s)ba=!1,f(ua).unbind("click.spectrum",H),f(C).unbind("resize.spectrum",G),W.removeClass("sp-active"),m.addClass("sp-hidden"),tinycolor.equals(z(),J)||(Aa&&"cancel"!==a?u(!0):U(J,!0)),E.hide(z()),v.trigger("hide.spectrum",[z()])},U=function(a,b){if(!tinycolor.equals(a,z())){var c=
tinycolor(a),d=c.toHsv();ca=d.h;ma=d.s;na=d.v;Q=d.a;w();c.ok&&!b&&(da=va||c.format)}},z=function(a){a=a||{};return tinycolor.fromRatio({h:ca,s:ma,v:na,a:Math.round(100*Q)/100},{format:a.format||da})},ea=function(){w();E.move(z());v.trigger("move.spectrum",[z()])},w=function(){K.removeClass("sp-validation-error");B();var a=tinycolor.fromRatio({h:ca,s:1,v:1});oa.css("background-color",a.toHexString());a=da;if(1>Q&&("hex"===a||"hex3"===a||"hex6"===a||"name"===a))a="rgb";var b=z({format:a}),c=b.toHexString(),
d=b.toRgbString();ta||1===b.alpha?wa.css("background-color",d):(wa.css("background-color","transparent"),wa.css("filter",b.toFilter()));if(l.showAlpha){d=b.toRgb();d.a=0;var d=tinycolor(d).toRgbString(),e="linear-gradient(left, "+d+", "+c+")";$?fa.css("filter",tinycolor(d).toFilter({gradientType:1},c)):(fa.css("background","-webkit-"+e),fa.css("background","-moz-"+e),fa.css("background","-ms-"+e),fa.css("background",e))}l.showInput&&K.val(b.toString(a));l.showPalette&&j();n()},B=function(){var a=
ma*aa,b=P-na*P,a=Math.max(-R,Math.min(aa-R/2,a-R/2)),b=Math.max(-R,Math.min(P-R/2,b-R/2));Ga.css({top:b,left:a});Ha.css({left:Q*T-Y/2});Ia.css({top:ca*la-ha})},u=function(a){var b=z();xa&&v.val(b.toString(da)).change();var c=!tinycolor.equals(b,J);J=b;d(b);a&&c&&(E.change(b),v.trigger("change.spectrum",[b]))},y=function(){aa=oa.width();P=oa.height();R=Ga.height();ya.width();la=ya.height();ha=Ia.height();T=Ja.width();Y=Ha.width();s||(m.css("position","absolute"),m.offset(Oa(m,ga)));B()};a=function(){H();
za=!0;v.attr("disabled",!0);ga.addClass("sp-disabled")};var l,A=f.extend({},Ca,b);A.callbacks={move:Z(A.move,this),change:Z(A.change,this),show:Z(A.show,this),hide:Z(A.hide,this),beforeShow:Z(A.beforeShow,this)};l=A;var s=l.flat,L=l.showSelectionPalette,V=l.localStorageKey,D=l.theme,E=l.callbacks,G,X=y,M;G=function(){var a=this,b=arguments;M||(M=setTimeout(function(){M=null;X.apply(a,b)},10))};var ba=!1,aa=0,P=0,R=0,la=0,T=0,Y=0,ha=0,ca=0,ma=0,na=0,Q=1,A=l.palette.slice(0),ka=f.isArray(A[0])?A:[A],
I=l.selectionPalette.slice(0),ra=l.maxSelectionSize,ia="sp-dragging",ua=this.ownerDocument,v=f(this),za=!1,m=f(Da,ua).addClass(D),oa=m.find(".sp-color"),Ga=m.find(".sp-dragger"),ya=m.find(".sp-hue"),Ia=m.find(".sp-slider"),fa=m.find(".sp-alpha-inner"),Ja=m.find(".sp-alpha"),Ha=m.find(".sp-alpha-handle"),K=m.find(".sp-input"),Ea=m.find(".sp-palette"),Fa=m.find(".sp-initial"),A=m.find(".sp-cancel"),Ka=m.find(".sp-choose"),xa=v.is("input"),S=xa&&!s,W=S?f("<div class='sp-replacer'><div class='sp-preview'><div class='sp-preview-inner'></div></div><div class='sp-dd'>&#9660;</div></div>").addClass(D).addClass(l.className):
f([]),ga=S?W:v,wa=W.find(".sp-preview-inner"),pa=l.color||xa&&v.val(),J=!1,va=l.preferredFormat,da=va,Aa=!l.showButtons||l.clickoutFiresChange,D=function(a){a.data&&a.data.ignore?(U(f(this).data("color")),ea()):(U(f(this).data("color")),u(!0),ea(),H());return!1};$&&m.find("*:not(input)").attr("unselectable","on");c();S&&v.after(W).hide();s?v.after(m).hide():(S="parent"===l.appendTo?v.parent():f(l.appendTo),1!==S.length&&(S=f("body")),S.append(m));if(V&&C.localStorage){try{var La=C.localStorage[V].split(",#");
1<La.length&&(delete C.localStorage[V],f.each(La,function(a,b){d(b)}))}catch(Ma){}try{I=C.localStorage[V].split(";")}catch(Na){}}ga.bind("click.spectrum touchstart.spectrum",function(a){za||q();a.stopPropagation();f(a.target).is("input")||a.preventDefault()});(v.is(":disabled")||!0===l.disabled)&&a();m.click(Pa);K.change(p);K.bind("paste",function(){setTimeout(p,1)});K.keydown(function(a){13==a.keyCode&&p()});A.text(l.cancelText);A.bind("click.spectrum",function(a){a.stopPropagation();a.preventDefault();
H("cancel")});Ka.text(l.chooseText);Ka.bind("click.spectrum",function(a){a.stopPropagation();a.preventDefault();K.hasClass("sp-validation-error")||(u(!0),H())});ja(Ja,function(a,b,c){Q=a/T;c.shiftKey&&(Q=Math.round(10*Q)/10);ea()});ja(ya,function(a,b){ca=parseFloat(b/la);ea()},h,r);ja(oa,function(a,b){ma=parseFloat(a/aa);na=parseFloat((P-b)/P);ea()},h,r);pa?(U(pa),w(),da=va||tinycolor(pa).format,d(pa)):w();s&&x();h=$?"mousedown.spectrum":"click.spectrum touchstart.spectrum";Ea.delegate(".sp-thumb-el",
h,D);Fa.delegate(".sp-thumb-el:nth-child(1)",h,{ignore:!0},D);var qa={show:x,hide:H,toggle:q,reflow:y,option:function(a,b){if(a===Ba)return f.extend({},l);if(b===Ba)return l[a];l[a]=b;c()},enable:function(){za=!1;v.attr("disabled",!1);ga.removeClass("sp-disabled")},disable:a,set:function(a){U(a);u()},get:z,destroy:function(){v.show();ga.unbind("click.spectrum touchstart.spectrum");m.remove();W.remove();O[qa.id]=null},container:m};qa.id=O.push(qa)-1;a=qa;f(this).data("spectrum.id",a.id)})};f.fn.spectrum.load=
!0;f.fn.spectrum.loadOpts={};f.fn.spectrum.draggable=ja;f.fn.spectrum.defaults=Ca;f.spectrum={};f.spectrum.localization={};f.spectrum.palettes={};f.fn.spectrum.processNativeColorInputs=function(){var b=f("<input type='color' value='!' />")[0];"color"===b.type&&"!"!=b.value||f("input[type=color]").spectrum({preferredFormat:"hex6"})};var e=function(b,d){var a,c,f,k,g;b=b?b:"";d=d||{};if("object"==typeof b&&b.hasOwnProperty("_tc_id"))return b;c=b;g=k=f=0;var F=1,t=a=!1;if("string"==typeof c)a:{c=c.replace(Aa,
"").replace(Ma,"").toLowerCase();var s=!1;if(T[c])c=T[c],s=!0;else if("transparent"==c){c={r:0,g:0,b:0,a:0};break a}var h;c=(h=y.rgb.exec(c))?{r:h[1],g:h[2],b:h[3]}:(h=y.rgba.exec(c))?{r:h[1],g:h[2],b:h[3],a:h[4]}:(h=y.hsl.exec(c))?{h:h[1],s:h[2],l:h[3]}:(h=y.hsla.exec(c))?{h:h[1],s:h[2],l:h[3],a:h[4]}:(h=y.hsv.exec(c))?{h:h[1],s:h[2],v:h[3]}:(h=y.hex6.exec(c))?{r:parseInt(h[1],16),g:parseInt(h[2],16),b:parseInt(h[3],16),format:s?"name":"hex"}:(h=y.hex3.exec(c))?{r:parseInt(h[1]+""+h[1],16),g:parseInt(h[2]+
""+h[2],16),b:parseInt(h[3]+""+h[3],16),format:s?"name":"hex"}:!1}"object"==typeof c&&(c.hasOwnProperty("r")&&c.hasOwnProperty("g")&&c.hasOwnProperty("b")?(f=255*n(c.r,255),k=255*n(c.g,255),g=255*n(c.b,255),a=!0,t="%"===String(c.r).substr(-1)?"prgb":"rgb"):c.hasOwnProperty("h")&&c.hasOwnProperty("s")&&c.hasOwnProperty("v")?(c.s=E(c.s),c.v=E(c.v),a=c.h,k=c.s,g=c.v,a=6*n(a,360),k=n(k,100),g=n(g,100),f=L.floor(a),h=a-f,a=g*(1-k),t=g*(1-h*k),h=g*(1-(1-h)*k),s=f%6,f=255*[g,t,a,a,h,g][s],k=255*[h,g,g,t,
a,a][s],g=255*[a,a,h,g,g,t][s],a=!0,t="hsv"):c.hasOwnProperty("h")&&(c.hasOwnProperty("s")&&c.hasOwnProperty("l"))&&(c.s=E(c.s),c.l=E(c.l),f=c.h,a=c.s,g=c.l,k=function(a,b,c){0>c&&(c+=1);1<c&&(c-=1);return c<1/6?a+6*(b-a)*c:0.5>c?b:c<2/3?a+6*(b-a)*(2/3-c):a},f=n(f,360),a=n(a,100),g=n(g,100),0===a?a=g=t=g:(t=0.5>g?g*(1+a):g+a-g*a,h=2*g-t,a=k(h,t,f+1/3),g=k(h,t,f),t=k(h,t,f-1/3)),f=255*a,k=255*g,g=255*t,a=!0,t="hsl"),c.hasOwnProperty("a")&&(F=c.a));F=parseFloat(F);if(isNaN(F)||0>F||1<F)F=1;c=c.format||
t;f=w(255,B(f,0));k=w(255,B(k,0));g=w(255,B(g,0));var r=f,p=k,q=g,x=F,u=j(100*x)/100,F=d.format||c;1>r&&(r=j(r));1>p&&(p=j(p));1>q&&(q=j(q));return{ok:a,format:F,_tc_id:Na++,alpha:x,toHsv:function(){var a=ha(r,p,q);return{h:360*a.h,s:a.s,v:a.v,a:x}},toHsvString:function(){var a=ha(r,p,q),b=j(360*a.h),c=j(100*a.s),a=j(100*a.v);return 1==x?"hsv("+b+", "+c+"%, "+a+"%)":"hsva("+b+", "+c+"%, "+a+"%, "+u+")"},toHsl:function(){var a=ra(r,p,q);return{h:360*a.h,s:a.s,l:a.l,a:x}},toHslString:function(){var a=
ra(r,p,q),b=j(360*a.h),c=j(100*a.s),a=j(100*a.l);return 1==x?"hsl("+b+", "+c+"%, "+a+"%)":"hsla("+b+", "+c+"%, "+a+"%, "+u+")"},toHex:function(a){return X(r,p,q,a)},toHexString:function(a){return"#"+X(r,p,q,a)},toRgb:function(){return{r:j(r),g:j(p),b:j(q),a:x}},toRgbString:function(){return 1==x?"rgb("+j(r)+", "+j(p)+", "+j(q)+")":"rgba("+j(r)+", "+j(p)+", "+j(q)+", "+u+")"},toPercentageRgb:function(){return{r:j(100*n(r,255))+"%",g:j(100*n(p,255))+"%",b:j(100*n(q,255))+"%",a:x}},toPercentageRgbString:function(){return 1==
x?"rgb("+j(100*n(r,255))+"%, "+j(100*n(p,255))+"%, "+j(100*n(q,255))+"%)":"rgba("+j(100*n(r,255))+"%, "+j(100*n(p,255))+"%, "+j(100*n(q,255))+"%, "+u+")"},toName:function(){return Qa[X(r,p,q,!0)]||!1},toFilter:function(a){var b=X(r,p,q),c=b,g=Math.round(255*parseFloat(x)).toString(16),f=g,k=d&&d.gradientType?"GradientType = 1, ":"";a&&(a=e(a),c=a.toHex(),f=Math.round(255*parseFloat(a.alpha)).toString(16));return"progid:DXImageTransform.Microsoft.gradient("+k+"startColorstr=#"+G(g)+b+",endColorstr=#"+
G(f)+c+")"},toString:function(a){a=a||this.format;var b=!1;"rgb"===a&&(b=this.toRgbString());"prgb"===a&&(b=this.toPercentageRgbString());if("hex"===a||"hex6"===a)b=this.toHexString();"hex3"===a&&(b=this.toHexString(!0));"name"===a&&(b=this.toName());"hsl"===a&&(b=this.toHslString());"hsv"===a&&(b=this.toHsvString());return b||this.toHexString()}}},ra=function(b,d,a){b=n(b,255);d=n(d,255);a=n(a,255);var c=B(b,d,a),e=w(b,d,a),f,g=(c+e)/2;if(c==e)f=e=0;else{var j=c-e,e=0.5<g?j/(2-c-e):j/(c+e);switch(c){case b:f=
(d-a)/j+(d<a?6:0);break;case d:f=(a-b)/j+2;break;case a:f=(b-d)/j+4}f/=6}return{h:f,s:e,l:g}},ha=function(b,d,a){b=n(b,255);d=n(d,255);a=n(a,255);var c=B(b,d,a),e=w(b,d,a),f,g=c-e;if(c==e)f=0;else{switch(c){case b:f=(d-a)/g+(d<a?6:0);break;case d:f=(a-b)/g+2;break;case a:f=(b-d)/g+4}f/=6}return{h:f,s:0===c?0:g/c,v:c}},X=function(b,d,a,c){b=[G(j(b).toString(16)),G(j(d).toString(16)),G(j(a).toString(16))];return c&&b[0].charAt(0)==b[0].charAt(1)&&b[1].charAt(0)==b[1].charAt(1)&&b[2].charAt(0)==b[2].charAt(1)?
b[0].charAt(0)+b[1].charAt(0)+b[2].charAt(0):b.join("")},n=function(b,d){"string"==typeof b&&(-1!=b.indexOf(".")&&1===parseFloat(b))&&(b="100%");var a="string"===typeof b&&-1!=b.indexOf("%");b=w(d,B(0,parseFloat(b)));a&&(b=parseInt(b*d,10)/100);return 1E-6>L.abs(b-d)?1:b%d/parseFloat(d)},G=function(b){return 1==b.length?"0"+b:""+b},E=function(b){1>=b&&(b=100*b+"%");return b},Aa=/^[\s,#]+/,Ma=/\s+$/,Na=0,L=Math,j=L.round,w=L.min,B=L.max,Y=L.random;e.fromRatio=function(b,d){if("object"==typeof b){var a=
{},c;for(c in b)b.hasOwnProperty(c)&&(a[c]="a"===c?b[c]:E(b[c]));b=a}return e(b,d)};e.equals=function(b,d){return!b||!d?!1:e(b).toRgbString()==e(d).toRgbString()};e.random=function(){return e.fromRatio({r:Y(),g:Y(),b:Y()})};e.desaturate=function(b,d){var a=e(b).toHsl();a.s-=(d||10)/100;a.s=w(1,B(0,a.s));return e(a)};e.saturate=function(b,d){var a=e(b).toHsl();a.s+=(d||10)/100;a.s=w(1,B(0,a.s));return e(a)};e.greyscale=function(b){return e.desaturate(b,100)};e.lighten=function(b,d){var a=e(b).toHsl();
a.l+=(d||10)/100;a.l=w(1,B(0,a.l));return e(a)};e.darken=function(b,d){var a=e(b).toHsl();a.l-=(d||10)/100;a.l=w(1,B(0,a.l));return e(a)};e.complement=function(b){b=e(b).toHsl();b.h=(b.h+180)%360;return e(b)};e.triad=function(b){var d=e(b).toHsl(),a=d.h;return[e(b),e({h:(a+120)%360,s:d.s,l:d.l}),e({h:(a+240)%360,s:d.s,l:d.l})]};e.tetrad=function(b){var d=e(b).toHsl(),a=d.h;return[e(b),e({h:(a+90)%360,s:d.s,l:d.l}),e({h:(a+180)%360,s:d.s,l:d.l}),e({h:(a+270)%360,s:d.s,l:d.l})]};e.splitcomplement=function(b){var d=
e(b).toHsl(),a=d.h;return[e(b),e({h:(a+72)%360,s:d.s,l:d.l}),e({h:(a+216)%360,s:d.s,l:d.l})]};e.analogous=function(b,d,a){d=d||6;a=a||30;var c=e(b).toHsl();a=360/a;b=[e(b)];for(c.h=(c.h-(a*d>>1)+720)%360;--d;)c.h=(c.h+a)%360,b.push(e(c));return b};e.monochromatic=function(b,d){d=d||6;for(var a=e(b).toHsv(),c=a.h,f=a.s,a=a.v,k=[],g=1/d;d--;)k.push(e({h:c,s:f,v:a})),a=(a+g)%1;return k};e.readability=function(b,d){var a=e(b).toRgb(),c=e(d).toRgb(),f=(299*a.r+587*a.g+114*a.b)/1E3,k=(299*c.r+587*c.g+114*
c.b)/1E3,a=Math.max(a.r,c.r)-Math.min(a.r,c.r)+Math.max(a.g,c.g)-Math.min(a.g,c.g)+Math.max(a.b,c.b)-Math.min(a.b,c.b);return{brightness:Math.abs(f-k),color:a}};e.readable=function(b,d){var a=e.readability(b,d);return 125<a.brightness&&500<a.color};e.mostReadable=function(b,d){for(var a=null,c=0,f=!1,k=0;k<d.length;k++){var g=e.readability(b,d[k]),j=125<g.brightness&&500<g.color,g=3*(g.brightness/125)+g.color/500;if(j&&!f||j&&f&&g>c||!j&&!f&&g>c)f=j,c=g,a=e(d[k])}return a};var T=e.names={aliceblue:"f0f8ff",
antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",
darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",
greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",
lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",
orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",
steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},u=e,s=T,ia={},M;for(M in s)s.hasOwnProperty(M)&&(ia[s[M]]=M);var Qa=u.hexNames=ia,y;y={rgb:RegExp("rgb[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),rgba:RegExp("rgba[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),
hsl:RegExp("hsl[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),hsla:RegExp("hsla[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),hsv:RegExp("hsv[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),
hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};this.tinycolor=e;f(function(){f.fn.spectrum.load&&f.fn.spectrum.processNativeColorInputs();f.fn.spectrum.get=function(b){return O[b]}})})(window,jQuery);
