var t,e;t=this,e=function(t){return function(t,e){var i={fillClass:"ct-fill-donut",label:{html:"div",class:"ct-fill-donut-label"},items:[{}]};e.plugins=e.plugins||{},e.plugins.fillDonut=function(t){return t=e.extend({},i,t),function fillDonut(i){if(i instanceof e.Pie){var l,o=i.container;o.style.position="relative";var drawDonut=function(e){if("slice"===e.type){0===e.index&&(l=o.querySelector("svg"));var i=e.group._node.cloneNode(!0);t.fillClass.split(" ").forEach((function(t){i.setAttribute("class",i.getAttribute("class")+" "+t)})),[].forEach.call(i.querySelectorAll("path"),(function(t){[].forEach.call(t.querySelectorAll("animate"),(function(t){t.parentNode.removeChild(t)})),t.removeAttribute("stroke-dashoffset")})),l.insertBefore(i,l.childNodes[0])}};i.on("draw",(function(t){drawDonut(t)})),i.on("created",(function(l){var n=0;i.options.fillDonutOptions&&(t=e.extend({},t,i.options.fillDonutOptions),drawDonut(l)),[].forEach.call(t.items,(function(i){var l=globalThis.document.createElement(t.label.html);t.label.class.split(" ").forEach((function(t){l.classList?l.classList.add(t):l.className+=" "+t}));var s=e.extend({},{class:"",id:"",content:"fillText",position:"center",offsetY:0,offsetX:0},i);s.id.length>0&&l.setAttribute("id",s.id),s.class.length>0&&l.setAttribute("class",s.class),[].forEach.call(o.querySelectorAll('*[data-fill-index$="fdid-'+n+'"]'),(function(t){t.parentNode.removeChild(t)})),l.setAttribute("data-fill-index","fdid-"+n),n+=1,l.insertAdjacentHTML("beforeend",s.content),l.style.position="absolute",o.appendChild(l);var f=Math.ceil(o.offsetWidth/2),a=Math.ceil(o.clientHeight/2),c=Math.ceil(l.offsetWidth/2),r=Math.ceil(l.clientHeight/2),d={bottom:{bottom:0+s.offsetY+"px",left:f-c+s.offsetX+"px"},top:{top:0+s.offsetY+"px",left:f-c+s.offsetX+"px"},left:{top:a-r+s.offsetY+"px",left:0+s.offsetX+"px"},right:{top:a-r+s.offsetY+"px",right:0+s.offsetX+"px"},center:{top:a-r+s.offsetY+"px",left:f-c+s.offsetX+"px"}};e.extend(l.style,d[s.position])}))}))}}}}(document,t),t.plugins.fillDonut},"function"==typeof define&&define.amd?define(["chartist"],e):"object"==typeof exports?module.exports=e(require("chartist")):t["Chartist.plugins.fillDonut"]=e(t.Chartist);