| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/nice/components/com_comprofiler/js/jquery/ |
Upload File : |
(function(e){if(typeof define==="function"&&define.amd){define(["jquery"],e)}else{e(jQuery)}})(function(k){"use strict";var i=0,e='<div class="ui-colorpicker ui-colorpicker-dialog ui-dialog ui-widget ui-widget-content ui-corner-all" style="display: none;"></div>',o='<div class="ui-colorpicker ui-colorpicker-inline ui-dialog ui-widget ui-widget-content ui-corner-all"></div>',t='<div class="ui-colorpicker ui-colorpicker-inline"></div>',s=function(e){var o=Math.round(e).toString(16);if(o.length===1){o="0"+o}return o.toLowerCase()},a={isPrint:function(e){return e==32||e>=48&&e<=57||e>=65&&e<=90||e>=96&&e<=111||e>=186&&e<192||e>=219&&e<222},isHex:function(e){return e>=48&&e<=57||e>=96&&e<=105||e>=65&&e<=70}},l=function(e,o){var i,t,r,n,a,s,l,c,u,p,h,f,b,g;e.sort(function(e,o){if(e.pos[1]===o.pos[1]){return e.pos[0]-o.pos[0]}return e.pos[1]-o.pos[1]});n=0;a=0;k.each(e,function(e,o){n=Math.max(n,o.pos[0]+o.pos[2]);a=Math.max(a,o.pos[1]+o.pos[3])});i=[];for(t=0;t<n;++t){i.push([])}l=[];s=[];k.each(e,function(e,o){for(t=0;t<o.pos[2];t+=1){s[o.pos[0]+t]=true}for(r=0;r<o.pos[3];r+=1){l[o.pos[1]+r]=true}});p="";u=e[c=0];for(r=0;r<a;++r){p+="<tr>";t=0;while(t<n){if(typeof u!=="undefined"&&t===u.pos[0]&&r===u.pos[1]){p+=o(u,t,r);for(f=0;f<u.pos[3];f+=1){for(h=0;h<u.pos[2];h+=1){i[t+h][r+f]=true}}t+=u.pos[2];u=e[++c]}else{b=0;g=false;while(t<n&&i[t][r]===undefined&&(u===undefined||r<u.pos[1]||r===u.pos[1]&&t<u.pos[0])){if(s[t]===true){b+=1}g=true;t+=1}if(b>0){p+='<td colspan="'+b+'"></td>'}else if(!g){t+=1}}}p+="</tr>"}return'<table cellspacing="0" cellpadding="0" border="0"><tbody>'+p+"</tbody></table>"};k.colorpicker=new function(){this.regional={"":{ok:"OK",cancel:"Cancel",none:"None",button:"Color",title:"Pick a color",transparent:"Transparent",hsvH:"H",hsvS:"S",hsvV:"V",rgbR:"R",rgbG:"G",rgbB:"B",labL:"L",labA:"a",labB:"b",hslH:"H",hslS:"S",hslL:"L",cmykC:"C",cmykM:"M",cmykY:"Y",cmykK:"K",alphaA:"A"}};this.swatchesNames={html:"HTML"};this.swatches={html:[{name:"black",r:0,g:0,b:0},{name:"dimgray",r:.4117647058823529,g:.4117647058823529,b:.4117647058823529},{name:"gray",r:.5019607843137255,g:.5019607843137255,b:.5019607843137255},{name:"darkgray",r:.6627450980392157,g:.6627450980392157,b:.6627450980392157},{name:"silver",r:.7529411764705882,g:.7529411764705882,b:.7529411764705882},{name:"lightgrey",r:.8274509803921568,g:.8274509803921568,b:.8274509803921568},{name:"gainsboro",r:.8627450980392157,g:.8627450980392157,b:.8627450980392157},{name:"whitesmoke",r:.9607843137254902,g:.9607843137254902,b:.9607843137254902},{name:"white",r:1,g:1,b:1},{name:"rosybrown",r:.7372549019607844,g:.5607843137254902,b:.5607843137254902},{name:"indianred",r:.803921568627451,g:.3607843137254902,b:.3607843137254902},{name:"brown",r:.6470588235294118,g:.16470588235294117,b:.16470588235294117},{name:"firebrick",r:.6980392156862745,g:.13333333333333333,b:.13333333333333333},{name:"lightcoral",r:.9411764705882353,g:.5019607843137255,b:.5019607843137255},{name:"maroon",r:.5019607843137255,g:0,b:0},{name:"darkred",r:.5450980392156862,g:0,b:0},{name:"red",r:1,g:0,b:0},{name:"snow",r:1,g:.9803921568627451,b:.9803921568627451},{name:"salmon",r:.9803921568627451,g:.5019607843137255,b:.4470588235294118},{name:"mistyrose",r:1,g:.8941176470588236,b:.8823529411764706},{name:"tomato",r:1,g:.38823529411764707,b:.2784313725490196},{name:"darksalmon",r:.9137254901960784,g:.5882352941176471,b:.47843137254901963},{name:"orangered",r:1,g:.27058823529411763,b:0},{name:"coral",r:1,g:.4980392156862745,b:.3137254901960784},{name:"lightsalmon",r:1,g:.6274509803921569,b:.47843137254901963},{name:"sienna",r:.6274509803921569,g:.3215686274509804,b:.17647058823529413},{name:"seashell",r:1,g:.9607843137254902,b:.9333333333333333},{name:"chocolate",r:.8235294117647058,g:.4117647058823529,b:.11764705882352941},{name:"saddlebrown",r:.5450980392156862,g:.27058823529411763,b:.07450980392156863},{name:"sandybrown",r:.9568627450980393,g:.6431372549019608,b:.3764705882352941},{name:"peachpuff",r:1,g:.8549019607843137,b:.7254901960784313},{name:"peru",r:.803921568627451,g:.5215686274509804,b:.24705882352941178},{name:"linen",r:.9803921568627451,g:.9411764705882353,b:.9019607843137255},{name:"darkorange",r:1,g:.5490196078431373,b:0},{name:"bisque",r:1,g:.8941176470588236,b:.7686274509803922},{name:"burlywood",r:.8705882352941177,g:.7215686274509804,b:.5294117647058824},{name:"tan",r:.8235294117647058,g:.7058823529411765,b:.5490196078431373},{name:"antiquewhite",r:.9803921568627451,g:.9215686274509803,b:.8431372549019608},{name:"navajowhite",r:1,g:.8705882352941177,b:.6784313725490196},{name:"blanchedalmond",r:1,g:.9215686274509803,b:.803921568627451},{name:"papayawhip",r:1,g:.9372549019607843,b:.8352941176470589},{name:"orange",r:1,g:.6470588235294118,b:0},{name:"moccasin",r:1,g:.8941176470588236,b:.7098039215686275},{name:"wheat",r:.9607843137254902,g:.8705882352941177,b:.7019607843137254},{name:"oldlace",r:.9921568627450981,g:.9607843137254902,b:.9019607843137255},{name:"floralwhite",r:1,g:.9803921568627451,b:.9411764705882353},{name:"goldenrod",r:.8549019607843137,g:.6470588235294118,b:.12549019607843137},{name:"darkgoldenrod",r:.7215686274509804,g:.5254901960784314,b:.043137254901960784},{name:"cornsilk",r:1,g:.9725490196078431,b:.8627450980392157},{name:"gold",r:1,g:.8431372549019608,b:0},{name:"palegoldenrod",r:.9333333333333333,g:.9098039215686274,b:.6666666666666666},{name:"khaki",r:.9411764705882353,g:.9019607843137255,b:.5490196078431373},{name:"lemonchiffon",r:1,g:.9803921568627451,b:.803921568627451},{name:"darkkhaki",r:.7411764705882353,g:.7176470588235294,b:.4196078431372549},{name:"beige",r:.9607843137254902,g:.9607843137254902,b:.8627450980392157},{name:"lightgoldenrodyellow",r:.9803921568627451,g:.9803921568627451,b:.8235294117647058},{name:"olive",r:.5019607843137255,g:.5019607843137255,b:0},{name:"yellow",r:1,g:1,b:0},{name:"lightyellow",r:1,g:1,b:.8784313725490196},{name:"ivory",r:1,g:1,b:.9411764705882353},{name:"olivedrab",r:.4196078431372549,g:.5568627450980392,b:.13725490196078433},{name:"yellowgreen",r:.6039215686274509,g:.803921568627451,b:.19607843137254902},{name:"darkolivegreen",r:.3333333333333333,g:.4196078431372549,b:.1843137254901961},{name:"greenyellow",r:.6784313725490196,g:1,b:.1843137254901961},{name:"lawngreen",r:.48627450980392156,g:.9882352941176471,b:0},{name:"chartreuse",r:.4980392156862745,g:1,b:0},{name:"darkseagreen",r:.5607843137254902,g:.7372549019607844,b:.5607843137254902},{name:"forestgreen",r:.13333333333333333,g:.5450980392156862,b:.13333333333333333},{name:"limegreen",r:.19607843137254902,g:.803921568627451,b:.19607843137254902},{name:"lightgreen",r:.5647058823529412,g:.9333333333333333,b:.5647058823529412},{name:"palegreen",r:.596078431372549,g:.984313725490196,b:.596078431372549},{name:"darkgreen",r:0,g:.39215686274509803,b:0},{name:"green",r:0,g:.5019607843137255,b:0},{name:"lime",r:0,g:1,b:0},{name:"honeydew",r:.9411764705882353,g:1,b:.9411764705882353},{name:"mediumseagreen",r:.23529411764705882,g:.7019607843137254,b:.44313725490196076},{name:"seagreen",r:.1803921568627451,g:.5450980392156862,b:.3411764705882353},{name:"springgreen",r:0,g:1,b:.4980392156862745},{name:"mintcream",r:.9607843137254902,g:1,b:.9803921568627451},{name:"mediumspringgreen",r:0,g:.9803921568627451,b:.6039215686274509},{name:"mediumaquamarine",r:.4,g:.803921568627451,b:.6666666666666666},{name:"aquamarine",r:.4980392156862745,g:1,b:.8313725490196079},{name:"turquoise",r:.25098039215686274,g:.8784313725490196,b:.8156862745098039},{name:"lightseagreen",r:.12549019607843137,g:.6980392156862745,b:.6666666666666666},{name:"mediumturquoise",r:.2823529411764706,g:.8196078431372549,b:.8},{name:"darkslategray",r:.1843137254901961,g:.30980392156862746,b:.30980392156862746},{name:"paleturquoise",r:.6862745098039216,g:.9333333333333333,b:.9333333333333333},{name:"teal",r:0,g:.5019607843137255,b:.5019607843137255},{name:"darkcyan",r:0,g:.5450980392156862,b:.5450980392156862},{name:"darkturquoise",r:0,g:.807843137254902,b:.8196078431372549},{name:"aqua",r:0,g:1,b:1},{name:"cyan",r:0,g:1,b:1},{name:"lightcyan",r:.8784313725490196,g:1,b:1},{name:"azure",r:.9411764705882353,g:1,b:1},{name:"cadetblue",r:.37254901960784315,g:.6196078431372549,b:.6274509803921569},{name:"powderblue",r:.6901960784313725,g:.8784313725490196,b:.9019607843137255},{name:"lightblue",r:.6784313725490196,g:.8470588235294118,b:.9019607843137255},{name:"deepskyblue",r:0,g:.7490196078431373,b:1},{name:"skyblue",r:.5294117647058824,g:.807843137254902,b:.9215686274509803},{name:"lightskyblue",r:.5294117647058824,g:.807843137254902,b:.9803921568627451},{name:"steelblue",r:.27450980392156865,g:.5098039215686274,b:.7058823529411765},{name:"aliceblue",r:.9411764705882353,g:.9725490196078431,b:1},{name:"dodgerblue",r:.11764705882352941,g:.5647058823529412,b:1},{name:"slategray",r:.4392156862745098,g:.5019607843137255,b:.5647058823529412},{name:"lightslategray",r:.4666666666666667,g:.5333333333333333,b:.6},{name:"lightsteelblue",r:.6901960784313725,g:.7686274509803922,b:.8705882352941177},{name:"cornflowerblue",r:.39215686274509803,g:.5843137254901961,b:.9294117647058824},{name:"royalblue",r:.2549019607843137,g:.4117647058823529,b:.8823529411764706},{name:"midnightblue",r:.09803921568627451,g:.09803921568627451,b:.4392156862745098},{name:"lavender",r:.9019607843137255,g:.9019607843137255,b:.9803921568627451},{name:"navy",r:0,g:0,b:.5019607843137255},{name:"darkblue",r:0,g:0,b:.5450980392156862},{name:"mediumblue",r:0,g:0,b:.803921568627451},{name:"blue",r:0,g:0,b:1},{name:"ghostwhite",r:.9725490196078431,g:.9725490196078431,b:1},{name:"darkslateblue",r:.2823529411764706,g:.23921568627450981,b:.5450980392156862},{name:"slateblue",r:.41568627450980394,g:.35294117647058826,b:.803921568627451},{name:"mediumslateblue",r:.4823529411764706,g:.40784313725490196,b:.9333333333333333},{name:"mediumpurple",r:.5764705882352941,g:.4392156862745098,b:.8588235294117647},{name:"blueviolet",r:.5411764705882353,g:.16862745098039217,b:.8862745098039215},{name:"indigo",r:.29411764705882354,g:0,b:.5098039215686274},{name:"darkorchid",r:.6,g:.19607843137254902,b:.8},{name:"darkviolet",r:.5803921568627451,g:0,b:.8274509803921568},{name:"mediumorchid",r:.7294117647058823,g:.3333333333333333,b:.8274509803921568},{name:"thistle",r:.8470588235294118,g:.7490196078431373,b:.8470588235294118},{name:"plum",r:.8666666666666667,g:.6274509803921569,b:.8666666666666667},{name:"violet",r:.9333333333333333,g:.5098039215686274,b:.9333333333333333},{name:"purple",r:.5019607843137255,g:0,b:.5019607843137255},{name:"darkmagenta",r:.5450980392156862,g:0,b:.5450980392156862},{name:"magenta",r:1,g:0,b:1},{name:"fuchsia",r:1,g:0,b:1},{name:"orchid",r:.8549019607843137,g:.4392156862745098,b:.8392156862745098},{name:"mediumvioletred",r:.7803921568627451,g:.08235294117647059,b:.5215686274509804},{name:"deeppink",r:1,g:.0784313725490196,b:.5764705882352941},{name:"hotpink",r:1,g:.4117647058823529,b:.7058823529411765},{name:"palevioletred",r:.8588235294117647,g:.4392156862745098,b:.5764705882352941},{name:"lavenderblush",r:1,g:.9411764705882353,b:.9607843137254902},{name:"crimson",r:.8627450980392157,g:.0784313725490196,b:.23529411764705882},{name:"pink",r:1,g:.7529411764705882,b:.796078431372549},{name:"lightpink",r:1,g:.7137254901960784,b:.7568627450980392}]};this.writers={"#HEX":function(e,o){return o._formatColor("#rxgxbx",e)},"#HEX3":function(e,o){var i=k.colorpicker.writers.HEX3(e);return i===false?false:"#"+i},HEX:function(e,o){return o._formatColor("rxgxbx",e)},HEX3:function(e,o){var i=e.getRGB(),t=Math.round(i.r*255),r=Math.round(i.g*255),n=Math.round(i.b*255);if(t>>>4===(t&=15)&&r>>>4===(r&=15)&&n>>>4===(n&=15)){return t.toString(16)+r.toString(16)+n.toString(16)}return false},"#HEXA":function(e,o){return o._formatColor("#rxgxbxax",e)},"#HEXA4":function(e,o){var i=k.colorpicker.writers.HEXA4(e,o);return i===false?false:"#"+i},HEXA:function(e,o){return o._formatColor("rxgxbxax",e)},HEXA4:function(e,o){var i=Math.round(e.getAlpha()*255);if(i>>>4===(i&=15)){return k.colorpicker.writers.HEX3(e,o)+i.toString(16)}return false},RGB:function(e,o){return e.getAlpha()>=1?o._formatColor("rgb(rd,gd,bd)",e):false},RGBA:function(e,o){return o._formatColor("rgba(rd,gd,bd,af)",e)},"RGB%":function(e,o){return e.getAlpha()>=1?o._formatColor("rgb(rp%,gp%,bp%)",e):false},"RGBA%":function(e,o){return o._formatColor("rgba(rp%,gp%,bp%,af)",e)},HSL:function(e,o){return e.getAlpha()>=1?o._formatColor("hsl(hd,sd,vd)",e):false},HSLA:function(e,o){return o._formatColor("hsla(hd,sd,vd,af)",e)},"HSL%":function(e,o){return e.getAlpha()>=1?o._formatColor("hsl(hp%,sp%,vp%)",e):false},"HSLA%":function(e,o){return o._formatColor("hsla(hp%,sp%,vp%,af)",e)},NAME:function(e,o){return o._closestName(e)},EXACT:function(e,o){return o._exactName(e)}};this.parsers={"":function(e){if(e===""){return new k.colorpicker.Color}},NAME:function(e,o){var i=o._getSwatch(k.trim(e));if(i){return new k.colorpicker.Color(i.r,i.g,i.b)}},RGBA:function(e){var o=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)$/.exec(e);if(o){return new k.colorpicker.Color(o[1]/255,o[2]/255,o[3]/255,parseFloat(o[4]))}},"RGBA%":function(e){var o=/^rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)$/.exec(e);if(o){return new k.colorpicker.Color(o[1]/100,o[2]/100,o[3]/100,o[4]/100)}},HSLA:function(e){var o=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)$/.exec(e);if(o){return(new k.colorpicker.Color).setHSL(o[1]/255,o[2]/255,o[3]/255).setAlpha(parseFloat(o[4]))}},"HSLA%":function(e){var o=/^hsla?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)$/.exec(e);if(o){return(new k.colorpicker.Color).setHSL(o[1]/100,o[2]/100,o[3]/100).setAlpha(o[4]/100)}},"#HEX":function(e){var o=/^#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/.exec(e);if(o){return new k.colorpicker.Color(parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255)}},"#HEX3":function(e){var o=/^#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/.exec(e);if(o){return new k.colorpicker.Color(parseInt(String(o[1])+o[1],16)/255,parseInt(String(o[2])+o[2],16)/255,parseInt(String(o[3])+o[3],16)/255)}},HEX:function(e){var o=/^([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/.exec(e);if(o){return new k.colorpicker.Color(parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255)}},HEX3:function(e){var o=/^([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/.exec(e);if(o){return new k.colorpicker.Color(parseInt(String(o[1])+o[1],16)/255,parseInt(String(o[2])+o[2],16)/255,parseInt(String(o[3])+o[3],16)/255)}},"#HEXA":function(e){var o=/^#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/.exec(e);if(o){return new k.colorpicker.Color(parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255,parseInt(o[4],16)/255)}},"#HEXA4":function(e){var o=/^#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/.exec(e);if(o){return new k.colorpicker.Color(parseInt(String(o[1])+o[1],16)/255,parseInt(String(o[2])+o[2],16)/255,parseInt(String(o[3])+o[3],16)/255,parseInt(String(o[4])+o[4],16)/255)}},HEXA:function(e){var o=/^([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/.exec(e);if(o){return new k.colorpicker.Color(parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255,parseInt(o[4],16)/255)}},HEXA4:function(e){var o=/^([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/.exec(e);if(o){return new k.colorpicker.Color(parseInt(String(o[1])+o[1],16)/255,parseInt(String(o[2])+o[2],16)/255,parseInt(String(o[3])+o[3],16)/255,parseInt(String(o[4])+o[4],16)/255)}}};this.partslists={full:["header","map","bar","hex","hsv","rgb","alpha","lab","cmyk","preview","swatches","footer"],popup:["map","bar","hex","hsv","rgb","alpha","preview","footer"],draggable:["header","map","bar","hex","hsv","rgb","alpha","preview","footer"],inline:["map","bar","hex","hsv","rgb","alpha","preview"]};this.limits={websafe:function(e){e.limit(6)},nibble:function(e){e.limit(16)},binary:function(e){e.limit(2)},name:function(e,o){var i=o._getSwatch(o._closestName(e));e.setRGB(i.r,i.g,i.b)}};this.parts={header:function(i){var e=this,t=null,r=function(){var e=i.options.title||i._getRegional("title"),o='<span class="ui-dialog-title">'+e+"</span>";if(!i.inline&&i.options.showCloseButton){o+='<a href="#" class="ui-dialog-titlebar-close ui-corner-all" role="button">'+'<span class="ui-icon ui-icon-closethick">close</span></a>'}return'<div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">'+o+"</div>"},n=function(e){e.preventDefault();i.close(i.options.revert)};this.init=function(){t=k(r()).prependTo(i.dialog);var e=k(".ui-dialog-titlebar-close",t);i._hoverable(e);i._focusable(e);e.on("click",n);if(!i.inline&&i.options.draggable){var o={handle:t};if(i.options.containment){o.containment=i.options.containment}i.dialog.draggable(o)}};this.disable=function(e){k(".ui-dialog-titlebar-close",t)[e?"off":"on"]("click",n)}},map:function(l){var r=this,n=null,a,c,u,s={},p,h,f,o,e;p=function(e){if(!l.opened){return}var o=s.p.offset(),i=e.pageX-o.left,t=e.pageY-o.top;if(i>=0&&i<c&&t>=0&&t<u){e.stopImmediatePropagation();e.preventDefault();n.off("mousedown",p).focus();k(document).on("mouseup",h);k(document).on("mousemove",f);f(e)}};h=function(e){e.stopImmediatePropagation();e.preventDefault();k(document).off("mouseup",h);k(document).off("mousemove",f);n.on("mousedown",p);l._callback("stop")};f=function(e){e.stopImmediatePropagation();e.preventDefault();if(e.pageX===r.x&&e.pageY===r.y){return}r.x=e.pageX;r.y=e.pageY;var o=s.p.offset(),i=e.pageX-o.left,t=e.pageY-o.top;i=Math.max(0,Math.min(i/c,1));t=Math.max(0,Math.min(t/u,1));switch(l.mode){case"h":l.color.setHSV(null,i,1-t);break;case"s":case"a":l.color.setHSV(i,null,1-t);break;case"v":l.color.setHSV(i,1-t,null);break;case"r":l.color.setRGB(null,1-t,i);break;case"g":l.color.setRGB(1-t,null,i);break;case"b":l.color.setRGB(i,1-t,null);break}l._change(false)};o=function(e){var o={h:"s",s:"h",v:"h",r:"b",g:"b",b:"r",a:"h"},i={37:-1,39:1},t={h:"v",s:"v",v:"s",r:"g",g:"r",b:"g",a:"v"},r={38:1,40:-1},n={35:0,36:1},a,s;if(typeof i[e.which]!=="undefined"){s=l.color.getChannel(o[l.mode])*c;a=i[e.which];if(e.shiftKey){a*=10}else if(e.ctrlKey||e.metaKey){a*=c}l.color.setChannel(o[l.mode],(s+a)/c);l._change(false)}else if(typeof r[e.which]!=="undefined"){s=l.color.getChannel(t[l.mode])*u;a=r[e.which];if(e.shiftKey){a*=10}else if(e.ctrlKey||e.metaKey){a*=u}l.color.setChannel(t[l.mode],(s+a)/u);l._change(false)}else if(typeof n[e.which]!=="undefined"){l.color.setChannel(o[l.mode],1-n[e.which]);l.color.setChannel(t[l.mode],n[e.which]);l._change(false)}};e=function(){var e='<div class="ui-colorpicker-map ui-colorpicker-map-'+(l.options.part.map.size||256)+' ui-colorpicker-border" taonex="0">'+'<span class="ui-colorpicker-map-layer-1"> </span>'+'<span class="ui-colorpicker-map-layer-2"> </span>'+(l.options.alpha?'<span class="ui-colorpicker-map-layer-alpha"> </span>':"")+'<span class="ui-colorpicker-map-layer-pointer"><span class="ui-colorpicker-map-pointer"></span></span></div>';return e};this.init=function(){n=k(e()).appendTo(k(".ui-colorpicker-map-container",l.dialog));n.on("mousedown",p);n.on("keydown",o);s[1]=k(".ui-colorpicker-map-layer-1",n);s[2]=k(".ui-colorpicker-map-layer-2",n);s.a=k(".ui-colorpicker-map-layer-alpha",n);s.p=k(".ui-colorpicker-map-layer-pointer",n);c=s.p.width();u=s.p.height();a=k(".ui-colorpicker-map-pointer",n)};this.update=function(){var e=(l.options.part.map.size||256)*65/64;switch(l.mode){case"h":s[1].css({"background-position":"0 0",opacity:""}).show();s[2].hide();break;case"s":case"a":s[1].css({"background-position":"0 "+-e+"px",opacity:""}).show();s[2].css({"background-position":"0 "+-e*2+"px",opacity:""}).show();break;case"v":n.css("background-color","black");s[1].css({"background-position":"0 "+-e*3+"px",opacity:""}).show();s[2].hide();break;case"r":s[1].css({"background-position":"0 "+-e*4+"px",opacity:""}).show();s[2].css({"background-position":"0 "+-e*5+"px",opacity:""}).show();break;case"g":s[1].css({"background-position":"0 "+-e*6+"px",opacity:""}).show();s[2].css({"background-position":"0 "+-e*7+"px",opacity:""}).show();break;case"b":s[1].css({"background-position":"0 "+-e*8+"px",opacity:""}).show();s[2].css({"background-position":"0 "+-e*9+"px",opacity:""}).show();break}r.repaint()};this.repaint=function(){var e=0,o=0;switch(l.mode){case"h":var i=l.color.getHSV();e=i.s*c;o=(1-i.v)*c;n.css("background-color",l.color.copy().setHSV(null,1,1).toCSS());break;case"s":case"a":var i=l.color.getHSV();e=i.h*c;o=(1-i.v)*c;s[2].css("opacity",1-i.s);break;case"v":var i=l.color.getHSV();e=i.h*c;o=(1-i.s)*c;s[1].css("opacity",i.v);break;case"r":var t=l.color.getRGB();e=t.b*c;o=(1-t.g)*c;s[2].css("opacity",t.r);break;case"g":var t=l.color.getRGB();e=t.b*c;o=(1-t.r)*c;s[2].css("opacity",t.g);break;case"b":var t=l.color.getRGB();e=t.r*c;o=(1-t.g)*c;s[2].css("opacity",t.b);break}if(l.options.alpha){s.a.css("opacity",1-l.color.getAlpha())}a.css({left:e-7,top:o-7})};this.disable=function(e){n[e?"off":"on"]("mousedown",p);n[e?"off":"on"]("keydown",o)}},bar:function(r){var t=this,n=null,a,s,l,c={},u,p,h,o,e;u=function(e){if(!r.opened){return}var o=c.p.offset(),i=e.pageX-o.left,t=e.pageY-o.top;if(i>=0&&i<s&&t>=0&&t<l){e.stopImmediatePropagation();e.preventDefault();n.off("mousedown",u).focus();k(document).on("mouseup",p);k(document).on("mousemove",h);h(e)}};p=function(e){e.stopImmediatePropagation();e.preventDefault();k(document).off("mouseup",p);k(document).off("mousemove",h);n.on("mousedown",u);r._callback("stop")};h=function(e){e.stopImmediatePropagation();e.preventDefault();if(e.pageY===t.y){return}t.y=e.pageY;var o=c.p.offset(),i=e.pageY-o.top;i=Math.max(0,Math.min(i/l,1));switch(r.mode){case"h":r.color.setHSV(1-i,null,null);break;case"s":r.color.setHSV(null,1-i,null);break;case"v":r.color.setHSV(null,null,1-i);break;case"r":r.color.setRGB(1-i,null,null);break;case"g":r.color.setRGB(null,1-i,null);break;case"b":r.color.setRGB(null,null,1-i);break;case"a":r.color.setAlpha(1-i);break}r._change(false)};o=function(e){var o={38:1,40:-1,33:10,34:-10},i={35:0,36:1},o,t;if(typeof o[e.which]!=="undefined"){t=r.color.getChannel(r.mode)*l;o=o[e.which];if(e.shiftKey){o*=10}else if(e.ctrlKey||e.metaKey){o*=l}r.color.setChannel(r.mode,(t+o)/l);r._change(false)}else if(typeof i[e.which]!=="undefined"){r.color.setChannel(r.mode,i[e.which]);r._change(false)}};e=function(){var e='<div class="ui-colorpicker-bar ui-colorpicker-bar-'+(r.options.part.bar.size||256)+' ui-colorpicker-border" taonex="0">'+'<span class="ui-colorpicker-bar-layer-1"> </span>'+'<span class="ui-colorpicker-bar-layer-2"> </span>'+'<span class="ui-colorpicker-bar-layer-3"> </span>'+'<span class="ui-colorpicker-bar-layer-4"> </span>';if(r.options.alpha){e+='<span class="ui-colorpicker-bar-layer-alpha"> </span>'+'<span class="ui-colorpicker-bar-layer-alphabar"> </span>'}e+='<span class="ui-colorpicker-bar-layer-pointer"><span class="ui-colorpicker-bar-pointer"></span></span></div>';return e};this.init=function(){n=k(e()).appendTo(k(".ui-colorpicker-bar-container",r.dialog));n.on("mousedown",u);n.on("keydown",o);c[1]=k(".ui-colorpicker-bar-layer-1",n);c[2]=k(".ui-colorpicker-bar-layer-2",n);c[3]=k(".ui-colorpicker-bar-layer-3",n);c[4]=k(".ui-colorpicker-bar-layer-4",n);c.a=k(".ui-colorpicker-bar-layer-alpha",n);c.ab=k(".ui-colorpicker-bar-layer-alphabar",n);c.p=k(".ui-colorpicker-bar-layer-pointer",n);s=c.p.width();l=c.p.height();a=k(".ui-colorpicker-bar-pointer",n)};this.update=function(){var e=(r.options.part.bar.size||256)*65/64;switch(r.mode){case"h":case"s":case"v":case"r":case"g":case"b":c.a.show();c.ab.hide();break;case"a":c.a.hide();c.ab.show();break}switch(r.mode){case"h":c[1].css({"background-position":"0 0",opacity:""}).show();c[2].hide();c[3].hide();c[4].hide();break;case"s":c[1].css({"background-position":"0 "+-e+"px",opacity:""}).show();c[2].css({"background-position":"0 "+-e*2+"px",opacity:""}).show();c[3].hide();c[4].hide();break;case"v":c[1].css({"background-position":"0 "+-e*2+"px",opacity:""}).show();c[2].hide();c[3].hide();c[4].hide();break;case"r":c[1].css({"background-position":"0 "+-e*6+"px",opacity:""}).show();c[2].css({"background-position":"0 "+-e*5+"px",opacity:""}).show();c[3].css({"background-position":"0 "+-e*3+"px",opacity:""}).show();c[4].css({"background-position":"0 "+-e*4+"px",opacity:""}).show();break;case"g":c[1].css({"background-position":"0 "+-e*10+"px",opacity:""}).show();c[2].css({"background-position":"0 "+-e*9+"px",opacity:""}).show();c[3].css({"background-position":"0 "+-e*7+"px",opacity:""}).show();c[4].css({"background-position":"0 "+-e*8+"px",opacity:""}).show();break;case"b":c[1].css({"background-position":"0 "+-e*14+"px",opacity:""}).show();c[2].css({"background-position":"0 "+-e*13+"px",opacity:""}).show();c[3].css({"background-position":"0 "+-e*11+"px",opacity:""}).show();c[4].css({"background-position":"0 "+-e*12+"px",opacity:""}).show();break;case"a":c[1].hide();c[2].hide();c[3].hide();c[4].hide();break}t.repaint()};this.repaint=function(){var e=0;switch(r.mode){case"h":e=(1-r.color.getHSV().h)*l;break;case"s":var o=r.color.getHSV();e=(1-o.s)*l;c[2].css("opacity",1-o.v);n.css("background-color",r.color.copy().setHSV(null,1,null).toCSS());break;case"v":e=(1-r.color.getHSV().v)*l;n.css("background-color",r.color.copy().setHSV(null,null,1).toCSS());break;case"r":var i=r.color.getRGB();e=(1-i.r)*l;c[2].css("opacity",Math.max(0,i.b-i.g));c[3].css("opacity",Math.max(0,i.g-i.b));c[4].css("opacity",Math.min(i.b,i.g));break;case"g":var i=r.color.getRGB();e=(1-i.g)*l;c[2].css("opacity",Math.max(0,i.b-i.r));c[3].css("opacity",Math.max(0,i.r-i.b));c[4].css("opacity",Math.min(i.r,i.b));break;case"b":var i=r.color.getRGB();e=(1-i.b)*l;c[2].css("opacity",Math.max(0,i.r-i.g));c[3].css("opacity",Math.max(0,i.g-i.r));c[4].css("opacity",Math.min(i.r,i.g));break;case"a":e=(1-r.color.getAlpha())*l;n.css("background-color",r.color.copy().toCSS());break}if(r.mode!=="a"){c.a.css("opacity",1-r.color.getAlpha())}a.css("top",e-3)};this.disable=function(e){n[e?"off":"on"]("mousedown",u);n[e?"off":"on"]("keydown",o)}},preview:function(e){var o=this,i=null,t,r,n,a,s,l,c=function(){e.color=e.currentColor.copy();e._change()};l=function(){return'<div class="ui-colorpicker-preview ui-colorpicker-border">'+'<div class="ui-colorpicker-preview-initial"><div class="ui-colorpicker-preview-initial-alpha"></div></div>'+'<div class="ui-colorpicker-preview-current"><div class="ui-colorpicker-preview-current-alpha"></div></div>'+"</div>"};this.init=function(){i=k(l()).appendTo(k(".ui-colorpicker-preview-container",e.dialog));k(".ui-colorpicker-preview-initial",i).on("click",c);r=k(".ui-colorpicker-preview-initial",i);n=k(".ui-colorpicker-preview-initial-alpha",i);a=k(".ui-colorpicker-preview-current",i);s=k(".ui-colorpicker-preview-current-alpha",i);t=k(".ui-colorpicker-preview-initial-alpha, .ui-colorpicker-preview-current-alpha",i)};this.update=function(){t[e.options.alpha?"show":"hide"]();this.repaint()};this.repaint=function(){r.css("background-color",e.currentColor.set?e.currentColor.toCSS():"").attr("title",e.currentColor.set?e.currentColor.toCSS():"");n.css("opacity",1-e.currentColor.getAlpha());a.css("background-color",e.color.set?e.color.toCSS():"").attr("title",e.color.set?e.color.toCSS():"");s.css("opacity",1-e.color.getAlpha())};this.disable=function(e){k(".ui-colorpicker-preview-initial",i)[e?"off":"on"]("click",c)}},hsv:function(o){var e=this,i=null,t={},r;r=function(){var e="";if(o.options.hsv){e+='<div class="ui-colorpicker-hsv-h"><input class="ui-colorpicker-mode" type="radio" value="h"/><label>'+o._getRegional("hsvH")+'</label><input class="ui-colorpicker-number" type="number" min="0" max="360" size="10"/><span class="ui-colorpicker-unit">°</span></div>'+'<div class="ui-colorpicker-hsv-s"><input class="ui-colorpicker-mode" type="radio" value="s"/><label>'+o._getRegional("hsvS")+'</label><input class="ui-colorpicker-number" type="number" min="0" max="100" size="10"/><span class="ui-colorpicker-unit">%</span></div>'+'<div class="ui-colorpicker-hsv-v"><input class="ui-colorpicker-mode" type="radio" value="v"/><label>'+o._getRegional("hsvV")+'</label><input class="ui-colorpicker-number" type="number" min="0" max="100" size="10"/><span class="ui-colorpicker-unit">%</span></div>'}return'<div class="ui-colorpicker-hsv">'+e+"</div>"};this.init=function(){i=k(r()).appendTo(k(".ui-colorpicker-hsv-container",o.dialog));k(".ui-colorpicker-mode",i).click(function(){o.mode=k(this).val();o._updateAllParts()});t.h=k(".ui-colorpicker-hsv-h .ui-colorpicker-number",i);t.s=k(".ui-colorpicker-hsv-s .ui-colorpicker-number",i);t.v=k(".ui-colorpicker-hsv-v .ui-colorpicker-number",i);k(".ui-colorpicker-number",i).on("input change keyup",function(){o.color.setHSV(t.h.val()/360,t.s.val()/100,t.v.val()/100);o._change()})};this.repaint=function(){var e=o.color.getHSV();t.h.val(Math.round(e.h*360));t.s.val(Math.round(e.s*100));t.v.val(Math.round(e.v*100))};this.update=function(){k(".ui-colorpicker-mode",i).each(function(){var e=k(this);e.prop("checked",e.val()===o.mode)});this.repaint()};this.disable=function(e){k(":input",i).prop("disabled",e)}},rgb:function(o){var e=this,i=null,t={},r;r=function(){var e="";if(o.options.rgb){e+='<div class="ui-colorpicker-rgb-r"><input class="ui-colorpicker-mode" type="radio" value="r"/><label>'+o._getRegional("rgbR")+'</label><input class="ui-colorpicker-number" type="number" min="0" max="255"/></div>'+'<div class="ui-colorpicker-rgb-g"><input class="ui-colorpicker-mode" type="radio" value="g"/><label>'+o._getRegional("rgbG")+'</label><input class="ui-colorpicker-number" type="number" min="0" max="255"/></div>'+'<div class="ui-colorpicker-rgb-b"><input class="ui-colorpicker-mode" type="radio" value="b"/><label>'+o._getRegional("rgbB")+'</label><input class="ui-colorpicker-number" type="number" min="0" max="255"/></div>'}return'<div class="ui-colorpicker-rgb">'+e+"</div>"};this.init=function(){i=k(r()).appendTo(k(".ui-colorpicker-rgb-container",o.dialog));k(".ui-colorpicker-mode",i).click(function(){o.mode=k(this).val();o._updateAllParts()});t.r=k(".ui-colorpicker-rgb-r .ui-colorpicker-number",i);t.g=k(".ui-colorpicker-rgb-g .ui-colorpicker-number",i);t.b=k(".ui-colorpicker-rgb-b .ui-colorpicker-number",i);k(".ui-colorpicker-number",i).on("input change keyup",function(){var e=k(".ui-colorpicker-rgb-r .ui-colorpicker-number",i).val();o.color.setRGB(t.r.val()/255,t.g.val()/255,t.b.val()/255);o._change()})};this.repaint=function(){var e=o.color.getRGB();t.r.val(Math.round(e.r*255));t.g.val(Math.round(e.g*255));t.b.val(Math.round(e.b*255))};this.update=function(){k(".ui-colorpicker-mode",i).each(function(){var e=k(this);e.prop("checked",e.val()===o.mode)});this.repaint()};this.disable=function(e){k(":input",i).prop("disabled",e)}},lab:function(o){var e=this,i=null,t={},r=function(){var e="";if(o.options.hsv){e+='<div class="ui-colorpicker-lab-l"><label>'+o._getRegional("labL")+'</label><input class="ui-colorpicker-number" type="number" min="0" max="100"/></div>'+'<div class="ui-colorpicker-lab-a"><label>'+o._getRegional("labA")+'</label><input class="ui-colorpicker-number" type="number" min="-128" max="127"/></div>'+'<div class="ui-colorpicker-lab-b"><label>'+o._getRegional("labB")+'</label><input class="ui-colorpicker-number" type="number" min="-128" max="127"/></div>'}return'<div class="ui-colorpicker-lab">'+e+"</div>"};this.init=function(){var e=0;i=k(r()).appendTo(k(".ui-colorpicker-lab-container",o.dialog));t.l=k(".ui-colorpicker-lab-l .ui-colorpicker-number",i);t.a=k(".ui-colorpicker-lab-a .ui-colorpicker-number",i);t.b=k(".ui-colorpicker-lab-b .ui-colorpicker-number",i);k(".ui-colorpicker-number",i).on("input change keyup",function(e){o.color.setLAB(parseInt(t.l.val(),10)/100,(parseInt(t.a.val(),10)+128)/255,(parseInt(t.b.val(),10)+128)/255);o._change()})};this.repaint=function(){var e=o.color.getLAB();t.l.val(Math.round(e.l*100));t.a.val(Math.round(e.a*255)-128);t.b.val(Math.round(e.b*255)-128)};this.update=this.repaint;this.disable=function(e){k(":input",i).prop("disabled",e)}},cmyk:function(o){var e=this,i=null,t={},r=function(){var e="";if(o.options.hsv){e+='<div class="ui-colorpicker-cmyk-c"><label>'+o._getRegional("cmykC")+'</label><input class="ui-colorpicker-number" type="number" min="0" max="100"/><span class="ui-colorpicker-unit">%</span></div>'+'<div class="ui-colorpicker-cmyk-m"><label>'+o._getRegional("cmykM")+'</label><input class="ui-colorpicker-number" type="number" min="0" max="100"/><span class="ui-colorpicker-unit">%</span></div>'+'<div class="ui-colorpicker-cmyk-y"><label>'+o._getRegional("cmykY")+'</label><input class="ui-colorpicker-number" type="number" min="0" max="100"/><span class="ui-colorpicker-unit">%</span></div>'+'<div class="ui-colorpicker-cmyk-k"><label>'+o._getRegional("cmykK")+'</label><input class="ui-colorpicker-number" type="number" min="0" max="100"/><span class="ui-colorpicker-unit">%</span></div>'}return'<div class="ui-colorpicker-cmyk">'+e+"</div>"};this.init=function(){i=k(r()).appendTo(k(".ui-colorpicker-cmyk-container",o.dialog));t.c=k(".ui-colorpicker-cmyk-c .ui-colorpicker-number",i);t.m=k(".ui-colorpicker-cmyk-m .ui-colorpicker-number",i);t.y=k(".ui-colorpicker-cmyk-y .ui-colorpicker-number",i);t.k=k(".ui-colorpicker-cmyk-k .ui-colorpicker-number",i);k(".ui-colorpicker-number",i).on("input change keyup",function(e){o.color.setCMYK(parseInt(t.c.val(),10)/100,parseInt(t.m.val(),10)/100,parseInt(t.y.val(),10)/100,parseInt(t.k.val(),10)/100);o._change()})};this.repaint=function(){var e=o.color.getCMYK();t.c.val(Math.round(e.c*100));t.m.val(Math.round(e.m*100));t.y.val(Math.round(e.y*100));t.k.val(Math.round(e.k*100))};this.update=this.repaint;this.disable=function(e){k(":input",i).prop("disabled",e)}},alpha:function(o){var e=this,i=null,t,r=function(){var e="";if(o.options.alpha){e+='<div class="ui-colorpicker-a"><input class="ui-colorpicker-mode" name="mode" type="radio" value="a"/><label>'+o._getRegional("alphaA")+'</label><input class="ui-colorpicker-number" type="number" min="0" max="100"/><span class="ui-colorpicker-unit">%</span></div>'}return'<div class="ui-colorpicker-alpha">'+e+"</div>"};this.init=function(){i=k(r()).appendTo(k(".ui-colorpicker-alpha-container",o.dialog));k(".ui-colorpicker-mode",i).click(function(){o.mode=k(this).val();o._updateAllParts()});t=k(".ui-colorpicker-a .ui-colorpicker-number",i);k(".ui-colorpicker-number",i).on("input change keyup",function(){o.color.setAlpha(t.val()/100);o._change()})};this.update=function(){k(".ui-colorpicker-mode",i).each(function(){k(this).prop("checked",k(this).val()===o.mode)});this.repaint()};this.repaint=function(){t.val(Math.round(o.color.getAlpha()*100))};this.disable=function(e){k(":input",i).prop("disabled",e)}},hex:function(o){var e=this,i=null,t={},r=function(e){var o,i;i=/^#?([a-fA-F0-9]{1,3})$/.exec(e);if(i){o=parseInt(i[1],16);return new k.colorpicker.Color((o>>8&15)/15,(o>>4&15)/15,(o&15)/15)}i=/^#?([a-fA-F0-9]{1,6})$/.exec(e);if(i){o=parseInt(i[1],16);return new k.colorpicker.Color((o>>16&255)/255,(o>>8&255)/255,(o&255)/255)}return new k.colorpicker.Color},n=function(){var e="";if(o.options.alpha){e+='<input class="ui-colorpicker-hex-alpha" type="text" maxlength="2" size="2"/>'}e+='<input class="ui-colorpicker-hex-input" type="text" maxlength="6" size="6"/>';return'<div class="ui-colorpicker-hex"><label>#</label>'+e+"</div>"};this.init=function(){i=k(n()).appendTo(k(".ui-colorpicker-hex-container",o.dialog));t.color=k(".ui-colorpicker-hex-input",i);t.alpha=k(".ui-colorpicker-hex-alpha",i);t.color.on("keydown keyup",function(e){return e.ctrlKey||e.metaKey||a.isHex(e.which)||!a.isPrint(e.which)});t.color.on("change",function(){if(/[^a-fA-F0-9]/.test(t.color.val())){t.color.val(t.color.val().replace(/[^a-fA-F0-9]/g,""))}});t.color.on("change keyup",function(){o.color=r(t.color.val()).setAlpha(o.color.getAlpha());o._change()});t.alpha.on("keydown keyup",function(e){return e.ctrlKey||e.metaKey||a.isHex(e.which)||!a.isPrint(e.which)});t.alpha.on("change",function(){if(/[^a-fA-F0-9]/.test(t.alpha)){t.alpha.val(t.alpha.val().replace(/[^a-fA-F0-9]/g,""))}});t.alpha.on("change keyup",function(){o.color.setAlpha(parseInt(t.alpha.val(),16)/255);o._change()})};this.repaint=function(){if(!t.color.is(":focus")){t.color.val(o.color.toHex(true))}if(!t.alpha.is(":focus")){t.alpha.val(s(o.color.getAlpha()*255))}};this.update=this.repaint;this.disable=function(e){k(":input",i).prop("disabled",e)}},swatches:function(e){var o=this,i=null,t=function(){var r="";e._eachSwatch(function(e,o){var i=new k.colorpicker.Color(o.r,o.g,o.b),t=i.toCSS();r+='<div class="ui-colorpicker-swatch" style="background-color:'+t+'" title="'+e+'"></div>'});return'<div class="ui-colorpicker-swatches ui-colorpicker-border" style="width:'+e.options.swatchesWidth+'px">'+r+"</div>"},r=function(){e.color=e._parseColor(k(this).css("background-color"))||new k.colorpicker.Color;e._change()};this.init=function(){i=k(t());k(".ui-colorpicker-swatches-container",e.dialog).html(i);k(".ui-colorpicker-swatch",i).on("click",r)};this.disable=function(e){k(".ui-colorpicker-swatch",i)[e?"off":"on"]("click",r)}},footer:function(o){var e=this,i=null,t="ui-colorpicker-special-transparent-"+o.colorpicker_index,r="ui-colorpicker-special-none-"+o.colorpicker_index,n=function(){var e="";if(o.options.alpha||!o.inline&&o.options.showNoneButton){e+='<div class="ui-colorpicker-buttonset">';if(o.options.alpha){e+='<input type="radio" name="ui-colorpicker-special" id="'+t+'" class="ui-colorpicker-special-transparent"/><label for="'+t+'">'+o._getRegional("transparent")+"</label>"}if(!o.inline&&o.options.showNoneButton){e+='<input type="radio" name="ui-colorpicker-special" id="'+r+'" class="ui-colorpicker-special-none"><label for="'+r+'">'+o._getRegional("none")+"</label>"}e+="</div>"}if(!o.inline){e+='<div class="ui-dialog-buttonset">';if(o.options.showCancelButton){e+='<button class="ui-colorpicker-cancel">'+o._getRegional("cancel")+"</button>"}e+='<button class="ui-colorpicker-ok">'+o._getRegional("ok")+"</button>";e+="</div>"}return'<div class="ui-dialog-buttonpane ui-widget-content">'+e+"</div>"};this.init=function(){i=k(n()).appendTo(o.dialog);k(".ui-colorpicker-ok",i).button().click(function(){o.close()});k(".ui-colorpicker-cancel",i).button().click(function(){o.close(true)});k(".ui-colorpicker-buttonset",i)[k.fn.controlgroup?"controlgroup":"buttonset"]();k(".ui-colorpicker-special-color",i).click(function(){o._change()});k("#"+r,i).click(function(){o.color.set=false;o._change()});k("#"+t,i).click(function(){o.color.setAlpha(0);o._change()})};this.repaint=function(){k(".ui-colorpicker-special-none",i).prop("checked",!o.color.set).button("refresh");k(".ui-colorpicker-special-transparent",i).prop("checked",o.color.set&&o.color.getAlpha()===0).button("refresh");k(".ui-colorpicker-ok",i).button(o.changed?"enable":"disable")};this.update=function(){};this.disable=function(e){k(":input, :button",i).button(e?"disable":"enable");if(!e){k(".ui-colorpicker-ok",i).button(o.changed?"enable":"disable")}}}};this.Color=function(){var r={rgb:{r:0,g:0,b:0},hsv:{h:0,s:0,v:0},hsl:{h:0,s:0,l:0},lab:{l:0,a:0,b:0},cmyk:{c:0,m:0,y:0,k:1}},o=1,n=[.9504285,1,1.0889],e=arguments,a=function(e){if(isNaN(e)||e===null){return 0}if(typeof e=="string"){e=parseInt(e,10)}return Math.max(0,Math.min(e,1))},i=function(e){var e=Math.round(e),o="0123456789abcdef",i=e%16,t=(e-i)/16,r=o.charAt(t)+o.charAt(i);return r},t=function(e){var o=e.r>.04045?Math.pow((e.r+.055)/1.055,2.4):e.r/12.92,i=e.g>.04045?Math.pow((e.g+.055)/1.055,2.4):e.g/12.92,t=e.b>.04045?Math.pow((e.b+.055)/1.055,2.4):e.b/12.92;return{x:o*.4124+i*.3576+t*.1805,y:o*.2126+i*.7152+t*.0722,z:o*.0193+i*.1192+t*.9505}},s=function(e){var o={r:e.x*3.2406+e.y*-1.5372+e.z*-.4986,g:e.x*-.9689+e.y*1.8758+e.z*.0415,b:e.x*.0557+e.y*-.204+e.z*1.057};o.r=o.r>.0031308?1.055*Math.pow(o.r,1/2.4)-.055:12.92*o.r;o.g=o.g>.0031308?1.055*Math.pow(o.g,1/2.4)-.055:12.92*o.g;o.b=o.b>.0031308?1.055*Math.pow(o.b,1/2.4)-.055:12.92*o.b;return o},l=function(e){var o=Math.min(e.r,e.g,e.b),i=Math.max(e.r,e.g,e.b),t=i-o,r,n,a,s={h:0,s:0,v:i};if(t===0){s.h=0;s.s=0}else{s.s=t/i;r=((i-e.r)/6+t/2)/t;n=((i-e.g)/6+t/2)/t;a=((i-e.b)/6+t/2)/t;if(e.r===i){s.h=a-n}else if(e.g===i){s.h=1/3+r-a}else if(e.b===i){s.h=2/3+n-r}if(s.h<0){s.h+=1}else if(s.h>1){s.h-=1}}return s},c=function(e){var o={r:0,g:0,b:0},i,t,r,n,a;if(e.s===0){o.r=o.g=o.b=e.v}else{i=e.h===1?0:e.h*6;t=Math.floor(i);r=e.v*(1-e.s);n=e.v*(1-e.s*(i-t));a=e.v*(1-e.s*(1-(i-t)));if(t===0){o.r=e.v;o.g=a;o.b=r}else if(t===1){o.r=n;o.g=e.v;o.b=r}else if(t===2){o.r=r;o.g=e.v;o.b=a}else if(t===3){o.r=r;o.g=n;o.b=e.v}else if(t===4){o.r=a;o.g=r;o.b=e.v}else{o.r=e.v;o.g=r;o.b=n}}return o},u=function(e){var o=Math.min(e.r,e.g,e.b),i=Math.max(e.r,e.g,e.b),t=i-o,r,n,a,s={h:0,s:0,l:(i+o)/2};if(t===0){s.h=0;s.s=0}else{s.s=s.l<.5?t/(i+o):t/(2-i-o);r=((i-e.r)/6+t/2)/t;n=((i-e.g)/6+t/2)/t;a=((i-e.b)/6+t/2)/t;if(e.r===i){s.h=a-n}else if(e.g===i){s.h=1/3+r-a}else if(e.b===i){s.h=2/3+n-r}if(s.h<0){s.h+=1}else if(s.h>1){s.h-=1}}return s},p=function(e){var o,i,t=function(e,o,i){if(i<0){i+=1}if(i>1){i-=1}if(6*i<1){return e+(o-e)*6*i}if(2*i<1){return o}if(3*i<2){return e+(o-e)*(2/3-i)*6}return e};if(e.s===0){return{r:e.l,g:e.l,b:e.l}}i=e.l<.5?e.l*(1+e.s):e.l+e.s-e.s*e.l;o=2*e.l-i;return{r:t(o,i,e.h+1/3),g:t(o,i,e.h),b:t(o,i,e.h-1/3)}},h=function(e){var o=e.x/n[0],i=e.y/n[1],t=e.z/n[2];o=o>.008856?Math.pow(o,1/3):7.787*o+16/116;i=i>.008856?Math.pow(i,1/3):7.787*i+16/116;t=t>.008856?Math.pow(t,1/3):7.787*t+16/116;return{l:(116*i-16)/100,a:(500*(o-i)+128)/255,b:(200*(i-t)+128)/255}},f=function(e){var o={l:e.l*100,a:e.a*255-128,b:e.b*255-128},i={x:0,y:(o.l+16)/116,z:0};i.x=o.a/500+i.y;i.z=i.y-o.b/200;i.x=Math.pow(i.x,3)>.008856?Math.pow(i.x,3):(i.x-16/116)/7.787;i.y=Math.pow(i.y,3)>.008856?Math.pow(i.y,3):(i.y-16/116)/7.787;i.z=Math.pow(i.z,3)>.008856?Math.pow(i.z,3):(i.z-16/116)/7.787;i.x*=n[0];i.y*=n[1];i.z*=n[2];return i},b=function(e){return{c:1-e.r,m:1-e.g,y:1-e.b}},g=function(e){return{r:1-e.c,g:1-e.m,b:1-e.y}},d=function(e){var o=1;if(e.c<o){o=e.c}if(e.m<o){o=e.m}if(e.y<o){o=e.y}if(o===1){return{c:0,m:0,y:0,k:1}}return{c:(e.c-o)/(1-o),m:(e.m-o)/(1-o),y:(e.y-o)/(1-o),k:o}},m=function(e){return{c:e.c*(1-e.k)+e.k,m:e.m*(1-e.k)+e.k,y:e.y*(1-e.k)+e.k}};this.set=false;this.setAlpha=function(e){if(e!==null){o=a(e)}this.set=true;return this};this.getAlpha=function(){return o};this.setRGB=function(e,o,i){r={rgb:this.getRGB()};if(e!==null){r.rgb.r=a(e)}if(o!==null){r.rgb.g=a(o)}if(i!==null){r.rgb.b=a(i)}this.set=true;return this};this.getChannel=function(e){switch(e){case"h":case"s":case"v":return this.getHSV()[e];case"r":case"g":case"b":return this.getRGB()[e];case"a":return this.getAlpha()}return null};this.setChannel=function(e,o){switch(e){case"h":return this.setHSV(o,null,null);case"s":return this.setHSV(null,o,null);case"v":return this.setHSV(null,null,o);case"r":return this.setRGB(o,null,null);case"g":return this.setRGB(null,o,null);case"b":return this.setRGB(null,null,o);case"a":return this.setAlpha(o)}return this};this.setHSV=function(e,o,i){r={hsv:this.getHSV()};if(e!==null){r.hsv.h=a(e)}if(o!==null){r.hsv.s=a(o)}if(i!==null){r.hsv.v=a(i)}this.set=true;return this};this.setHSL=function(e,o,i){r={hsl:this.getHSL()};if(e!==null){r.hsl.h=a(e)}if(o!==null){r.hsl.s=a(o)}if(i!==null){r.hsl.l=a(i)}this.set=true;return this};this.setLAB=function(e,o,i){r={lab:this.getLAB()};if(e!==null){r.lab.l=a(e)}if(o!==null){r.lab.a=a(o)}if(i!==null){r.lab.b=a(i)}this.set=true;return this};this.setCMYK=function(e,o,i,t){r={cmyk:this.getCMYK()};if(e!==null){r.cmyk.c=a(e)}if(o!==null){r.cmyk.m=a(o)}if(i!==null){r.cmyk.y=a(i)}if(t!==null){r.cmyk.k=a(t)}this.set=true;return this};this.getRGB=function(){if(!r.rgb){r.rgb=r.lab?s(f(r.lab)):r.hsv?c(r.hsv):r.hsl?p(r.hsl):r.cmyk?g(m(r.cmyk)):{r:0,g:0,b:0};r.rgb.r=a(r.rgb.r);r.rgb.g=a(r.rgb.g);r.rgb.b=a(r.rgb.b)}return k.extend({},r.rgb)};this.getHSV=function(){if(!r.hsv){r.hsv=r.lab?l(this.getRGB()):r.rgb?l(r.rgb):r.hsl?l(this.getRGB()):r.cmyk?l(this.getRGB()):{h:0,s:0,v:0};r.hsv.h=a(r.hsv.h);r.hsv.s=a(r.hsv.s);r.hsv.v=a(r.hsv.v)}return k.extend({},r.hsv)};this.getHSL=function(){if(!r.hsl){r.hsl=r.rgb?u(r.rgb):r.hsv?u(this.getRGB()):r.cmyk?u(this.getRGB()):r.hsv?u(this.getRGB()):{h:0,s:0,l:0};r.hsl.h=a(r.hsl.h);r.hsl.s=a(r.hsl.s);r.hsl.l=a(r.hsl.l)}return k.extend({},r.hsl)};this.getCMYK=function(){if(!r.cmyk){r.cmyk=r.rgb?d(b(r.rgb)):r.hsv?d(b(this.getRGB())):r.hsl?d(b(this.getRGB())):r.lab?d(b(this.getRGB())):{c:0,m:0,y:0,k:1};r.cmyk.c=a(r.cmyk.c);r.cmyk.m=a(r.cmyk.m);r.cmyk.y=a(r.cmyk.y);r.cmyk.k=a(r.cmyk.k)}return k.extend({},r.cmyk)};this.getLAB=function(){if(!r.lab){r.lab=r.rgb?h(t(r.rgb)):r.hsv?h(t(this.getRGB())):r.hsl?h(t(this.getRGB())):r.cmyk?h(t(this.getRGB())):{l:0,a:0,b:0};r.lab.l=a(r.lab.l);r.lab.a=a(r.lab.a);r.lab.b=a(r.lab.b)}return k.extend({},r.lab)};this.getChannels=function(){return{r:this.getRGB().r,g:this.getRGB().g,b:this.getRGB().b,a:this.getAlpha(),h:this.getHSV().h,s:this.getHSV().s,v:this.getHSV().v,c:this.getCMYK().c,m:this.getCMYK().m,y:this.getCMYK().y,k:this.getCMYK().k,L:this.getLAB().l,A:this.getLAB().a,B:this.getLAB().b}};this.getSpaces=function(){return k.extend(true,{},r)};this.distance=function(e){var o="lab",i="get"+o.toUpperCase(),t=this[i](),r=e[i](),n=0,a;for(a in t){n+=Math.pow(t[a]-r[a],2)}return n};this.equals=function(e){if(e){var o=this.getRGB(),i=e.getRGB();return this.set===e.set&&this.getAlpha()===e.getAlpha()&&o.r===i.r&&o.g===i.g&&o.b===i.b}return false};this.limit=function(e){e-=1;var o=this.getRGB();this.setRGB(Math.round(o.r*e)/e,Math.round(o.g*e)/e,Math.round(o.b*e)/e)};this.toHex=function(){var e=this.getRGB();return i(e.r*255)+i(e.g*255)+i(e.b*255)};this.toCSS=function(){return"#"+this.toHex()};this.copy=function(){var e=new k.colorpicker.Color(this.getSpaces(),this.getAlpha());e.set=this.set;return e};if(e.length===2){r=e[0];this.setAlpha(e[1]===0?0:e[1]||1);this.set=true}if(e.length>2){this.setRGB(e[0],e[1],e[2]);this.setAlpha(e[3]===0?0:e[3]||1);this.set=true}}};k.widget("vanderlee.colorpicker",{options:{alpha:false,altAlpha:true,altField:"",altOnChange:true,altProperties:"background-color",autoOpen:false,buttonClass:null,buttonColorize:false,buttonImage:"images/ui-colorpicker.png",buttonImageOnly:false,buttonText:null,cancelOnExit:false,closeOnEscape:true,closeOnOutside:true,color:"#00FF00",colorFormat:"HEX",disabled:false,draggable:true,containment:null,duration:"fast",hideOn:"button",hsv:true,inline:true,inlineFrame:true,layout:{map:[0,0,1,5],bar:[1,0,1,5],preview:[2,0,1,1],hsv:[2,1,1,1],rgb:[2,2,1,1],alpha:[2,3,1,1],hex:[2,4,1,1],lab:[3,1,1,1],cmyk:[3,2,1,2],swatches:[4,0,1,5]},limit:"",modal:false,mode:"h",okOnEnter:false,parts:"",part:{map:{size:256},bar:{size:256}},position:null,regional:"",revert:false,rgb:true,showAnim:"fadeIn",showCancelButton:true,showNoneButton:false,showCloseButton:true,showOn:"focus click alt",showOptions:{},swatches:null,swatchesWidth:84,title:null,cancel:null,close:null,init:null,ok:null,open:null,select:null,stop:null,ready:null},_create:function(){var o=this,e;o.colorpicker_index=i++;o.widgetEventPrefix="colorpicker";o.opened=false;o.generated=false;o.inline=false;o.changed=false;o.dialog=null;o.button=null;o.image=null;o.overlay=null;o.events={window_resize:null,document_keydown:null,document_click_html:null};o.mode=o.options.mode;if(o.element.is("input")||o.options.inline===false){o._setColor(o.element.is("input")?o.element.val():o.options.color);o._callback("init");if(/\bfocus|all|both\b/.test(o.options.showOn)){o.element.on("focus",function(){o.open()})}if(/\bfocus|all|both\b/.test(o.options.hideOn)){o.element.on("focusout",function(e){o.close()})}if(/\bclick|all|both\b/.test(o.options.showOn)){o.element.on("click",function(e){if(o.opened&&/\bclick|all|both\b/.test(o.options.hideOn)){o.close()}else{o.open()}})}if(/\bbutton|all|both\b/.test(o.options.showOn)){if(o.options.buttonImage!==""){e=o.options.buttonText||o._getRegional("button");o.image=k("<img/>").attr({src:o.options.buttonImage,alt:e,title:e});if(o.options.buttonClass){o.image.attr("class",o.options.buttonClass)}o._setImageBackground()}if(o.options.buttonImageOnly&&o.image){o.button=o.image}else{o.button=k('<button type="button"></button>').html(o.image||o.options.buttonText).button();o.image=o.image?k("img",o.button).first():null}o.button.insertAfter(o.element).click(function(){if(!o.options.disabled){if(o.opened&&/\bbutton|all|both\b/.test(o.options.hideOn)){o.close()}else{o.open()}}})}if(/\balt|all|both\b/.test(o.options.showOn)){k(o.options.altField).on("click",function(){if(o.opened&&/\balt|all|both\b/.test(o.options.hideOn)){o.close()}else{o.open()}})}if(o.options.autoOpen){o.open()}}else{o.inline=true;o._generate();o.opened=true}(o.element.is(":disabled")||o.options.disabled)&&o.disable();o._callback("ready");return this},_setOption:function(e,o){switch(e){case"disabled":this[o?"disable":"enable"]();break;case"swatches":this.options.swatches=o;this.parts.swatches.init();break}k.Widget.prototype._setOption.apply(this,arguments)},enable:function(){this.element&&this.element.prop("disabled",false);this.button&&this.button.prop("disabled",false);this.dialog&&this.dialog.removeClass("ui-colorpicker-disabled");this.options.disabled=false;this.parts&&k.each(this.parts,function(e,o){o.disable&&o.disable(false)})},disable:function(){this.element&&this.element.prop("disabled",true);this.button&&this.button.prop("disabled",true);this.dialog&&this.dialog.addClass("ui-colorpicker-disabled");this.options.disabled=true;this.parts&&k.each(this.parts,function(e,o){o.disable&&o.disable(true)})},_setImageBackground:function(){if(this.image&&this.options.buttonColorize){this.image.css("background-color",this.color.set?this._formatColor("RGBA",this.color):"")}},_setAltField:function(){if(this.options.altOnChange&&this.options.altField&&this.options.altProperties){var e,o,i=this.options.altProperties.split(",");for(e=0;e<=i.length;++e){o=k.trim(i[e]);switch(o){case"color":case"fill":case"stroke":case"background-color":case"backgroundColor":case"outline-color":case"border-color":k(this.options.altField).css(o,this.color.set?this.color.toCSS():"");break}}this.options.altAlpha&&k(this.options.altField).css("opacity",this.color.set?this.color.getAlpha():"")}},_setColor:function(e){this.color=this._parseColor(e)||new k.colorpicker.Color;this.currentColor=this.color.copy();this._setImageBackground();this._setAltField()},setColor:function(e){this._setColor(e);this._change()},getColor:function(e){return this._formatColor(e||this.options.colorFormat,this.color)},_generateInline:function(){var e=this;k(e.element).html(e.options.inlineFrame?o:t);e.dialog=k(".ui-colorpicker",e.element)},_generatePopup:function(){var t=this;t.dialog=k(e).appendTo("body");if(t.events.document_click_html===null){k(document).on("touchstart click","html",t.events.document_click_html=function(e){if(!t.opened||e.target===t.element[0]||t.overlay){return}if(t.dialog.is(e.target)||t.dialog.has(e.target).length>0){t.element.blur();return}var o,i=k(e.target).parents();i.push(e.target);for(o=0;o<=i.length;++o){if(t.button!==null&&i[o]===t.button[0]){return}if(/\balt|all|both\b/.test(t.options.showOn)&&k(t.options.altField).is(i[o])){return}}if(!t.options.closeOnOutside){return}if(t.options.cancelOnExit){t.color=t.currentColor.copy();t._change()}t.close(t.options.revert)})}if(t.events.document_keydown===null){k(document).on("keydown",t.events.document_keydown=function(e){if(t.opened&&e.keyCode===27&&t.options.closeOnEscape){t.close(t.options.revert)}if(t.opened&&e.keyCode===13&&t.options.okOnEnter){t.close()}})}t.element.keydown(function(e){if(e.keyCode===9){t.close()}}).keyup(function(e){var o=t._parseColor(t.element.val());if(o&&!t.color.equals(o)){t.color=o;t._change()}})},_generate:function(){var i=this,e,o,t,r,n,a;i._setColor(i.inline||!i.element.is("input")?i.options.color:i.element.val());i[i.inline?"_generateInline":"_generatePopup"]();if(typeof i.options.parts==="string"){if(k.colorpicker.partslists[i.options.parts]){t=k.colorpicker.partslists[i.options.parts]}else{t=k.colorpicker.partslists[i.inline?"inline":"popup"]}}else{t=i.options.parts}i.parts={};k.each(t,function(e,o){if(k.colorpicker.parts[o]){i.parts[o]=new k.colorpicker.parts[o](i)}});if(!i.generated){r=[];k.each(i.options.layout,function(e,o){if(i.parts[e]){r.push({part:e,pos:o})}});n=k(l(r,function(e,o,i){a=["ui-colorpicker-"+e.part+"-container"];if(o>0){a.push("ui-colorpicker-padding-left")}if(i>0){a.push("ui-colorpicker-padding-top")}return'<td class="'+a.join(" ")+'"'+(e.pos[2]>1?' colspan="'+e.pos[2]+'"':"")+(e.pos[3]>1?' rowspan="'+e.pos[3]+'"':"")+' valign="top"></td>'})).appendTo(i.dialog);if(i.options.inlineFrame){n.addClass("ui-dialog-content ui-widget-content")}i._initAllParts();i._updateAllParts();i.generated=true}},_effectGeneric:function(e,o,i,t,r){var n=this;if(k.effects&&k.effects[n.options.showAnim]){e[o](n.options.showAnim,n.options.showOptions,n.options.duration,r)}else{e[n.options.showAnim==="slideDown"?i:n.options.showAnim==="fadeIn"?t:o](n.options.showAnim?n.options.duration:null,r);if(k.isFunction(r)&&(!n.options.showAnim||!n.options.duration)){r()}}},_effectShow:function(e,o){this._effectGeneric(e,"show","slideDown","fadeIn",o)},_effectHide:function(e,o){this._effectGeneric(e,"hide","slideUp","fadeOut",o)},open:function(){var e=this,o,i,t,r,n,a,s,l,c,u;if(!e.opened){e._generate();if(e.element.is(":hidden")){c=k("<div/>").insertBefore(e.element)}else{c=e.element}if(e.element.is(":hidden")){c.remove()}l=0;k(e.element[0]).parents().each(function(){var e=k(this).css("z-index");if((typeof e==="number"||typeof e==="string")&&e!==""&&!isNaN(e)){if(e>l){l=parseInt(e,10);return false}}else{k(this).siblings().each(function(){var e=k(this).css("z-index");if((typeof e==="number"||typeof e==="string")&&e!==""&&!isNaN(e)){if(e>l){l=parseInt(e,10)}}})}});l+=2;e.dialog.css("z-index",l);if(e.options.modal){e.overlay=k('<div class="ui-widget-overlay"></div>').appendTo("body").css("z-index",l-1);if(e.events.window_resize!==null){k(window).off("resize",e.events.window_resize)}e.events.window_resize=function(){if(e.overlay){e.overlay.width(k(document).width());e.overlay.height(k(document).height())}},k(window).on("resize",e.events.window_resize);e.events.window_resize()}e._effectShow(this.dialog);if(e.options.position){u=k.extend({},e.options.position);if(u.of==="element"){u.of=c}}else{u={my:"left top",at:"left bottom",of:c,collision:"flip"}}e.dialog.position(u);e.opened=true;e._callback("open");k(function(){e._repaintAllParts()})}},close:function(e){var o=this;if(!o.opened){return}if(e){o.color=o.currentColor.copy();o._change();o._callback("cancel")}else{o.currentColor=o.color.copy();o._callback("ok")}o.changed=false;if(o.overlay){k(window).off("resize",o.events.window_resize);o.overlay.remove()}o._effectHide(o.dialog,function(){o.dialog.remove();o.dialog=null;o.generated=false;o.opened=false;o._callback("close")})},destroy:function(){var e=this;if(e.events.document_click_html!==null){k(document).off("touchstart click","html",e.events.document_click_html)}if(e.events.document_keydown!==null){k(document).off("keydown",e.events.document_keydown)}if(e.events.window_resize!==null){k(window).off("resize",e.events.window_resize)}this.element.off();if(this.overlay){this.overlay.remove()}if(this.dialog!==null){this.dialog.remove()}if(this.image!==null){this.image.remove()}if(this.button!==null){this.button.remove()}},_callback:function(e){var o=this,i,t;if(o.color.set){i={formatted:o._formatColor(o.options.colorFormat,o.color),colorPicker:o};i.hex=o.color.toHex();i.css=o.color.toCSS();i.a=o.color.getAlpha();i.rgb=o.color.getRGB();i.hsv=o.color.getHSV();i.cmyk=o.color.getCMYK();i.hsl=o.color.getHSL();t=o.color.getLAB();t.a=t.a*2-1;t.b=t.b*2-1;i.lab=t;return o._trigger(e,null,i)}else{return o._trigger(e,null,{formatted:"",colorPicker:o})}},_initAllParts:function(){k.each(this.parts,function(e,o){if(o.init){o.init()}})},_updateAllParts:function(){k.each(this.parts,function(e,o){if(o.update){o.update()}})},_repaintAllParts:function(){k.each(this.parts,function(e,o){if(o.repaint){o.repaint()}})},_change:function(e){if(this.color.set&&this.options.limit&&k.colorpicker.limits[this.options.limit]){k.colorpicker.limits[this.options.limit](this.color,this)}this.changed=!this.color.equals(this.currentColor);if(!this.inline){if(!this.color.set){if(this.element.val()!==""){this.element.val("").change()}}else if(!this.color.equals(this._parseColor(this.element.val()))){this.element.val(this._formatColor(this.options.colorFormat,this.color)).change()}this._setImageBackground()}this._setAltField();this.options.color=this.color.set?this.color.toCSS():"";if(this.opened){this._repaintAllParts()}this._callback("select");if(typeof e==="undefined"?true:!!e){this._callback("stop")}},_hoverable:function(e){e.hover(function(){e.addClass("ui-state-hover")},function(){e.removeClass("ui-state-hover")})},_focusable:function(e){e.focus(function(){e.addClass("ui-state-focus")}).blur(function(){e.removeClass("ui-state-focus")})},_getRegional:function(e){return k.colorpicker.regional[this.options.regional][e]!==undefined?k.colorpicker.regional[this.options.regional][e]:k.colorpicker.regional[""][e]},_getSwatches:function(){if(typeof this.options.swatches==="string"){return k.colorpicker.swatches[this.options.swatches]}if(k.isPlainObject(this.options.swatches)){return this.options.swatches}return k.colorpicker.swatches.html},_eachSwatch:function(i){var t=this._getSwatches(),r;k.each(t,function(e,o){r=k.isArray(t)?o.name:e;return i(r,o)})},_getSwatch:function(i){var t=false;this._eachSwatch(function(e,o){if(e.toLowerCase()==i.toLowerCase()){t=o;return false}});return t},_parseFormat:function(e,o){var i=this,t={x:function(){return"([0-9a-fA-F]{2})"},d:function(){return"([12]?[0-9]{1,2})"},f:function(){return"([0-9]*\\.?[0-9]*)"},p:function(){return"([0-9]*\\.?[0-9]*)"}},r={x:function(e){return parseInt(e,16)/255},d:function(e){return e/255},f:function(e){return e},p:function(e){return e*.01}},n={r:"setRGB",g:"setRGB",b:"setRGB",h:"setHSV",s:"setHSV",v:"setHSV",c:"setCMYK",m:"setCMYK",y:"setCMYK",k:"setCMYK",L:"setLAB",A:"setLAB",B:"setLAB"},a={setRGB:["r","g","b"],setHSV:["h","s","v"],setCMYK:["c","m","y","k"],setLAB:["L","A","B"]},s=[],l=[],c=null,u,p;p=e.replace(/[()\\^$.|?*+[\]]/g,function(e){return"\\"+e});p=p.replace(/\\?[argbhsvcmykLAB][xdfp]/g,function(e){if(e.match(/^\\/)){return e.slice(1)}var o=e.charAt(0),i=e.charAt(1);s.push(o);l.push(r[i]);if(n[o]){c=n[o]}return t[i]()});if(c){var h=o.match(new RegExp(p));if(h){var f=[],b;h.shift();k.each(a[c],function(e,o){b=k.inArray(o,s);f[e]=l[b](h[b])});u=new k.colorpicker.Color;u[c].apply(u,f)}}return u},_parseColor:function(i){var t=this,r;var e=k.isArray(t.options.colorFormat)?t.options.colorFormat:[t.options.colorFormat];k.each(e,function(e,o){if(k.colorpicker.parsers[o]){r=k.colorpicker.parsers[o](i,t)}else{r=t._parseFormat(o,i)}if(r){return false}});if(!r){k.each(k.colorpicker.parsers,function(e,o){r=o(i,t);if(r){return false}})}if(r){return r}return false},_exactName:function(i){var t=false;this._eachSwatch(function(e,o){if(i.equals(new k.colorpicker.Color(o.r,o.g,o.b))){t=e;return false}});return t},_closestName:function(i){var e=i.getRGB(),t=null,r=false,n;this._eachSwatch(function(e,o){n=i.distance(new k.colorpicker.Color(o.r,o.g,o.b));if(n<t||t===null){r=e;if(n<=1e-20){return false}t=n}});return r},_formatColor:function(e,i){var t=this,r=null,n={x:function(e){return s(e*255)},d:function(e){return Math.round(e*255)},f:function(e){return e},p:function(e){return e*100}},a=i.getChannels();if(!k.isArray(e)){e=[e]}k.each(e,function(e,o){if(k.colorpicker.writers[o]){r=k.colorpicker.writers[o](i,t);return r===false}else{r=o.replace(/\\?[argbhsvcmykLAB][xdfp]/g,function(e){if(e.match(/^\\/)){return e.slice(1)}return n[e.charAt(1)](a[e.charAt(0)])});return false}});return r}});return k.vanderlee.colorpicker});