/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/chartjs-plugin-doughnutlabel2@2.1.1/dist/chartjs-plugin-doughnutlabel.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("chart.js")):"function"==typeof define&&define.amd?define(["chart.js"],e):e(t.Chart)}(this,(function(t){"use strict";var e={font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null}},n=(t=t&&t.hasOwnProperty("default")?t.default:t).helpers,i={parseFont:function(e){var l=t.defaults.global,o=n.valueOrDefault(e.size,l.defaultFontSize),a={family:n.valueOrDefault(e.family,l.defaultFontFamily),lineHeight:n.options.toLineHeight(e.lineHeight,o),size:o,style:n.valueOrDefault(e.style,l.defaultFontStyle),weight:n.valueOrDefault(e.weight,null),string:""};return a.string=i.toFontString(a),a},toFontString:function(t){return!t||n.isNullOrUndef(t.size)||n.isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family},textSize:function(t,e){var n,i=[].concat(e),l=i.length,o=t.font,a=0,r=0;for(n=0;n<l;++n)t.font=i[n].font.string,a=Math.max(t.measureText(i[n].text).width,a),r+=i[n].font.lineHeight;return t.font=o,{height:r,width:a}}},l=t.helpers;t.defaults.global.plugins.doughnutlabel=e,t.plugins.register({id:"doughnutlabel",beforeDatasetDraw:function(e,n,o){!function(e,n){if(n&&n.labels&&n.labels.length>0){var o=e.ctx,a=l.options.resolve,r=[];n.labels.forEach((function(l){var f={text:"function"==typeof l.text?l.text(e):l.text,font:i.parseFont(a([l.font,n.font,{}],o,0)),color:a([l.color,n.color,t.defaults.global.defaultFontColor],o,0)};r.push(f)}));var f=i.textSize(o,r),u=Math.sqrt(Math.pow(f.width,2)+Math.pow(f.height,2)),s=(2*e.innerRadius+(n.padding||0))/u;s<1&&(r.forEach((function(t){t.font.size=Math.floor(t.font.size*s),t.font.lineHeight=void 0,t.font=i.parseFont(a([t.font,{}],o,0))})),f=i.textSize(o,r)),o.textAlign="center",o.textBaseline="middle";var h,g=(e.chartArea.left+e.chartArea.right)/2,d=(e.chartArea.top+e.chartArea.bottom)/2-f.height/2,c=r.length,p=0;for(h=0;h<c;++h){o.fillStyle=r[h].color,o.font=r[h].font.string;var y=d+r[h].font.lineHeight/2+p;p+=r[h].font.lineHeight,o.fillText(r[h].text,g,y)}}}(e,o)}})}));
//# sourceMappingURL=/sm/92a4b7ed99730430bd21fee38bf1e3525469e74bc4b02e2bd8555e510e2ef132.map