import{S as g,Q as x}from"./app-JmgyQoR0.js";import{v as w}from"./v4-U7xWZqn4.js";import{b as $,a as l,w as k,h as B,t as M,u as e,z as t,y as P}from"./vue-y3KLWBaS.js";const S=["viewBox"],b=["id"],C=["stop-color"],z=["stop-color"],E=["points"],I=["points","stroke"],V=["cx","cy","fill"],r=50,c=50,N=$({__name:"MkMiniChart",props:{src:{}},setup(h){const p=h,u=w();let i=l(""),d=l(""),m=l(null),_=l(null);l(null);const s=g(getComputedStyle(document.documentElement).getPropertyValue("--accent")).toRgbString();function f(){const n=p.src.slice().reverse(),v=Math.max.apply(null,n)||1,o=n.map((a,y)=>[y*(r/(n.length-1)),(1-a/v)*c]);i.value=o.map(a=>`${a[0]},${a[1]}`).join(" "),d.value=`0,${c} ${i.value} ${r},${c}`,m.value=o[o.length-1][0],_.value=o[o.length-1][1]}return k(()=>p.src,f,{immediate:!0}),x(f,1e3,{immediate:!1,afterMounted:!0}),(n,v)=>(B(),M("svg",{viewBox:`0 0 ${r} ${c}`,style:{overflow:"visible"}},[e("defs",null,[e("linearGradient",{id:t(u),x1:"0",x2:"0",y1:"1",y2:"0"},[e("stop",{offset:"0%","stop-color":t(s),"stop-opacity":"0"},null,8,C),e("stop",{offset:"100%","stop-color":t(s),"stop-opacity":"0.65"},null,8,z)],8,b)]),e("polygon",{points:d.value,style:P(`stroke: none; fill: url(#${t(u)});`)},null,12,E),e("polyline",{points:i.value,fill:"none",stroke:t(s),"stroke-width":"2"},null,8,I),e("circle",{cx:m.value,cy:_.value,r:"3",fill:t(s)},null,8,V)],8,S))}});export{N as _};
