import{j as Y}from"./chunk-HAPUDHDK.js";Y();(function(G){var J={series:{curvedLines:{active:!1,apply:!1,monotonicFit:!1,tension:.5,nrSplinePoints:20,legacyOverride:void 0}}};function K(R){R.hooks.processOptions.push(U);function U(h,t){t.series.curvedLines.active&&h.hooks.processDatapoints.unshift(V)}function V(h,t,u){var n=u.points.length/u.pointsize,i=.005,c=b(t.curvedLines);if(!c&&t.curvedLines.apply==!0&&t.originSeries===void 0&&n>1+i)if(t.lines.fill){var e=M(u,t.curvedLines,1),r=M(u,t.curvedLines,2);u.pointsize=3,u.points=[];for(var f=0,l=0,v=0,s=2;v<e.length||f<r.length;)e[v]==r[f]?(u.points[l]=e[v],u.points[l+1]=e[v+1],u.points[l+2]=r[f+1],f+=s,v+=s):e[v]<r[f]?(u.points[l]=e[v],u.points[l+1]=e[v+1],u.points[l+2]=l>0?u.points[l-1]:null,v+=s):(u.points[l]=r[f],u.points[l+1]=l>1?u.points[l-2]:null,u.points[l+2]=r[f+1],f+=s),l+=3}else t.lines.lineWidth>0&&(u.points=M(u,t.curvedLines,1),u.pointsize=2)}function M(h,t,u){if(typeof t.legacyOverride<"u"&&t.legacyOverride!=!1){var n={fit:!1,curvePointFactor:20,fitPointDist:void 0},i=jQuery.extend(n,t.legacyOverride);return j(h,i,u)}return Z(h,t,u)}function Z(h,t,u){for(var n=h.points,i=h.pointsize,c=$(h,t,u),e=[],r=0,f=0;f<n.length-i;f+=i){var l=f,v=f+u,s=n[l],o=n[l+i],p=(o-s)/Number(t.nrSplinePoints);e.push(n[l]),e.push(n[v]);for(var a=s+=p;a<o;a+=p)e.push(a),e.push(c[r](a));r++}return e.push(n[n.length-i]),e.push(n[n.length-i+u]),e}function $(h,t,u){for(var n=h.points,i=h.pointsize,c=[],e=[],r=0;r<n.length-i;r+=i){var f=r,l=r+u,v=n[f+i]-n[f],s=n[l+i]-n[l];c.push(v),e.push(s/v)}var o=[e[0]];if(t.monotonicFit)for(var r=1;r<c.length;r++){var p=e[r],a=e[r-1];if(p*a<=0)o.push(0);else{var F=c[r],N=c[r-1],y=F+N;o.push(3*y/((y+F)/a+(y+N)/p))}}else for(var r=i;r<n.length-i;r+=i){var f=r,l=r+u;o.push(Number(t.tension)*(n[l+i]-n[l-i])/(n[f+i]-n[f-i]))}o.push(e[e.length-1]);var z=[],g=[];for(r=0;r<c.length;r++){var P=o[r],H=o[r+1],p=e[r],I=1/c[r],y=P+H-p-p;z.push(y*I*I),g.push((p-y-P)*I)}for(var D=[],r=0;r<c.length;r++){var W=function(q,L,A,d,E){return function(Q){var w=Q-q,C=w*w;return L*w*C+A*C+d*w+E}};D.push(W(n[r*i],z[r],g[r],o[r],n[r*i+u]))}return D}function j(h,t,u){var n=h.points,i=h.pointsize,c=Number(t.curvePointFactor)*(n.length/i),e=new Array,r=new Array,f=-1,l=-1,v=0;if(t.fit){var s;if(typeof t.fitPointDist>"u"){var o=n[0],p=n[n.length-i];s=(p-o)/(500*100)}else s=Number(t.fitPointDist);for(var a=0;a<n.length;a+=i){var F,N;f=a,l=a+u,F=n[f]-s,N=n[f]+s;for(var y=2;F==n[f]||N==n[f];)F=n[f]-s*y,N=n[f]+s*y,y++;e[v]=F,r[v]=n[l],v++,e[v]=n[f],r[v]=n[l],v++,e[v]=N,r[v]=n[l],v++}}else for(var a=0;a<n.length;a+=i)f=a,l=a+u,e[v]=n[f],r[v]=n[l],v++;var z=e.length,g=new Array,P=new Array;g[0]=0,g[z-1]=0,P[0]=0;for(var a=1;a<z-1;++a){var H=e[a+1]-e[a-1];if(H==0)return[];var I=(e[a]-e[a-1])/H,D=I*g[a-1]+2;g[a]=(I-1)/D,P[a]=(r[a+1]-r[a])/(e[a+1]-e[a])-(r[a]-r[a-1])/(e[a]-e[a-1]),P[a]=(6*P[a]/(e[a+1]-e[a-1])-I*P[a-1])/D}for(var v=z-2;v>=0;--v)g[v]=g[v]*g[v+1]+P[v];var W=(e[z-1]-e[0])/(c-1),S=new Array,q=new Array,L=new Array;for(S[0]=e[0],q[0]=r[0],L.push(S[0]),L.push(q[0]),v=1;v<c;++v){S[v]=S[0]+v*W;for(var A=z-1,d=0;A-d>1;){var E=Math.round((A+d)/2);e[E]>S[v]?A=E:d=E}var Q=e[A]-e[d];if(Q==0)return[];var w=(e[A]-S[v])/Q,C=(S[v]-e[d])/Q;q[v]=w*r[d]+C*r[A]+((w*w*w-w)*g[d]+(C*C*C-C)*g[A])*(Q*Q)/6,L.push(S[v]),L.push(q[v])}return L}function b(h){if(typeof h.fit<"u"||typeof h.curvePointFactor<"u"||typeof h.fitPointDist<"u")throw new Error("CurvedLines detected illegal parameters. The CurvedLines API changed with version 1.0.0 please check the options object.");return!1}}G.plot.plugins.push({init:K,options:J,name:"curvedLines",version:"1.1.1"})})(jQuery);
