(()=>{"use strict";const t=t=>{const r=new IntersectionObserver((o=>{o.forEach((o=>{o.isIntersecting&&(new EasyPieChart(o.target,{scaleColor:!1,size:250,lineCap:t?.lineCap,lineWidth:t?.lineWidth||5,trackColor:t?.trackColor||"#f5f5f5",barColor:function(r){const o=this.renderer.getCtx(),e=this.renderer.getCanvas(),n=t?.barColor;return"string"==typeof n?n:function(t,r,o){if(!t||"object"!=typeof t)return t||"#72e9cd";const e=t.gradient?.includes("linear-gradient"),n=t.gradient?.includes("radial-gradient");if(e||n){const a=t.gradient.match(/(\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3})/g),i=r[e?"createLinearGradient":"createRadialGradient"](...function(t,r){return t?[r/2,r/2,0,r/2,r/2,r/2]:[0,0,r,0]}(n,o));return a.forEach(((t,r)=>{i.addColorStop(r/(a.length-1),`rgb(${t})`)})),i}return t.backgroundColor?t.backgroundColor:"#72e9cd"}(n,o,e.width)}}),r.unobserve(o.target))}))}),{threshold:.5});return r},r=t=>{if("object"==typeof t&&t.backgroundColor){const r=t.backgroundColor.trim();if(r.includes(",")){const t=r.split(","),o=t[1]?.trim();return/^#[0-9A-Fa-f]{6}$/.test(o)?o:"Color not found"}return/^#[0-9A-Fa-f]{6}$/.test(r)?r:"Color not found"}if("string"!=typeof t)return"Invalid input";if(t.includes(",")){const r=t.split(","),o=r[1]?.trim();return/^#[0-9A-Fa-f]{6}$/.test(o)?o:"Color not found"}return{"accent-3":"#d8613c","accent-5":"#b5bdbc","contrast-2":"#636363"}[t]||(/^#[0-9A-Fa-f]{6}$/.test(t.trim())?t.trim():"Color not found")};document.addEventListener("DOMContentLoaded",(()=>{const o=document.querySelectorAll(".gkit-piechart-element");if(o&&void 0!==window?.EasyPieChart)for(const e of o){const o=JSON.parse(e.dataset.settings);o.barColor=r(o.barColor),o.trackColor=r(o.trackColor),t({...o,barColor:o.barColor,trackColor:o.trackColor}).observe(e)}}))})();