"use strict";function m(e,i,t,o={}){if(t<=0)return;e.save();const{color:s="black",lineWidth:g=1,lineCap:f="round",lineJoin:r="round",lineDash:w=null,lineDashoffset:h=0,shadowColor:l=null,shadowBlur:a=0,shadowOffsetX:y=0,shadowOffsetY:u=0,fillStyle:N="#FFFFFF"}=o;e.beginPath(),e.arc(i.x,i.y,t,0,2*Math.PI),e.strokeStyle=s,e.lineWidth=g,e.lineCap=f,e.lineJoin=r,w&&(e.setLineDash(w),e.lineDashoffset=h),l&&(e.shadowColor=l,e.shadowOffsetX=y,e.shadowOffsetY=u),a&&(e.shadowBlur=a),N&&(e.fillStyle=N),e.fillStyle&&e.fill(),e.stroke(),e.restore()}function L(e,i,t={}){if(!i.length)return;e.save();const{color:o="black",lineWidth:s=1,lineCap:g="round",lineJoin:f="round",lineDash:r=null,lineDashoffset:w=0,shadowColor:h=null,shadowBlur:l=0,shadowOffsetX:a=0,shadowOffsetY:y=0}=t;e.beginPath(),e.moveTo(i[0].x,i[0].y);for(let u=1;u<i.length;u+=1)e.lineTo(i[u].x,i[u].y);e.strokeStyle=o,e.lineWidth=s,e.lineCap=g,e.lineJoin=f,r&&(e.setLineDash(r),e.lineDashoffset=w),h&&(e.shadowColor=h,e.shadowOffsetX=a,e.shadowOffsetY=y),l&&(e.shadowBlur=l),e.stroke(),e.restore()}function I(e,i,t={}){if(!i.length)return;e.save();const{strokeColor:o="black",lineWidth:s=1,lineCap:g="round",lineJoin:f="round",lineDash:r=null,lineDashoffset:w=0,fillColor:h=null,gradient:l=null,shadowColor:a=null,shadowBlur:y=0,shadowOffsetX:u=0,shadowOffsetY:N=0}=t;e.beginPath(),e.moveTo(i[0].x,i[0].y);for(let n=1;n<i.length;n+=1)e.lineTo(i[n].x,i[n].y);if(e.closePath(),e.strokeStyle=o,e.lineWidth=s,e.lineCap=g,e.lineJoin=f,r&&(e.setLineDash(r),e.lineDashoffset=w),a&&(e.shadowColor=a,e.shadowBlur=y,e.shadowOffsetX=u,e.shadowOffsetY=N),l){let n;l.type==="linear"?n=e.createLinearGradient(d(l.start.x,Number.MIN_VALUE),d(l.start.y,Number.MIN_VALUE),d(l.end.x,Number.MIN_VALUE*2),d(l.end.y,Number.MIN_VALUE*2)):l.type==="radial"&&(n=e.createRadialGradient(d(l.start.x,Number.MIN_VALUE),d(l.start.y,Number.MIN_VALUE),l.start.r||0,d(l.end.x,Number.MIN_VALUE*2),d(l.end.y,Number.MIN_VALUE*2),l.end.r||0)),n&&l.stops&&(l.stops.forEach(b=>{n.addColorStop(b.offset,b.color)}),e.fillStyle=n)}else h&&(e.fillStyle=h);e.fillStyle&&e.fill(),o&&e.stroke(),e.restore()}function O(e,i,t={}){if(!i.length)return;e.save();const{strokeColor:o="black",lineWidth:s=1,lineCap:g="round",lineJoin:f="round",lineDash:r=null,lineDashoffset:w=0,fillColor:h=null,gradient:l=null,shadowColor:a=null,shadowBlur:y=0,shadowOffsetX:u=0,shadowOffsetY:N=0}=t;e.beginPath(),e.moveTo(i[0].x,i[0].y);for(let n=1;n<i.length;n+=1)e.lineTo(i[n].x,i[n].y);if(e.closePath(),e.strokeStyle=o,e.lineWidth=s,e.lineCap=g,e.lineJoin=f,r&&(e.setLineDash(r),e.lineDashoffset=w),a&&(e.shadowColor=a,e.shadowBlur=y,e.shadowOffsetX=u,e.shadowOffsetY=N),l){let n;l.type==="linear"?n=e.createLinearGradient(d(l.start.x,Number.MIN_VALUE),d(l.start.y,Number.MIN_VALUE),d(l.end.x,Number.MIN_VALUE*2),d(l.end.y,Number.MIN_VALUE*2)):l.type==="radial"&&(n=e.createRadialGradient(d(l.start.x,Number.MIN_VALUE),d(l.start.y,Number.MIN_VALUE),l.start.r||0,d(l.end.x,Number.MIN_VALUE*2),d(l.end.y,Number.MIN_VALUE*2),l.end.r||0)),n&&l.stops&&(l.stops.forEach(b=>{n.addColorStop(b.offset,b.color)}),e.fillStyle=n)}else h&&(e.fillStyle=h);e.fillStyle&&e.fill(),o&&e.stroke(),e.restore()}function A(e,i,t,o,s={}){e.save();const{font:g="16px sans-serif",color:f="black",align:r="start",baseline:w="alphabetic",maxWidth:h=void 0,rotation:l=0,shadowColor:a=null,shadowBlur:y=0,shadowOffsetX:u=0,shadowOffsetY:N=0,strokeColor:n=null,lineWidth:b=1,globalAlpha:p=1}=s;e.font=g,e.fillStyle=f,e.textAlign=r,e.textBaseline=w,e.globalAlpha=p,a&&(e.shadowColor=a,e.shadowBlur=y,e.shadowOffsetX=u,e.shadowOffsetY=N),n&&(e.strokeStyle=n,e.lineWidth=b),l!==0&&(e.translate(t,o),e.rotate(Math.PI/180*l),e.translate(-t,-o)),e.fillText(i,t,o,h),n&&e.strokeText(i,t,o,h),e.restore()}function E(e,i=20){let t;return function(...o){const s=this;t||(e.apply(s,o),t=!0,setTimeout(()=>t=!1,i))}}function S(e,i,t=!1){let o;return function(...s){const g=this,f=function(){o=null,t||e.apply(g,s)},r=t&&!o;clearTimeout(o),o=setTimeout(f,i),r&&e.apply(g,s)}}function k(e){const i=document.createElement("canvas");return i.width=e.width||1,i.height=e.height||1,e.width||(e.width=1),e.height||(e.height=1),i.getContext("2d").drawImage(e,0,0),i}function d(e,i){return[null,void 0,NaN,1/0,-1/0].includes(e)?i:e}function M({chart:e,title:i=null,slicer:t=null,legend:o=null,source:s=null,noTitle:g=null,padding:f=null}){let r=0,w=0,h=0,l=0,a=0,y=0,u=0,N=0,n=0;if(e){const b=e.parentNode,{height:p,width:C}=b.getBoundingClientRect();i&&(h=i.getBoundingClientRect().height),t&&(l=t.getBoundingClientRect().height),o&&(a=o.getBoundingClientRect().height),s&&(y=s.getBoundingClientRect().height),g&&(u=g.getBoundingClientRect().height),f&&(N=f.top+f.bottom,n=f.right+f.left),r=p-h-l-a-y-u-N,w=C-n}return{width:w,height:r,heightTitle:h,heightNoTitle:u}}exports.circle=m;exports.cloneCanvas=k;exports.debounce=S;exports.line=L;exports.polygon=I;exports.rect=O;exports.text=A;exports.throttle=E;exports.useResponsive=M;
