mirror of
https://github.com/Karaka-Management/Resources.git
synced 2026-01-10 21:08:41 +00:00
59 lines
50 KiB
JavaScript
59 lines
50 KiB
JavaScript
!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("chart.js"),require("chart.js/helpers")):"function"==typeof define&&define.amd?define(["exports","chart.js","chart.js/helpers"],t):t((r="undefined"!=typeof globalThis?globalThis:r||self).ChartFunnel={},r.Chart,r.Chart.helpers)}(this,(function(r,t,e){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function n(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var a={exports:{}};
|
|
/**
|
|
* 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
|
|
*/!function(r,t){r.exports=function(){for(var r=function(r,t,e){return void 0===t&&(t=0),void 0===e&&(e=1),r<t?t:r>e?e:r},t=r,e=function(r){r._clipped=!1,r._unclipped=r.slice(0);for(var e=0;e<=3;e++)e<3?((r[e]<0||r[e]>255)&&(r._clipped=!0),r[e]=t(r[e],0,255)):3===e&&(r[e]=t(r[e],0,1));return r},n={},a=0,o=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];a<o.length;a+=1){var f=o[a];n["[object "+f+"]"]=f.toLowerCase()}var u=function(r){return n[Object.prototype.toString.call(r)]||"object"},i=u,c=function(r,t){return void 0===t&&(t=null),r.length>=3?Array.prototype.slice.call(r):"object"==i(r[0])&&t?t.split("").filter((function(t){return void 0!==r[0][t]})).map((function(t){return r[0][t]})):r[0]},l=u,s=function(r){if(r.length<2)return null;var t=r.length-1;return"string"==l(r[t])?r[t].toLowerCase():null},h=Math.PI,d={clip_rgb:e,limit:r,type:u,unpack:c,last:s,PI:h,TWOPI:2*h,PITHIRD:h/3,DEG2RAD:h/180,RAD2DEG:180/h},b={format:{},autodetect:[]},p=d.last,g=d.clip_rgb,v=d.type,m=b,y=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=this;if("object"===v(r[0])&&r[0].constructor&&r[0].constructor===this.constructor)return r[0];var n=p(r),a=!1;if(!n){a=!0,m.sorted||(m.autodetect=m.autodetect.sort((function(r,t){return t.p-r.p})),m.sorted=!0);for(var o=0,f=m.autodetect;o<f.length;o+=1){var u=f[o];if(n=u.test.apply(u,r))break}}if(!m.format[n])throw new Error("unknown format: "+r);var i=m.format[n].apply(null,a?r:r.slice(0,-1));e._rgb=g(i),3===e._rgb.length&&e._rgb.push(1)};y.prototype.toString=function(){return"function"==v(this.hex)?this.hex():"["+this._rgb.join(",")+"]"};var k=y,w=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return new(Function.prototype.bind.apply(w.Color,[null].concat(r)))};w.Color=k,w.version="2.4.2";var M=w,x=d.unpack,_=Math.max,N=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=x(r,"rgb"),n=e[0],a=e[1],o=e[2],f=1-_(n/=255,_(a/=255,o/=255)),u=f<1?1/(1-f):0;return[(1-n-f)*u,(1-a-f)*u,(1-o-f)*u,f]},A=N,C=d.unpack,E=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=(r=C(r,"cmyk"))[0],n=r[1],a=r[2],o=r[3],f=r.length>4?r[4]:1;return 1===o?[0,0,0,f]:[e>=1?0:255*(1-e)*(1-o),n>=1?0:255*(1-n)*(1-o),a>=1?0:255*(1-a)*(1-o),f]},P=E,F=M,B=k,R=b,j=d.unpack,O=d.type,z=A;B.prototype.cmyk=function(){return z(this._rgb)},F.cmyk=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return new(Function.prototype.bind.apply(B,[null].concat(r,["cmyk"])))},R.format.cmyk=P,R.autodetect.push({p:2,test:function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];if(r=j(r,"cmyk"),"array"===O(r)&&4===r.length)return"cmyk"}});var q=d.unpack,I=d.last,L=function(r){return Math.round(100*r)/100},G=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=q(r,"hsla"),n=I(r)||"lsa";return e[0]=L(e[0]||0),e[1]=L(100*e[1])+"%",e[2]=L(100*e[2])+"%","hsla"===n||e.length>3&&e[3]<1?(e[3]=e.length>3?e[3]:1,n="hsla"):e.length=3,n+"("+e.join(",")+")"},S=G,T=d.unpack,D=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=(r=T(r,"rgba"))[0],n=r[1],a=r[2];e/=255,n/=255,a/=255;var o,f,u=Math.min(e,n,a),i=Math.max(e,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),e==i?f=(n-a)/(i-u):n==i?f=2+(a-e)/(i-u):a==i&&(f=4+(e-n)/(i-u)),(f*=60)<0&&(f+=360),r.length>3&&void 0!==r[3]?[f,o,c,r[3]]:[f,o,c]},Y=D,$=d.unpack,W=d.last,X=S,U=Y,V=Math.round,Z=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=$(r,"rgba"),n=W(r)||"rgb";return"hsl"==n.substr(0,3)?X(U(e),n):(e[0]=V(e[0]),e[1]=V(e[1]),e[2]=V(e[2]),("rgba"===n||e.length>3&&e[3]<1)&&(e[3]=e.length>3?e[3]:1,n="rgba"),n+"("+e.slice(0,"rgb"===n?3:4).join(",")+")")},K=Z,H=d.unpack,J=Math.round,Q=function(){for(var r,t=[],e=arguments.length;e--;)t[e]=arguments[e];var n,a,o,f=(t=H(t,"hsl"))[0],u=t[1],i=t[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,h=2*i-s,d=f/360;c[0]=d+1/3,c[1]=d,c[2]=d-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]=h+6*(s-h)*c[b]:2*c[b]<1?l[b]=s:3*c[b]<2?l[b]=h+(s-h)*(2/3-c[b])*6:l[b]=h;n=(r=[J(255*l[0]),J(255*l[1]),J(255*l[2])])[0],a=r[1],o=r[2]}return t.length>3?[n,a,o,t[3]]:[n,a,o,1]},rr=Q,tr=rr,er=b,nr=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,ar=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,or=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,fr=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,ur=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,ir=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,cr=Math.round,lr=function(r){var t;if(r=r.toLowerCase().trim(),er.format.named)try{return er.format.named(r)}catch(r){}if(t=r.match(nr)){for(var e=t.slice(1,4),n=0;n<3;n++)e[n]=+e[n];return e[3]=1,e}if(t=r.match(ar)){for(var a=t.slice(1,5),o=0;o<4;o++)a[o]=+a[o];return a}if(t=r.match(or)){for(var f=t.slice(1,4),u=0;u<3;u++)f[u]=cr(2.55*f[u]);return f[3]=1,f}if(t=r.match(fr)){for(var i=t.slice(1,5),c=0;c<3;c++)i[c]=cr(2.55*i[c]);return i[3]=+i[3],i}if(t=r.match(ur)){var l=t.slice(1,4);l[1]*=.01,l[2]*=.01;var s=tr(l);return s[3]=1,s}if(t=r.match(ir)){var h=t.slice(1,4);h[1]*=.01,h[2]*=.01;var d=tr(h);return d[3]=+t[4],d}};lr.test=function(r){return nr.test(r)||ar.test(r)||or.test(r)||fr.test(r)||ur.test(r)||ir.test(r)};var sr=lr,hr=M,dr=k,br=b,pr=d.type,gr=K,vr=sr;dr.prototype.css=function(r){return gr(this._rgb,r)},hr.css=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return new(Function.prototype.bind.apply(dr,[null].concat(r,["css"])))},br.format.css=vr,br.autodetect.push({p:5,test:function(r){for(var t=[],e=arguments.length-1;e-- >0;)t[e]=arguments[e+1];if(!t.length&&"string"===pr(r)&&vr.test(r))return"css"}});var mr=k,yr=M,kr=b,wr=d.unpack;kr.format.gl=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=wr(r,"rgba");return e[0]*=255,e[1]*=255,e[2]*=255,e},yr.gl=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return new(Function.prototype.bind.apply(mr,[null].concat(r,["gl"])))},mr.prototype.gl=function(){var r=this._rgb;return[r[0]/255,r[1]/255,r[2]/255,r[3]]};var Mr=d.unpack,xr=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e,n=Mr(r,"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?e=Number.NaN:(a===i&&(e=(o-f)/c),o===i&&(e=2+(f-a)/c),f===i&&(e=4+(a-o)/c),(e*=60)<0&&(e+=360)),[e,l,s]},_r=xr,Nr=d.unpack,Ar=Math.floor,Cr=function(){for(var r,t,e,n,a,o,f=[],u=arguments.length;u--;)f[u]=arguments[u];var i,c,l,s=(f=Nr(f,"hcg"))[0],h=f[1],d=f[2];d*=255;var b=255*h;if(0===h)i=c=l=d;else{360===s&&(s=0),s>360&&(s-=360),s<0&&(s+=360);var p=Ar(s/=60),g=s-p,v=d*(1-h),m=v+b*(1-g),y=v+b*g,k=v+b;switch(p){case 0:i=(r=[k,y,v])[0],c=r[1],l=r[2];break;case 1:i=(t=[m,k,v])[0],c=t[1],l=t[2];break;case 2:i=(e=[v,k,y])[0],c=e[1],l=e[2];break;case 3:i=(n=[v,m,k])[0],c=n[1],l=n[2];break;case 4:i=(a=[y,v,k])[0],c=a[1],l=a[2];break;case 5:i=(o=[k,v,m])[0],c=o[1],l=o[2]}}return[i,c,l,f.length>3?f[3]:1]},Er=Cr,Pr=d.unpack,Fr=d.type,Br=M,Rr=k,jr=b,Or=_r;Rr.prototype.hcg=function(){return Or(this._rgb)},Br.hcg=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return new(Function.prototype.bind.apply(Rr,[null].concat(r,["hcg"])))},jr.format.hcg=Er,jr.autodetect.push({p:1,test:function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];if(r=Pr(r,"hcg"),"array"===Fr(r)&&3===r.length)return"hcg"}});var zr=d.unpack,qr=d.last,Ir=Math.round,Lr=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=zr(r,"rgba"),n=e[0],a=e[1],o=e[2],f=e[3],u=qr(r)||"auto";void 0===f&&(f=1),"auto"===u&&(u=f<1?"rgba":"rgb");var i="000000"+((n=Ir(n))<<16|(a=Ir(a))<<8|(o=Ir(o))).toString(16);i=i.substr(i.length-6);var c="0"+Ir(255*f).toString(16);switch(c=c.substr(c.length-2),u.toLowerCase()){case"rgba":return"#"+i+c;case"argb":return"#"+c+i;default:return"#"+i}},Gr=Lr,Sr=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Tr=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,Dr=function(r){if(r.match(Sr)){4!==r.length&&7!==r.length||(r=r.substr(1)),3===r.length&&(r=(r=r.split(""))[0]+r[0]+r[1]+r[1]+r[2]+r[2]);var t=parseInt(r,16);return[t>>16,t>>8&255,255&t,1]}if(r.match(Tr)){5!==r.length&&9!==r.length||(r=r.substr(1)),4===r.length&&(r=(r=r.split(""))[0]+r[0]+r[1]+r[1]+r[2]+r[2]+r[3]+r[3]);var e=parseInt(r,16);return[e>>24&255,e>>16&255,e>>8&255,Math.round((255&e)/255*100)/100]}throw new Error("unknown hex color: "+r)},Yr=M,$r=k,Wr=d.type,Xr=b,Ur=Gr;$r.prototype.hex=function(r){return Ur(this._rgb,r)},Yr.hex=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return new(Function.prototype.bind.apply($r,[null].concat(r,["hex"])))},Xr.format.hex=Dr,Xr.autodetect.push({p:4,test:function(r){for(var t=[],e=arguments.length-1;e-- >0;)t[e]=arguments[e+1];if(!t.length&&"string"===Wr(r)&&[3,4,5,6,7,8,9].indexOf(r.length)>=0)return"hex"}});var Vr=d.unpack,Zr=d.TWOPI,Kr=Math.min,Hr=Math.sqrt,Jr=Math.acos,Qr=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e,n=Vr(r,"rgb"),a=n[0],o=n[1],f=n[2],u=Kr(a/=255,o/=255,f/=255),i=(a+o+f)/3,c=i>0?1-u/i:0;return 0===c?e=NaN:(e=(a-o+(a-f))/2,e/=Hr((a-o)*(a-o)+(a-f)*(o-f)),e=Jr(e),f>o&&(e=Zr-e),e/=Zr),[360*e,c,i]},rt=Qr,tt=d.unpack,et=d.limit,nt=d.TWOPI,at=d.PITHIRD,ot=Math.cos,ft=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e,n,a,o=(r=tt(r,"hsi"))[0],f=r[1],u=r[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)+(e=(1+f*ot(nt*o)/ot(at-nt*o))/3)):o<2/3?a=1-((e=(1-f)/3)+(n=(1+f*ot(nt*(o-=1/3))/ot(at-nt*o))/3)):e=1-((n=(1-f)/3)+(a=(1+f*ot(nt*(o-=2/3))/ot(at-nt*o))/3)),[255*(e=et(u*e*3)),255*(n=et(u*n*3)),255*(a=et(u*a*3)),r.length>3?r[3]:1]},ut=ft,it=d.unpack,ct=d.type,lt=M,st=k,ht=b,dt=rt;st.prototype.hsi=function(){return dt(this._rgb)},lt.hsi=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return new(Function.prototype.bind.apply(st,[null].concat(r,["hsi"])))},ht.format.hsi=ut,ht.autodetect.push({p:2,test:function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];if(r=it(r,"hsi"),"array"===ct(r)&&3===r.length)return"hsi"}});var bt=d.unpack,pt=d.type,gt=M,vt=k,mt=b,yt=Y;vt.prototype.hsl=function(){return yt(this._rgb)},gt.hsl=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return new(Function.prototype.bind.apply(vt,[null].concat(r,["hsl"])))},mt.format.hsl=rr,mt.autodetect.push({p:2,test:function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];if(r=bt(r,"hsl"),"array"===pt(r)&&3===r.length)return"hsl"}});var kt=d.unpack,wt=Math.min,Mt=Math.max,xt=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e,n,a,o=(r=kt(r,"rgb"))[0],f=r[1],u=r[2],i=wt(o,f,u),c=Mt(o,f,u),l=c-i;return a=c/255,0===c?(e=Number.NaN,n=0):(n=l/c,o===c&&(e=(f-u)/l),f===c&&(e=2+(u-o)/l),u===c&&(e=4+(o-f)/l),(e*=60)<0&&(e+=360)),[e,n,a]},_t=xt,Nt=d.unpack,At=Math.floor,Ct=function(){for(var r,t,e,n,a,o,f=[],u=arguments.length;u--;)f[u]=arguments[u];var i,c,l,s=(f=Nt(f,"hsv"))[0],h=f[1],d=f[2];if(d*=255,0===h)i=c=l=d;else{360===s&&(s=0),s>360&&(s-=360),s<0&&(s+=360);var b=At(s/=60),p=s-b,g=d*(1-h),v=d*(1-h*p),m=d*(1-h*(1-p));switch(b){case 0:i=(r=[d,m,g])[0],c=r[1],l=r[2];break;case 1:i=(t=[v,d,g])[0],c=t[1],l=t[2];break;case 2:i=(e=[g,d,m])[0],c=e[1],l=e[2];break;case 3:i=(n=[g,v,d])[0],c=n[1],l=n[2];break;case 4:i=(a=[m,g,d])[0],c=a[1],l=a[2];break;case 5:i=(o=[d,g,v])[0],c=o[1],l=o[2]}}return[i,c,l,f.length>3?f[3]:1]},Et=Ct,Pt=d.unpack,Ft=d.type,Bt=M,Rt=k,jt=b,Ot=_t;Rt.prototype.hsv=function(){return Ot(this._rgb)},Bt.hsv=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return new(Function.prototype.bind.apply(Rt,[null].concat(r,["hsv"])))},jt.format.hsv=Et,jt.autodetect.push({p:2,test:function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];if(r=Pt(r,"hsv"),"array"===Ft(r)&&3===r.length)return"hsv"}});var zt={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},qt=zt,It=d.unpack,Lt=Math.pow,Gt=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=It(r,"rgb"),n=e[0],a=e[1],o=e[2],f=Dt(n,a,o),u=f[0],i=f[1],c=116*i-16;return[c<0?0:c,500*(u-i),200*(i-f[2])]},St=function(r){return(r/=255)<=.04045?r/12.92:Lt((r+.055)/1.055,2.4)},Tt=function(r){return r>qt.t3?Lt(r,1/3):r/qt.t2+qt.t0},Dt=function(r,t,e){return r=St(r),t=St(t),e=St(e),[Tt((.4124564*r+.3575761*t+.1804375*e)/qt.Xn),Tt((.2126729*r+.7151522*t+.072175*e)/qt.Yn),Tt((.0193339*r+.119192*t+.9503041*e)/qt.Zn)]},Yt=Gt,$t=zt,Wt=d.unpack,Xt=Math.pow,Ut=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e,n,a,o=(r=Wt(r,"lab"))[0],f=r[1],u=r[2];return n=(o+16)/116,e=isNaN(f)?n:n+f/500,a=isNaN(u)?n:n-u/200,n=$t.Yn*Zt(n),e=$t.Xn*Zt(e),a=$t.Zn*Zt(a),[Vt(3.2404542*e-1.5371385*n-.4985314*a),Vt(-.969266*e+1.8760108*n+.041556*a),Vt(.0556434*e-.2040259*n+1.0572252*a),r.length>3?r[3]:1]},Vt=function(r){return 255*(r<=.00304?12.92*r:1.055*Xt(r,1/2.4)-.055)},Zt=function(r){return r>$t.t1?r*r*r:$t.t2*(r-$t.t0)},Kt=Ut,Ht=d.unpack,Jt=d.type,Qt=M,re=k,te=b,ee=Yt;re.prototype.lab=function(){return ee(this._rgb)},Qt.lab=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return new(Function.prototype.bind.apply(re,[null].concat(r,["lab"])))},te.format.lab=Kt,te.autodetect.push({p:2,test:function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];if(r=Ht(r,"lab"),"array"===Jt(r)&&3===r.length)return"lab"}});var ne=d.unpack,ae=d.RAD2DEG,oe=Math.sqrt,fe=Math.atan2,ue=Math.round,ie=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=ne(r,"lab"),n=e[0],a=e[1],o=e[2],f=oe(a*a+o*o),u=(fe(o,a)*ae+360)%360;return 0===ue(1e4*f)&&(u=Number.NaN),[n,f,u]},ce=ie,le=d.unpack,se=Yt,he=ce,de=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=le(r,"rgb"),n=e[0],a=e[1],o=e[2],f=se(n,a,o),u=f[0],i=f[1],c=f[2];return he(u,i,c)},be=de,pe=d.unpack,ge=d.DEG2RAD,ve=Math.sin,me=Math.cos,ye=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=pe(r,"lch"),n=e[0],a=e[1],o=e[2];return isNaN(o)&&(o=0),[n,me(o*=ge)*a,ve(o)*a]},ke=ye,we=d.unpack,Me=ke,xe=Kt,_e=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=(r=we(r,"lch"))[0],n=r[1],a=r[2],o=Me(e,n,a),f=o[0],u=o[1],i=o[2],c=xe(f,u,i);return[c[0],c[1],c[2],r.length>3?r[3]:1]},Ne=_e,Ae=d.unpack,Ce=Ne,Ee=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=Ae(r,"hcl").reverse();return Ce.apply(void 0,e)},Pe=Ee,Fe=d.unpack,Be=d.type,Re=M,je=k,Oe=b,ze=be;je.prototype.lch=function(){return ze(this._rgb)},je.prototype.hcl=function(){return ze(this._rgb).reverse()},Re.lch=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return new(Function.prototype.bind.apply(je,[null].concat(r,["lch"])))},Re.hcl=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return new(Function.prototype.bind.apply(je,[null].concat(r,["hcl"])))},Oe.format.lch=Ne,Oe.format.hcl=Pe,["lch","hcl"].forEach((function(r){return Oe.autodetect.push({p:2,test:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];if(t=Fe(t,r),"array"===Be(t)&&3===t.length)return r}})}));var qe={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"},Ie=k,Le=b,Ge=d.type,Se=qe,Te=Dr,De=Gr;Ie.prototype.name=function(){for(var r=De(this._rgb,"rgb"),t=0,e=Object.keys(Se);t<e.length;t+=1){var n=e[t];if(Se[n]===r)return n.toLowerCase()}return r},Le.format.named=function(r){if(r=r.toLowerCase(),Se[r])return Te(Se[r]);throw new Error("unknown color name: "+r)},Le.autodetect.push({p:5,test:function(r){for(var t=[],e=arguments.length-1;e-- >0;)t[e]=arguments[e+1];if(!t.length&&"string"===Ge(r)&&Se[r.toLowerCase()])return"named"}});var Ye=d.unpack,$e=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=Ye(r,"rgb");return(e[0]<<16)+(e[1]<<8)+e[2]},We=$e,Xe=d.type,Ue=function(r){if("number"==Xe(r)&&r>=0&&r<=16777215)return[r>>16,r>>8&255,255&r,1];throw new Error("unknown num color: "+r)},Ve=M,Ze=k,Ke=b,He=d.type,Je=We;Ze.prototype.num=function(){return Je(this._rgb)},Ve.num=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return new(Function.prototype.bind.apply(Ze,[null].concat(r,["num"])))},Ke.format.num=Ue,Ke.autodetect.push({p:5,test:function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];if(1===r.length&&"number"===He(r[0])&&r[0]>=0&&r[0]<=16777215)return"num"}});var Qe=M,rn=k,tn=b,en=d.unpack,nn=d.type,an=Math.round;rn.prototype.rgb=function(r){return void 0===r&&(r=!0),!1===r?this._rgb.slice(0,3):this._rgb.slice(0,3).map(an)},rn.prototype.rgba=function(r){return void 0===r&&(r=!0),this._rgb.slice(0,4).map((function(t,e){return e<3?!1===r?t:an(t):t}))},Qe.rgb=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return new(Function.prototype.bind.apply(rn,[null].concat(r,["rgb"])))},tn.format.rgb=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=en(r,"rgba");return void 0===e[3]&&(e[3]=1),e},tn.autodetect.push({p:3,test:function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];if(r=en(r,"rgba"),"array"===nn(r)&&(3===r.length||4===r.length&&"number"==nn(r[3])&&r[3]>=0&&r[3]<=1))return"rgb"}});var on=Math.log,fn=function(r){var t,e,n,a=r/100;return a<66?(t=255,e=a<6?0:-155.25485562709179-.44596950469579133*(e=a-2)+104.49216199393888*on(e),n=a<20?0:.8274096064007395*(n=a-10)-254.76935184120902+115.67994401066147*on(n)):(t=351.97690566805693+.114206453784165*(t=a-55)-40.25366309332127*on(t),e=325.4494125711974+.07943456536662342*(e=a-50)-28.0852963507957*on(e),n=255),[t,e,n,1]},un=fn,cn=d.unpack,ln=Math.round,sn=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];for(var e,n=cn(r,"rgb"),a=n[0],o=n[2],f=1e3,u=4e4,i=.4;u-f>i;){var c=un(e=.5*(u+f));c[2]/c[0]>=o/a?u=e:f=e}return ln(e)},hn=M,dn=k,bn=b,pn=sn;dn.prototype.temp=dn.prototype.kelvin=dn.prototype.temperature=function(){return pn(this._rgb)},hn.temp=hn.kelvin=hn.temperature=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return new(Function.prototype.bind.apply(dn,[null].concat(r,["temp"])))},bn.format.temp=bn.format.kelvin=bn.format.temperature=fn;var gn=d.unpack,vn=Math.cbrt,mn=Math.pow,yn=Math.sign,kn=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=gn(r,"rgb"),n=e[0],a=e[1],o=e[2],f=[Mn(n/255),Mn(a/255),Mn(o/255)],u=f[0],i=f[1],c=f[2],l=vn(.4122214708*u+.5363325363*i+.0514459929*c),s=vn(.2119034982*u+.6806995451*i+.1073969566*c),h=vn(.0883024619*u+.2817188376*i+.6299787005*c);return[.2104542553*l+.793617785*s-.0040720468*h,1.9779984951*l-2.428592205*s+.4505937099*h,.0259040371*l+.7827717662*s-.808675766*h]},wn=kn;function Mn(r){var t=Math.abs(r);return t<.04045?r/12.92:(yn(r)||1)*mn((t+.055)/1.055,2.4)}var xn=d.unpack,_n=Math.pow,Nn=Math.sign,An=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=(r=xn(r,"lab"))[0],n=r[1],a=r[2],o=_n(e+.3963377774*n+.2158037573*a,3),f=_n(e-.1055613458*n-.0638541728*a,3),u=_n(e-.0894841775*n-1.291485548*a,3);return[255*En(4.0767416621*o-3.3077115913*f+.2309699292*u),255*En(-1.2684380046*o+2.6097574011*f-.3413193965*u),255*En(-.0041960863*o-.7034186147*f+1.707614701*u),r.length>3?r[3]:1]},Cn=An;function En(r){var t=Math.abs(r);return t>.0031308?(Nn(r)||1)*(1.055*_n(t,1/2.4)-.055):12.92*r}var Pn=d.unpack,Fn=d.type,Bn=M,Rn=k,jn=b,On=wn;Rn.prototype.oklab=function(){return On(this._rgb)},Bn.oklab=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return new(Function.prototype.bind.apply(Rn,[null].concat(r,["oklab"])))},jn.format.oklab=Cn,jn.autodetect.push({p:3,test:function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];if(r=Pn(r,"oklab"),"array"===Fn(r)&&3===r.length)return"oklab"}});var zn=d.unpack,qn=wn,In=ce,Ln=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=zn(r,"rgb"),n=e[0],a=e[1],o=e[2],f=qn(n,a,o),u=f[0],i=f[1],c=f[2];return In(u,i,c)},Gn=Ln,Sn=d.unpack,Tn=ke,Dn=Cn,Yn=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];var e=(r=Sn(r,"lch"))[0],n=r[1],a=r[2],o=Tn(e,n,a),f=o[0],u=o[1],i=o[2],c=Dn(f,u,i);return[c[0],c[1],c[2],r.length>3?r[3]:1]},$n=Yn,Wn=d.unpack,Xn=d.type,Un=M,Vn=k,Zn=b,Kn=Gn;Vn.prototype.oklch=function(){return Kn(this._rgb)},Un.oklch=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return new(Function.prototype.bind.apply(Vn,[null].concat(r,["oklch"])))},Zn.format.oklch=$n,Zn.autodetect.push({p:3,test:function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];if(r=Wn(r,"oklch"),"array"===Xn(r)&&3===r.length)return"oklch"}});var Hn=k,Jn=d.type;Hn.prototype.alpha=function(r,t){return void 0===t&&(t=!1),void 0!==r&&"number"===Jn(r)?t?(this._rgb[3]=r,this):new Hn([this._rgb[0],this._rgb[1],this._rgb[2],r],"rgb"):this._rgb[3]},k.prototype.clipped=function(){return this._rgb._clipped||!1};var Qn=k,ra=zt;Qn.prototype.darken=function(r){void 0===r&&(r=1);var t=this,e=t.lab();return e[0]-=ra.Kn*r,new Qn(e,"lab").alpha(t.alpha(),!0)},Qn.prototype.brighten=function(r){return void 0===r&&(r=1),this.darken(-r)},Qn.prototype.darker=Qn.prototype.darken,Qn.prototype.brighter=Qn.prototype.brighten,k.prototype.get=function(r){var t=r.split("."),e=t[0],n=t[1],a=this[e]();if(n){var o=e.indexOf(n)-("ok"===e.substr(0,2)?2:0);if(o>-1)return a[o];throw new Error("unknown channel "+n+" in mode "+e)}return a};var ta=k,ea=d.type,na=Math.pow,aa=1e-7,oa=20;ta.prototype.luminance=function(r){if(void 0!==r&&"number"===ea(r)){if(0===r)return new ta([0,0,0,this._rgb[3]],"rgb");if(1===r)return new ta([255,255,255,this._rgb[3]],"rgb");var t=this.luminance(),e="rgb",n=oa,a=function(t,o){var f=t.interpolate(o,.5,e),u=f.luminance();return Math.abs(r-u)<aa||!n--?f:u>r?a(t,f):a(f,o)},o=(t>r?a(new ta([0,0,0]),this):a(this,new ta([255,255,255]))).rgb();return new ta(o.concat([this._rgb[3]]))}return fa.apply(void 0,this._rgb.slice(0,3))};var fa=function(r,t,e){return.2126*(r=ua(r))+.7152*(t=ua(t))+.0722*(e=ua(e))},ua=function(r){return(r/=255)<=.03928?r/12.92:na((r+.055)/1.055,2.4)},ia={},ca=k,la=d.type,sa=ia,ha=function(r,t,e){void 0===e&&(e=.5);for(var n=[],a=arguments.length-3;a-- >0;)n[a]=arguments[a+3];var o=n[0]||"lrgb";if(sa[o]||n.length||(o=Object.keys(sa)[0]),!sa[o])throw new Error("interpolation mode "+o+" is not defined");return"object"!==la(r)&&(r=new ca(r)),"object"!==la(t)&&(t=new ca(t)),sa[o](r,t,e).alpha(r.alpha()+e*(t.alpha()-r.alpha()))},da=k,ba=ha;da.prototype.mix=da.prototype.interpolate=function(r,t){void 0===t&&(t=.5);for(var e=[],n=arguments.length-2;n-- >0;)e[n]=arguments[n+2];return ba.apply(void 0,[this,r,t].concat(e))};var pa=k;pa.prototype.premultiply=function(r){void 0===r&&(r=!1);var t=this._rgb,e=t[3];return r?(this._rgb=[t[0]*e,t[1]*e,t[2]*e,e],this):new pa([t[0]*e,t[1]*e,t[2]*e,e],"rgb")};var ga=k,va=zt;ga.prototype.saturate=function(r){void 0===r&&(r=1);var t=this,e=t.lch();return e[1]+=va.Kn*r,e[1]<0&&(e[1]=0),new ga(e,"lch").alpha(t.alpha(),!0)},ga.prototype.desaturate=function(r){return void 0===r&&(r=1),this.saturate(-r)};var ma=k,ya=d.type;ma.prototype.set=function(r,t,e){void 0===e&&(e=!1);var n=r.split("."),a=n[0],o=n[1],f=this[a]();if(o){var u=a.indexOf(o)-("ok"===a.substr(0,2)?2:0);if(u>-1){if("string"==ya(t))switch(t.charAt(0)){case"+":case"-":f[u]+=+t;break;case"*":f[u]*=+t.substr(1);break;case"/":f[u]/=+t.substr(1);break;default:f[u]=+t}else{if("number"!==ya(t))throw new Error("unsupported value for Color.set");f[u]=t}var i=new ma(f,a);return e?(this._rgb=i._rgb,this):i}throw new Error("unknown channel "+o+" in mode "+a)}return f};var ka=k,wa=function(r,t,e){var n=r._rgb,a=t._rgb;return new ka(n[0]+e*(a[0]-n[0]),n[1]+e*(a[1]-n[1]),n[2]+e*(a[2]-n[2]),"rgb")};ia.rgb=wa;var Ma=k,xa=Math.sqrt,_a=Math.pow,Na=function(r,t,e){var n=r._rgb,a=n[0],o=n[1],f=n[2],u=t._rgb,i=u[0],c=u[1],l=u[2];return new Ma(xa(_a(a,2)*(1-e)+_a(i,2)*e),xa(_a(o,2)*(1-e)+_a(c,2)*e),xa(_a(f,2)*(1-e)+_a(l,2)*e),"rgb")};ia.lrgb=Na;var Aa=k,Ca=function(r,t,e){var n=r.lab(),a=t.lab();return new Aa(n[0]+e*(a[0]-n[0]),n[1]+e*(a[1]-n[1]),n[2]+e*(a[2]-n[2]),"lab")};ia.lab=Ca;var Ea=k,Pa=function(r,t,e,n){var a,o,f,u,i,c,l,s,h,d,b,p,g;return"hsl"===n?(f=r.hsl(),u=t.hsl()):"hsv"===n?(f=r.hsv(),u=t.hsv()):"hcg"===n?(f=r.hcg(),u=t.hcg()):"hsi"===n?(f=r.hsi(),u=t.hsi()):"lch"===n||"hcl"===n?(n="hcl",f=r.hcl(),u=t.hcl()):"oklch"===n&&(f=r.oklch().reverse(),u=t.oklch().reverse()),"h"!==n.substr(0,1)&&"oklch"!==n||(i=(a=f)[0],l=a[1],h=a[2],c=(o=u)[0],s=o[1],d=o[2]),isNaN(i)||isNaN(c)?isNaN(i)?isNaN(c)?p=Number.NaN:(p=c,1!=h&&0!=h||"hsv"==n||(b=s)):(p=i,1!=d&&0!=d||"hsv"==n||(b=l)):p=i+e*(c>i&&c-i>180?c-(i+360):c<i&&i-c>180?c+360-i:c-i),void 0===b&&(b=l+e*(s-l)),g=h+e*(d-h),new Ea("oklch"===n?[g,b,p]:[p,b,g],n)},Fa=Pa,Ba=function(r,t,e){return Fa(r,t,e,"lch")};ia.lch=Ba,ia.hcl=Ba;var Ra=k,ja=function(r,t,e){var n=r.num(),a=t.num();return new Ra(n+e*(a-n),"num")};ia.num=ja;var Oa=Pa,za=function(r,t,e){return Oa(r,t,e,"hcg")};ia.hcg=za;var qa=Pa,Ia=function(r,t,e){return qa(r,t,e,"hsi")};ia.hsi=Ia;var La=Pa,Ga=function(r,t,e){return La(r,t,e,"hsl")};ia.hsl=Ga;var Sa=Pa,Ta=function(r,t,e){return Sa(r,t,e,"hsv")};ia.hsv=Ta;var Da=k,Ya=function(r,t,e){var n=r.oklab(),a=t.oklab();return new Da(n[0]+e*(a[0]-n[0]),n[1]+e*(a[1]-n[1]),n[2]+e*(a[2]-n[2]),"oklab")};ia.oklab=Ya;var $a=Pa,Wa=function(r,t,e){return $a(r,t,e,"oklch")};ia.oklch=Wa;var Xa=k,Ua=d.clip_rgb,Va=Math.pow,Za=Math.sqrt,Ka=Math.PI,Ha=Math.cos,Ja=Math.sin,Qa=Math.atan2,ro=function(r,t,e){void 0===t&&(t="lrgb"),void 0===e&&(e=null);var n=r.length;e||(e=Array.from(new Array(n)).map((function(){return 1})));var a=n/e.reduce((function(r,t){return r+t}));if(e.forEach((function(r,t){e[t]*=a})),r=r.map((function(r){return new Xa(r)})),"lrgb"===t)return to(r,e);for(var o=r.shift(),f=o.get(t),u=[],i=0,c=0,l=0;l<f.length;l++)if(f[l]=(f[l]||0)*e[0],u.push(isNaN(f[l])?0:e[0]),"h"===t.charAt(l)&&!isNaN(f[l])){var s=f[l]/180*Ka;i+=Ha(s)*e[0],c+=Ja(s)*e[0]}var h=o.alpha()*e[0];r.forEach((function(r,n){var a=r.get(t);h+=r.alpha()*e[n+1];for(var o=0;o<f.length;o++)if(!isNaN(a[o]))if(u[o]+=e[n+1],"h"===t.charAt(o)){var l=a[o]/180*Ka;i+=Ha(l)*e[n+1],c+=Ja(l)*e[n+1]}else f[o]+=a[o]*e[n+1]}));for(var d=0;d<f.length;d++)if("h"===t.charAt(d)){for(var b=Qa(c/u[d],i/u[d])/Ka*180;b<0;)b+=360;for(;b>=360;)b-=360;f[d]=b}else f[d]=f[d]/u[d];return h/=n,new Xa(f,t).alpha(h>.99999?1:h,!0)},to=function(r,t){for(var e=r.length,n=[0,0,0,0],a=0;a<r.length;a++){var o=r[a],f=t[a]/e,u=o._rgb;n[0]+=Va(u[0],2)*f,n[1]+=Va(u[1],2)*f,n[2]+=Va(u[2],2)*f,n[3]+=u[3]*f}return n[0]=Za(n[0]),n[1]=Za(n[1]),n[2]=Za(n[2]),n[3]>.9999999&&(n[3]=1),new Xa(Ua(n))},eo=M,no=d.type,ao=Math.pow,oo=function(r){var t="rgb",e=eo("#ccc"),n=0,a=[0,1],o=[],f=[0,0],u=!1,i=[],c=!1,l=0,s=1,h=!1,d={},b=!0,p=1,g=function(r){if((r=r||["#fff","#000"])&&"string"===no(r)&&eo.brewer&&eo.brewer[r.toLowerCase()]&&(r=eo.brewer[r.toLowerCase()]),"array"===no(r)){1===r.length&&(r=[r[0],r[0]]),r=r.slice(0);for(var t=0;t<r.length;t++)r[t]=eo(r[t]);o.length=0;for(var e=0;e<r.length;e++)o.push(e/(r.length-1))}return w(),i=r},v=function(r){if(null!=u){for(var t=u.length-1,e=0;e<t&&r>=u[e];)e++;return e-1}return 0},m=function(r){return r},y=function(r){return r},k=function(r,n){var a,c;if(null==n&&(n=!1),isNaN(r)||null===r)return e;c=n?r:u&&u.length>2?v(r)/(u.length-2):s!==l?(r-l)/(s-l):1,c=y(c),n||(c=m(c)),1!==p&&(c=ao(c,p)),c=f[0]+c*(1-f[0]-f[1]),c=Math.min(1,Math.max(0,c));var h=Math.floor(1e4*c);if(b&&d[h])a=d[h];else{if("array"===no(i))for(var g=0;g<o.length;g++){var k=o[g];if(c<=k){a=i[g];break}if(c>=k&&g===o.length-1){a=i[g];break}if(c>k&&c<o[g+1]){c=(c-k)/(o[g+1]-k),a=eo.interpolate(i[g],i[g+1],c,t);break}}else"function"===no(i)&&(a=i(c));b&&(d[h]=a)}return a},w=function(){return d={}};g(r);var M=function(r){var t=eo(k(r));return c&&t[c]?t[c]():t};return M.classes=function(r){if(null!=r){if("array"===no(r))u=r,a=[r[0],r[r.length-1]];else{var t=eo.analyze(a);u=0===r?[t.min,t.max]:eo.limits(t,"e",r)}return M}return u},M.domain=function(r){if(!arguments.length)return a;l=r[0],s=r[r.length-1],o=[];var t=i.length;if(r.length===t&&l!==s)for(var e=0,n=Array.from(r);e<n.length;e+=1){var f=n[e];o.push((f-l)/(s-l))}else{for(var u=0;u<t;u++)o.push(u/(t-1));if(r.length>2){var c=r.map((function(t,e){return e/(r.length-1)})),h=r.map((function(r){return(r-l)/(s-l)}));h.every((function(r,t){return c[t]===r}))||(y=function(r){if(r<=0||r>=1)return r;for(var t=0;r>=h[t+1];)t++;var e=(r-h[t])/(h[t+1]-h[t]);return c[t]+e*(c[t+1]-c[t])})}}return a=[l,s],M},M.mode=function(r){return arguments.length?(t=r,w(),M):t},M.range=function(r,t){return g(r),M},M.out=function(r){return c=r,M},M.spread=function(r){return arguments.length?(n=r,M):n},M.correctLightness=function(r){return null==r&&(r=!0),h=r,w(),m=h?function(r){for(var t=k(0,!0).lab()[0],e=k(1,!0).lab()[0],n=t>e,a=k(r,!0).lab()[0],o=t+(e-t)*r,f=a-o,u=0,i=1,c=20;Math.abs(f)>.01&&c-- >0;)n&&(f*=-1),f<0?(u=r,r+=.5*(i-r)):(i=r,r+=.5*(u-r)),a=k(r,!0).lab()[0],f=a-o;return r}:function(r){return r},M},M.padding=function(r){return null!=r?("number"===no(r)&&(r=[r,r]),f=r,M):f},M.colors=function(t,e){arguments.length<2&&(e="hex");var n=[];if(0===arguments.length)n=i.slice(0);else if(1===t)n=[M(.5)];else if(t>1){var o=a[0],f=a[1]-o;n=fo(0,t,!1).map((function(r){return M(o+r/(t-1)*f)}))}else{r=[];var c=[];if(u&&u.length>2)for(var l=1,s=u.length,h=1<=s;h?l<s:l>s;h?l++:l--)c.push(.5*(u[l-1]+u[l]));else c=a;n=c.map((function(r){return M(r)}))}return eo[e]&&(n=n.map((function(r){return r[e]()}))),n},M.cache=function(r){return null!=r?(b=r,M):b},M.gamma=function(r){return null!=r?(p=r,M):p},M.nodata=function(r){return null!=r?(e=eo(r),M):e},M};function fo(r,t,e){for(var n=[],a=r<t,o=e?a?t+1:t-1:t,f=r;a?f<o:f>o;a?f++:f--)n.push(f);return n}var uo=k,io=oo,co=function(r){for(var t=[1,1],e=1;e<r;e++){for(var n=[1],a=1;a<=t.length;a++)n[a]=(t[a]||0)+t[a-1];t=n}return t},lo=function(r){var t,e,n,a,o,f,u;if(2===(r=r.map((function(r){return new uo(r)}))).length)t=r.map((function(r){return r.lab()})),o=t[0],f=t[1],a=function(r){var t=[0,1,2].map((function(t){return o[t]+r*(f[t]-o[t])}));return new uo(t,"lab")};else if(3===r.length)e=r.map((function(r){return r.lab()})),o=e[0],f=e[1],u=e[2],a=function(r){var t=[0,1,2].map((function(t){return(1-r)*(1-r)*o[t]+2*(1-r)*r*f[t]+r*r*u[t]}));return new uo(t,"lab")};else if(4===r.length){var i;n=r.map((function(r){return r.lab()})),o=n[0],f=n[1],u=n[2],i=n[3],a=function(r){var t=[0,1,2].map((function(t){return(1-r)*(1-r)*(1-r)*o[t]+3*(1-r)*(1-r)*r*f[t]+3*(1-r)*r*r*u[t]+r*r*r*i[t]}));return new uo(t,"lab")}}else{if(!(r.length>=5))throw new RangeError("No point in running bezier with only one color.");var c,l,s;c=r.map((function(r){return r.lab()})),s=r.length-1,l=co(s),a=function(r){var t=1-r,e=[0,1,2].map((function(e){return c.reduce((function(n,a,o){return n+l[o]*Math.pow(t,s-o)*Math.pow(r,o)*a[e]}),0)}));return new uo(e,"lab")}}return a},so=function(r){var t=lo(r);return t.scale=function(){return io(t)},t},ho=M,bo=function(r,t,e){if(!bo[e])throw new Error("unknown blend mode "+e);return bo[e](r,t)},po=function(r){return function(t,e){var n=ho(e).rgb(),a=ho(t).rgb();return ho.rgb(r(n,a))}},go=function(r){return function(t,e){var n=[];return n[0]=r(t[0],e[0]),n[1]=r(t[1],e[1]),n[2]=r(t[2],e[2]),n}},vo=function(r){return r},mo=function(r,t){return r*t/255},yo=function(r,t){return r>t?t:r},ko=function(r,t){return r>t?r:t},wo=function(r,t){return 255*(1-(1-r/255)*(1-t/255))},Mo=function(r,t){return t<128?2*r*t/255:255*(1-2*(1-r/255)*(1-t/255))},xo=function(r,t){return 255*(1-(1-t/255)/(r/255))},_o=function(r,t){return 255===r||(r=t/255*255/(1-r/255))>255?255:r};bo.normal=po(go(vo)),bo.multiply=po(go(mo)),bo.screen=po(go(wo)),bo.overlay=po(go(Mo)),bo.darken=po(go(yo)),bo.lighten=po(go(ko)),bo.dodge=po(go(_o)),bo.burn=po(go(xo));for(var No=bo,Ao=d.type,Co=d.clip_rgb,Eo=d.TWOPI,Po=Math.pow,Fo=Math.sin,Bo=Math.cos,Ro=M,jo=function(r,t,e,n,a){void 0===r&&(r=300),void 0===t&&(t=-1.5),void 0===e&&(e=1),void 0===n&&(n=1),void 0===a&&(a=[0,1]);var o,f=0;"array"===Ao(a)?o=a[1]-a[0]:(o=0,a=[a,a]);var u=function(u){var i=Eo*((r+120)/360+t*u),c=Po(a[0]+o*u,n),l=(0!==f?e[0]+u*f:e)*c*(1-c)/2,s=Bo(i),h=Fo(i);return Ro(Co([255*(c+l*(-.14861*s+1.78277*h)),255*(c+l*(-.29227*s-.90649*h)),255*(c+l*(1.97294*s)),1]))};return u.start=function(t){return null==t?r:(r=t,u)},u.rotations=function(r){return null==r?t:(t=r,u)},u.gamma=function(r){return null==r?n:(n=r,u)},u.hue=function(r){return null==r?e:("array"===Ao(e=r)?0==(f=e[1]-e[0])&&(e=e[1]):f=0,u)},u.lightness=function(r){return null==r?a:("array"===Ao(r)?(a=r,o=r[1]-r[0]):(a=[r,r],o=0),u)},u.scale=function(){return Ro.scale(u)},u.hue(e),u},Oo=k,zo="0123456789abcdef",qo=Math.floor,Io=Math.random,Lo=function(){for(var r="#",t=0;t<6;t++)r+=zo.charAt(qo(16*Io()));return new Oo(r,"hex")},Go=u,So=Math.log,To=Math.pow,Do=Math.floor,Yo=Math.abs,$o=function(r,t){void 0===t&&(t=null);var e={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===Go(r)&&(r=Object.values(r)),r.forEach((function(r){t&&"object"===Go(r)&&(r=r[t]),null==r||isNaN(r)||(e.values.push(r),e.sum+=r,r<e.min&&(e.min=r),r>e.max&&(e.max=r),e.count+=1)})),e.domain=[e.min,e.max],e.limits=function(r,t){return Wo(e,r,t)},e},Wo=function(r,t,e){void 0===t&&(t="equal"),void 0===e&&(e=7),"array"==Go(r)&&(r=$o(r));var n=r.min,a=r.max,o=r.values.sort((function(r,t){return r-t}));if(1===e)return[n,a];var f=[];if("c"===t.substr(0,1)&&(f.push(n),f.push(a)),"e"===t.substr(0,1)){f.push(n);for(var u=1;u<e;u++)f.push(n+u/e*(a-n));f.push(a)}else if("l"===t.substr(0,1)){if(n<=0)throw new Error("Logarithmic scales are only possible for values > 0");var i=Math.LOG10E*So(n),c=Math.LOG10E*So(a);f.push(n);for(var l=1;l<e;l++)f.push(To(10,i+l/e*(c-i)));f.push(a)}else if("q"===t.substr(0,1)){f.push(n);for(var s=1;s<e;s++){var h=(o.length-1)*s/e,d=Do(h);if(d===h)f.push(o[d]);else{var b=h-d;f.push(o[d]*(1-b)+o[d+1]*b)}}f.push(a)}else if("k"===t.substr(0,1)){var p,g=o.length,v=new Array(g),m=new Array(e),y=!0,k=0,w=null;(w=[]).push(n);for(var M=1;M<e;M++)w.push(n+M/e*(a-n));for(w.push(a);y;){for(var x=0;x<e;x++)m[x]=0;for(var _=0;_<g;_++)for(var N=o[_],A=Number.MAX_VALUE,C=void 0,E=0;E<e;E++){var P=Yo(w[E]-N);P<A&&(A=P,C=E),m[C]++,v[_]=C}for(var F=new Array(e),B=0;B<e;B++)F[B]=null;for(var R=0;R<g;R++)null===F[p=v[R]]?F[p]=o[R]:F[p]+=o[R];for(var j=0;j<e;j++)F[j]*=1/m[j];y=!1;for(var O=0;O<e;O++)if(F[O]!==w[O]){y=!0;break}w=F,++k>200&&(y=!1)}for(var z={},q=0;q<e;q++)z[q]=[];for(var I=0;I<g;I++)z[p=v[I]].push(o[I]);for(var L=[],G=0;G<e;G++)L.push(z[G][0]),L.push(z[G][z[G].length-1]);L=L.sort((function(r,t){return r-t})),f.push(L[0]);for(var S=1;S<L.length;S+=2){var T=L[S];isNaN(T)||-1!==f.indexOf(T)||f.push(T)}}return f},Xo={analyze:$o,limits:Wo},Uo=k,Vo=function(r,t){r=new Uo(r),t=new Uo(t);var e=r.luminance(),n=t.luminance();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},Zo=k,Ko=Math.sqrt,Ho=Math.pow,Jo=Math.min,Qo=Math.max,rf=Math.atan2,tf=Math.abs,ef=Math.cos,nf=Math.sin,af=Math.exp,of=Math.PI,ff=function(r,t,e,n,a){void 0===e&&(e=1),void 0===n&&(n=1),void 0===a&&(a=1);var o=function(r){return 360*r/(2*of)},f=function(r){return 2*of*r/360};r=new Zo(r),t=new Zo(t);var u=Array.from(r.lab()),i=u[0],c=u[1],l=u[2],s=Array.from(t.lab()),h=s[0],d=s[1],b=s[2],p=(i+h)/2,g=(Ko(Ho(c,2)+Ho(l,2))+Ko(Ho(d,2)+Ho(b,2)))/2,v=.5*(1-Ko(Ho(g,7)/(Ho(g,7)+Ho(25,7)))),m=c*(1+v),y=d*(1+v),k=Ko(Ho(m,2)+Ho(l,2)),w=Ko(Ho(y,2)+Ho(b,2)),M=(k+w)/2,x=o(rf(l,m)),_=o(rf(b,y)),N=x>=0?x:x+360,A=_>=0?_:_+360,C=tf(N-A)>180?(N+A+360)/2:(N+A)/2,E=1-.17*ef(f(C-30))+.24*ef(f(2*C))+.32*ef(f(3*C+6))-.2*ef(f(4*C-63)),P=A-N;P=tf(P)<=180?P:A<=N?P+360:P-360,P=2*Ko(k*w)*nf(f(P)/2);var F=h-i,B=w-k,R=1+.015*Ho(p-50,2)/Ko(20+Ho(p-50,2)),j=1+.045*M,O=1+.015*M*E,z=30*af(-Ho((C-275)/25,2)),q=-2*Ko(Ho(M,7)/(Ho(M,7)+Ho(25,7)))*nf(2*f(z)),I=Ko(Ho(F/(e*R),2)+Ho(B/(n*j),2)+Ho(P/(a*O),2)+q*(B/(n*j))*(P/(a*O)));return Qo(0,Jo(100,I))},uf=k,cf=function(r,t,e){void 0===e&&(e="lab"),r=new uf(r),t=new uf(t);var n=r.get(e),a=t.get(e),o=0;for(var f in n){var u=(n[f]||0)-(a[f]||0);o+=u*u}return Math.sqrt(o)},lf=k,sf=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];try{return new(Function.prototype.bind.apply(lf,[null].concat(r))),!0}catch(r){return!1}},hf=M,df=oo,bf={cool:function(){return df([hf.hsl(180,1,.9),hf.hsl(250,.7,.4)])},hot:function(){return df(["#000","#f00","#ff0","#fff"]).mode("rgb")}},pf={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"]},gf=0,vf=Object.keys(pf);gf<vf.length;gf+=1){var mf=vf[gf];pf[mf.toLowerCase()]=pf[mf]}var yf=pf,kf=M;kf.average=ro,kf.bezier=so,kf.blend=No,kf.cubehelix=jo,kf.mix=kf.interpolate=ha,kf.random=Lo,kf.scale=oo,kf.analyze=Xo.analyze,kf.contrast=Vo,kf.deltaE=ff,kf.distance=cf,kf.limits=Xo.limits,kf.valid=sf,kf.scales=bf,kf.colors=qe,kf.brewer=yf;var wf=kf;return wf}()}(a);var o=n(a.exports);function f(r,t="#000000",e="#ffffff"){return o(r).luminance()>.5?t:e}function u(r,t){return o.scale("Blues")(r/(t-1)).hex()}function i(r,t,e,n=1e-5){return r>=Math.min(t,e)-n&&r<=Math.max(t,e)+n}function c(r){return{left:r.top,right:r.bottom,top:r.left,bottom:r.right,horizontal:!r.horizontal}}class l extends t.BarElement{constructor(){super(...arguments),this.align="center",this.next=void 0,this.previous=void 0}getBounds(r=!1){const{x:t,y:e,base:n,width:a,height:o,horizontal:f}=this.getProps(["x","y","base","width","height","horizontal"],r);if(f){const r=Math.abs(t-n);let a=o/2;return{left:n-("left"!==this.align?r:0),top:e-a,right:n+("right"!==this.align?r:0),bottom:e+a,horizontal:f}}{const r=Math.abs(e-n);let o=a/2,u=t+o;return{left:t-o,top:n-("right"!==this.align?r:0),right:u,bottom:n+("left"!==this.align?r:0),horizontal:f}}}inRange(r,t,e){const n=this.getBounds(e),a=null==r||i(r,n.left,n.right),o=null==t||i(t,n.top,n.bottom);return a&&o}inXRange(r,t){return this.inRange(r,null,t)}inYRange(r,t){return this.inRange(null,r,t)}getCenterPoint(r){const{x:t,y:e,base:n,horizontal:a}=this.getProps(["x","y","base","horizontal"],r);return{center:{x:a?n:t,y:a?e:n},left:{x:a?(n+t)/2:t,y:a?e:(n+e)/2},right:{x:a?n-(t-n)/2:t,y:a?e:n-(e+n)/2}}[this.align]}tooltipPosition(r){return this.getCenterPoint(r)}getRange(r){const{width:t,height:e}=this.getProps(["width","height"]);return"x"===r?t:e}computeWayPoints(r=!1){let t=this.options.shrinkAnchor,e=Math.max(Math.min(this.options.shrinkFraction,1),0);0===e&&(t="none",e=1);let n=this.getBounds(r);const a=n.horizontal;let o=!this.next||"top"!==t&&"middle"!==t?n:this.next.getBounds(r),f=!this.previous||"bottom"!==t&&"middle"!==t?n:this.previous.getBounds(r);a||(n=c(n),o=c(o),f=c(f));const u=Math.floor((n.bottom-n.top)*(1-e)),i=Math.floor((n.bottom-n.top-u)/2),l=[],s=[];if("none"===t||"top"===t)l.push([n.left,n.top],[n.right,n.top]);else{let r=1;if("middle"===t){r=i/(Math.floor((f.bottom-f.top)*e*.5)+i)}l.push([n.left+(f.left-n.left)*r,n.top],[n.right+(f.right-n.right)*r,n.top])}if("middle"===t?(l.push([n.right,n.top+i]),l.push([n.right,n.bottom-i]),s.push([n.left,n.top+i]),s.push([n.left,n.bottom-i])):"top"===t&&e<1?(l.push([n.right,n.top+u]),s.push([n.left,n.top+u])):"bottom"===t&&e<1&&(l.push([n.right,n.bottom-u]),s.push([n.left,n.bottom-u])),"none"===t||"bottom"===t)l.push([n.right,n.bottom],[n.left,n.bottom]);else{let r=1;if("middle"===t){r=i/(Math.floor((o.bottom-o.top)*e*.5)+i)}l.push([n.right+(o.right-n.right)*r,n.bottom],[n.left+(o.left-n.left)*r,n.bottom])}return l.push(...s.reverse()),a?l:l.map((([r,t])=>[t,r]))}draw(r){const{options:t}=this;r.save(),r.beginPath();const e=this.computeWayPoints();r.moveTo(e[0][0],e[0][1]);for(const t of e.slice(1))r.lineTo(t[0],t[1]);t.backgroundColor&&(r.fillStyle=t.backgroundColor,r.fill()),t.borderColor&&(r.strokeStyle=t.borderColor,r.lineWidth=t.borderWidth,r.stroke()),r.restore()}}l.id="trapezoid",l.defaults={...t.BarElement.defaults,shrinkAnchor:"top",shrinkFraction:1},l.defaultRoutes=t.BarElement.defaultRoutes;class s extends t.BarController{getMinMax(r,t){const{max:e}=super.getMinMax(r,t);return{center:{min:-e,max:e},left:{min:0,max:e},right:{min:-e,max:0}}[this.options.align]}update(r){super.update(r);const t=this._cachedMeta.data||[];for(let r=0;r<t.length;r++)t[r].align=this.options.align,t[r].next=t[r+1],t[r].previous=t[r-1]}}s.id="funnel",s.defaults=e.merge({},[t.BarController.defaults,{dataElementType:l.id,barPercentage:1,align:"center",categoryPercentage:.98}]),s.overrides=e.merge({},[t.BarController.overrides,{plugins:{legend:{display:!1},colors:{enabled:!1},datalabels:{anchor:"start",textAlign:"center",font:{size:20},color:r=>f(r.chart.getDatasetMeta(r.datasetIndex).data[r.dataIndex].options.backgroundColor,t.Chart.defaults.color,"#ffffff"),formatter:(r,t)=>{var e,n;return`${null!==(n=null===(e=t.chart.data.labels)||void 0===e?void 0:e[t.dataIndex])&&void 0!==n?n:""}\n${(100*r).toLocaleString()}%`}}},scales:{_index_:{display:!1,padding:10,grid:{display:!1}},_value_:{display:!1,beginAtZero:!1,grace:0,grid:{display:!1}}},elements:{trapezoid:{backgroundColor(r){const t=r.chart.data.datasets[r.datasetIndex].data.length;return u(r.dataIndex,t)}}}}]);class h extends t.Chart{constructor(r,e){super(r,function(r,e,n,a=[],o=[]){t.registry.addControllers(n),Array.isArray(a)?t.registry.addElements(...a):t.registry.addElements(a),Array.isArray(o)?t.registry.addScales(...o):t.registry.addScales(o);const f=e;return f.type=r,f}("funnel",e,s,l,[t.CategoryScale,t.LinearScale]))}}h.id=s.id,t.registry.addControllers(s),t.registry.addElements(l),r.FunnelChart=h,r.FunnelController=s,r.TrapezoidElement=l,r.blues=u,r.pickForegroundColorToBackgroundColor=f}));
|
|
//# sourceMappingURL=index.umd.min.js.map
|