import{i as j}from"./chunk-Z427YWOQ.js";j();(function(q){var O={series:{stack:null}};function M(Q){function S(v,s){for(var u=null,r=0;r<s.length&&v!==s[r];++r)s[r].stack===v.stack&&s[r].data.length&&(u=s[r]);return u}function d(v,s,u){if(!(s.stack==null||s.stack===!1)){var r=S(s,v.getData());if(r){for(var e=u.pointsize,i=u.points,a=r.datapoints.pointsize,l=r.datapoints.points,o=[],c,w,D,h,p,k,y=s.lines.show,z=s.bars.horizontal,A=e>2&&(z?u.format[2].x:u.format[2].y),x=!0,b=z?1:0,g=z?0:1,n=0,f=0,m,t;!(n>=i.length);)if(m=o.length,i[n]==null){for(t=0;t<e;++t)o.push(i[n+t]);n+=e}else if(f>=l.length){if(!y)for(t=0;t<e;++t)o.push(i[n+t]);n+=e}else if(l[f]==null){for(t=0;t<e;++t)o.push(null);x=!0,f+=a}else{if(c=i[n+b],w=i[n+g],h=l[f+b],p=l[f+g],k=0,c===h){for(t=0;t<e;++t)o.push(i[n+t]);o[m+g]+=p,k=p,n+=e,f+=a}else if(c>h){if(y&&n>0&&i[n-e]!=null){for(D=w+(i[n-e+g]-w)*(h-c)/(i[n-e+b]-c),o.push(h),o.push(D+p),t=2;t<e;++t)o.push(i[n+t]);k=p}f+=a}else{if(x&&y){n+=e;continue}for(t=0;t<e;++t)o.push(i[n+t]);y&&f>0&&l[f-a]!=null&&(k=p+(l[f-a+g]-p)*(c-h)/(l[f-a+b]-h)),o[m+g]+=k,n+=e}x=!1,m!==o.length&&A&&(o[m+2]+=k)}u.points=o}}}Q.hooks.processDatapoints.push(d)}q.plot.plugins.push({init:M,options:O,name:"stack",version:"1.2"})})(jQuery);
