svelte-chroma-picker
Version:
A color picker for Svelte using chroma-js to do the color manipulations
58 lines • 51.1 kB
JavaScript
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(e=e||self).SvelteChromaPicker=r()}(this,(function(){"use strict";function e(){}function r(e){return e()}function t(){return Object.create(null)}function n(e){e.forEach(r)}function a(e){return"function"==typeof e}function o(e,r){return e!=e?r==r:e!==r||e&&"object"==typeof e||"function"==typeof e}function f(e,r){e.appendChild(r)}function u(e,r,t){e.insertBefore(r,t||null)}function i(e){e.parentNode.removeChild(e)}function c(e){return document.createElement(e)}function l(){return e=" ",document.createTextNode(e);var e}function s(e,r,t,n){return e.addEventListener(r,t,n),()=>e.removeEventListener(r,t,n)}function d(e,r,t){null==t?e.removeAttribute(r):e.getAttribute(r)!==t&&e.setAttribute(r,t)}function h(e,r){(null!=r||e.value)&&(e.value=r)}function b(e,r,t,n){e.style.setProperty(r,t,n?"important":"")}let p;function g(e){p=e}function v(){const e=function(){if(!p)throw new Error("Function called outside component initialization");return p}();return(r,t)=>{const n=e.$$.callbacks[r];if(n){const a=function(e,r){const t=document.createEvent("CustomEvent");return t.initCustomEvent(e,!1,!1,r),t}(r,t);n.slice().forEach(r=>{r.call(e,a)})}}}const y=[],m=[],w=[],k=[],x=Promise.resolve();let M=!1;function _(e){w.push(e)}let N=!1;const $=new Set;function E(){if(!N){N=!0;do{for(let e=0;e<y.length;e+=1){const r=y[e];g(r),A(r.$$)}for(y.length=0;m.length;)m.pop()();for(let e=0;e<w.length;e+=1){const r=w[e];$.has(r)||($.add(r),r())}w.length=0}while(y.length);for(;k.length;)k.pop()();M=!1,N=!1,$.clear()}}function A(e){if(null!==e.fragment){e.update(),n(e.before_update);const r=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,r),e.after_update.forEach(_)}}const F=new Set;function P(e,r){-1===e.$$.dirty[0]&&(y.push(e),M||(M=!0,x.then(E)),e.$$.dirty.fill(0)),e.$$.dirty[r/31|0]|=1<<r%31}function O(o,f,u,c,l,s,d=[-1]){const h=p;g(o);const b=f.props||{},v=o.$$={fragment:null,ctx:null,props:s,update:e,not_equal:l,bound:t(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(h?h.$$.context:[]),callbacks:t(),dirty:d};let y=!1;if(v.ctx=u?u(o,b,(e,r,...t)=>{const n=t.length?t[0]:r;return v.ctx&&l(v.ctx[e],v.ctx[e]=n)&&(v.bound[e]&&v.bound[e](n),y&&P(o,e)),r}):[],v.update(),y=!0,n(v.before_update),v.fragment=!!c&&c(v.ctx),f.target){if(f.hydrate){const e=function(e){return Array.from(e.childNodes)}(f.target);v.fragment&&v.fragment.l(e),e.forEach(i)}else v.fragment&&v.fragment.c();f.intro&&((m=o.$$.fragment)&&m.i&&(F.delete(m),m.i(w))),function(e,t,o){const{fragment:f,on_mount:u,on_destroy:i,after_update:c}=e.$$;f&&f.m(t,o),_(()=>{const t=u.map(r).filter(a);i?i.push(...t):n(t),e.$$.on_mount=[]}),c.forEach(_)}(o,f.target,f.anchor),E()}var m,w;g(h)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var C=function(e,r){return e(r={exports:{}},r.exports),r.exports}((function(e,r){
/**
* chroma.js - JavaScript library for color conversions
*
* Copyright (c) 2011-2019, Gregor Aisch
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name Gregor Aisch may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* -------------------------------------------------------
*
* chroma.js includes colors from colorbrewer2.org, which are released under
* the following license:
*
* Copyright (c) 2002 Cynthia Brewer, Mark Harrower,
* and The Pennsylvania State University.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*
* ------------------------------------------------------
*
* Named colors are taken from X11 Color Names.
* http://www.w3.org/TR/css3-color/#svg-color
*
* @preserve
*/
e.exports=function(){for(var e=function(e,r,t){return void 0===r&&(r=0),void 0===t&&(t=1),e<r?r:e>t?t:e},r={},t=0,n=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];t<n.length;t+=1){var a=n[t];r["[object "+a+"]"]=a.toLowerCase()}var o=function(e){return r[Object.prototype.toString.call(e)]||"object"},f=Math.PI,u={clip_rgb:function(r){r._clipped=!1,r._unclipped=r.slice(0);for(var t=0;t<=3;t++)t<3?((r[t]<0||r[t]>255)&&(r._clipped=!0),r[t]=e(r[t],0,255)):3===t&&(r[t]=e(r[t],0,1));return r},limit:e,type:o,unpack:function(e,r){return void 0===r&&(r=null),e.length>=3?Array.prototype.slice.call(e):"object"==o(e[0])&&r?r.split("").filter((function(r){return void 0!==e[0][r]})).map((function(r){return e[0][r]})):e[0]},last:function(e){if(e.length<2)return null;var r=e.length-1;return"string"==o(e[r])?e[r].toLowerCase():null},PI:f,TWOPI:2*f,PITHIRD:f/3,DEG2RAD:f/180,RAD2DEG:180/f},i={format:{},autodetect:[]},c=u.last,l=u.clip_rgb,s=u.type,d=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=this;if("object"===s(e[0])&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];var n=c(e),a=!1;if(!n){a=!0,i.sorted||(i.autodetect=i.autodetect.sort((function(e,r){return r.p-e.p})),i.sorted=!0);for(var o=0,f=i.autodetect;o<f.length;o+=1){var u=f[o];if(n=u.test.apply(u,e))break}}if(!i.format[n])throw new Error("unknown format: "+e);var d=i.format[n].apply(null,a?e:e.slice(0,-1));t._rgb=l(d),3===t._rgb.length&&t._rgb.push(1)};d.prototype.toString=function(){return"function"==s(this.hex)?this.hex():"["+this._rgb.join(",")+"]"};var h=d,b=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(b.Color,[null].concat(e)))};b.Color=h,b.version="2.1.0";var p=b,g=u.unpack,v=Math.max,y=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=g(e,"rgb"),n=t[0],a=t[1],o=t[2],f=1-v(n/=255,v(a/=255,o/=255)),u=f<1?1/(1-f):0,i=(1-n-f)*u,c=(1-a-f)*u,l=(1-o-f)*u;return[i,c,l,f]},m=u.unpack,w=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=(e=m(e,"cmyk"))[0],n=e[1],a=e[2],o=e[3],f=e.length>4?e[4]:1;return 1===o?[0,0,0,f]:[t>=1?0:255*(1-t)*(1-o),n>=1?0:255*(1-n)*(1-o),a>=1?0:255*(1-a)*(1-o),f]},k=u.unpack,x=u.type;h.prototype.cmyk=function(){return y(this._rgb)},p.cmyk=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["cmyk"])))},i.format.cmyk=w,i.autodetect.push({p:2,test:function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e=k(e,"cmyk"),"array"===x(e)&&4===e.length)return"cmyk"}});var M=u.unpack,_=u.last,N=function(e){return Math.round(100*e)/100},$=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=M(e,"hsla"),n=_(e)||"lsa";return t[0]=N(t[0]||0),t[1]=N(100*t[1])+"%",t[2]=N(100*t[2])+"%","hsla"===n||t.length>3&&t[3]<1?(t[3]=t.length>3?t[3]:1,n="hsla"):t.length=3,n+"("+t.join(",")+")"},E=u.unpack,A=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=(e=E(e,"rgba"))[0],n=e[1],a=e[2];t/=255,n/=255,a/=255;var o,f,u=Math.min(t,n,a),i=Math.max(t,n,a),c=(i+u)/2;return i===u?(o=0,f=Number.NaN):o=c<.5?(i-u)/(i+u):(i-u)/(2-i-u),t==i?f=(n-a)/(i-u):n==i?f=2+(a-t)/(i-u):a==i&&(f=4+(t-n)/(i-u)),(f*=60)<0&&(f+=360),e.length>3&&void 0!==e[3]?[f,o,c,e[3]]:[f,o,c]},F=u.unpack,P=u.last,O=Math.round,C=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=F(e,"rgba"),n=P(e)||"rgb";return"hsl"==n.substr(0,3)?$(A(t),n):(t[0]=O(t[0]),t[1]=O(t[1]),t[2]=O(t[2]),("rgba"===n||t.length>3&&t[3]<1)&&(t[3]=t.length>3?t[3]:1,n="rgba"),n+"("+t.slice(0,"rgb"===n?3:4).join(",")+")")},j=u.unpack,L=Math.round,q=function(){for(var e,r=[],t=arguments.length;t--;)r[t]=arguments[t];var n,a,o,f=(r=j(r,"hsl"))[0],u=r[1],i=r[2];if(0===u)n=a=o=255*i;else{var c=[0,0,0],l=[0,0,0],s=i<.5?i*(1+u):i+u-i*u,d=2*i-s,h=f/360;c[0]=h+1/3,c[1]=h,c[2]=h-1/3;for(var b=0;b<3;b++)c[b]<0&&(c[b]+=1),c[b]>1&&(c[b]-=1),6*c[b]<1?l[b]=d+6*(s-d)*c[b]:2*c[b]<1?l[b]=s:3*c[b]<2?l[b]=d+(s-d)*(2/3-c[b])*6:l[b]=d;n=(e=[L(255*l[0]),L(255*l[1]),L(255*l[2])])[0],a=e[1],o=e[2]}return r.length>3?[n,a,o,r[3]]:[n,a,o,1]},B=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,G=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,R=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,I=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,D=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,S=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Y=Math.round,z=function(e){var r;if(e=e.toLowerCase().trim(),i.format.named)try{return i.format.named(e)}catch(e){}if(r=e.match(B)){for(var t=r.slice(1,4),n=0;n<3;n++)t[n]=+t[n];return t[3]=1,t}if(r=e.match(G)){for(var a=r.slice(1,5),o=0;o<4;o++)a[o]=+a[o];return a}if(r=e.match(R)){for(var f=r.slice(1,4),u=0;u<3;u++)f[u]=Y(2.55*f[u]);return f[3]=1,f}if(r=e.match(I)){for(var c=r.slice(1,5),l=0;l<3;l++)c[l]=Y(2.55*c[l]);return c[3]=+c[3],c}if(r=e.match(D)){var s=r.slice(1,4);s[1]*=.01,s[2]*=.01;var d=q(s);return d[3]=1,d}if(r=e.match(S)){var h=r.slice(1,4);h[1]*=.01,h[2]*=.01;var b=q(h);return b[3]=+r[4],b}};z.test=function(e){return B.test(e)||G.test(e)||R.test(e)||I.test(e)||D.test(e)||S.test(e)};var T=z,X=u.type;h.prototype.css=function(e){return C(this._rgb,e)},p.css=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["css"])))},i.format.css=T,i.autodetect.push({p:5,test:function(e){for(var r=[],t=arguments.length-1;t-- >0;)r[t]=arguments[t+1];if(!r.length&&"string"===X(e)&&T.test(e))return"css"}});var U=u.unpack;i.format.gl=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=U(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t},p.gl=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["gl"])))},h.prototype.gl=function(){var e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]};var V=u.unpack,W=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t,n=V(e,"rgb"),a=n[0],o=n[1],f=n[2],u=Math.min(a,o,f),i=Math.max(a,o,f),c=i-u,l=100*c/255,s=u/(255-c)*100;return 0===c?t=Number.NaN:(a===i&&(t=(o-f)/c),o===i&&(t=2+(f-a)/c),f===i&&(t=4+(a-o)/c),(t*=60)<0&&(t+=360)),[t,l,s]},H=u.unpack,J=Math.floor,K=function(){for(var e,r,t,n,a,o,f=[],u=arguments.length;u--;)f[u]=arguments[u];var i,c,l,s=(f=H(f,"hcg"))[0],d=f[1],h=f[2];h*=255;var b=255*d;if(0===d)i=c=l=h;else{360===s&&(s=0),s>360&&(s-=360),s<0&&(s+=360);var p=J(s/=60),g=s-p,v=h*(1-d),y=v+b*(1-g),m=v+b*g,w=v+b;switch(p){case 0:i=(e=[w,m,v])[0],c=e[1],l=e[2];break;case 1:i=(r=[y,w,v])[0],c=r[1],l=r[2];break;case 2:i=(t=[v,w,m])[0],c=t[1],l=t[2];break;case 3:i=(n=[v,y,w])[0],c=n[1],l=n[2];break;case 4:i=(a=[m,v,w])[0],c=a[1],l=a[2];break;case 5:i=(o=[w,v,y])[0],c=o[1],l=o[2]}}return[i,c,l,f.length>3?f[3]:1]},Q=u.unpack,Z=u.type;h.prototype.hcg=function(){return W(this._rgb)},p.hcg=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["hcg"])))},i.format.hcg=K,i.autodetect.push({p:1,test:function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e=Q(e,"hcg"),"array"===Z(e)&&3===e.length)return"hcg"}});var ee=u.unpack,re=u.last,te=Math.round,ne=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=ee(e,"rgba"),n=t[0],a=t[1],o=t[2],f=t[3],u=re(e)||"auto";void 0===f&&(f=1),"auto"===u&&(u=f<1?"rgba":"rgb");var i=(n=te(n))<<16|(a=te(a))<<8|(o=te(o)),c="000000"+i.toString(16);c=c.substr(c.length-6);var l="0"+te(255*f).toString(16);switch(l=l.substr(l.length-2),u.toLowerCase()){case"rgba":return"#"+c+l;case"argb":return"#"+l+c;default:return"#"+c}},ae=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,oe=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,fe=function(e){if(e.match(ae)){4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var r=parseInt(e,16);return[r>>16,r>>8&255,255&r,1]}if(e.match(oe)){5!==e.length&&9!==e.length||(e=e.substr(1)),4===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);var t=parseInt(e,16);return[t>>24&255,t>>16&255,t>>8&255,Math.round((255&t)/255*100)/100]}throw new Error("unknown hex color: "+e)},ue=u.type;h.prototype.hex=function(e){return ne(this._rgb,e)},p.hex=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["hex"])))},i.format.hex=fe,i.autodetect.push({p:4,test:function(e){for(var r=[],t=arguments.length-1;t-- >0;)r[t]=arguments[t+1];if(!r.length&&"string"===ue(e)&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});var ie=u.unpack,ce=u.TWOPI,le=Math.min,se=Math.sqrt,de=Math.acos,he=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t,n=ie(e,"rgb"),a=n[0],o=n[1],f=n[2],u=le(a/=255,o/=255,f/=255),i=(a+o+f)/3,c=i>0?1-u/i:0;return 0===c?t=NaN:(t=(a-o+(a-f))/2,t/=se((a-o)*(a-o)+(a-f)*(o-f)),t=de(t),f>o&&(t=ce-t),t/=ce),[360*t,c,i]},be=u.unpack,pe=u.limit,ge=u.TWOPI,ve=u.PITHIRD,ye=Math.cos,me=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t,n,a,o=(e=be(e,"hsi"))[0],f=e[1],u=e[2];return isNaN(o)&&(o=0),isNaN(f)&&(f=0),o>360&&(o-=360),o<0&&(o+=360),(o/=360)<1/3?n=1-((a=(1-f)/3)+(t=(1+f*ye(ge*o)/ye(ve-ge*o))/3)):o<2/3?a=1-((t=(1-f)/3)+(n=(1+f*ye(ge*(o-=1/3))/ye(ve-ge*o))/3)):t=1-((n=(1-f)/3)+(a=(1+f*ye(ge*(o-=2/3))/ye(ve-ge*o))/3)),[255*(t=pe(u*t*3)),255*(n=pe(u*n*3)),255*(a=pe(u*a*3)),e.length>3?e[3]:1]},we=u.unpack,ke=u.type;h.prototype.hsi=function(){return he(this._rgb)},p.hsi=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["hsi"])))},i.format.hsi=me,i.autodetect.push({p:2,test:function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e=we(e,"hsi"),"array"===ke(e)&&3===e.length)return"hsi"}});var xe=u.unpack,Me=u.type;h.prototype.hsl=function(){return A(this._rgb)},p.hsl=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["hsl"])))},i.format.hsl=q,i.autodetect.push({p:2,test:function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e=xe(e,"hsl"),"array"===Me(e)&&3===e.length)return"hsl"}});var _e=u.unpack,Ne=Math.min,$e=Math.max,Ee=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t,n,a,o=(e=_e(e,"rgb"))[0],f=e[1],u=e[2],i=Ne(o,f,u),c=$e(o,f,u),l=c-i;return a=c/255,0===c?(t=Number.NaN,n=0):(n=l/c,o===c&&(t=(f-u)/l),f===c&&(t=2+(u-o)/l),u===c&&(t=4+(o-f)/l),(t*=60)<0&&(t+=360)),[t,n,a]},Ae=u.unpack,Fe=Math.floor,Pe=function(){for(var e,r,t,n,a,o,f=[],u=arguments.length;u--;)f[u]=arguments[u];var i,c,l,s=(f=Ae(f,"hsv"))[0],d=f[1],h=f[2];if(h*=255,0===d)i=c=l=h;else{360===s&&(s=0),s>360&&(s-=360),s<0&&(s+=360);var b=Fe(s/=60),p=s-b,g=h*(1-d),v=h*(1-d*p),y=h*(1-d*(1-p));switch(b){case 0:i=(e=[h,y,g])[0],c=e[1],l=e[2];break;case 1:i=(r=[v,h,g])[0],c=r[1],l=r[2];break;case 2:i=(t=[g,h,y])[0],c=t[1],l=t[2];break;case 3:i=(n=[g,v,h])[0],c=n[1],l=n[2];break;case 4:i=(a=[y,g,h])[0],c=a[1],l=a[2];break;case 5:i=(o=[h,g,v])[0],c=o[1],l=o[2]}}return[i,c,l,f.length>3?f[3]:1]},Oe=u.unpack,Ce=u.type;h.prototype.hsv=function(){return Ee(this._rgb)},p.hsv=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["hsv"])))},i.format.hsv=Pe,i.autodetect.push({p:2,test:function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e=Oe(e,"hsv"),"array"===Ce(e)&&3===e.length)return"hsv"}});var je=18,Le=.95047,qe=1,Be=1.08883,Ge=.137931034,Re=.206896552,Ie=.12841855,De=.008856452,Se=u.unpack,Ye=Math.pow,ze=function(e){return(e/=255)<=.04045?e/12.92:Ye((e+.055)/1.055,2.4)},Te=function(e){return e>De?Ye(e,1/3):e/Ie+Ge},Xe=function(e,r,t){return e=ze(e),r=ze(r),t=ze(t),[Te((.4124564*e+.3575761*r+.1804375*t)/Le),Te((.2126729*e+.7151522*r+.072175*t)/qe),Te((.0193339*e+.119192*r+.9503041*t)/Be)]},Ue=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=Se(e,"rgb"),n=t[0],a=t[1],o=t[2],f=Xe(n,a,o),u=f[0],i=f[1],c=f[2],l=116*i-16;return[l<0?0:l,500*(u-i),200*(i-c)]},Ve=u.unpack,We=Math.pow,He=function(e){return 255*(e<=.00304?12.92*e:1.055*We(e,1/2.4)-.055)},Je=function(e){return e>Re?e*e*e:Ie*(e-Ge)},Ke=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t,n,a,o=(e=Ve(e,"lab"))[0],f=e[1],u=e[2];return n=(o+16)/116,t=isNaN(f)?n:n+f/500,a=isNaN(u)?n:n-u/200,n=qe*Je(n),t=Le*Je(t),a=Be*Je(a),[He(3.2404542*t-1.5371385*n-.4985314*a),He(-.969266*t+1.8760108*n+.041556*a),He(.0556434*t-.2040259*n+1.0572252*a),e.length>3?e[3]:1]},Qe=u.unpack,Ze=u.type;h.prototype.lab=function(){return Ue(this._rgb)},p.lab=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["lab"])))},i.format.lab=Ke,i.autodetect.push({p:2,test:function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e=Qe(e,"lab"),"array"===Ze(e)&&3===e.length)return"lab"}});var er=u.unpack,rr=u.RAD2DEG,tr=Math.sqrt,nr=Math.atan2,ar=Math.round,or=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=er(e,"lab"),n=t[0],a=t[1],o=t[2],f=tr(a*a+o*o),u=(nr(o,a)*rr+360)%360;return 0===ar(1e4*f)&&(u=Number.NaN),[n,f,u]},fr=u.unpack,ur=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=fr(e,"rgb"),n=t[0],a=t[1],o=t[2],f=Ue(n,a,o),u=f[0],i=f[1],c=f[2];return or(u,i,c)},ir=u.unpack,cr=u.DEG2RAD,lr=Math.sin,sr=Math.cos,dr=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=ir(e,"lch"),n=t[0],a=t[1],o=t[2];return isNaN(o)&&(o=0),[n,sr(o*=cr)*a,lr(o)*a]},hr=u.unpack,br=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=(e=hr(e,"lch"))[0],n=e[1],a=e[2],o=dr(t,n,a),f=o[0],u=o[1],i=o[2],c=Ke(f,u,i),l=c[0],s=c[1],d=c[2];return[l,s,d,e.length>3?e[3]:1]},pr=u.unpack,gr=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=pr(e,"hcl").reverse();return br.apply(void 0,t)},vr=u.unpack,yr=u.type;h.prototype.lch=function(){return ur(this._rgb)},h.prototype.hcl=function(){return ur(this._rgb).reverse()},p.lch=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["lch"])))},p.hcl=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["hcl"])))},i.format.lch=br,i.format.hcl=gr,["lch","hcl"].forEach((function(e){return i.autodetect.push({p:2,test:function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];if(r=vr(r,e),"array"===yr(r)&&3===r.length)return e}})}));var mr={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",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:"#ff00ff",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",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",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",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",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:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},wr=u.type;h.prototype.name=function(){for(var e=ne(this._rgb,"rgb"),r=0,t=Object.keys(mr);r<t.length;r+=1){var n=t[r];if(mr[n]===e)return n.toLowerCase()}return e},i.format.named=function(e){if(e=e.toLowerCase(),mr[e])return fe(mr[e]);throw new Error("unknown color name: "+e)},i.autodetect.push({p:5,test:function(e){for(var r=[],t=arguments.length-1;t-- >0;)r[t]=arguments[t+1];if(!r.length&&"string"===wr(e)&&mr[e.toLowerCase()])return"named"}});var kr=u.unpack,xr=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=kr(e,"rgb"),n=t[0],a=t[1],o=t[2];return(n<<16)+(a<<8)+o},Mr=u.type,_r=function(e){if("number"==Mr(e)&&e>=0&&e<=16777215)return[e>>16,e>>8&255,255&e,1];throw new Error("unknown num color: "+e)},Nr=u.type;h.prototype.num=function(){return xr(this._rgb)},p.num=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["num"])))},i.format.num=_r,i.autodetect.push({p:5,test:function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(1===e.length&&"number"===Nr(e[0])&&e[0]>=0&&e[0]<=16777215)return"num"}});var $r=u.unpack,Er=u.type,Ar=Math.round;h.prototype.rgb=function(e){return void 0===e&&(e=!0),!1===e?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Ar)},h.prototype.rgba=function(e){return void 0===e&&(e=!0),this._rgb.slice(0,4).map((function(r,t){return t<3?!1===e?r:Ar(r):r}))},p.rgb=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["rgb"])))},i.format.rgb=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=$r(e,"rgba");return void 0===t[3]&&(t[3]=1),t},i.autodetect.push({p:3,test:function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e=$r(e,"rgba"),"array"===Er(e)&&(3===e.length||4===e.length&&"number"==Er(e[3])&&e[3]>=0&&e[3]<=1))return"rgb"}});var Fr=Math.log,Pr=function(e){var r,t,n,a=e/100;return a<66?(r=255,t=-155.25485562709179-.44596950469579133*(t=a-2)+104.49216199393888*Fr(t),n=a<20?0:.8274096064007395*(n=a-10)-254.76935184120902+115.67994401066147*Fr(n)):(r=351.97690566805693+.114206453784165*(r=a-55)-40.25366309332127*Fr(r),t=325.4494125711974+.07943456536662342*(t=a-50)-28.0852963507957*Fr(t),n=255),[r,t,n,1]},Or=u.unpack,Cr=Math.round,jr=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];for(var t,n=Or(e,"rgb"),a=n[0],o=n[2],f=1e3,u=4e4,i=.4;u-f>i;){var c=Pr(t=.5*(u+f));c[2]/c[0]>=o/a?u=t:f=t}return Cr(t)};h.prototype.temp=h.prototype.kelvin=h.prototype.temperature=function(){return jr(this._rgb)},p.temp=p.kelvin=p.temperature=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["temp"])))},i.format.temp=i.format.kelvin=i.format.temperature=Pr;var Lr=u.type;h.prototype.alpha=function(e,r){return void 0===r&&(r=!1),void 0!==e&&"number"===Lr(e)?r?(this._rgb[3]=e,this):new h([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]},h.prototype.clipped=function(){return this._rgb._clipped||!1},h.prototype.darken=function(e){void 0===e&&(e=1);var r=this.lab();return r[0]-=je*e,new h(r,"lab").alpha(this.alpha(),!0)},h.prototype.brighten=function(e){return void 0===e&&(e=1),this.darken(-e)},h.prototype.darker=h.prototype.darken,h.prototype.brighter=h.prototype.brighten,h.prototype.get=function(e){var r=e.split("."),t=r[0],n=r[1],a=this[t]();if(n){var o=t.indexOf(n);if(o>-1)return a[o];throw new Error("unknown channel "+n+" in mode "+t)}return a};var qr=u.type,Br=Math.pow;h.prototype.luminance=function(e){if(void 0!==e&&"number"===qr(e)){if(0===e)return new h([0,0,0,this._rgb[3]],"rgb");if(1===e)return new h([255,255,255,this._rgb[3]],"rgb");var r=this.luminance(),t=20,n=function(r,a){var o=r.interpolate(a,.5,"rgb"),f=o.luminance();return Math.abs(e-f)<1e-7||!t--?o:f>e?n(r,o):n(o,a)},a=(r>e?n(new h([0,0,0]),this):n(this,new h([255,255,255]))).rgb();return new h(a.concat([this._rgb[3]]))}return Gr.apply(void 0,this._rgb.slice(0,3))};var Gr=function(e,r,t){return.2126*(e=Rr(e))+.7152*(r=Rr(r))+.0722*(t=Rr(t))},Rr=function(e){return(e/=255)<=.03928?e/12.92:Br((e+.055)/1.055,2.4)},Ir={},Dr=u.type,Sr=function(e,r,t){void 0===t&&(t=.5);for(var n=[],a=arguments.length-3;a-- >0;)n[a]=arguments[a+3];var o=n[0]||"lrgb";if(Ir[o]||n.length||(o=Object.keys(Ir)[0]),!Ir[o])throw new Error("interpolation mode "+o+" is not defined");return"object"!==Dr(e)&&(e=new h(e)),"object"!==Dr(r)&&(r=new h(r)),Ir[o](e,r,t).alpha(e.alpha()+t*(r.alpha()-e.alpha()))};h.prototype.mix=h.prototype.interpolate=function(e,r){void 0===r&&(r=.5);for(var t=[],n=arguments.length-2;n-- >0;)t[n]=arguments[n+2];return Sr.apply(void 0,[this,e,r].concat(t))},h.prototype.premultiply=function(e){void 0===e&&(e=!1);var r=this._rgb,t=r[3];return e?(this._rgb=[r[0]*t,r[1]*t,r[2]*t,t],this):new h([r[0]*t,r[1]*t,r[2]*t,t],"rgb")},h.prototype.saturate=function(e){void 0===e&&(e=1);var r=this.lch();return r[1]+=je*e,r[1]<0&&(r[1]=0),new h(r,"lch").alpha(this.alpha(),!0)},h.prototype.desaturate=function(e){return void 0===e&&(e=1),this.saturate(-e)};var Yr=u.type;h.prototype.set=function(e,r,t){void 0===t&&(t=!1);var n=e.split("."),a=n[0],o=n[1],f=this[a]();if(o){var u=a.indexOf(o);if(u>-1){if("string"==Yr(r))switch(r.charAt(0)){case"+":case"-":f[u]+=+r;break;case"*":f[u]*=+r.substr(1);break;case"/":f[u]/=+r.substr(1);break;default:f[u]=+r}else{if("number"!==Yr(r))throw new Error("unsupported value for Color.set");f[u]=r}var i=new h(f,a);return t?(this._rgb=i._rgb,this):i}throw new Error("unknown channel "+o+" in mode "+a)}return f},Ir.rgb=function(e,r,t){var n=e._rgb,a=r._rgb;return new h(n[0]+t*(a[0]-n[0]),n[1]+t*(a[1]-n[1]),n[2]+t*(a[2]-n[2]),"rgb")};var zr=Math.sqrt,Tr=Math.pow;Ir.lrgb=function(e,r,t){var n=e._rgb,a=n[0],o=n[1],f=n[2],u=r._rgb,i=u[0],c=u[1],l=u[2];return new h(zr(Tr(a,2)*(1-t)+Tr(i,2)*t),zr(Tr(o,2)*(1-t)+Tr(c,2)*t),zr(Tr(f,2)*(1-t)+Tr(l,2)*t),"rgb")},Ir.lab=function(e,r,t){var n=e.lab(),a=r.lab();return new h(n[0]+t*(a[0]-n[0]),n[1]+t*(a[1]-n[1]),n[2]+t*(a[2]-n[2]),"lab")};var Xr=function(e,r,t,n){var a,o,f,u,i,c,l,s,d,b,p,g;return"hsl"===n?(f=e.hsl(),u=r.hsl()):"hsv"===n?(f=e.hsv(),u=r.hsv()):"hcg"===n?(f=e.hcg(),u=r.hcg()):"hsi"===n?(f=e.hsi(),u=r.hsi()):"lch"!==n&&"hcl"!==n||(n="hcl",f=e.hcl(),u=r.hcl()),"h"===n.substr(0,1)&&(i=(a=f)[0],l=a[1],d=a[2],c=(o=u)[0],s=o[1],b=o[2]),isNaN(i)||isNaN(c)?isNaN(i)?isNaN(c)?g=Number.NaN:(g=c,1!=d&&0!=d||"hsv"==n||(p=s)):(g=i,1!=b&&0!=b||"hsv"==n||(p=l)):g=i+t*(c>i&&c-i>180?c-(i+360):c<i&&i-c>180?c+360-i:c-i),void 0===p&&(p=l+t*(s-l)),new h([g,p,d+t*(b-d)],n)},Ur=function(e,r,t){return Xr(e,r,t,"lch")};Ir.lch=Ur,Ir.hcl=Ur,Ir.num=function(e,r,t){var n=e.num(),a=r.num();return new h(n+t*(a-n),"num")},Ir.hcg=function(e,r,t){return Xr(e,r,t,"hcg")},Ir.hsi=function(e,r,t){return Xr(e,r,t,"hsi")},Ir.hsl=function(e,r,t){return Xr(e,r,t,"hsl")},Ir.hsv=function(e,r,t){return Xr(e,r,t,"hsv")};var Vr=u.clip_rgb,Wr=Math.pow,Hr=Math.sqrt,Jr=Math.PI,Kr=Math.cos,Qr=Math.sin,Zr=Math.atan2,et=function(e,r){for(var t=e.length,n=[0,0,0,0],a=0;a<e.length;a++){var o=e[a],f=r[a]/t,u=o._rgb;n[0]+=Wr(u[0],2)*f,n[1]+=Wr(u[1],2)*f,n[2]+=Wr(u[2],2)*f,n[3]+=u[3]*f}return n[0]=Hr(n[0]),n[1]=Hr(n[1]),n[2]=Hr(n[2]),n[3]>.9999999&&(n[3]=1),new h(Vr(n))},rt=u.type,tt=Math.pow,nt=function(e){var r="rgb",t=p("#ccc"),n=0,a=[0,1],o=[],f=[0,0],u=!1,i=[],c=!1,l=0,s=1,d=!1,h={},b=!0,g=1,v=function(e){if((e=e||["#fff","#000"])&&"string"===rt(e)&&p.brewer&&p.brewer[e.toLowerCase()]&&(e=p.brewer[e.toLowerCase()]),"array"===rt(e)){1===e.length&&(e=[e[0],e[0]]),e=e.slice(0);for(var r=0;r<e.length;r++)e[r]=p(e[r]);o.length=0;for(var t=0;t<e.length;t++)o.push(t/(e.length-1))}return k(),i=e},y=function(e){return e},m=function(e){return e},w=function(e,n){var a,c;if(null==n&&(n=!1),isNaN(e)||null===e)return t;c=n?e:u&&u.length>2?function(e){if(null!=u){for(var r=u.length-1,t=0;t<r&&e>=u[t];)t++;return t-1}return 0}(e)/(u.length-2):s!==l?(e-l)/(s-l):1,c=m(c),n||(c=y(c)),1!==g&&(c=tt(c,g)),c=f[0]+c*(1-f[0]-f[1]),c=Math.min(1,Math.max(0,c));var d=Math.floor(1e4*c);if(b&&h[d])a=h[d];else{if("array"===rt(i))for(var v=0;v<o.length;v++){var w=o[v];if(c<=w){a=i[v];break}if(c>=w&&v===o.length-1){a=i[v];break}if(c>w&&c<o[v+1]){c=(c-w)/(o[v+1]-w),a=p.interpolate(i[v],i[v+1],c,r);break}}else"function"===rt(i)&&(a=i(c));b&&(h[d]=a)}return a},k=function(){return h={}};v(e);var x=function(e){var r=p(w(e));return c&&r[c]?r[c]():r};return x.classes=function(e){if(null!=e){if("array"===rt(e))u=e,a=[e[0],e[e.length-1]];else{var r=p.analyze(a);u=0===e?[r.min,r.max]:p.limits(r,"e",e)}return x}return u},x.domain=function(e){if(!arguments.length)return a;l=e[0],s=e[e.length-1],o=[];var r=i.length;if(e.length===r&&l!==s)for(var t=0,n=Array.from(e);t<n.length;t+=1){var f=n[t];o.push((f-l)/(s-l))}else{for(var u=0;u<r;u++)o.push(u/(r-1));if(e.length>2){var c=e.map((function(r,t){return t/(e.length-1)})),d=e.map((function(e){return(e-l)/(s-l)}));d.every((function(e,r){return c[r]===e}))||(m=function(e){if(e<=0||e>=1)return e;for(var r=0;e>=d[r+1];)r++;var t=(e-d[r])/(d[r+1]-d[r]);return c[r]+t*(c[r+1]-c[r])})}}return a=[l,s],x},x.mode=function(e){return arguments.length?(r=e,k(),x):r},x.range=function(e,r){return v(e),x},x.out=function(e){return c=e,x},x.spread=function(e){return arguments.length?(n=e,x):n},x.correctLightness=function(e){return null==e&&(e=!0),d=e,k(),y=d?function(e){for(var r=w(0,!0).lab()[0],t=w(1,!0).lab()[0],n=r>t,a=w(e,!0).lab()[0],o=r+(t-r)*e,f=a-o,u=0,i=1,c=20;Math.abs(f)>.01&&c-- >0;)n&&(f*=-1),f<0?(u=e,e+=.5*(i-e)):(i=e,e+=.5*(u-e)),a=w(e,!0).lab()[0],f=a-o;return e}:function(e){return e},x},x.padding=function(e){return null!=e?("number"===rt(e)&&(e=[e,e]),f=e,x):f},x.colors=function(r,t){arguments.length<2&&(t="hex");var n=[];if(0===arguments.length)n=i.slice(0);else if(1===r)n=[x(.5)];else if(r>1){var o=a[0],f=a[1]-o;n=at(0,r,!1).map((function(e){return x(o+e/(r-1)*f)}))}else{e=[];var c=[];if(u&&u.length>2)for(var l=1,s=u.length,d=1<=s;d?l<s:l>s;d?l++:l--)c.push(.5*(u[l-1]+u[l]));else c=a;n=c.map((function(e){return x(e)}))}return p[t]&&(n=n.map((function(e){return e[t]()}))),n},x.cache=function(e){return null!=e?(b=e,x):b},x.gamma=function(e){return null!=e?(g=e,x):g},x.nodata=function(e){return null!=e?(t=p(e),x):t},x};function at(e,r,t){for(var n=[],a=e<r,o=t?a?r+1:r-1:r,f=e;a?f<o:f>o;a?f++:f--)n.push(f);return n}var ot=function(e){var r,t,n,a,o,f,u;if(2===(e=e.map((function(e){return new h(e)}))).length)r=e.map((function(e){return e.lab()})),o=r[0],f=r[1],a=function(e){var r=[0,1,2].map((function(r){return o[r]+e*(f[r]-o[r])}));return new h(r,"lab")};else if(3===e.length)t=e.map((function(e){return e.lab()})),o=t[0],f=t[1],u=t[2],a=function(e){var r=[0,1,2].map((function(r){return(1-e)*(1-e)*o[r]+2*(1-e)*e*f[r]+e*e*u[r]}));return new h(r,"lab")};else if(4===e.length){var i;n=e.map((function(e){return e.lab()})),o=n[0],f=n[1],u=n[2],i=n[3],a=function(e){var r=[0,1,2].map((function(r){return(1-e)*(1-e)*(1-e)*o[r]+3*(1-e)*(1-e)*e*f[r]+3*(1-e)*e*e*u[r]+e*e*e*i[r]}));return new h(r,"lab")}}else if(5===e.length){var c=ot(e.slice(0,3)),l=ot(e.slice(2,5));a=function(e){return e<.5?c(2*e):l(2*(e-.5))}}return a},ft=function(e,r,t){if(!ft[t])throw new Error("unknown blend mode "+t);return ft[t](e,r)},ut=function(e){return function(r,t){var n=p(t).rgb(),a=p(r).rgb();return p.rgb(e(n,a))}},it=function(e){return function(r,t){var n=[];return n[0]=e(r[0],t[0]),n[1]=e(r[1],t[1]),n[2]=e(r[2],t[2]),n}};ft.normal=ut(it((function(e){return e}))),ft.multiply=ut(it((function(e,r){return e*r/255}))),ft.screen=ut(it((function(e,r){return 255*(1-(1-e/255)*(1-r/255))}))),ft.overlay=ut(it((function(e,r){return r<128?2*e*r/255:255*(1-2*(1-e/255)*(1-r/255))}))),ft.darken=ut(it((function(e,r){return e>r?r:e}))),ft.lighten=ut(it((function(e,r){return e>r?e:r}))),ft.dodge=ut(it((function(e,r){return 255===e||(e=r/255*255/(1-e/255))>255?255:e}))),ft.burn=ut(it((function(e,r){return 255*(1-(1-r/255)/(e/255))})));for(var ct=ft,lt=u.type,st=u.clip_rgb,dt=u.TWOPI,ht=Math.pow,bt=Math.sin,pt=Math.cos,gt=Math.floor,vt=Math.random,yt=Math.log,mt=Math.pow,wt=Math.floor,kt=Math.abs,xt=function(e,r){void 0===r&&(r=null);var t={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===o(e)&&(e=Object.values(e)),e.forEach((function(e){r&&"object"===o(e)&&(e=e[r]),null==e||isNaN(e)||(t.values.push(e),t.sum+=e,e<t.min&&(t.min=e),e>t.max&&(t.max=e),t.count+=1)})),t.domain=[t.min,t.max],t.limits=function(e,r){return Mt(t,e,r)},t},Mt=function(e,r,t){void 0===r&&(r="equal"),void 0===t&&(t=7),"array"==o(e)&&(e=xt(e));var n=e.min,a=e.max,f=e.values.sort((function(e,r){return e-r}));if(1===t)return[n,a];var u=[];if("c"===r.substr(0,1)&&(u.push(n),u.push(a)),"e"===r.substr(0,1)){u.push(n);for(var i=1;i<t;i++)u.push(n+i/t*(a-n));u.push(a)}else if("l"===r.substr(0,1)){if(n<=0)throw new Error("Logarithmic scales are only possible for values > 0");var c=Math.LOG10E*yt(n),l=Math.LOG10E*yt(a);u.push(n);for(var s=1;s<t;s++)u.push(mt(10,c+s/t*(l-c)));u.push(a)}else if("q"===r.substr(0,1)){u.push(n);for(var d=1;d<t;d++){var h=(f.length-1)*d/t,b=wt(h);if(b===h)u.push(f[b]);else{var p=h-b;u.push(f[b]*(1-p)+f[b+1]*p)}}u.push(a)}else if("k"===r.substr(0,1)){var g,v=f.length,y=new Array(v),m=new Array(t),w=!0,k=0,x=null;(x=[]).push(n);for(var M=1;M<t;M++)x.push(n+M/t*(a-n));for(x.push(a);w;){for(var _=0;_<t;_++)m[_]=0;for(var N=0;N<v;N++)for(var $=f[N],E=Number.MAX_VALUE,A=void 0,F=0;F<t;F++){var P=kt(x[F]-$);P<E&&(E=P,A=F),m[A]++,y[N]=A}for(var O=new Array(t),C=0;C<t;C++)O[C]=null;for(var j=0;j<v;j++)null===O[g=y[j]]?O[g]=f[j]:O[g]+=f[j];for(var L=0;L<t;L++)O[L]*=1/m[L];w=!1;for(var q=0;q<t;q++)if(O[q]!==x[q]){w=!0;break}x=O,++k>200&&(w=!1)}for(var B={},G=0;G<t;G++)B[G]=[];for(var R=0;R<v;R++)B[g=y[R]].push(f[R]);for(var I=[],D=0;D<t;D++)I.push(B[D][0]),I.push(B[D][B[D].length-1]);I=I.sort((function(e,r){return e-r})),u.push(I[0]);for(var S=1;S<I.length;S+=2){var Y=I[S];isNaN(Y)||-1!==u.indexOf(Y)||u.push(Y)}}return u},_t={analyze:xt,limits:Mt},Nt=Math.sqrt,$t=Math.atan2,Et=Math.abs,At=Math.cos,Ft=Math.PI,Pt={cool:function(){return nt([p.hsl(180,1,.9),p.hsl(250,.7,.4)])},hot:function(){return nt(["#000","#f00","#ff0","#fff"]).mode("rgb")}},Ot={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Ct=0,jt=Object.keys(Ot);Ct<jt.length;Ct+=1){var Lt=jt[Ct];Ot[Lt.toLowerCase()]=Ot[Lt]}var qt=Ot;return p.average=function(e,r,t){void 0===r&&(r="lrgb"),void 0===t&&(t=null);var n=e.length;t||(t=Array.from(new Array(n)).map((function(){return 1})));var a=n/t.reduce((function(e,r){return e+r}));if(t.forEach((function(e,r){t[r]*=a})),e=e.map((function(e){return new h(e)})),"lrgb"===r)return et(e,t);for(var o=e.shift(),f=o.get(r),u=[],i=0,c=0,l=0;l<f.length;l++)if(f[l]=(f[l]||0)*t[0],u.push(isNaN(f[l])?0:t[0]),"h"===r.charAt(l)&&!isNaN(f[l])){var s=f[l]/180*Jr;i+=Kr(s)*t[0],c+=Qr(s)*t[0]}var d=o.alpha()*t[0];e.forEach((function(e,n){var a=e.get(r);d+=e.alpha()*t[n+1];for(var o=0;o<f.length;o++)if(!isNaN(a[o]))if(u[o]+=t[n+1],"h"===r.charAt(o)){var l=a[o]/180*Jr;i+=Kr(l)*t[n+1],c+=Qr(l)*t[n+1]}else f[o]+=a[o]*t[n+1]}));for(var b=0;b<f.length;b++)if("h"===r.charAt(b)){for(var p=Zr(c/u[b],i/u[b])/Jr*180;p<0;)p+=360;for(;p>=360;)p-=360;f[b]=p}else f[b]=f[b]/u[b];return d/=n,new h(f,r).alpha(d>.99999?1:d,!0)},p.bezier=function(e){var r=ot(e);return r.scale=function(){return nt(r)},r},p.blend=ct,p.cubehelix=function(e,r,t,n,a){void 0===e&&(e=300),void 0===r&&(r=-1.5),void 0===t&&(t=1),void 0===n&&(n=1),void 0===a&&(a=[0,1]);var o,f=0;"array"===lt(a)?o=a[1]-a[0]:(o=0,a=[a,a]);var u=function(u){var i=dt*((e+120)/360+r*u),c=ht(a[0]+o*u,n),l=(0!==f?t[0]+u*f:t)*c*(1-c)/2,s=pt(i),d=bt(i);return p(st([255*(c+l*(-.14861*s+1.78277*d)),255*(c+l*(-.29227*s-.90649*d)),255*(c+l*(1.97294*s)),1]))};return u.start=function(r){return null==r?e:(e=r,u)},u.rotations=function(e){return null==e?r:(r=e,u)},u.gamma=function(e){return null==e?n:(n=e,u)},u.hue=function(e){return null==e?t:("array"===lt(t=e)?0==(f=t[1]-t[0])&&(t=t[1]):f=0,u)},u.lightness=function(e){return null==e?a:("array"===lt(e)?(a=e,o=e[1]-e[0]):(a=[e,e],o=0),u)},u.scale=function(){return p.scale(u)},u.hue(t),u},p.mix=p.interpolate=Sr,p.random=function(){for(var e="#",r=0;r<6;r++)e+="0123456789abcdef".charAt(gt(16*vt()));return new h(e,"hex")},p.scale=nt,p.analyze=_t.analyze,p.contrast=function(e,r){e=new h(e),r=new h(r);var t=e.luminance(),n=r.luminance();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},p.deltaE=function(e,r,t,n){void 0===t&&(t=1),void 0===n&&(n=1),e=new h(e),r=new h(r);for(var a=Array.from(e.lab()),o=a[0],f=a[1],u=a[2],i=Array.from(r.lab()),c=i[0],l=i[1],s=i[2],d=Nt(f*f+u*u),b=Nt(l*l+s*s),p=o<16?.511:.040975*o/(1+.01765*o),g=.0638*d/(1+.0131*d)+.638,v=d<1e-6?0:180*$t(u,f)/Ft;v<0;)v+=360;for(;v>=360;)v-=360;var y=v>=164&&v<=345?.56+Et(.2*At(Ft*(v+168)/180)):.36+Et(.4*At(Ft*(v+35)/180)),m=d*d*d*d,w=Nt(m/(m+1900)),k=g*(w*y+1-w),x=d-b,M=f-l,_=u-s,N=(o-c)/(t*p),$=x/(n*g);return Nt(N*N+$*$+(M*M+_*_-x*x)/(k*k))},p.distance=function(e,r,t){void 0===t&&(t="lab"),e=new h(e),r=new h(r);var n=e.get(t),a=r.get(t),o=0;for(var f in n){var u=(n[f]||0)-(a[f]||0);o+=u*u}return Math.sqrt(o)},p.limits=_t.limits,p.valid=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];try{return new(Function.prototype.bind.apply(h,[null].concat(e))),!0}catch(e){return!1}},p.scales=Pt,p.colors=mr,p.brewer=qt,p}()}));const{valid:j}=C,L=e=>{const r=C(e);return{rgb:{r:r.get("rgb.r"),g:r.get("rgb.g"),b:r.get("rgb.b")},hsv:{h:r.get("hsv.h"),s:r.get("hsv.s"),v:r.get("hsv.v")}}};function q(r){let t,a,o,p,g,v,y,m,w,k,x,M;return{c(){t=c("div"),a=c("div"),o=c("div"),p=c("div"),g=l(),v=c("div"),y=l(),m=c("label"),w=c("span"),w.textContent="Hue",k=l(),x=c("input"),d(p,"data-picker","handle"),b(p,"--top",r[0].handle.y+"%"),b(p,"--left",r[0].handle.y+"%"),d(p,"class","svelte-1rsulyd"),d(v,"data-picker","colorBox"),d(v,"class","svelte-1rsulyd"),d(o,"data-picker","value"),d(o,"class","svelte-1rsulyd"),d(a,"data-picker","saturation"),d(a,"class","svelte-1rsulyd"),d(t,"role","presentation"),b(t,"--width",r[0].width+"px"),b(t,"--height",r[0].height+"px"),b(t,"--color-red",r[0].bg.r),b(t,"--color-green",r[0].bg.g),b(t,"--color-blue",r[0].bg.b),d(t,"class","svelte-1rsulyd"),d(w,"class","svelte-1rsulyd"),d(x,"type","range"),d(x,"min","0"),d(x,"max","360"),d(x,"class","svelte-1rsulyd"),b(m,"--width",r[0].width+"px"),b(m,"--height",r[0].height+"px"),d(m,"class","svelte-1rsulyd")},m(e,i,c){u(e,t,i),f(t,a),f(a,o),f(o,p),r[18](p),f(o,g),f(o,v),r[19](v),u(e,y,i),u(e,m,i),f(m,w),f(m,k),f(m,x),h(x,r[1]),c&&n(M),M=[s(v,"mousedown",r[5]),s(v,"touchstart",r[5]),s(v,"mousemove",r[6]),s(v,"touchmove",r[7]),s(v,"mouseup",r[4]),s(v,"touchend",r[4],{passive:!0}),s(x,"change",r[20]),s(x,"input",r[20])]},p(e,[r]){1&r&&b(p,"--top",e[0].handle.y+"%"),1&r&&b(p,"--left",e[0].handle.y+"%"),1&r&&b(t,"--width",e[0].width+"px"),1&r&&b(t,"--height",e[0].height+"px"),1&r&&b(t,"--color-red",e[0].bg.r),1&r&&b(t,"--color-green",e[0].bg.g),1&r&&b(t,"--color-blue",e[0].bg.b),2&r&&h(x,e[1]),1&r&&b(m,"--width",e[0].width+"px"),1&r&&b(m,"--height",e[0].height+"px")},i:e,o:e,d(e){e&&i(t),r[18](null),r[19](null),e&&i(y),e&&i(m),n(M)}}}function B(e,r,t){let{color:n="#fff"}=r,{width:a=240}=r,{height:o=160}=r;const f=v(),u={width:a,height:o,handle:{x:0,y:0},bg:{}};let i,c,l=180,s=!1;const d=(e,r)=>{t(8,n=((e,r,t)=>C(e).set(r,t).hex())(n,e,r))},h=e=>{const r=((e,r,t)=>C.hsv(e,r,t).rgb())(e,1,1);d("hsv.h",e),t(0,u.bg={r:r[0],g:r[1],b:r[2]},u)},b=(e,r)=>{t(2,i.style.top=`${r}%`,i),t(2,i.style.left=`${e}%`,i),t(8,n=((e,r,t)=>C.hsv(e,r,t).hex())(l,e/100,1-r/100))},p=(e,r=0,t=100)=>{let n=e;return e>t&&(n=t),e<r&&(n=r),n=n.toFixed(2),n},g=(e,r)=>{const{x:t,y:n}=c.getBoundingClientRect();let a=(e-t)/u.width*100,o=(r-n)/u.height*100;o=p(o),a=p(a),b(a,o)};return e.$set=e=>{"color"in e&&t(8,n=e.color),"width"in e&&t(9,a=e.width),"height"in e&&t(10,o=e.height)},e.$$.update=()=>{if(256&e.$$.dirty&&j(n)){const{hsv:e}=L(n);isNaN(e.h)||t(1,l=e.h),t(0,u.handle.x=100*e.s,u),t(0,u.handle.y=100*(1-e.v),u)}2&e.$$.dirty&&h(l),256&e.$$.dirty&&j(n)&&f("update",{hex:n,...L(n)})},[u,l,i,c,()=>{s=!1},e=>{s=!0;const r=((e.offsetX+1)/u.width*100).toFixed(2),t=((e.offsetY+1)/u.height*100).toFixed(2);b(r,t)},e=>{s&&g(e.clientX,e.clientY)},e=>{s&&g(e.touches[0].clientX,e.touches[0].clientY)},n,a,o,s,f,d,h,b,p,g,function(e){m[e?"unshift":"push"](()=>{t(2,i=e)})},function(e){m[e?"unshift":"push"](()=>{t(3,c=e)})},function(){var e;e=this.value,l=""===e?void 0:+e,t(1,l),t(8,n)}]}return class extends class{$destroy(){!function(e,r){const t=e.$$;null!==t.fragment&&(n(t.on_destroy),t.fragment&&t.fragment.d(r),t.on_destroy=t.fragment=null,t.ctx=[])}(this,1),this.$destroy=e}$on(e,r){const t=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return t.push(r),()=>{const e=t.indexOf(r);-1!==e&&t.splice(e,1)}}$set(){}}{constructor(e){var r;super(),document.getElementById("svelte-1rsulyd-style")||((r=c("style")).id="svelte-1rsulyd-style",r.textContent="[role='presentation'].svelte-1rsulyd.svelte-1rsulyd{background:rgb(var(--color-red), var(--color-green), var(--color-blue));box-shadow:rgba(0, 0, 0, 0.06) 0 0 0 1px;height:var(--height);width:var(--width)}[data-picker='saturation'].svelte-1rsulyd.svelte-1rsulyd{background:linear-gradient(\n to right,\n rgb(255, 255, 255),\n rgba(255, 255, 255, 0)\n );height:var(--height);width:var(--width)}[data-picker='value'].svelte-1rsulyd.svelte-1rsulyd{background:linear-gradient(to top, rgb(0, 0, 0), rgba(0, 0, 0, 0));height:var(--height);overflow:hidden;width:var(--width)}[data-picker='handle'].svelte-1rsulyd.svelte-1rsulyd{background:transparent;border-radius:50%;border:2px solid #f2f2f2;box-shadow:0 0.3px 1.4px rgba(0, 0, 0, 0.6),\n 0 0.9px 4.7px rgba(0, 0, 0, 0.032), 0 4px 21px rgba(0, 0, 0, 0.04);cursor:crosshair;height:8px;left:100%;margin:0;padding:0;position:relative;transform:translate(-9px, -9px);width:8px;top:var(--top, 50%);left:var(--left, 50%)}[data-picker='colorBox'].svelte-1rsulyd.svelte-1rsulyd{box-shadow:0 0 1px rgba(0, 0, 0, 0.32) inset;cursor:crosshair;display:block;height:100%;position:relative;transform:translate(0, -16px);touch-action:none;width:100%}label.svelte-1rsulyd.svelte-1rsulyd{display:block;margin:0.8em 0;max-width:calc(var(--width) - 4px);width:calc(var(--width) - 4px)}label.svelte-1rsulyd span.svelte-1rsulyd{border:0;clip:rect(0, 0, 0, 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}input.svelte-1rsulyd.svelte-1rsulyd{-webkit-appearance:no