Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

uplot

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uplot - npm Package Compare versions

Comparing version 1.6.23 to 1.6.24

23

dist/uPlot.d.ts

@@ -80,3 +80,3 @@ declare class uPlot {

/** sets the legend to the values of the specified idx */
setLegend(opts: {idx: number}, fireHook?: boolean): void;
setLegend(opts: {idx?: number, idxs?: (number | null)[]}, fireHook?: boolean): void;

@@ -478,2 +478,4 @@ // TODO: include other series style opts which are dynamically pulled?

uni?: number; // null
/** post-drag "click" event proxy, default is to prevent these click events */
click?: (self: uPlot, e: MouseEvent) => void;
}

@@ -518,3 +520,11 @@

prox: number;
/** when non-zero, will ignore absolute proximity and focus next series towards or away from zero */
bias?: FocusBias; // 0
}
export const enum FocusBias {
None = 0,
AwayFromZero = 1,
TowardsZero = -1,
}
}

@@ -694,2 +704,7 @@

/** radii for bar end (at bar's value) and bar start (baseline, zero) */
export type BarsPathBuilderRadii = [endRadius: number, baseRadius: number];
export type BarsPathBuilderRadius = number | BarsPathBuilderRadii | ((self: uPlot, seriesIdx: number) => BarsPathBuilderRadii);
export interface BarsPathBuilderOpts {

@@ -701,3 +716,3 @@ align?: -1 | 0 | 1; // 0

// corner radius factor of bar size (0 - 0.5)
radius?: number; // 0
radius?: BarsPathBuilderRadius; // 0

@@ -817,5 +832,5 @@ /** fixed-size gap between bars in CSS pixels (reduces bar width) */

export type Value = string | ((self: uPlot, rawValue: number, seriesIdx: number, idx: number) => string | number);
export type Value = string | ((self: uPlot, rawValue: number, seriesIdx: number, idx: number | null) => string | number);
export type Values = (self: uPlot, seriesIdx: number, idx: number) => object;
export type Values = (self: uPlot, seriesIdx: number, idx: number | null) => object;

@@ -822,0 +837,0 @@ export type FillTo = number | ((self: uPlot, seriesIdx: number, dataMin: number, dataMax: number) => number);

4

dist/uPlot.iife.min.js

@@ -1,2 +0,2 @@

/*! https://github.com/leeoniya/uPlot (v1.6.23) */
var uPlot=function(){"use strict";const e="u-off",t="u-label",l="width",n="height",i="top",o="bottom",s="left",r="right",u="#000",a="#0000",f="mousemove",c="mousedown",h="mouseup",d="mouseenter",p="mouseleave",m="dblclick",g="change",x="dppxchange",w="undefined"!=typeof window,_=w?document:null,b=w?window:null,v=w?navigator:null;let k,y;function M(e,t){if(null!=t){let l=e.classList;!l.contains(t)&&l.add(t)}}function S(e,t){let l=e.classList;l.contains(t)&&l.remove(t)}function E(e,t,l){e.style[t]=l+"px"}function D(e,t,l,n){let i=_.createElement(e);return null!=t&&M(i,t),null!=l&&l.insertBefore(i,n),i}function z(e,t){return D("div",e,t)}const T=new WeakMap;function P(t,l,n,i,o){let s="translate("+l+"px,"+n+"px)";s!=T.get(t)&&(t.style.transform=s,T.set(t,s),0>l||0>n||l>i||n>o?M(t,e):S(t,e))}const A=new WeakMap;function W(e,t,l){let n=t+l;n!=A.get(e)&&(A.set(e,n),e.style.background=t,e.style.borderColor=l)}const Y=new WeakMap;function C(e,t,l,n){let i=t+""+l;i!=Y.get(e)&&(Y.set(e,i),e.style.height=l+"px",e.style.width=t+"px",e.style.marginLeft=n?-t/2+"px":0,e.style.marginTop=n?-l/2+"px":0)}const F={passive:!0},H={...F,capture:!0};function R(e,t,l,n){t.addEventListener(e,l,n?H:F)}function L(e,t,l,n){t.removeEventListener(e,l,n?H:F)}function G(e,t,l,n){let i;l=l||0;let o=2147483647>=(n=n||t.length-1);for(;n-l>1;)i=o?l+n>>1:ee((l+n)/2),e>t[i]?l=i:n=i;return e-t[l]>t[n]-e?n:l}function I(e,t,l,n){for(let i=1==n?t:l;i>=t&&l>=i;i+=n)if(null!=e[i])return i;return-1}function O(e,t,l,n){let i=se(e),o=se(t),s=10==l?re:ue;e==t&&(-1==i?(e*=l,t/=l):(e/=l,t*=l));let r=1==o?le:ee,u=(1==i?ee:le)(s(Q(e))),a=r(s(Q(t))),f=oe(l,u),c=oe(l,a);return 0>u&&(f=ke(f,-u)),0>a&&(c=ke(c,-a)),n?(e=f*i,t=c*o):(e=ve(e,f),t=be(t,c)),[e,t]}function N(e,t,l,n){let i=O(e,t,l,n);return 0==e&&(i[0]=0),0==t&&(i[1]=0),i}w&&function e(){let t=devicePixelRatio;k!=t&&(k=t,y&&L(g,y,e),y=matchMedia(`(min-resolution: ${k-.001}dppx) and (max-resolution: ${k+.001}dppx)`),R(g,y,e),b.dispatchEvent(new CustomEvent(x)))}();const j={mode:3,pad:.1},U={pad:0,soft:null,mode:0},B={min:U,max:U};function V(e,t,l,n){return We(l)?q(e,t,l):(U.pad=l,U.soft=n?0:null,U.mode=n?3:0,q(e,t,B))}function J(e,t){return null==e?t:e}function q(e,t,l){let n=l.min,i=l.max,o=J(n.pad,0),s=J(i.pad,0),r=J(n.hard,-fe),u=J(i.hard,fe),a=J(n.soft,fe),f=J(i.soft,-fe),c=J(n.mode,0),h=J(i.mode,0),d=t-e,p=re(d),m=ie(Q(e),Q(t)),g=re(m),x=Q(g-p);(1e-9>d||x>10)&&(d=0,0!=e&&0!=t||(d=1e-9,2==c&&a!=fe&&(o=0),2==h&&f!=-fe&&(s=0)));let w=d||m||1e3,_=re(w),b=oe(10,ee(_)),v=ke(ve(e-w*(0==d?0==e?.1:1:o),b/10),9),k=a>e||1!=c&&(3!=c||v>a)&&(2!=c||a>v)?fe:a,y=ie(r,k>v&&e>=k?k:ne(k,v)),M=ke(be(t+w*(0==d?0==t?.1:1:s),b/10),9),S=t>f||1!=h&&(3!=h||f>M)&&(2!=h||M>f)?-fe:f,E=ne(u,M>S&&S>=t?S:ie(S,M));return y==E&&0==y&&(E=100),[y,E]}const K=new Intl.NumberFormat(w?v.language:"en-US"),X=e=>K.format(e),Z=Math,$=Z.PI,Q=Z.abs,ee=Z.floor,te=Z.round,le=Z.ceil,ne=Z.min,ie=Z.max,oe=Z.pow,se=Z.sign,re=Z.log10,ue=Z.log2,ae=(e,t=1)=>Z.asinh(e/t),fe=1/0;function ce(e){return 1+(0|re((e^e>>31)-(e>>31)))}function he(e,t){return te(e/t)*t}function de(e,t,l){return ne(ie(e,t),l)}function pe(e){return"function"==typeof e?e:()=>e}const me=e=>e,ge=(e,t)=>t,xe=()=>null,we=()=>!0,_e=(e,t)=>e==t;function be(e,t){return le(e/t)*t}function ve(e,t){return ee(e/t)*t}function ke(e,t=0){if(Pe(e))return e;let l=10**t;return te(e*l*(1+Number.EPSILON))/l}const ye=new Map;function Me(e){return((""+e).split(".")[1]||"").length}function Se(e,t,l,n){let i=[],o=n.map(Me);for(let s=t;l>s;s++){let t=Q(s),l=ke(oe(e,s),t);for(let e=0;n.length>e;e++){let r=n[e]*l,u=(0>r||0>s?t:0)+(o[e]>s?o[e]:0),a=ke(r,u);i.push(a),ye.set(a,u)}}return i}const Ee={},De=[],ze=[null,null],Te=Array.isArray,Pe=Number.isInteger;function Ae(e){return"string"==typeof e}function We(e){let t=!1;if(null!=e){let l=e.constructor;t=null==l||l==Object}return t}function Ye(e){return null!=e&&"object"==typeof e}const Ce=Object.getPrototypeOf(Uint8Array);function Fe(e,t=We){let l;if(Te(e)){let n=e.find((e=>null!=e));if(Te(n)||t(n)){l=Array(e.length);for(let n=0;e.length>n;n++)l[n]=Fe(e[n],t)}else l=e.slice()}else if(e instanceof Ce)l=e.slice();else if(t(e)){l={};for(let n in e)l[n]=Fe(e[n],t)}else l=e;return l}function He(e){let t=arguments;for(let l=1;t.length>l;l++){let n=t[l];for(let t in n)We(e[t])?He(e[t],Fe(n[t])):e[t]=Fe(n[t])}return e}function Re(e,t,l){for(let n,i=0,o=-1;t.length>i;i++){let s=t[i];if(s>o){for(n=s-1;n>=0&&null==e[n];)e[n--]=null;for(n=s+1;l>n&&null==e[n];)e[o=n++]=null}}}const Le="undefined"==typeof queueMicrotask?e=>Promise.resolve().then(e):queueMicrotask,Ge=["January","February","March","April","May","June","July","August","September","October","November","December"],Ie=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Oe(e){return e.slice(0,3)}const Ne=Ie.map(Oe),je=Ge.map(Oe),Ue={MMMM:Ge,MMM:je,WWWW:Ie,WWW:Ne};function Be(e){return(10>e?"0":"")+e}const Ve={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,t)=>t.MMMM[e.getMonth()],MMM:(e,t)=>t.MMM[e.getMonth()],MM:e=>Be(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>Be(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>Be(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return 0==t?12:t>12?t-12:t},AA:e=>12>e.getHours()?"AM":"PM",aa:e=>12>e.getHours()?"am":"pm",a:e=>12>e.getHours()?"a":"p",mm:e=>Be(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>Be(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>function(e){return(10>e?"00":100>e?"0":"")+e}(e.getMilliseconds())};function Je(e,t){t=t||Ue;let l,n=[],i=/\{([a-z]+)\}|[^{]+/gi;for(;l=i.exec(e);)n.push("{"==l[0][0]?Ve[l[1]]:l[0]);return e=>{let l="";for(let i=0;n.length>i;i++)l+="string"==typeof n[i]?n[i]:n[i](e,t);return l}}const qe=(new Intl.DateTimeFormat).resolvedOptions().timeZone,Ke=e=>e%1==0,Xe=[1,2,2.5,5],Ze=Se(10,-16,0,Xe),$e=Se(10,0,16,Xe),Qe=$e.filter(Ke),et=Ze.concat($e),tt="{YYYY}",lt="\n"+tt,nt="{M}/{D}",it="\n"+nt,ot=it+"/{YY}",st="{aa}",rt="{h}:{mm}"+st,ut="\n"+rt,at=":{ss}",ft=null;function ct(e){let t=1e3*e,l=60*t,n=60*l,i=24*n,o=30*i,s=365*i;return[(1==e?Se(10,0,3,Xe).filter(Ke):Se(10,-3,0,Xe)).concat([t,5*t,10*t,15*t,30*t,l,5*l,10*l,15*l,30*l,n,2*n,3*n,4*n,6*n,8*n,12*n,i,2*i,3*i,4*i,5*i,6*i,7*i,8*i,9*i,10*i,15*i,o,2*o,3*o,4*o,6*o,s,2*s,5*s,10*s,25*s,50*s,100*s]),[[s,tt,ft,ft,ft,ft,ft,ft,1],[28*i,"{MMM}",lt,ft,ft,ft,ft,ft,1],[i,nt,lt,ft,ft,ft,ft,ft,1],[n,"{h}"+st,ot,ft,it,ft,ft,ft,1],[l,rt,ot,ft,it,ft,ft,ft,1],[t,at,ot+" "+rt,ft,it+" "+rt,ft,ut,ft,1],[e,at+".{fff}",ot+" "+rt,ft,it+" "+rt,ft,ut,ft,1]],function(t){return(r,u,a,f,c,h)=>{let d=[],p=c>=s,m=c>=o&&s>c,g=t(a),x=ke(g*e,3),w=bt(g.getFullYear(),p?0:g.getMonth(),m||p?1:g.getDate()),_=ke(w*e,3);if(m||p){let l=m?c/o:0,n=p?c/s:0,i=x==_?x:ke(bt(w.getFullYear()+n,w.getMonth()+l,1)*e,3),r=new Date(te(i/e)),u=r.getFullYear(),a=r.getMonth();for(let o=0;f>=i;o++){let s=bt(u+n*o,a+l*o,1),r=s-t(ke(s*e,3));i=ke((+s+r)*e,3),i>f||d.push(i)}}else{let o=i>c?c:i,s=_+(ee(a)-ee(x))+be(x-_,o);d.push(s);let p=t(s),m=p.getHours()+p.getMinutes()/l+p.getSeconds()/n,g=c/n,w=h/r.axes[u]._space;for(;s=ke(s+c,1==e?0:3),f>=s;)if(g>1){let e=ee(ke(m+g,6))%24,l=t(s).getHours()-e;l>1&&(l=-1),s-=l*n,m=(m+g)%24,.7>ke((s-d[d.length-1])/c,3)*w||d.push(s)}else d.push(s)}return d}}]}const[ht,dt,pt]=ct(1),[mt,gt,xt]=ct(.001);function wt(e,t){return e.map((e=>e.map(((l,n)=>0==n||8==n||null==l?l:t(1==n||0==e[8]?l:e[1]+l)))))}function _t(e,t){return(l,n,i,o,s)=>{let r,u,a,f,c,h,d=t.find((e=>s>=e[0]))||t[t.length-1];return n.map((t=>{let l=e(t),n=l.getFullYear(),i=l.getMonth(),o=l.getDate(),s=l.getHours(),p=l.getMinutes(),m=l.getSeconds(),g=n!=r&&d[2]||i!=u&&d[3]||o!=a&&d[4]||s!=f&&d[5]||p!=c&&d[6]||m!=h&&d[7]||d[1];return r=n,u=i,a=o,f=s,c=p,h=m,g(l)}))}}function bt(e,t,l){return new Date(e,t,l)}function vt(e,t){return t(e)}function kt(e,t){return(l,n)=>t(e(n))}Se(2,-53,53,[1]);const yt={show:!0,live:!0,isolate:!1,mount:()=>{},markers:{show:!0,width:2,stroke:function(e,t){let l=e.series[t];return l.width?l.stroke(e,t):l.points.width?l.points.stroke(e,t):null},fill:function(e,t){return e.series[t].fill(e,t)},dash:"solid"},idx:null,idxs:null,values:[]},Mt=[0,0];function St(e,t,l){return e=>{0==e.button&&l(e)}}function Et(e,t,l){return l}const Dt={show:!0,x:!0,y:!0,lock:!1,move:function(e,t,l){return Mt[0]=t,Mt[1]=l,Mt},points:{show:function(e,t){let i=e.cursor.points,o=z(),s=i.size(e,t);E(o,l,s),E(o,n,s);let r=s/-2;E(o,"marginLeft",r),E(o,"marginTop",r);let u=i.width(e,t,s);return u&&E(o,"borderWidth",u),o},size:function(e,t){return Jt(e.series[t].points.width,1)},width:0,stroke:function(e,t){let l=e.series[t].points;return l._stroke||l._fill},fill:function(e,t){let l=e.series[t].points;return l._fill||l._stroke}},bind:{mousedown:St,mouseup:St,click:St,dblclick:St,mousemove:Et,mouseleave:Et,mouseenter:Et},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,_x:!1,_y:!1},focus:{prox:-1},left:-10,top:-10,idx:null,dataIdx:function(e,t,l){return l},idxs:null},zt={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},Tt=He({},zt,{filter:ge}),Pt=He({},Tt,{size:10}),At=He({},zt,{show:!1}),Wt='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',Yt="bold "+Wt,Ct={show:!0,scale:"x",stroke:u,space:50,gap:5,size:50,labelGap:0,labelSize:30,labelFont:Yt,side:2,grid:Tt,ticks:Pt,border:At,font:Wt,rotate:0},Ft={show:!0,scale:"x",auto:!1,sorted:1,min:fe,max:-fe,idxs:[]};function Ht(e,t){return t.map((e=>null==e?"":X(e)))}function Rt(e,t,l,n,i,o,s){let r=[],u=ye.get(i)||0;for(let e=l=s?l:ke(be(l,i),u);n>=e;e=ke(e+i,u))r.push(Object.is(e,-0)?0:e);return r}function Lt(e,t,l,n,i){const o=[],s=e.scales[e.axes[t].scale].log,r=ee((10==s?re:ue)(l));i=oe(s,r),0>r&&(i=ke(i,-r));let u=l;do{o.push(u),u=ke(u+i,ye.get(i)),i*s>u||(i=u)}while(n>=u);return o}function Gt(e,t,l,n,i){let o=e.scales[e.axes[t].scale].asinh,s=n>o?Lt(e,t,ie(o,l),n,i):[o],r=0>n||l>0?[]:[0];return(-o>l?Lt(e,t,ie(o,-n),-l,i):[o]).reverse().map((e=>-e)).concat(r,s)}const It=/./,Ot=/[12357]/,Nt=/[125]/,jt=/1/;function Ut(e,t,l){let n=e.axes[l],i=n.scale,o=e.scales[i];if(3==o.distr&&2==o.log)return t;let s=e.valToPos,r=n._space,u=s(10,i),a=s(9,i)-u<r?s(7,i)-u<r?s(5,i)-u<r?jt:Nt:Ot:It;return t.map((e=>4==o.distr&&0==e||a.test(e)?e:null))}function Bt(e,t){return null==t?"":X(t)}const Vt={show:!0,scale:"y",stroke:u,space:30,gap:5,size:50,labelGap:0,labelSize:30,labelFont:Yt,side:3,grid:Tt,ticks:Pt,border:At,font:Wt,rotate:0};function Jt(e,t){return ke((3+2*(e||1))*t,3)}const qt={scale:null,auto:!0,sorted:0,min:fe,max:-fe},Kt=(e,t,l,n,i)=>i,Xt={show:!0,auto:!0,sorted:0,gaps:Kt,alpha:1,facets:[He({},qt,{scale:"x"}),He({},qt,{scale:"y"})]},Zt={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:Kt,alpha:1,points:{show:function(e,t){let{scale:l,idxs:n}=e.series[0],i=e._data[0],o=e.valToPos(i[n[0]],l,!0),s=e.valToPos(i[n[1]],l,!0);return Q(s-o)/(e.series[t].points.space*k)>=n[1]-n[0]},filter:null},values:null,min:fe,max:-fe,idxs:[],path:null,clip:null};function $t(e,t,l){return l/10}const Qt={time:!0,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},el=He({},Qt,{time:!1,ori:1}),tl={};function ll(e){let t=tl[e];return t||(t={key:e,plots:[],sub(e){t.plots.push(e)},unsub(e){t.plots=t.plots.filter((t=>t!=e))},pub(e,l,n,i,o,s,r){for(let u=0;t.plots.length>u;u++)t.plots[u]!=l&&t.plots[u].pub(e,l,n,i,o,s,r)}},null!=e&&(tl[e]=t)),t}function nl(e,t,l){const n=e.mode,i=e.series[t],o=2==n?e._data[t]:e._data,s=e.scales,r=e.bbox;let u=o[0],a=2==n?o[1]:o[t],f=2==n?s[i.facets[0].scale]:s[e.series[0].scale],c=2==n?s[i.facets[1].scale]:s[i.scale],h=r.left,d=r.top,p=r.width,m=r.height,g=e.valToPosH,x=e.valToPosV;return 0==f.ori?l(i,u,a,f,c,g,x,h,d,p,m,cl,dl,ml,xl,_l):l(i,u,a,f,c,x,g,d,h,m,p,hl,pl,gl,wl,bl)}function il(e,t){let l=0,n=0,i=J(e.bands,De);for(let e=0;i.length>e;e++){let o=i[e];o.series[0]==t?l=o.dir:o.series[1]==t&&(n|=1==o.dir?1:2)}return[l,1==n?-1:2==n?1:3==n?2:0]}function ol(e,t,l,n,i){let o=e.series[t],s=e.scales[2==e.mode?o.facets[1].scale:o.scale];return-1==i?s.min:1==i?s.max:3==s.distr?1==s.dir?s.min:s.max:0}function sl(e,t,l,n,i,o){return nl(e,t,((e,t,s,r,u,a,f,c,h,d,p)=>{let m=e.pxRound;const g=0==r.ori?dl:pl;let x,w;1==r.dir*(0==r.ori?1:-1)?(x=l,w=n):(x=n,w=l);let _=m(a(t[x],r,d,c)),b=m(f(s[x],u,p,h)),v=m(a(t[w],r,d,c)),k=m(f(1==o?u.max:u.min,u,p,h)),y=new Path2D(i);return g(y,v,k),g(y,_,k),g(y,_,b),y}))}function rl(e,t,l,n,i,o){let s=null;if(e.length>0){s=new Path2D;const r=0==t?ml:gl;let u=l;for(let t=0;e.length>t;t++){let l=e[t];if(l[1]>l[0]){let e=l[0]-u;e>0&&r(s,u,n,e,n+o),u=l[1]}}let a=l+i-u;a>0&&r(s,u,n,a,n+o)}return s}function ul(e,t,l,n,i,o,s){let r=[],u=e.length;for(let a=1==i?l:n;a>=l&&n>=a;a+=i)if(null===t[a]){let f=a,c=a;if(1==i)for(;++a<=n&&null===t[a];)c=a;else for(;--a>=l&&null===t[a];)c=a;let h=o(e[f]),d=c==f?h:o(e[c]),p=f-i;h=s>0||0>p||p>=u?h:o(e[p]);let m=c+i;d=0>s||0>m||m>=u?d:o(e[m]),h>d||r.push([h,d])}return r}function al(e){return 0==e?me:1==e?te:t=>he(t,e)}function fl(e){let t=0==e?cl:hl,l=0==e?(e,t,l,n,i,o)=>{e.arcTo(t,l,n,i,o)}:(e,t,l,n,i,o)=>{e.arcTo(l,t,i,n,o)},n=0==e?(e,t,l,n,i)=>{e.rect(t,l,n,i)}:(e,t,l,n,i)=>{e.rect(l,t,i,n)};return(e,i,o,s,r,u=0)=>{0==u?n(e,i,o,s,r):(u=ne(u,s/2,r/2),t(e,i+u,o),l(e,i+s,o,i+s,o+r,u),l(e,i+s,o+r,i,o+r,u),l(e,i,o+r,i,o,u),l(e,i,o,i+s,o,u),e.closePath())}}const cl=(e,t,l)=>{e.moveTo(t,l)},hl=(e,t,l)=>{e.moveTo(l,t)},dl=(e,t,l)=>{e.lineTo(t,l)},pl=(e,t,l)=>{e.lineTo(l,t)},ml=fl(0),gl=fl(1),xl=(e,t,l,n,i,o)=>{e.arc(t,l,n,i,o)},wl=(e,t,l,n,i,o)=>{e.arc(l,t,n,i,o)},_l=(e,t,l,n,i,o,s)=>{e.bezierCurveTo(t,l,n,i,o,s)},bl=(e,t,l,n,i,o,s)=>{e.bezierCurveTo(l,t,i,n,s,o)};function vl(){return(e,t,l,n,i)=>nl(e,t,((t,o,s,r,u,a,f,c,h,d,p)=>{let m,g,{pxRound:x,points:w}=t;0==r.ori?(m=cl,g=xl):(m=hl,g=wl);const _=ke(w.width*k,3);let b=(w.size-w.width)/2*k,v=ke(2*b,3),y=new Path2D,M=new Path2D,{left:S,top:E,width:D,height:z}=e.bbox;ml(M,S-v,E-v,D+2*v,z+2*v);const T=e=>{if(null!=s[e]){let t=x(a(o[e],r,d,c)),l=x(f(s[e],u,p,h));m(y,t+b,l),g(y,t,l,b,0,2*$)}};if(i)i.forEach(T);else for(let e=l;n>=e;e++)T(e);return{stroke:_>0?y:null,fill:y,clip:M,flags:3}}))}function kl(e){return(t,l,n,i,o,s)=>{n!=i&&(o!=n&&s!=n&&e(t,l,n),o!=i&&s!=i&&e(t,l,i),e(t,l,s))}}const yl=kl(dl),Ml=kl(pl);function Sl(e){const t=J(e?.alignGaps,0);return(e,l,n,i)=>nl(e,l,((o,s,r,u,a,f,c,h,d,p,m)=>{let g,x,w=o.pxRound,_=e=>w(f(e,u,p,h)),b=e=>w(c(e,a,m,d));0==u.ori?(g=dl,x=yl):(g=pl,x=Ml);const v=u.dir*(0==u.ori?1:-1),k={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},y=k.stroke;let M,S,E,D=fe,z=-fe,T=_(s[1==v?n:i]),P=I(r,n,i,1*v),A=I(r,n,i,-1*v),W=_(s[P]),Y=_(s[A]);for(let e=1==v?n:i;e>=n&&i>=e;e+=v){let t=_(s[e]);t==T?null!=r[e]&&(S=b(r[e]),D==fe&&(g(y,t,S),M=S),D=ne(S,D),z=ie(S,z)):(D!=fe&&(x(y,T,D,z,M,S),E=T),null!=r[e]?(S=b(r[e]),g(y,t,S),D=z=M=S):(D=fe,z=-fe),T=t)}D!=fe&&D!=z&&E!=T&&x(y,T,D,z,M,S);let[C,F]=il(e,l);if(null!=o.fill||0!=C){let t=k.fill=new Path2D(y),n=b(o.fillTo(e,l,o.min,o.max,C));g(t,Y,n),g(t,W,n)}if(!o.spanGaps){let a=[];a.push(...ul(s,r,n,i,v,_,t)),k.gaps=a=o.gaps(e,l,n,i,a),k.clip=rl(a,u.ori,h,d,p,m)}return 0!=F&&(k.band=2==F?[sl(e,l,n,i,y,-1),sl(e,l,n,i,y,1)]:sl(e,l,n,i,y,F)),k}))}function El(e,t,l,n,i){const o=e.length;if(2>o)return null;const s=new Path2D;if(l(s,e[0],t[0]),2==o)n(s,e[1],t[1]);else{let l=Array(o),n=Array(o-1),r=Array(o-1),u=Array(o-1);for(let l=0;o-1>l;l++)r[l]=t[l+1]-t[l],u[l]=e[l+1]-e[l],n[l]=r[l]/u[l];l[0]=n[0];for(let e=1;o-1>e;e++)0===n[e]||0===n[e-1]||n[e-1]>0!=n[e]>0?l[e]=0:(l[e]=3*(u[e-1]+u[e])/((2*u[e]+u[e-1])/n[e-1]+(u[e]+2*u[e-1])/n[e]),isFinite(l[e])||(l[e]=0));l[o-1]=n[o-2];for(let n=0;o-1>n;n++)i(s,e[n]+u[n]/3,t[n]+l[n]*u[n]/3,e[n+1]-u[n]/3,t[n+1]-l[n+1]*u[n]/3,e[n+1],t[n+1])}return s}const Dl=new Set;function zl(){for(let e of Dl)e.syncRect(!0)}w&&(R("resize",b,zl),R("scroll",b,zl,!0),R(x,b,(()=>{jl.pxRatio=k})));const Tl=Sl(),Pl=vl();function Al(e,t,l,n){return(n?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map(((e,n)=>Wl(e,n,t,l)))}function Wl(e,t,l,n){return He({},0==t?l:n,e)}function Yl(e,t,l){return null==t?ze:[t,l]}const Cl=Yl;function Fl(e,t,l){return null==t?ze:V(t,l,.1,!0)}function Hl(e,t,l,n){return null==t?ze:O(t,l,e.scales[n].log,!1)}const Rl=Hl;function Ll(e,t,l,n){return null==t?ze:N(t,l,e.scales[n].log,!1)}const Gl=Ll;function Il(e,t,l,n,i){let o=ie(ce(e),ce(t)),s=t-e,r=G(i/n*s,l);do{let e=l[r],t=n*e/s;if(t>=i&&17>=o+(5>e?ye.get(e):0))return[e,t]}while(++r<l.length);return[0,0]}function Ol(e){let t,l;return[e=e.replace(/(\d+)px/,((e,n)=>(t=te((l=+n)*k))+"px")),t,l]}function Nl(e){e.show&&[e.font,e.labelFont].forEach((e=>{let t=ke(e[2]*k,1);e[0]=e[0].replace(/[0-9.]+px/,t+"px"),e[1]=t}))}function jl(u,g,w){const v={mode:J(u.mode,1)},y=v.mode;function T(e,t){return((3==t.distr?re(e>0?e:t.clamp(v,e,t.min,t.max,t.key)):4==t.distr?ae(e,t.asinh):e)-t._min)/(t._max-t._min)}function A(e,t,l,n){let i=T(e,t);return n+l*(-1==t.dir?1-i:i)}function Y(e,t,l,n){let i=T(e,t);return n+l*(-1==t.dir?i:1-i)}function F(e,t,l,n){return 0==t.ori?A(e,t,l,n):Y(e,t,l,n)}v.valToPosH=A,v.valToPosV=Y;let H=!1;v.status=0;const I=v.root=z("uplot");null!=u.id&&(I.id=u.id),M(I,u.class),u.title&&(z("u-title",I).textContent=u.title);const U=D("canvas"),B=v.ctx=U.getContext("2d"),q=z("u-wrap",I),K=v.under=z("u-under",q);q.appendChild(U);const X=v.over=z("u-over",q),ee=+J((u=Fe(u)).pxAlign,1),se=al(ee);(u.plugins||[]).forEach((e=>{e.opts&&(u=e.opts(v,u)||u)}));const ue=u.ms||.001,ce=v.series=1==y?Al(u.series||[],Ft,Zt,!1):function(e,t){return e.map(((e,l)=>0==l?null:He({},t,e)))}(u.series||[null],Xt),me=v.axes=Al(u.axes||[],Ct,Vt,!0),ve=v.scales={},ye=v.bands=u.bands||[];ye.forEach((e=>{e.fill=pe(e.fill||null),e.dir=J(e.dir,-1)}));const Me=2==y?ce[1].facets[0].scale:ce[0].scale,Se={axes:function(){for(let e=0;me.length>e;e++){let t=me[e];if(!t.show||!t._show)continue;let l,n,u=t.side,a=u%2,f=t.stroke(v,e),c=0==u||3==u?-1:1;if(t.label){let e=te((t._lpos+t.labelGap*c)*k);Xl(t.labelFont[0],f,"center",2==u?i:o),B.save(),1==a?(l=n=0,B.translate(e,te(Wt+It/2)),B.rotate((3==u?-$:$)/2)):(l=te(At+Yt/2),n=e),B.fillText(t.label,l,n),B.restore()}let[h,d]=t._found;if(0==d)continue;let p=ve[t.scale],m=0==a?Yt:It,g=0==a?At:Wt,x=te(t.gap*k),w=t._splits,_=2==p.distr?w.map((e=>Bl[e])):w,b=2==p.distr?Bl[w[1]]-Bl[w[0]]:h,y=t.ticks,M=t.border,S=y.show?te(y.size*k):0,E=t._rotate*-$/180,D=se(t._pos*k),z=D+(S+x)*c;n=0==a?z:0,l=1==a?z:0,Xl(t.font[0],f,1==t.align?s:2==t.align?r:E>0?s:0>E?r:0==a?"center":3==u?r:s,E||1==a?"middle":2==u?i:o);let T=1.5*t.font[1],P=w.map((e=>se(F(e,p,m,g)))),A=t._values;for(let e=0;A.length>e;e++){let t=A[e];if(null!=t){0==a?l=P[e]:n=P[e],t=""+t;let i=-1==t.indexOf("\n")?[t]:t.split(/\n/gm);for(let e=0;i.length>e;e++){let t=i[e];E?(B.save(),B.translate(l,n+e*T),B.rotate(E),B.fillText(t,0,0),B.restore()):B.fillText(t,l,n+e*T)}}}y.show&&nn(P,y.filter(v,_,e,d,b),a,u,D,S,ke(y.width*k,3),y.stroke(v,e),y.dash,y.cap);let W=t.grid;W.show&&nn(P,W.filter(v,_,e,d,b),a,0==a?2:1,0==a?Wt:At,0==a?It:Yt,ke(W.width*k,3),W.stroke(v,e),W.dash,W.cap),M.show&&nn([D],[1],0==a?1:0,0==a?1:2,1==a?Wt:At,1==a?It:Yt,ke(M.width*k,3),M.stroke(v,e),M.dash,M.cap)}ni("drawAxes")},series:function(){gl>0&&(ce.forEach(((e,t)=>{if(t>0&&e.show&&null==e._paths){let l=2==y?[0,g[t][0].length-1]:function(e){let t=de(xl-1,0,gl-1),l=de(wl+1,0,gl-1);for(;null==e[t]&&t>0;)t--;for(;null==e[l]&&gl-1>l;)l++;return[t,l]}(g[t]);e._paths=e.paths(v,t,l[0],l[1])}})),ce.forEach(((e,t)=>{if(t>0&&e.show){Ul!=e.alpha&&(B.globalAlpha=Ul=e.alpha),$l(t,!1),e._paths&&Ql(t,!1);{$l(t,!0);let l=e._paths?e._paths.gaps:null,n=e.points.show(v,t,xl,wl,l),i=e.points.filter(v,t,n,l);(n||i)&&(e.points._paths=e.points.paths(v,t,xl,wl,i),Ql(t,!0))}1!=Ul&&(B.globalAlpha=Ul=1),ni("drawSeries",t)}})))}},Pe=(u.drawOrder||["axes","series"]).map((e=>Se[e]));function Ce(e){let t=ve[e];if(null==t){let l=(u.scales||Ee)[e]||Ee;if(null!=l.from)Ce(l.from),ve[e]=He({},ve[l.from],l,{key:e});else{t=ve[e]=He({},e==Me?Qt:el,l),t.key=e;let n=t.time,i=t.range,o=Te(i);if((e!=Me||2==y&&!n)&&(!o||null!=i[0]&&null!=i[1]||(i={min:null==i[0]?j:{mode:1,hard:i[0],soft:i[0]},max:null==i[1]?j:{mode:1,hard:i[1],soft:i[1]}},o=!1),!o&&We(i))){let e=i;i=(t,l,n)=>null==l?ze:V(l,n,e)}t.range=pe(i||(n?Cl:e==Me?3==t.distr?Rl:4==t.distr?Gl:Yl:3==t.distr?Hl:4==t.distr?Ll:Fl)),t.auto=pe(!o&&t.auto),t.clamp=pe(t.clamp||$t),t._min=t._max=null}}}Ce("x"),Ce("y"),1==y&&ce.forEach((e=>{Ce(e.scale)})),me.forEach((e=>{Ce(e.scale)}));for(let e in u.scales)Ce(e);const Re=ve[Me],Ge=Re.distr;let Ie,Oe;0==Re.ori?(M(I,"u-hz"),Ie=A,Oe=Y):(M(I,"u-vt"),Ie=Y,Oe=A);const Ne={};for(let e in ve){let t=ve[e];null==t.min&&null==t.max||(Ne[e]={min:t.min,max:t.max},t.min=t.max=null)}const je=u.tzDate||(e=>new Date(te(e/ue))),Ue=u.fmtDate||Je,Be=1==ue?pt(je):xt(je),Ve=_t(je,wt(1==ue?dt:gt,Ue)),qe=kt(je,vt("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",Ue)),Ke=[],Xe=v.legend=He({},yt,u.legend),Ze=Xe.show,$e=Xe.markers;let tt;Xe.idxs=Ke,$e.width=pe($e.width),$e.dash=pe($e.dash),$e.stroke=pe($e.stroke),$e.fill=pe($e.fill);let lt,nt=[],it=[],ot=!1,st={};if(Xe.live){const e=ce[1]?ce[1].values:null;ot=null!=e,lt=ot?e(v,1,0):{_:0};for(let e in lt)st[e]="--"}if(Ze)if(tt=D("table","u-legend",I),Xe.mount(v,tt),ot){let e=D("tr","u-thead",tt);for(var rt in D("th",null,e),lt)D("th",t,e).textContent=rt}else M(tt,"u-inline"),Xe.live&&M(tt,"u-live");const ut={show:!0},at={show:!1},ft=new Map;function ct(e,t,l){const n=ft.get(t)||{},i=sl.bind[e](v,t,l);i&&(R(e,t,n[e]=i),ft.set(t,n))}function bt(e,t){const l=ft.get(t)||{};for(let n in l)null!=e&&n!=e||(L(n,t,l[n]),delete l[n]);null==e&&ft.delete(t)}let Mt=0,St=0,Et=0,zt=0,Tt=0,Pt=0,At=0,Wt=0,Yt=0,It=0;v.bbox={};let Ot=!1,Nt=!1,jt=!1,qt=!1,Kt=!1,tl=!1;function nl(e,t,l){(l||e!=v.width||t!=v.height)&&il(e,t),rn(!1),jt=!0,Nt=!0,0>sl.left||(qt=tl=!0),vn()}function il(e,t){v.width=Mt=Et=e,v.height=St=zt=t,Tt=Pt=0,function(){let e=!1,t=!1,l=!1,n=!1;me.forEach((i=>{if(i.show&&i._show){let{side:o,_size:s}=i,r=o%2,u=s+(null!=i.label?i.labelSize:0);u>0&&(r?(Et-=u,3==o?(Tt+=u,n=!0):l=!0):(zt-=u,0==o?(Pt+=u,e=!0):t=!0))}})),hl[0]=e,hl[1]=l,hl[2]=t,hl[3]=n,Et-=ml[1]+ml[3],Tt+=ml[3],zt-=ml[2]+ml[0],Pt+=ml[0]}(),function(){let e=Tt+Et,t=Pt+zt,l=Tt,n=Pt;function i(i,o){switch(i){case 1:return e+=o,e-o;case 2:return t+=o,t-o;case 3:return l-=o,l+o;case 0:return n-=o,n+o}}me.forEach((e=>{if(e.show&&e._show){let t=e.side;e._pos=i(t,e._size),null!=e.label&&(e._lpos=i(t,e.labelSize))}}))}();let l=v.bbox;At=l.left=he(Tt*k,.5),Wt=l.top=he(Pt*k,.5),Yt=l.width=he(Et*k,.5),It=l.height=he(zt*k,.5)}v.setSize=function({width:e,height:t}){nl(e,t)};const sl=v.cursor=He({},Dt,{drag:{y:2==y}},u.cursor);{sl.idxs=Ke,sl._lock=!1;let e=sl.points;e.show=pe(e.show),e.size=pe(e.size),e.stroke=pe(e.stroke),e.width=pe(e.width),e.fill=pe(e.fill)}const rl=v.focus=He({},u.focus||{alpha:.3},sl.focus),ul=rl.prox>=0;let fl=[null];function cl(l,n){if(1==y||n>0){let e=1==y&&ve[l.scale].time,t=l.value;l.value=e?Ae(t)?kt(je,vt(t,Ue)):t||qe:t||Bt,l.label=l.label||(e?"Time":"Value")}if(n>0){l.width=null==l.width?1:l.width,l.paths=l.paths||Tl||xe,l.fillTo=pe(l.fillTo||ol),l.pxAlign=+J(l.pxAlign,ee),l.pxRound=al(l.pxAlign),l.stroke=pe(l.stroke||null),l.fill=pe(l.fill||null),l._stroke=l._fill=l._paths=l._focus=null;let e=Jt(l.width,1),t=l.points=He({},{size:e,width:ie(1,.2*e),stroke:l.stroke,space:2*e,paths:Pl,_stroke:null,_fill:null},l.points);t.show=pe(t.show),t.filter=pe(t.filter),t.fill=pe(t.fill),t.stroke=pe(t.stroke),t.paths=pe(t.paths),t.pxAlign=l.pxAlign}if(Ze){let i=function(l,n){if(0==n&&(ot||!Xe.live||2==y))return ze;let i=[],o=D("tr","u-series",tt,tt.childNodes[n]);M(o,l.class),l.show||M(o,e);let s=D("th",null,o);if($e.show){let e=z("u-marker",s);if(n>0){let t=$e.width(v,n);t&&(e.style.border=t+"px "+$e.dash(v,n)+" "+$e.stroke(v,n)),e.style.background=$e.fill(v,n)}}let r=z(t,s);for(var u in r.textContent=l.label,n>0&&($e.show||(r.style.color=l.width>0?$e.stroke(v,n):$e.fill(v,n)),ct("click",s,(e=>{if(sl._lock)return;let t=ce.indexOf(l);if((e.ctrlKey||e.metaKey)!=Xe.isolate){let e=ce.some(((e,l)=>l>0&&l!=t&&e.show));ce.forEach(((l,n)=>{n>0&&Wn(n,e?n==t?ut:at:ut,!0,ii.setSeries)}))}else Wn(t,{show:!l.show},!0,ii.setSeries)})),ul&&ct(d,s,(()=>{sl._lock||Wn(ce.indexOf(l),Hn,!0,ii.setSeries)}))),lt){let e=D("td","u-value",o);e.textContent="--",i.push(e)}return[o,i]}(l,n);nt.splice(n,0,i[0]),it.splice(n,0,i[1]),Xe.values.push(null)}if(sl.show){Ke.splice(n,0,null);let e=function(e,t){if(t>0){let l=sl.points.show(v,t);if(l)return M(l,"u-cursor-pt"),M(l,e.class),P(l,-10,-10,Et,zt),X.insertBefore(l,fl[t]),l}}(l,n);e&&fl.splice(n,0,e)}ni("addSeries",n)}v.addSeries=function(e,t){t=null==t?ce.length:t,e=1==y?Wl(e,t,Ft,Zt):Wl(e,t,null,Xt),ce.splice(t,0,e),cl(ce[t],t)},v.delSeries=function(e){if(ce.splice(e,1),Ze){Xe.values.splice(e,1),it.splice(e,1);let t=nt.splice(e,1)[0];bt(null,t.firstChild),t.remove()}sl.show&&(Ke.splice(e,1),fl.length>1&&fl.splice(e,1)[0].remove()),ni("delSeries",e)};const hl=[!1,!1,!1,!1];function dl(e,t,l){let[n,i,o,s]=l,r=t%2,u=0;return 0==r&&(s||i)&&(u=0==t&&!n||2==t&&!o?te(Ct.size/3):0),1==r&&(n||o)&&(u=1==t&&!i||3==t&&!s?te(Vt.size/2):0),u}const pl=v.padding=(u.padding||[dl,dl,dl,dl]).map((e=>pe(J(e,dl)))),ml=v._padding=pl.map(((e,t)=>e(v,t,hl,0)));let gl,xl=null,wl=null;const _l=1==y?ce[0].idxs:null;let bl,vl,kl,yl,Ml,Sl,El,zl,jl,Ul,Bl=null,Vl=!1;function Jl(e,t){if(g=null==e?[]:Fe(e,Ye),2==y){gl=0;for(let e=1;ce.length>e;e++)gl+=g[e][0].length;v.data=g=e}else if(null==g[0]&&(g[0]=[]),v.data=g.slice(),Bl=g[0],gl=Bl.length,2==Ge){g[0]=Array(gl);for(let e=0;gl>e;e++)g[0][e]=e}if(v._data=g,rn(!0),ni("setData"),2==Ge&&(jt=!0),!1!==t){let e=Re;e.auto(v,Vl)?ql():An(Me,e.min,e.max),qt=sl.left>=0,tl=!0,vn()}}function ql(){let e,t;Vl=!0,1==y&&(gl>0?(xl=_l[0]=0,wl=_l[1]=gl-1,e=g[0][xl],t=g[0][wl],2==Ge?(e=xl,t=wl):1==gl&&(3==Ge?[e,t]=O(e,e,Re.log,!1):4==Ge?[e,t]=N(e,e,Re.log,!1):Re.time?t=e+te(86400/ue):[e,t]=V(e,t,.1,!0))):(xl=_l[0]=e=null,wl=_l[1]=t=null)),An(Me,e,t)}function Kl(e,t,l,n,i,o){e??=a,l??=De,n??="butt",i??=a,o??="round",e!=bl&&(B.strokeStyle=bl=e),i!=vl&&(B.fillStyle=vl=i),t!=kl&&(B.lineWidth=kl=t),o!=Ml&&(B.lineJoin=Ml=o),n!=Sl&&(B.lineCap=Sl=n),l!=yl&&B.setLineDash(yl=l)}function Xl(e,t,l,n){t!=vl&&(B.fillStyle=vl=t),e!=El&&(B.font=El=e),l!=zl&&(B.textAlign=zl=l),n!=jl&&(B.textBaseline=jl=n)}function Zl(e,t,l,n,i=0){if(n.length>0&&e.auto(v,Vl)&&(null==t||null==t.min)){let t=J(xl,0),o=J(wl,n.length-1),s=null==l.min?3==e.distr?function(e,t,l){let n=fe,i=-fe;for(let o=t;l>=o;o++)e[o]>0&&(n=ne(n,e[o]),i=ie(i,e[o]));return[n==fe?1:n,i==-fe?10:i]}(n,t,o):function(e,t,l,n){let i=fe,o=-fe;if(1==n)i=e[t],o=e[l];else if(-1==n)i=e[l],o=e[t];else for(let n=t;l>=n;n++)null!=e[n]&&(i=ne(i,e[n]),o=ie(o,e[n]));return[i,o]}(n,t,o,i):[l.min,l.max];e.min=ne(e.min,l.min=s[0]),e.max=ie(e.max,l.max=s[1])}}function $l(e,t){let l=t?ce[e].points:ce[e];l._stroke=l.stroke(v,e),l._fill=l.fill(v,e)}function Ql(e,t){let l=t?ce[e].points:ce[e],n=l._stroke,i=l._fill,{stroke:o,fill:s,clip:r,flags:u}=l._paths,a=null,f=ke(l.width*k,3),c=f%2/2;t&&null==i&&(i=f>0?"#fff":n);let h=1==l.pxAlign;if(h&&B.translate(c,c),!t){let e=At,t=Wt,n=Yt,i=It,o=f*k/2;0==l.min&&(i+=o),0==l.max&&(t-=o,i+=o),a=new Path2D,a.rect(e,t,n,i)}t?en(n,f,l.dash,l.cap,i,o,s,u,r):function(e,t,l,n,i,o,s,r,u,a,f){let c=!1;ye.forEach(((h,d)=>{if(h.series[0]==e){let e,p=ce[h.series[1]],m=g[h.series[1]],x=(p._paths||Ee).band;Te(x)&&(x=1==h.dir?x[0]:x[1]);let w=null;p.show&&x&&function(e,t,l){for(t=J(t,0),l=J(l,e.length-1);l>=t;){if(null!=e[t])return!0;t++}return!1}(m,xl,wl)?(w=h.fill(v,d)||o,e=p._paths.clip):x=null,en(t,l,n,i,w,s,r,u,a,f,e,x),c=!0}})),c||en(t,l,n,i,o,s,r,u,a,f)}(e,n,f,l.dash,l.cap,i,o,s,u,a,r),h&&B.translate(-c,-c)}function en(e,t,l,n,i,o,s,r,u,a,f,c){Kl(e,t,l,n,i),(u||a||c)&&(B.save(),u&&B.clip(u),a&&B.clip(a)),c?3==(3&r)?(B.clip(c),f&&B.clip(f),ln(i,s),tn(e,o,t)):2&r?(ln(i,s),B.clip(c),tn(e,o,t)):1&r&&(B.save(),B.clip(c),f&&B.clip(f),ln(i,s),B.restore(),tn(e,o,t)):(ln(i,s),tn(e,o,t)),(u||a||c)&&B.restore()}function tn(e,t,l){l>0&&(t instanceof Map?t.forEach(((e,t)=>{B.strokeStyle=bl=t,B.stroke(e)})):null!=t&&e&&B.stroke(t))}function ln(e,t){t instanceof Map?t.forEach(((e,t)=>{B.fillStyle=vl=t,B.fill(e)})):null!=t&&e&&B.fill(t)}function nn(e,t,l,n,i,o,s,r,u,a){let f=s%2/2;1==ee&&B.translate(f,f),Kl(r,s,u,a,r),B.beginPath();let c,h,d,p,m=i+(0==n||3==n?-o:o);0==l?(h=i,p=m):(c=i,d=m);for(let n=0;e.length>n;n++)null!=t[n]&&(0==l?c=d=e[n]:h=p=e[n],B.moveTo(c,h),B.lineTo(d,p));B.stroke(),1==ee&&B.translate(-f,-f)}function on(e){let t=!0;return me.forEach(((l,n)=>{if(!l.show)return;let i=ve[l.scale];if(null==i.min)return void(l._show&&(t=!1,l._show=!1,rn(!1)));l._show||(t=!1,l._show=!0,rn(!1));let o=l.side,s=o%2,{min:r,max:u}=i,[a,f]=function(e,t,l,n){let i,o=me[e];if(n>0){let s=o._space=o.space(v,e,t,l,n);i=Il(t,l,o._incrs=o.incrs(v,e,t,l,n,s),n,s)}else i=[0,0];return o._found=i}(n,r,u,0==s?Et:zt);if(0==f)return;let c=l._splits=l.splits(v,n,r,u,a,f,2==i.distr),h=2==i.distr?c.map((e=>Bl[e])):c,d=2==i.distr?Bl[c[1]]-Bl[c[0]]:a,p=l._values=l.values(v,l.filter(v,h,n,f,d),n,f,d);l._rotate=2==o?l.rotate(v,p,n,f):0;let m=l._size;l._size=le(l.size(v,p,n,e)),null!=m&&l._size!=m&&(t=!1)})),t}function sn(e){let t=!0;return pl.forEach(((l,n)=>{let i=l(v,n,hl,e);i!=ml[n]&&(t=!1),ml[n]=i})),t}function rn(e){ce.forEach(((t,l)=>{l>0&&(t._paths=null,e&&(1==y?(t.min=null,t.max=null):t.facets.forEach((e=>{e.min=null,e.max=null}))))}))}v.setData=Jl;let un,an,fn,cn,hn,dn,pn,mn,gn,xn,wn,_n,bn=!1;function vn(){bn||(Le(kn),bn=!0)}function kn(){Ot&&(function(){let e=Fe(ve,Ye);for(let t in e){let l=e[t],n=Ne[t];if(null!=n&&null!=n.min)He(l,n),t==Me&&rn(!0);else if(t!=Me||2==y)if(0==gl&&null==l.from){let e=l.range(v,null,null,t);l.min=e[0],l.max=e[1]}else l.min=fe,l.max=-fe}if(gl>0){ce.forEach(((t,l)=>{if(1==y){let n=t.scale,i=e[n],o=Ne[n];if(0==l){let e=i.range(v,i.min,i.max,n);i.min=e[0],i.max=e[1],xl=G(i.min,g[0]),wl=G(i.max,g[0]),wl-xl>1&&(i.min>g[0][xl]&&xl++,g[0][wl]>i.max&&wl--),t.min=Bl[xl],t.max=Bl[wl]}else t.show&&t.auto&&Zl(i,o,t,g[l],t.sorted);t.idxs[0]=xl,t.idxs[1]=wl}else if(l>0&&t.show&&t.auto){let[n,i]=t.facets,o=n.scale,s=i.scale,[r,u]=g[l];Zl(e[o],Ne[o],n,r,n.sorted),Zl(e[s],Ne[s],i,u,i.sorted),t.min=i.min,t.max=i.max}}));for(let t in e){let l=e[t],n=Ne[t];if(null==l.from&&(null==n||null==n.min)){let e=l.range(v,l.min==fe?null:l.min,l.max==-fe?null:l.max,t);l.min=e[0],l.max=e[1]}}}for(let t in e){let l=e[t];if(null!=l.from){let n=e[l.from];if(null==n.min)l.min=l.max=null;else{let e=l.range(v,n.min,n.max,t);l.min=e[0],l.max=e[1]}}}let t={},l=!1;for(let n in e){let i=e[n],o=ve[n];if(o.min!=i.min||o.max!=i.max){o.min=i.min,o.max=i.max;let e=o.distr;o._min=3==e?re(o.min):4==e?ae(o.min,o.asinh):o.min,o._max=3==e?re(o.max):4==e?ae(o.max,o.asinh):o.max,t[n]=l=!0}}if(l){ce.forEach(((e,l)=>{2==y?l>0&&t.y&&(e._paths=null):t[e.scale]&&(e._paths=null)}));for(let e in t)jt=!0,ni("setScale",e);sl.show&&sl.left>=0&&(qt=tl=!0)}for(let e in Ne)Ne[e]=null}(),Ot=!1),jt&&(function(){let e=!1,t=0;for(;!e;){t++;let l=on(t),n=sn(t);e=3==t||l&&n,e||(il(v.width,v.height),Nt=!0)}}(),jt=!1),Nt&&(E(K,s,Tt),E(K,i,Pt),E(K,l,Et),E(K,n,zt),E(X,s,Tt),E(X,i,Pt),E(X,l,Et),E(X,n,zt),E(q,l,Mt),E(q,n,St),U.width=te(Mt*k),U.height=te(St*k),me.forEach((({_el:t,_show:l,_size:n,_pos:i,side:o})=>{if(null!=t)if(l){let l=o%2==1;E(t,l?"left":"top",i-(3===o||0===o?n:0)),E(t,l?"width":"height",n),E(t,l?"top":"left",l?Pt:Tt),E(t,l?"height":"width",l?zt:Et),S(t,e)}else M(t,e)})),bl=vl=kl=Ml=Sl=El=zl=jl=yl=null,Ul=1,Vn(!0),ni("setSize"),Nt=!1),Mt>0&&St>0&&(B.clearRect(0,0,U.width,U.height),ni("drawClear"),Pe.forEach((e=>e())),ni("draw")),zn.show&&Kt&&(Pn(zn),Kt=!1),sl.show&&qt&&(Un(null,!0,!1),qt=!1),H||(H=!0,v.status=1,ni("ready")),Vl=!1,bn=!1}function yn(e,t){let l=ve[e];if(null==l.from){if(0==gl){let n=l.range(v,t.min,t.max,e);t.min=n[0],t.max=n[1]}if(t.min>t.max){let e=t.min;t.min=t.max,t.max=e}if(gl>1&&null!=t.min&&null!=t.max&&1e-16>t.max-t.min)return;e==Me&&2==l.distr&&gl>0&&(t.min=G(t.min,g[0]),t.max=G(t.max,g[0]),t.min==t.max&&t.max++),Ne[e]=t,Ot=!0,vn()}}v.redraw=(e,t)=>{jt=t||!1,!1!==e?An(Me,Re.min,Re.max):vn()},v.setScale=yn;let Mn=!1;const Sn=sl.drag;let En=Sn.x,Dn=Sn.y;sl.show&&(sl.x&&(un=z("u-cursor-x",X)),sl.y&&(an=z("u-cursor-y",X)),0==Re.ori?(fn=un,cn=an):(fn=an,cn=un),wn=sl.left,_n=sl.top);const zn=v.select=He({show:!0,over:!0,left:0,width:0,top:0,height:0},u.select),Tn=zn.show?z("u-select",zn.over?X:K):null;function Pn(e,t){if(zn.show){for(let t in e)zn[t]=e[t],t in Kn&&E(Tn,t,e[t]);!1!==t&&ni("setSelect")}}function An(e,t,l){yn(e,{min:t,max:l})}function Wn(t,l,n,i){null!=l.focus&&function(e){if(e!=Fn){let t=null==e,l=1!=rl.alpha;ce.forEach(((n,i)=>{let o=t||0==i||i==e;n._focus=t?null:o,l&&function(e,t){ce[e].alpha=t,sl.show&&fl[e]&&(fl[e].style.opacity=t),Ze&&nt[e]&&(nt[e].style.opacity=t)}(i,o?1:rl.alpha)})),Fn=e,l&&vn()}}(t),null!=l.show&&ce.forEach(((n,i)=>{0>=i||t!=i&&null!=t||(n.show=l.show,function(t){let l=Ze?nt[t]:null;ce[t].show?l&&S(l,e):(l&&M(l,e),fl.length>1&&P(fl[t],-10,-10,Et,zt))}(i),An(2==y?n.facets[1].scale:n.scale,null,null),vn())})),!1!==n&&ni("setSeries",t,l),i&&ri("setSeries",v,t,l)}let Yn,Cn,Fn;v.setSelect=Pn,v.setSeries=Wn,v.addBand=function(e,t){e.fill=pe(e.fill||null),e.dir=J(e.dir,-1),ye.splice(t=null==t?ye.length:t,0,e)},v.setBand=function(e,t){He(ye[e],t)},v.delBand=function(e){null==e?ye.length=0:ye.splice(e,1)};const Hn={focus:!0};function Rn(e,t,l){let n=ve[t];l&&(e=e/k-(1==n.ori?Pt:Tt));let i=Et;1==n.ori&&(i=zt,e=i-e),-1==n.dir&&(e=i-e);let o=n._min,s=o+e/i*(n._max-o),r=n.distr;return 3==r?oe(10,s):4==r?((e,t=1)=>Z.sinh(e)*t)(s,n.asinh):s}function Ln(e,t){E(Tn,s,zn.left=e),E(Tn,l,zn.width=t)}function Gn(e,t){E(Tn,i,zn.top=e),E(Tn,n,zn.height=t)}Ze&&ul&&R(p,tt,(()=>{sl._lock||null!=Fn&&Wn(null,Hn,!0,ii.setSeries)})),v.valToIdx=e=>G(e,g[0]),v.posToIdx=function(e,t){return G(Rn(e,Me,t),g[0],xl,wl)},v.posToVal=Rn,v.valToPos=(e,t,l)=>0==ve[t].ori?A(e,ve[t],l?Yt:Et,l?At:0):Y(e,ve[t],l?It:zt,l?Wt:0),v.batch=function(e){e(v),vn()},v.setCursor=(e,t,l)=>{wn=e.left,_n=e.top,Un(null,t,l)};let In=0==Re.ori?Ln:Gn,On=1==Re.ori?Ln:Gn;function Nn(e,t){if(null!=e){let t=e.idx;Xe.idx=t,ce.forEach(((e,l)=>{(l>0||!ot)&&jn(l,t)}))}Ze&&Xe.live&&function(){if(Ze&&Xe.live)for(let e=2==y?1:0;ce.length>e;e++){if(0==e&&ot)continue;let t=Xe.values[e],l=0;for(let n in t)it[e][l++].firstChild.nodeValue=t[n]}}(),tl=!1,!1!==t&&ni("setLegend")}function jn(e,t){let l;if(null==t)l=st;else{let n=ce[e],i=0==e&&2==Ge?Bl:g[e];l=ot?n.values(v,e,t):{_:n.value(v,i[t],e,t)}}Xe.values[e]=l}function Un(e,t,l){let n;gn=wn,xn=_n,[wn,_n]=sl.move(v,wn,_n),sl.show&&(fn&&P(fn,te(wn),0,Et,zt),cn&&P(cn,0,te(_n),Et,zt)),Yn=fe;let i=0==Re.ori?Et:zt,o=1==Re.ori?Et:zt;if(0>wn||0==gl||xl>wl){n=null;for(let e=0;ce.length>e;e++)e>0&&fl.length>1&&P(fl[e],-10,-10,Et,zt);if(ul&&Wn(null,Hn,!0,null==e&&ii.setSeries),Xe.live){Ke.fill(null),tl=!0;for(let e=0;ce.length>e;e++)Xe.values[e]=st}}else{let e,t,l;1==y&&(e=0==Re.ori?wn:_n,t=Rn(e,Me),n=G(t,g[0],xl,wl),l=be(Ie(g[0][n],Re,i,0),.5));for(let e=2==y?1:0;ce.length>e;e++){let s=ce[e],r=Ke[e],u=1==y?g[e][r]:g[e][1][r],a=sl.dataIdx(v,e,n,t),f=1==y?g[e][a]:g[e][1][a];tl=tl||f!=u||a!=r,Ke[e]=a;let c=a==n?l:be(Ie(1==y?g[0][a]:g[e][0][a],Re,i,0),.5);if(e>0&&s.show){let t,l,n=null==f?-10:be(Oe(f,1==y?ve[s.scale]:ve[s.facets[1].scale],o,0),.5);if(n>0&&1==y){let t=Q(n-_n);t>Yn||(Yn=t,Cn=e)}if(0==Re.ori?(t=c,l=n):(t=n,l=c),tl&&fl.length>1){W(fl[e],sl.points.fill(v,e),sl.points.stroke(v,e));let n,i,o,s,r=!0,u=sl.points.bbox;if(null!=u){r=!1;let t=u(v,e);o=t.left,s=t.top,n=t.width,i=t.height}else o=t,s=l,n=i=sl.points.size(v,e);C(fl[e],n,i,r),P(fl[e],o,s,Et,zt)}}if(Xe.live){if(!tl||0==e&&ot)continue;jn(e,a)}}}if(sl.idx=n,sl.left=wn,sl.top=_n,tl&&(Xe.idx=n,Nn()),zn.show&&Mn)if(null!=e){let[t,l]=ii.scales,[n,s]=ii.match,[r,u]=e.cursor.sync.scales,a=e.cursor.drag;if(En=a._x,Dn=a._y,En||Dn){let a,f,c,h,d,{left:p,top:m,width:g,height:x}=e.select,w=e.scales[t].ori,_=e.posToVal,b=null!=t&&n(t,r),v=null!=l&&s(l,u);b&&En?(0==w?(a=p,f=g):(a=m,f=x),c=ve[t],h=Ie(_(a,r),c,i,0),d=Ie(_(a+f,r),c,i,0),In(ne(h,d),Q(d-h))):In(0,i),v&&Dn?(1==w?(a=p,f=g):(a=m,f=x),c=ve[l],h=Oe(_(a,u),c,o,0),d=Oe(_(a+f,u),c,o,0),On(ne(h,d),Q(d-h))):On(0,o)}else Xn()}else{let e=Q(gn-hn),t=Q(xn-dn);if(1==Re.ori){let l=e;e=t,t=l}En=Sn.x&&e>=Sn.dist,Dn=Sn.y&&t>=Sn.dist;let l,n,s=Sn.uni;null!=s?En&&Dn&&(En=e>=s,Dn=t>=s,En||Dn||(t>e?Dn=!0:En=!0)):Sn.x&&Sn.y&&(En||Dn)&&(En=Dn=!0),En&&(0==Re.ori?(l=pn,n=wn):(l=mn,n=_n),In(ne(l,n),Q(n-l)),Dn||On(0,o)),Dn&&(1==Re.ori?(l=pn,n=wn):(l=mn,n=_n),On(ne(l,n),Q(n-l)),En||In(0,i)),En||Dn||(In(0,0),On(0,0))}if(Sn._x=En,Sn._y=Dn,null==e){if(l){if(null!=oi){let[e,t]=ii.scales;ii.values[0]=null!=e?Rn(0==Re.ori?wn:_n,e):null,ii.values[1]=null!=t?Rn(1==Re.ori?wn:_n,t):null}ri(f,v,wn,_n,Et,zt,n)}if(ul){let e=l&&ii.setSeries,t=rl.prox;null==Fn?Yn>t||Wn(Cn,Hn,!0,e):Yn>t?Wn(null,Hn,!0,e):Cn!=Fn&&Wn(Cn,Hn,!0,e)}}!1!==t&&ni("setCursor")}v.setLegend=Nn;let Bn=null;function Vn(e){!0===e?Bn=null:(Bn=X.getBoundingClientRect(),ni("syncRect",Bn))}function Jn(e,t,l,n,i,o){sl._lock||Mn&&null!=e&&0==e.movementX&&0==e.movementY||(qn(e,t,l,n,i,o,0,!1,null!=e),null!=e?Un(null,!0,!0):Un(t,!0,!1))}function qn(e,t,l,n,i,o,s,r,u){if(null==Bn&&Vn(!1),null!=e)l=e.clientX-Bn.left,n=e.clientY-Bn.top;else{if(0>l||0>n)return wn=-10,void(_n=-10);let[e,s]=ii.scales,r=t.cursor.sync,[u,a]=r.values,[f,c]=r.scales,[h,d]=ii.match,p=t.axes[0].side%2==1,m=0==Re.ori?Et:zt,g=1==Re.ori?Et:zt,x=p?o:i,w=p?i:o,_=p?n:l,b=p?l:n;if(l=null!=f?h(e,f)?F(u,ve[e],m,0):-10:m*(_/x),n=null!=c?d(s,c)?F(a,ve[s],g,0):-10:g*(b/w),1==Re.ori){let e=l;l=n,n=e}}u&&(l>1&&Et-1>l||(l=he(l,Et)),n>1&&zt-1>n||(n=he(n,zt))),r?(hn=l,dn=n,[pn,mn]=sl.move(v,l,n)):(wn=l,_n=n)}const Kn={width:0,height:0,left:0,top:0};function Xn(){Pn(Kn,!1)}function Zn(e,t,l,n,i,o){Mn=!0,En=Dn=Sn._x=Sn._y=!1,qn(e,t,l,n,i,o,0,!0,!1),null!=e&&(ct(h,_,$n),ri(c,v,pn,mn,Et,zt,null))}function $n(e,t,l,n,i,o){Mn=Sn._x=Sn._y=!1,qn(e,t,l,n,i,o,0,!1,!0);let{left:s,top:r,width:u,height:a}=zn,f=u>0||a>0;if(f&&Pn(zn),Sn.setScale&&f){let e=s,t=u,l=r,n=a;if(1==Re.ori&&(e=r,t=a,l=s,n=u),En&&An(Me,Rn(e,Me),Rn(e+t,Me)),Dn)for(let e in ve){let t=ve[e];e!=Me&&null==t.from&&t.min!=fe&&An(e,Rn(l+n,e),Rn(l,e))}Xn()}else sl.lock&&(sl._lock=!sl._lock,sl._lock||Un(null,!0,!1));null!=e&&(bt(h,_),ri(h,v,wn,_n,Et,zt,null))}function Qn(e){ql(),Xn(),null!=e&&ri(m,v,wn,_n,Et,zt,null)}function ei(){me.forEach(Nl),nl(v.width,v.height,!0)}R(x,b,ei);const ti={};ti.mousedown=Zn,ti.mousemove=Jn,ti.mouseup=$n,ti.dblclick=Qn,ti.setSeries=(e,t,l,n)=>{Wn(l,n,!0,!1)},sl.show&&(ct(c,X,Zn),ct(f,X,Jn),ct(d,X,Vn),ct(p,X,(function(){if(!sl._lock){let e=Mn;if(Mn){let e,t,l=!0,n=!0,i=10;0==Re.ori?(e=En,t=Dn):(e=Dn,t=En),e&&t&&(l=i>=wn||wn>=Et-i,n=i>=_n||_n>=zt-i),e&&l&&(wn=pn>wn?0:Et),t&&n&&(_n=mn>_n?0:zt),Un(null,!0,!0),Mn=!1}wn=-10,_n=-10,Un(null,!0,!0),e&&(Mn=e)}})),ct(m,X,Qn),Dl.add(v),v.syncRect=Vn);const li=v.hooks=u.hooks||{};function ni(e,t,l){e in li&&li[e].forEach((e=>{e.call(null,v,t,l)}))}(u.plugins||[]).forEach((e=>{for(let t in e.hooks)li[t]=(li[t]||[]).concat(e.hooks[t])}));const ii=He({key:null,setSeries:!1,filters:{pub:we,sub:we},scales:[Me,ce[1]?ce[1].scale:null],match:[_e,_e],values:[null,null]},sl.sync);sl.sync=ii;const oi=ii.key,si=ll(oi);function ri(e,t,l,n,i,o,s){ii.filters.pub(e,t,l,n,i,o,s)&&si.pub(e,t,l,n,i,o,s)}function ui(){ni("init",u,g),Jl(g||u.data,!1),Ne[Me]?yn(Me,Ne[Me]):ql(),Kt=zn.show,qt=tl=!0,nl(u.width,u.height)}return si.sub(v),v.pub=function(e,t,l,n,i,o,s){ii.filters.sub(e,t,l,n,i,o,s)&&ti[e](null,t,l,n,i,o,s)},v.destroy=function(){si.unsub(v),Dl.delete(v),ft.clear(),L(x,b,ei),I.remove(),tt?.remove(),ni("destroy")},ce.forEach(cl),me.forEach((function(e,t){if(e._show=e.show,e.show){let l=e.side%2,n=ve[e.scale];null==n&&(e.scale=l?ce[1].scale:Me,n=ve[e.scale]);let i=n.time;e.size=pe(e.size),e.space=pe(e.space),e.rotate=pe(e.rotate),e.incrs=pe(e.incrs||(2==n.distr?Qe:i?1==ue?ht:mt:et)),e.splits=pe(e.splits||(i&&1==n.distr?Be:3==n.distr?Lt:4==n.distr?Gt:Rt)),e.stroke=pe(e.stroke),e.grid.stroke=pe(e.grid.stroke),e.ticks.stroke=pe(e.ticks.stroke),e.border.stroke=pe(e.border.stroke);let o=e.values;e.values=Te(o)&&!Te(o[0])?pe(o):i?Te(o)?_t(je,wt(o,Ue)):Ae(o)?function(e,t){let l=Je(t);return(t,n)=>n.map((t=>l(e(t))))}(je,o):o||Ve:o||Ht,e.filter=pe(e.filter||(3>n.distr||10!=n.log?ge:Ut)),e.font=Ol(e.font),e.labelFont=Ol(e.labelFont),e._size=e.size(v,null,t,0),e._space=e._rotate=e._incrs=e._found=e._splits=e._values=null,e._size>0&&(hl[t]=!0,e._el=z("u-axis",q))}})),w?w instanceof HTMLElement?(w.appendChild(I),ui()):w(v,ui):ui(),v}jl.assign=He,jl.fmtNum=X,jl.rangeNum=V,jl.rangeLog=O,jl.rangeAsinh=N,jl.orient=nl,jl.pxRatio=k,jl.join=function(e,t){let l=new Set;for(let t=0;e.length>t;t++){let n=e[t][0],i=n.length;for(let e=0;i>e;e++)l.add(n[e])}let n=[Array.from(l).sort(((e,t)=>e-t))],i=n[0].length,o=new Map;for(let e=0;i>e;e++)o.set(n[0][e],e);for(let l=0;e.length>l;l++){let s=e[l],r=s[0];for(let e=1;s.length>e;e++){let u=s[e],a=Array(i).fill(void 0),f=t?t[l][e]:1,c=[];for(let e=0;u.length>e;e++){let t=u[e],l=o.get(r[e]);null===t?0!=f&&(a[l]=t,2==f&&c.push(l)):a[l]=t}Re(a,c,i),n.push(a)}}return n},jl.fmtDate=Je,jl.tzDate=function(e,t){let l;return"UTC"==t||"Etc/UTC"==t?l=new Date(+e+6e4*e.getTimezoneOffset()):t==qe?l=e:(l=new Date(e.toLocaleString("en-US",{timeZone:t})),l.setMilliseconds(e.getMilliseconds())),l},jl.sync=ll;{jl.addGap=function(e,t,l){let n=e[e.length-1];n&&n[0]==t?n[1]=l:e.push([t,l])},jl.clipGaps=rl;let e=jl.paths={points:vl};e.linear=Sl,e.stepped=function(e){const t=J(e.align,1),l=J(e.ascDesc,!1),n=J(e.alignGaps,0),i=J(e.extend,!1);return(e,o,s,r)=>nl(e,o,((u,a,f,c,h,d,p,m,g,x,w)=>{let _=u.pxRound,{left:b,width:v}=e.bbox,y=e=>_(d(e,c,x,m)),M=e=>_(p(e,h,w,g)),S=0==c.ori?dl:pl;const E={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},D=E.stroke,z=c.dir*(0==c.ori?1:-1);s=I(f,s,r,1),r=I(f,s,r,-1);let T=M(f[1==z?s:r]),P=y(a[1==z?s:r]),A=P,W=P;i&&-1==t&&(W=b,S(D,W,T)),S(D,P,T);for(let e=1==z?s:r;e>=s&&r>=e;e+=z){let l=f[e];if(null==l)continue;let n=y(a[e]),i=M(l);1==t?S(D,n,T):S(D,A,i),S(D,n,i),T=i,A=n}let Y=A;i&&1==t&&(Y=b+v,S(D,Y,T));let[C,F]=il(e,o);if(null!=u.fill||0!=C){let t=E.fill=new Path2D(D),l=M(u.fillTo(e,o,u.min,u.max,C));S(t,Y,l),S(t,W,l)}if(!u.spanGaps){let i=[];i.push(...ul(a,f,s,r,z,y,n));let h=u.width*k/2,d=l||1==t?h:-h,p=l||-1==t?-h:h;i.forEach((e=>{e[0]+=d,e[1]+=p})),E.gaps=i=u.gaps(e,o,s,r,i),E.clip=rl(i,c.ori,m,g,x,w)}return 0!=F&&(E.band=2==F?[sl(e,o,s,r,D,-1),sl(e,o,s,r,D,1)]:sl(e,o,s,r,D,F)),E}))},e.bars=function(e){const t=J((e=e||Ee).size,[.6,fe,1]),l=e.align||0,n=(e.gap||0)*k,i=J(e.radius,0),o=1-t[0],s=J(t[1],fe)*k,r=J(t[2],1)*k,u=J(e.disp,Ee),a=J(e.each,(()=>{})),{fill:f,stroke:c}=u;return(e,t,h,d)=>nl(e,t,((p,m,g,x,w,_,b,v,y,M,S)=>{let E=p.pxRound;const D=x.dir*(0==x.ori?1:-1),z=w.dir*(1==w.ori?1:-1);let T,P,A=0==x.ori?ml:gl,W=0==x.ori?a:(e,t,l,n,i,o,s)=>{a(e,t,l,i,n,s,o)},[Y,C]=il(e,t),F=3==w.distr?1==Y?w.max:w.min:0,H=b(F,w,S,y),R=E(p.width*k),L=!1,G=null,I=null,O=null,N=null;null==f||0!=R&&null==c||(L=!0,G=f.values(e,t,h,d),I=new Map,new Set(G).forEach((e=>{null!=e&&I.set(e,new Path2D)})),R>0&&(O=c.values(e,t,h,d),N=new Map,new Set(O).forEach((e=>{null!=e&&N.set(e,new Path2D)}))));let{x0:j,size:U}=u;if(null!=j&&null!=U){m=j.values(e,t,h,d),2==j.unit&&(m=m.map((t=>e.posToVal(v+t*M,x.key,!0))));let l=U.values(e,t,h,d);P=2==U.unit?l[0]*M:_(l[0],x,M,v)-_(0,x,M,v),P=E(P-R),T=1==D?-R/2:P+R/2}else{let e=M;if(m.length>1){let t=null;for(let l=0,n=1/0;m.length>l;l++)if(void 0!==g[l]){if(null!=t){let i=Q(m[l]-m[t]);n>i&&(n=i,e=Q(_(m[l],x,M,v)-_(m[t],x,M,v)))}t=l}}P=E(ne(s,ie(r,e-e*o))-R-n),T=(0==l?P/2:l==D?0:P)-l*D*n/2}const B={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:3};let V;0!=C&&(B.band=new Path2D,V=E(b(1==C?w.max:w.min,w,S,y)));const q=L?null:new Path2D,K=B.band;let{y0:X,y1:Z}=u,$=null;null!=X&&null!=Z&&(g=Z.values(e,t,h,d),$=X.values(e,t,h,d));for(let l=1==D?h:d;l>=h&&d>=l;l+=D){let n=g[l];if(void 0===n)continue;let o=_(2!=x.distr||null!=u?m[l]:l,x,M,v),s=b(J(n,F),w,S,y);null!=$&&null!=n&&(H=b($[l],w,S,y));let r=E(o-T),a=E(ie(s,H)),f=E(ne(s,H)),c=a-f,h=i*P;null!=n&&(L?(R>0&&null!=O[l]&&A(N.get(O[l]),r,f+ee(R/2),P,ie(0,c-R),h),null!=G[l]&&A(I.get(G[l]),r,f+ee(R/2),P,ie(0,c-R),h)):A(q,r,f+ee(R/2),P,ie(0,c-R),h),W(e,t,l,r-R/2,f,P+R,c)),0!=C&&(z*C==1?(a=f,f=V):(f=a,a=V),c=a-f,A(K,r-R/2,f,P+R,ie(0,c),0))}return R>0&&(B.stroke=L?N:q),B.fill=L?I:q,B}))},e.spline=function(e){return function(e,t){const l=J(t?.alignGaps,0);return(t,n,i,o)=>nl(t,n,((s,r,u,a,f,c,h,d,p,m,g)=>{let x,w,_,b=s.pxRound,v=e=>b(c(e,a,m,d)),k=e=>b(h(e,f,g,p));0==a.ori?(x=cl,_=dl,w=_l):(x=hl,_=pl,w=bl);const y=a.dir*(0==a.ori?1:-1);i=I(u,i,o,1),o=I(u,i,o,-1);let M=v(r[1==y?i:o]),S=M,E=[],D=[];for(let e=1==y?i:o;e>=i&&o>=e;e+=y)if(null!=u[e]){let t=v(r[e]);E.push(S=t),D.push(k(u[e]))}const z={stroke:e(E,D,x,_,w,b),fill:null,clip:null,band:null,gaps:null,flags:1},T=z.stroke;let[P,A]=il(t,n);if(null!=s.fill||0!=P){let e=z.fill=new Path2D(T),l=k(s.fillTo(t,n,s.min,s.max,P));_(e,S,l),_(e,M,l)}if(!s.spanGaps){let e=[];e.push(...ul(r,u,i,o,y,v,l)),z.gaps=e=s.gaps(t,n,i,o,e),z.clip=rl(e,a.ori,d,p,m,g)}return 0!=A&&(z.band=2==A?[sl(t,n,i,o,T,-1),sl(t,n,i,o,T,1)]:sl(t,n,i,o,T,A)),z}))}(El,e)}}return jl}();
/*! https://github.com/leeoniya/uPlot (v1.6.24) */
var uPlot=function(){"use strict";const e="u-off",t="u-label",l="width",n="height",i="top",o="bottom",s="left",r="right",u="#000",a=u+"0",f="mousemove",c="mousedown",h="mouseup",d="mouseenter",p="mouseleave",m="dblclick",g="change",x="dppxchange",w="--",b="undefined"!=typeof window,_=b?document:null,k=b?window:null,v=b?navigator:null;let y,M;function S(e,t){if(null!=t){let l=e.classList;!l.contains(t)&&l.add(t)}}function E(e,t){let l=e.classList;l.contains(t)&&l.remove(t)}function z(e,t,l){e.style[t]=l+"px"}function D(e,t,l,n){let i=_.createElement(e);return null!=t&&S(i,t),null!=l&&l.insertBefore(i,n),i}function T(e,t){return D("div",e,t)}const P=new WeakMap;function A(t,l,n,i,o){let s="translate("+l+"px,"+n+"px)";s!=P.get(t)&&(t.style.transform=s,P.set(t,s),0>l||0>n||l>i||n>o?S(t,e):E(t,e))}const W=new WeakMap;function Y(e,t,l){let n=t+l;n!=W.get(e)&&(W.set(e,n),e.style.background=t,e.style.borderColor=l)}const C=new WeakMap;function F(e,t,l,n){let i=t+""+l;i!=C.get(e)&&(C.set(e,i),e.style.height=l+"px",e.style.width=t+"px",e.style.marginLeft=n?-t/2+"px":0,e.style.marginTop=n?-l/2+"px":0)}const H={passive:!0},R={...H,capture:!0};function I(e,t,l,n){t.addEventListener(e,l,n?R:H)}function L(e,t,l,n){t.removeEventListener(e,l,n?R:H)}function G(e,t,l,n){let i;l=l||0;let o=2147483647>=(n=n||t.length-1);for(;n-l>1;)i=o?l+n>>1:te((l+n)/2),e>t[i]?l=i:n=i;return e-t[l]>t[n]-e?n:l}function O(e,t,l,n){for(let i=1==n?t:l;i>=t&&l>=i;i+=n)if(null!=e[i])return i;return-1}function N(e,t,l,n){let i=re(e),o=re(t),s=10==l?ue:ae;e==t&&(-1==i?(e*=l,t/=l):(e/=l,t*=l));let r=1==o?ne:te,u=(1==i?te:ne)(s(ee(e))),a=r(s(ee(t))),f=se(l,u),c=se(l,a);return 10==l&&(0>u&&(f=Me(f,-u)),0>a&&(c=Me(c,-a))),n||2==l?(e=f*i,t=c*o):(e=ye(e,f),t=ve(t,c)),[e,t]}function j(e,t,l,n){let i=N(e,t,l,n);return 0==e&&(i[0]=0),0==t&&(i[1]=0),i}b&&function e(){let t=devicePixelRatio;y!=t&&(y=t,M&&L(g,M,e),M=matchMedia(`(min-resolution: ${y-.001}dppx) and (max-resolution: ${y+.001}dppx)`),I(g,M,e),k.dispatchEvent(new CustomEvent(x)))}();const U={mode:3,pad:.1},B={pad:0,soft:null,mode:0},V={min:B,max:B};function J(e,t,l,n){return Ce(l)?K(e,t,l):(B.pad=l,B.soft=n?0:null,B.mode=n?3:0,K(e,t,V))}function q(e,t){return null==e?t:e}function K(e,t,l){let n=l.min,i=l.max,o=q(n.pad,0),s=q(i.pad,0),r=q(n.hard,-ce),u=q(i.hard,ce),a=q(n.soft,ce),f=q(i.soft,-ce),c=q(n.mode,0),h=q(i.mode,0),d=t-e,p=ue(d),m=oe(ee(e),ee(t)),g=ue(m),x=ee(g-p);(1e-9>d||x>10)&&(d=0,0!=e&&0!=t||(d=1e-9,2==c&&a!=ce&&(o=0),2==h&&f!=-ce&&(s=0)));let w=d||m||1e3,b=ue(w),_=se(10,te(b)),k=Me(ye(e-w*(0==d?0==e?.1:1:o),_/10),9),v=a>e||1!=c&&(3!=c||k>a)&&(2!=c||a>k)?ce:a,y=oe(r,v>k&&e>=v?v:ie(v,k)),M=Me(ve(t+w*(0==d?0==t?.1:1:s),_/10),9),S=t>f||1!=h&&(3!=h||f>M)&&(2!=h||M>f)?-ce:f,E=ie(u,M>S&&S>=t?S:oe(S,M));return y==E&&0==y&&(E=100),[y,E]}const X=new Intl.NumberFormat(b?v.language:"en-US"),Z=e=>X.format(e),$=Math,Q=$.PI,ee=$.abs,te=$.floor,le=$.round,ne=$.ceil,ie=$.min,oe=$.max,se=$.pow,re=$.sign,ue=$.log10,ae=$.log2,fe=(e,t=1)=>$.asinh(e/t),ce=1/0;function he(e){return 1+(0|ue((e^e>>31)-(e>>31)))}function de(e,t,l){return ie(oe(e,t),l)}function pe(e){return"function"==typeof e?e:()=>e}const me=e=>e,ge=(e,t)=>t,xe=()=>null,we=()=>!0,be=(e,t)=>e==t,_e=e=>Me(e,14);function ke(e,t){return _e(Me(_e(e/t))*t)}function ve(e,t){return _e(ne(_e(e/t))*t)}function ye(e,t){return _e(te(_e(e/t))*t)}function Me(e,t=0){if(We(e))return e;let l=10**t;return le(e*l*(1+Number.EPSILON))/l}const Se=new Map;function Ee(e){return((""+e).split(".")[1]||"").length}function ze(e,t,l,n){let i=[],o=n.map(Ee);for(let s=t;l>s;s++){let t=ee(s),l=Me(se(e,s),t);for(let e=0;n.length>e;e++){let r=n[e]*l,u=(0>r||0>s?t:0)+(o[e]>s?o[e]:0),a=Me(r,u);i.push(a),Se.set(a,u)}}return i}const De={},Te=[],Pe=[null,null],Ae=Array.isArray,We=Number.isInteger;function Ye(e){return"string"==typeof e}function Ce(e){let t=!1;if(null!=e){let l=e.constructor;t=null==l||l==Object}return t}function Fe(e){return null!=e&&"object"==typeof e}const He=Object.getPrototypeOf(Uint8Array);function Re(e,t=Ce){let l;if(Ae(e)){let n=e.find((e=>null!=e));if(Ae(n)||t(n)){l=Array(e.length);for(let n=0;e.length>n;n++)l[n]=Re(e[n],t)}else l=e.slice()}else if(e instanceof He)l=e.slice();else if(t(e)){l={};for(let n in e)l[n]=Re(e[n],t)}else l=e;return l}function Ie(e){let t=arguments;for(let l=1;t.length>l;l++){let n=t[l];for(let t in n)Ce(e[t])?Ie(e[t],Re(n[t])):e[t]=Re(n[t])}return e}function Le(e,t,l){for(let n,i=0,o=-1;t.length>i;i++){let s=t[i];if(s>o){for(n=s-1;n>=0&&null==e[n];)e[n--]=null;for(n=s+1;l>n&&null==e[n];)e[o=n++]=null}}}const Ge="undefined"==typeof queueMicrotask?e=>Promise.resolve().then(e):queueMicrotask,Oe=["January","February","March","April","May","June","July","August","September","October","November","December"],Ne=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function je(e){return e.slice(0,3)}const Ue=Ne.map(je),Be=Oe.map(je),Ve={MMMM:Oe,MMM:Be,WWWW:Ne,WWW:Ue};function Je(e){return(10>e?"0":"")+e}const qe={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,t)=>t.MMMM[e.getMonth()],MMM:(e,t)=>t.MMM[e.getMonth()],MM:e=>Je(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>Je(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>Je(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return 0==t?12:t>12?t-12:t},AA:e=>12>e.getHours()?"AM":"PM",aa:e=>12>e.getHours()?"am":"pm",a:e=>12>e.getHours()?"a":"p",mm:e=>Je(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>Je(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>function(e){return(10>e?"00":100>e?"0":"")+e}(e.getMilliseconds())};function Ke(e,t){t=t||Ve;let l,n=[],i=/\{([a-z]+)\}|[^{]+/gi;for(;l=i.exec(e);)n.push("{"==l[0][0]?qe[l[1]]:l[0]);return e=>{let l="";for(let i=0;n.length>i;i++)l+="string"==typeof n[i]?n[i]:n[i](e,t);return l}}const Xe=(new Intl.DateTimeFormat).resolvedOptions().timeZone,Ze=e=>e%1==0,$e=[1,2,2.5,5],Qe=ze(10,-16,0,$e),et=ze(10,0,16,$e),tt=et.filter(Ze),lt=Qe.concat(et),nt="{YYYY}",it="\n"+nt,ot="{M}/{D}",st="\n"+ot,rt=st+"/{YY}",ut="{aa}",at="{h}:{mm}"+ut,ft="\n"+at,ct=":{ss}",ht=null;function dt(e){let t=1e3*e,l=60*t,n=60*l,i=24*n,o=30*i,s=365*i;return[(1==e?ze(10,0,3,$e).filter(Ze):ze(10,-3,0,$e)).concat([t,5*t,10*t,15*t,30*t,l,5*l,10*l,15*l,30*l,n,2*n,3*n,4*n,6*n,8*n,12*n,i,2*i,3*i,4*i,5*i,6*i,7*i,8*i,9*i,10*i,15*i,o,2*o,3*o,4*o,6*o,s,2*s,5*s,10*s,25*s,50*s,100*s]),[[s,nt,ht,ht,ht,ht,ht,ht,1],[28*i,"{MMM}",it,ht,ht,ht,ht,ht,1],[i,ot,it,ht,ht,ht,ht,ht,1],[n,"{h}"+ut,rt,ht,st,ht,ht,ht,1],[l,at,rt,ht,st,ht,ht,ht,1],[t,ct,rt+" "+at,ht,st+" "+at,ht,ft,ht,1],[e,ct+".{fff}",rt+" "+at,ht,st+" "+at,ht,ft,ht,1]],function(t){return(r,u,a,f,c,h)=>{let d=[],p=c>=s,m=c>=o&&s>c,g=t(a),x=Me(g*e,3),w=vt(g.getFullYear(),p?0:g.getMonth(),m||p?1:g.getDate()),b=Me(w*e,3);if(m||p){let l=m?c/o:0,n=p?c/s:0,i=x==b?x:Me(vt(w.getFullYear()+n,w.getMonth()+l,1)*e,3),r=new Date(le(i/e)),u=r.getFullYear(),a=r.getMonth();for(let o=0;f>=i;o++){let s=vt(u+n*o,a+l*o,1),r=s-t(Me(s*e,3));i=Me((+s+r)*e,3),i>f||d.push(i)}}else{let o=i>c?c:i,s=b+(te(a)-te(x))+ve(x-b,o);d.push(s);let p=t(s),m=p.getHours()+p.getMinutes()/l+p.getSeconds()/n,g=c/n,w=h/r.axes[u]._space;for(;s=Me(s+c,1==e?0:3),f>=s;)if(g>1){let e=te(Me(m+g,6))%24,l=t(s).getHours()-e;l>1&&(l=-1),s-=l*n,m=(m+g)%24,.7>Me((s-d[d.length-1])/c,3)*w||d.push(s)}else d.push(s)}return d}}]}const[pt,mt,gt]=dt(1),[xt,wt,bt]=dt(.001);function _t(e,t){return e.map((e=>e.map(((l,n)=>0==n||8==n||null==l?l:t(1==n||0==e[8]?l:e[1]+l)))))}function kt(e,t){return(l,n,i,o,s)=>{let r,u,a,f,c,h,d=t.find((e=>s>=e[0]))||t[t.length-1];return n.map((t=>{let l=e(t),n=l.getFullYear(),i=l.getMonth(),o=l.getDate(),s=l.getHours(),p=l.getMinutes(),m=l.getSeconds(),g=n!=r&&d[2]||i!=u&&d[3]||o!=a&&d[4]||s!=f&&d[5]||p!=c&&d[6]||m!=h&&d[7]||d[1];return r=n,u=i,a=o,f=s,c=p,h=m,g(l)}))}}function vt(e,t,l){return new Date(e,t,l)}function yt(e,t){return t(e)}function Mt(e,t){return(l,n,i,o)=>null==o?w:t(e(n))}ze(2,-53,53,[1]);const St={show:!0,live:!0,isolate:!1,mount:()=>{},markers:{show:!0,width:2,stroke:function(e,t){let l=e.series[t];return l.width?l.stroke(e,t):l.points.width?l.points.stroke(e,t):null},fill:function(e,t){return e.series[t].fill(e,t)},dash:"solid"},idx:null,idxs:null,values:[]},Et=[0,0];function zt(e,t,l){return e=>{0==e.button&&l(e)}}function Dt(e,t,l){return l}const Tt={show:!0,x:!0,y:!0,lock:!1,move:function(e,t,l){return Et[0]=t,Et[1]=l,Et},points:{show:function(e,t){let i=e.cursor.points,o=T(),s=i.size(e,t);z(o,l,s),z(o,n,s);let r=s/-2;z(o,"marginLeft",r),z(o,"marginTop",r);let u=i.width(e,t,s);return u&&z(o,"borderWidth",u),o},size:function(e,t){return e.series[t].points.size},width:0,stroke:function(e,t){let l=e.series[t].points;return l._stroke||l._fill},fill:function(e,t){let l=e.series[t].points;return l._fill||l._stroke}},bind:{mousedown:zt,mouseup:zt,click:zt,dblclick:zt,mousemove:Dt,mouseleave:Dt,mouseenter:Dt},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,t)=>{t.stopPropagation(),t.stopImmediatePropagation()},_x:!1,_y:!1},focus:{prox:-1,bias:0},left:-10,top:-10,idx:null,dataIdx:function(e,t,l){return l},idxs:null},Pt={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},At=Ie({},Pt,{filter:ge}),Wt=Ie({},At,{size:10}),Yt=Ie({},Pt,{show:!1}),Ct='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',Ft="bold "+Ct,Ht={show:!0,scale:"x",stroke:u,space:50,gap:5,size:50,labelGap:0,labelSize:30,labelFont:Ft,side:2,grid:At,ticks:Wt,border:Yt,font:Ct,rotate:0},Rt={show:!0,scale:"x",auto:!1,sorted:1,min:ce,max:-ce,idxs:[]};function It(e,t){return t.map((e=>null==e?"":Z(e)))}function Lt(e,t,l,n,i,o,s){let r=[],u=Se.get(i)||0;for(let e=l=s?l:Me(ve(l,i),u);n>=e;e=Me(e+i,u))r.push(Object.is(e,-0)?0:e);return r}function Gt(e,t,l,n,i){const o=[],s=e.scales[e.axes[t].scale].log,r=te((10==s?ue:ae)(l));i=se(s,r),10==s&&0>r&&(i=Me(i,-r));let u=l;do{o.push(u),u+=i,10==s&&(u=Me(u,Se.get(i))),i*s>u||(i=u)}while(n>=u);return o}function Ot(e,t,l,n,i){let o=e.scales[e.axes[t].scale].asinh,s=n>o?Gt(e,t,oe(o,l),n,i):[o],r=0>n||l>0?[]:[0];return(-o>l?Gt(e,t,oe(o,-n),-l,i):[o]).reverse().map((e=>-e)).concat(r,s)}const Nt=/./,jt=/[12357]/,Ut=/[125]/,Bt=/1/;function Vt(e,t,l){let n=e.axes[l],i=n.scale,o=e.scales[i];if(3==o.distr&&2==o.log)return t;let s=e.valToPos,r=n._space,u=s(10,i),a=s(9,i)-u<r?s(7,i)-u<r?s(5,i)-u<r?Bt:Ut:jt:Nt;return t.map((e=>4==o.distr&&0==e||a.test(e)?e:null))}function Jt(e,t,l,n){return null==n?w:null==t?"":Z(t)}const qt={show:!0,scale:"y",stroke:u,space:30,gap:5,size:50,labelGap:0,labelSize:30,labelFont:Ft,side:3,grid:At,ticks:Wt,border:Yt,font:Ct,rotate:0},Kt={scale:null,auto:!0,sorted:0,min:ce,max:-ce},Xt=(e,t,l,n,i)=>i,Zt={show:!0,auto:!0,sorted:0,gaps:Xt,alpha:1,facets:[Ie({},Kt,{scale:"x"}),Ie({},Kt,{scale:"y"})]},$t={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:Xt,alpha:1,points:{show:function(e,t){let{scale:l,idxs:n}=e.series[0],i=e._data[0],o=e.valToPos(i[n[0]],l,!0),s=e.valToPos(i[n[1]],l,!0);return ee(s-o)/(e.series[t].points.space*y)>=n[1]-n[0]},filter:null},values:null,min:ce,max:-ce,idxs:[],path:null,clip:null};function Qt(e,t,l){return l/10}const el={time:!0,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},tl=Ie({},el,{time:!1,ori:1}),ll={};function nl(e){let t=ll[e];return t||(t={key:e,plots:[],sub(e){t.plots.push(e)},unsub(e){t.plots=t.plots.filter((t=>t!=e))},pub(e,l,n,i,o,s,r){for(let u=0;t.plots.length>u;u++)t.plots[u]!=l&&t.plots[u].pub(e,l,n,i,o,s,r)}},null!=e&&(ll[e]=t)),t}function il(e,t,l){const n=e.mode,i=e.series[t],o=2==n?e._data[t]:e._data,s=e.scales,r=e.bbox;let u=o[0],a=2==n?o[1]:o[t],f=2==n?s[i.facets[0].scale]:s[e.series[0].scale],c=2==n?s[i.facets[1].scale]:s[i.scale],h=r.left,d=r.top,p=r.width,m=r.height,g=e.valToPosH,x=e.valToPosV;return 0==f.ori?l(i,u,a,f,c,g,x,h,d,p,m,hl,pl,gl,wl,_l):l(i,u,a,f,c,x,g,d,h,m,p,dl,ml,xl,bl,kl)}function ol(e,t){let l=0,n=0,i=q(e.bands,Te);for(let e=0;i.length>e;e++){let o=i[e];o.series[0]==t?l=o.dir:o.series[1]==t&&(n|=1==o.dir?1:2)}return[l,1==n?-1:2==n?1:3==n?2:0]}function sl(e,t,l,n,i){let o=e.series[t],s=e.scales[2==e.mode?o.facets[1].scale:o.scale];return-1==i?s.min:1==i?s.max:3==s.distr?1==s.dir?s.min:s.max:0}function rl(e,t,l,n,i,o){return il(e,t,((e,t,s,r,u,a,f,c,h,d,p)=>{let m=e.pxRound;const g=0==r.ori?pl:ml;let x,w;1==r.dir*(0==r.ori?1:-1)?(x=l,w=n):(x=n,w=l);let b=m(a(t[x],r,d,c)),_=m(f(s[x],u,p,h)),k=m(a(t[w],r,d,c)),v=m(f(1==o?u.max:u.min,u,p,h)),y=new Path2D(i);return g(y,k,v),g(y,b,v),g(y,b,_),y}))}function ul(e,t,l,n,i,o){let s=null;if(e.length>0){s=new Path2D;const r=0==t?gl:xl;let u=l;for(let t=0;e.length>t;t++){let l=e[t];if(l[1]>l[0]){let e=l[0]-u;e>0&&r(s,u,n,e,n+o),u=l[1]}}let a=l+i-u;a>0&&r(s,u,n,a,n+o)}return s}function al(e,t,l,n,i,o,s){let r=[],u=e.length;for(let a=1==i?l:n;a>=l&&n>=a;a+=i)if(null===t[a]){let f=a,c=a;if(1==i)for(;++a<=n&&null===t[a];)c=a;else for(;--a>=l&&null===t[a];)c=a;let h=o(e[f]),d=c==f?h:o(e[c]),p=f-i;h=s>0||0>p||p>=u?h:o(e[p]);let m=c+i;d=0>s||0>m||m>=u?d:o(e[m]),h>d||r.push([h,d])}return r}function fl(e){return 0==e?me:1==e?le:t=>ke(t,e)}function cl(e){let t=0==e?hl:dl,l=0==e?(e,t,l,n,i,o)=>{e.arcTo(t,l,n,i,o)}:(e,t,l,n,i,o)=>{e.arcTo(l,t,i,n,o)},n=0==e?(e,t,l,n,i)=>{e.rect(t,l,n,i)}:(e,t,l,n,i)=>{e.rect(l,t,i,n)};return(e,i,o,s,r,u=0,a=0)=>{0==u&&0==a?n(e,i,o,s,r):(u=ie(u,s/2,r/2),a=ie(a,s/2,r/2),t(e,i+u,o),l(e,i+s,o,i+s,o+r,u),l(e,i+s,o+r,i,o+r,a),l(e,i,o+r,i,o,a),l(e,i,o,i+s,o,u),e.closePath())}}const hl=(e,t,l)=>{e.moveTo(t,l)},dl=(e,t,l)=>{e.moveTo(l,t)},pl=(e,t,l)=>{e.lineTo(t,l)},ml=(e,t,l)=>{e.lineTo(l,t)},gl=cl(0),xl=cl(1),wl=(e,t,l,n,i,o)=>{e.arc(t,l,n,i,o)},bl=(e,t,l,n,i,o)=>{e.arc(l,t,n,i,o)},_l=(e,t,l,n,i,o,s)=>{e.bezierCurveTo(t,l,n,i,o,s)},kl=(e,t,l,n,i,o,s)=>{e.bezierCurveTo(l,t,i,n,s,o)};function vl(){return(e,t,l,n,i)=>il(e,t,((t,o,s,r,u,a,f,c,h,d,p)=>{let m,g,{pxRound:x,points:w}=t;0==r.ori?(m=hl,g=wl):(m=dl,g=bl);const b=Me(w.width*y,3);let _=(w.size-w.width)/2*y,k=Me(2*_,3),v=new Path2D,M=new Path2D,{left:S,top:E,width:z,height:D}=e.bbox;gl(M,S-k,E-k,z+2*k,D+2*k);const T=e=>{if(null!=s[e]){let t=x(a(o[e],r,d,c)),l=x(f(s[e],u,p,h));m(v,t+_,l),g(v,t,l,_,0,2*Q)}};if(i)i.forEach(T);else for(let e=l;n>=e;e++)T(e);return{stroke:b>0?v:null,fill:v,clip:M,flags:3}}))}function yl(e){return(t,l,n,i,o,s)=>{n!=i&&(o!=n&&s!=n&&e(t,l,n),o!=i&&s!=i&&e(t,l,i),e(t,l,s))}}const Ml=yl(pl),Sl=yl(ml);function El(e){const t=q(e?.alignGaps,0);return(e,l,n,i)=>il(e,l,((o,s,r,u,a,f,c,h,d,p,m)=>{let g,x,w=o.pxRound,b=e=>w(f(e,u,p,h)),_=e=>w(c(e,a,m,d));0==u.ori?(g=pl,x=Ml):(g=ml,x=Sl);const k=u.dir*(0==u.ori?1:-1),v={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},y=v.stroke;let M,S,E,z=ce,D=-ce,T=b(s[1==k?n:i]),P=O(r,n,i,1*k),A=O(r,n,i,-1*k),W=b(s[P]),Y=b(s[A]),C=!1;for(let e=1==k?n:i;e>=n&&i>=e;e+=k){let t=b(s[e]),l=r[e];t==T?null!=l?(S=_(l),z==ce&&(g(y,t,S),M=S),z=ie(S,z),D=oe(S,D)):null===l&&(C=!0):(z!=ce&&(x(y,T,z,D,M,S),E=T),null!=l?(S=_(l),g(y,t,S),z=D=M=S):(z=ce,D=-ce,null===l&&(C=!0)),T=t)}z!=ce&&z!=D&&E!=T&&x(y,T,z,D,M,S);let[F,H]=ol(e,l);if(null!=o.fill||0!=F){let t=v.fill=new Path2D(y),n=_(o.fillTo(e,l,o.min,o.max,F));g(t,Y,n),g(t,W,n)}if(!o.spanGaps){let a=[];C&&a.push(...al(s,r,n,i,k,b,t)),v.gaps=a=o.gaps(e,l,n,i,a),v.clip=ul(a,u.ori,h,d,p,m)}return 0!=H&&(v.band=2==H?[rl(e,l,n,i,y,-1),rl(e,l,n,i,y,1)]:rl(e,l,n,i,y,H)),v}))}function zl(e,t,l,n,i){const o=e.length;if(2>o)return null;const s=new Path2D;if(l(s,e[0],t[0]),2==o)n(s,e[1],t[1]);else{let l=Array(o),n=Array(o-1),r=Array(o-1),u=Array(o-1);for(let l=0;o-1>l;l++)r[l]=t[l+1]-t[l],u[l]=e[l+1]-e[l],n[l]=r[l]/u[l];l[0]=n[0];for(let e=1;o-1>e;e++)0===n[e]||0===n[e-1]||n[e-1]>0!=n[e]>0?l[e]=0:(l[e]=3*(u[e-1]+u[e])/((2*u[e]+u[e-1])/n[e-1]+(u[e]+2*u[e-1])/n[e]),isFinite(l[e])||(l[e]=0));l[o-1]=n[o-2];for(let n=0;o-1>n;n++)i(s,e[n]+u[n]/3,t[n]+l[n]*u[n]/3,e[n+1]-u[n]/3,t[n+1]-l[n+1]*u[n]/3,e[n+1],t[n+1])}return s}const Dl=new Set;function Tl(){for(let e of Dl)e.syncRect(!0)}b&&(I("resize",k,Tl),I("scroll",k,Tl,!0),I(x,k,(()=>{Ul.pxRatio=y})));const Pl=El(),Al=vl();function Wl(e,t,l,n){return(n?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map(((e,n)=>Yl(e,n,t,l)))}function Yl(e,t,l,n){return Ie({},0==t?l:n,e)}function Cl(e,t,l){return null==t?Pe:[t,l]}const Fl=Cl;function Hl(e,t,l){return null==t?Pe:J(t,l,.1,!0)}function Rl(e,t,l,n){return null==t?Pe:N(t,l,e.scales[n].log,!1)}const Il=Rl;function Ll(e,t,l,n){return null==t?Pe:j(t,l,e.scales[n].log,!1)}const Gl=Ll;function Ol(e,t,l,n,i){let o=oe(he(e),he(t)),s=t-e,r=G(i/n*s,l);do{let e=l[r],t=n*e/s;if(t>=i&&17>=o+(5>e?Se.get(e):0))return[e,t]}while(++r<l.length);return[0,0]}function Nl(e){let t,l;return[e=e.replace(/(\d+)px/,((e,n)=>(t=le((l=+n)*y))+"px")),t,l]}function jl(e){e.show&&[e.font,e.labelFont].forEach((e=>{let t=Me(e[2]*y,1);e[0]=e[0].replace(/[0-9.]+px/,t+"px"),e[1]=t}))}function Ul(u,g,b){const v={mode:q(u.mode,1)},M=v.mode;function P(e,t){return((3==t.distr?ue(e>0?e:t.clamp(v,e,t.min,t.max,t.key)):4==t.distr?fe(e,t.asinh):e)-t._min)/(t._max-t._min)}function W(e,t,l,n){let i=P(e,t);return n+l*(-1==t.dir?1-i:i)}function C(e,t,l,n){let i=P(e,t);return n+l*(-1==t.dir?i:1-i)}function H(e,t,l,n){return 0==t.ori?W(e,t,l,n):C(e,t,l,n)}v.valToPosH=W,v.valToPosV=C;let R=!1;v.status=0;const O=v.root=T("uplot");null!=u.id&&(O.id=u.id),S(O,u.class),u.title&&(T("u-title",O).textContent=u.title);const B=D("canvas"),V=v.ctx=B.getContext("2d"),K=T("u-wrap",O);I("click",K,(e=>{(wn!=pn||bn!=mn)&&Sn.click(v,e)}),!0);const X=v.under=T("u-under",K);K.appendChild(B);const Z=v.over=T("u-over",K),te=+q((u=Re(u)).pxAlign,1),re=fl(te);(u.plugins||[]).forEach((e=>{e.opts&&(u=e.opts(v,u)||u)}));const ae=u.ms||.001,he=v.series=1==M?Wl(u.series||[],Rt,$t,!1):function(e,t){return e.map(((e,l)=>0==l?null:Ie({},t,e)))}(u.series||[null],Zt),me=v.axes=Wl(u.axes||[],Ht,qt,!0),_e=v.scales={},ye=v.bands=u.bands||[];ye.forEach((e=>{e.fill=pe(e.fill||null),e.dir=q(e.dir,-1)}));const Se=2==M?he[1].facets[0].scale:he[0].scale,Ee={axes:function(){for(let e=0;me.length>e;e++){let t=me[e];if(!t.show||!t._show)continue;let l,n,u=t.side,a=u%2,f=t.stroke(v,e),c=0==u||3==u?-1:1;if(t.label){let e=le((t._lpos+t.labelGap*c)*y);Xl(t.labelFont[0],f,"center",2==u?i:o),V.save(),1==a?(l=n=0,V.translate(e,le(Yt+Ft/2)),V.rotate((3==u?-Q:Q)/2)):(l=le(Wt+Ct/2),n=e),V.fillText(t.label,l,n),V.restore()}let[h,d]=t._found;if(0==d)continue;let p=_e[t.scale],m=0==a?Ct:Ft,g=0==a?Wt:Yt,x=le(t.gap*y),w=t._splits,b=2==p.distr?w.map((e=>Bl[e])):w,_=2==p.distr?Bl[w[1]]-Bl[w[0]]:h,k=t.ticks,M=t.border,S=k.show?le(k.size*y):0,E=t._rotate*-Q/180,z=re(t._pos*y),D=z+(S+x)*c;n=0==a?D:0,l=1==a?D:0,Xl(t.font[0],f,1==t.align?s:2==t.align?r:E>0?s:0>E?r:0==a?"center":3==u?r:s,E||1==a?"middle":2==u?i:o);let T=1.5*t.font[1],P=w.map((e=>re(H(e,p,m,g)))),A=t._values;for(let e=0;A.length>e;e++){let t=A[e];if(null!=t){0==a?l=P[e]:n=P[e],t=""+t;let i=-1==t.indexOf("\n")?[t]:t.split(/\n/gm);for(let e=0;i.length>e;e++){let t=i[e];E?(V.save(),V.translate(l,n+e*T),V.rotate(E),V.fillText(t,0,0),V.restore()):V.fillText(t,l,n+e*T)}}}k.show&&nn(P,k.filter(v,b,e,d,_),a,u,z,S,Me(k.width*y,3),k.stroke(v,e),k.dash,k.cap);let W=t.grid;W.show&&nn(P,W.filter(v,b,e,d,_),a,0==a?2:1,0==a?Yt:Wt,0==a?Ft:Ct,Me(W.width*y,3),W.stroke(v,e),W.dash,W.cap),M.show&&nn([z],[1],0==a?1:0,0==a?1:2,1==a?Yt:Wt,1==a?Ft:Ct,Me(M.width*y,3),M.stroke(v,e),M.dash,M.cap)}ni("drawAxes")},series:function(){gl>0&&(he.forEach(((e,t)=>{if(t>0&&e.show&&null==e._paths){let l=2==M?[0,g[t][0].length-1]:function(e){let t=de(xl-1,0,gl-1),l=de(wl+1,0,gl-1);for(;null==e[t]&&t>0;)t--;for(;null==e[l]&&gl-1>l;)l++;return[t,l]}(g[t]);e._paths=e.paths(v,t,l[0],l[1])}})),he.forEach(((e,t)=>{if(t>0&&e.show){Ul!=e.alpha&&(V.globalAlpha=Ul=e.alpha),$l(t,!1),e._paths&&Ql(t,!1);{$l(t,!0);let l=e._paths?e._paths.gaps:null,n=e.points.show(v,t,xl,wl,l),i=e.points.filter(v,t,n,l);(n||i)&&(e.points._paths=e.points.paths(v,t,xl,wl,i),Ql(t,!0))}1!=Ul&&(V.globalAlpha=Ul=1),ni("drawSeries",t)}})))}},ze=(u.drawOrder||["axes","series"]).map((e=>Ee[e]));function We(e){let t=_e[e];if(null==t){let l=(u.scales||De)[e]||De;if(null!=l.from)We(l.from),_e[e]=Ie({},_e[l.from],l,{key:e});else{t=_e[e]=Ie({},e==Se?el:tl,l),t.key=e;let n=t.time,i=t.range,o=Ae(i);if((e!=Se||2==M&&!n)&&(!o||null!=i[0]&&null!=i[1]||(i={min:null==i[0]?U:{mode:1,hard:i[0],soft:i[0]},max:null==i[1]?U:{mode:1,hard:i[1],soft:i[1]}},o=!1),!o&&Ce(i))){let e=i;i=(t,l,n)=>null==l?Pe:J(l,n,e)}t.range=pe(i||(n?Fl:e==Se?3==t.distr?Il:4==t.distr?Gl:Cl:3==t.distr?Rl:4==t.distr?Ll:Hl)),t.auto=pe(!o&&t.auto),t.clamp=pe(t.clamp||Qt),t._min=t._max=null}}}We("x"),We("y"),1==M&&he.forEach((e=>{We(e.scale)})),me.forEach((e=>{We(e.scale)}));for(let e in u.scales)We(e);const He=_e[Se],Le=He.distr;let Oe,Ne;0==He.ori?(S(O,"u-hz"),Oe=W,Ne=C):(S(O,"u-vt"),Oe=C,Ne=W);const je={};for(let e in _e){let t=_e[e];null==t.min&&null==t.max||(je[e]={min:t.min,max:t.max},t.min=t.max=null)}const Ue=u.tzDate||(e=>new Date(le(e/ae))),Be=u.fmtDate||Ke,Ve=1==ae?gt(Ue):bt(Ue),Je=kt(Ue,_t(1==ae?mt:wt,Be)),qe=Mt(Ue,yt("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",Be)),Xe=[],Ze=v.legend=Ie({},St,u.legend),$e=Ze.show,Qe=Ze.markers;let et;Ze.idxs=Xe,Qe.width=pe(Qe.width),Qe.dash=pe(Qe.dash),Qe.stroke=pe(Qe.stroke),Qe.fill=pe(Qe.fill);let nt,it=[],ot=[],st=!1,rt={};if(Ze.live){const e=he[1]?he[1].values:null;st=null!=e,nt=st?e(v,1,0):{_:0};for(let e in nt)rt[e]=w}if($e)if(et=D("table","u-legend",O),Ze.mount(v,et),st){let e=D("tr","u-thead",et);for(var ut in D("th",null,e),nt)D("th",t,e).textContent=ut}else S(et,"u-inline"),Ze.live&&S(et,"u-live");const at={show:!0},ft={show:!1},ct=new Map;function ht(e,t,l){const n=ct.get(t)||{},i=ol.bind[e](v,t,l);i&&(I(e,t,n[e]=i),ct.set(t,n))}function dt(e,t){const l=ct.get(t)||{};for(let n in l)null!=e&&n!=e||(L(n,t,l[n]),delete l[n]);null==e&&ct.delete(t)}let vt=0,Et=0,zt=0,Dt=0,Pt=0,At=0,Wt=0,Yt=0,Ct=0,Ft=0;v.bbox={};let Nt=!1,jt=!1,Ut=!1,Bt=!1,Kt=!1,Xt=!1;function ll(e,t,l){(l||e!=v.width||t!=v.height)&&il(e,t),rn(!1),Ut=!0,jt=!0,0>ol.left||(Bt=Xt=!0),kn()}function il(e,t){v.width=vt=zt=e,v.height=Et=Dt=t,Pt=At=0,function(){let e=!1,t=!1,l=!1,n=!1;me.forEach((i=>{if(i.show&&i._show){let{side:o,_size:s}=i,r=s+(null!=i.label?i.labelSize:0);r>0&&(o%2?(zt-=r,3==o?(Pt+=r,n=!0):l=!0):(Dt-=r,0==o?(At+=r,e=!0):t=!0))}})),hl[0]=e,hl[1]=l,hl[2]=t,hl[3]=n,zt-=ml[1]+ml[3],Pt+=ml[3],Dt-=ml[2]+ml[0],At+=ml[0]}(),function(){let e=Pt+zt,t=At+Dt,l=Pt,n=At;function i(i,o){switch(i){case 1:return e+=o,e-o;case 2:return t+=o,t-o;case 3:return l-=o,l+o;case 0:return n-=o,n+o}}me.forEach((e=>{if(e.show&&e._show){let t=e.side;e._pos=i(t,e._size),null!=e.label&&(e._lpos=i(t,e.labelSize))}}))}();let l=v.bbox;Wt=l.left=ke(Pt*y,.5),Yt=l.top=ke(At*y,.5),Ct=l.width=ke(zt*y,.5),Ft=l.height=ke(Dt*y,.5)}v.setSize=function({width:e,height:t}){ll(e,t)};const ol=v.cursor=Ie({},Tt,{drag:{y:2==M}},u.cursor);{ol.idxs=Xe,ol._lock=!1;let e=ol.points;e.show=pe(e.show),e.size=pe(e.size),e.stroke=pe(e.stroke),e.width=pe(e.width),e.fill=pe(e.fill)}const rl=v.focus=Ie({},u.focus||{alpha:.3},ol.focus);0!=rl.bias&&(rl.prox=1e5);const ul=rl.prox>=0;let al=[null];function cl(l,n){if(1==M||n>0){let e=1==M&&_e[l.scale].time,t=l.value;l.value=e?Ye(t)?Mt(Ue,yt(t,Be)):t||qe:t||Jt,l.label=l.label||(e?"Time":"Value")}if(n>0){l.width=null==l.width?1:l.width,l.paths=l.paths||Pl||xe,l.fillTo=pe(l.fillTo||sl),l.pxAlign=+q(l.pxAlign,te),l.pxRound=fl(l.pxAlign),l.stroke=pe(l.stroke||null),l.fill=pe(l.fill||null),l._stroke=l._fill=l._paths=l._focus=null;let e=function(e){return Me(1*(3+2*(e||1)),3)}(oe(1,l.width)),t=l.points=Ie({},{size:e,width:oe(1,.2*e),stroke:l.stroke,space:2*e,paths:Al,_stroke:null,_fill:null},l.points);t.show=pe(t.show),t.filter=pe(t.filter),t.fill=pe(t.fill),t.stroke=pe(t.stroke),t.paths=pe(t.paths),t.pxAlign=l.pxAlign}if($e){let i=function(l,n){if(0==n&&(st||!Ze.live||2==M))return Pe;let i=[],o=D("tr","u-series",et,et.childNodes[n]);S(o,l.class),l.show||S(o,e);let s=D("th",null,o);if(Qe.show){let e=T("u-marker",s);if(n>0){let t=Qe.width(v,n);t&&(e.style.border=t+"px "+Qe.dash(v,n)+" "+Qe.stroke(v,n)),e.style.background=Qe.fill(v,n)}}let r=T(t,s);for(var u in r.textContent=l.label,n>0&&(Qe.show||(r.style.color=l.width>0?Qe.stroke(v,n):Qe.fill(v,n)),ht("click",s,(e=>{if(ol._lock)return;let t=he.indexOf(l);if((e.ctrlKey||e.metaKey)!=Ze.isolate){let e=he.some(((e,l)=>l>0&&l!=t&&e.show));he.forEach(((l,n)=>{n>0&&Wn(n,e?n==t?at:ft:at,!0,ii.setSeries)}))}else Wn(t,{show:!l.show},!0,ii.setSeries)})),ul&&ht(d,s,(()=>{ol._lock||Wn(he.indexOf(l),Hn,!0,ii.setSeries)}))),nt){let e=D("td","u-value",o);e.textContent="--",i.push(e)}return[o,i]}(l,n);it.splice(n,0,i[0]),ot.splice(n,0,i[1]),Ze.values.push(null)}if(ol.show){Xe.splice(n,0,null);let e=function(e,t){if(t>0){let l=ol.points.show(v,t);if(l)return S(l,"u-cursor-pt"),S(l,e.class),A(l,-10,-10,zt,Dt),Z.insertBefore(l,al[t]),l}}(l,n);e&&al.splice(n,0,e)}ni("addSeries",n)}v.addSeries=function(e,t){t=null==t?he.length:t,e=1==M?Yl(e,t,Rt,$t):Yl(e,t,null,Zt),he.splice(t,0,e),cl(he[t],t)},v.delSeries=function(e){if(he.splice(e,1),$e){Ze.values.splice(e,1),ot.splice(e,1);let t=it.splice(e,1)[0];dt(null,t.firstChild),t.remove()}ol.show&&(Xe.splice(e,1),al.length>1&&al.splice(e,1)[0].remove()),ni("delSeries",e)};const hl=[!1,!1,!1,!1];function dl(e,t,l){let[n,i,o,s]=l,r=t%2,u=0;return 0==r&&(s||i)&&(u=0==t&&!n||2==t&&!o?le(Ht.size/3):0),1==r&&(n||o)&&(u=1==t&&!i||3==t&&!s?le(qt.size/2):0),u}const pl=v.padding=(u.padding||[dl,dl,dl,dl]).map((e=>pe(q(e,dl)))),ml=v._padding=pl.map(((e,t)=>e(v,t,hl,0)));let gl,xl=null,wl=null;const bl=1==M?he[0].idxs:null;let _l,kl,vl,yl,Ml,Sl,El,zl,Tl,Ul,Bl=null,Vl=!1;function Jl(e,t){if(g=null==e?[]:Re(e,Fe),2==M){gl=0;for(let e=1;he.length>e;e++)gl+=g[e][0].length;v.data=g=e}else if(null==g[0]&&(g[0]=[]),v.data=g.slice(),Bl=g[0],gl=Bl.length,2==Le){g[0]=Array(gl);for(let e=0;gl>e;e++)g[0][e]=e}if(v._data=g,rn(!0),ni("setData"),2==Le&&(Ut=!0),!1!==t){let e=He;e.auto(v,Vl)?ql():An(Se,e.min,e.max),Bt=ol.left>=0,Xt=!0,kn()}}function ql(){let e,t;Vl=!0,1==M&&(gl>0?(xl=bl[0]=0,wl=bl[1]=gl-1,e=g[0][xl],t=g[0][wl],2==Le?(e=xl,t=wl):1==gl&&(3==Le?[e,t]=N(e,e,He.log,!1):4==Le?[e,t]=j(e,e,He.log,!1):He.time?t=e+le(86400/ae):[e,t]=J(e,t,.1,!0))):(xl=bl[0]=e=null,wl=bl[1]=t=null)),An(Se,e,t)}function Kl(e,t,l,n,i,o){e??=a,l??=Te,n??="butt",i??=a,o??="round",e!=_l&&(V.strokeStyle=_l=e),i!=kl&&(V.fillStyle=kl=i),t!=vl&&(V.lineWidth=vl=t),o!=Ml&&(V.lineJoin=Ml=o),n!=Sl&&(V.lineCap=Sl=n),l!=yl&&V.setLineDash(yl=l)}function Xl(e,t,l,n){t!=kl&&(V.fillStyle=kl=t),e!=El&&(V.font=El=e),l!=zl&&(V.textAlign=zl=l),n!=Tl&&(V.textBaseline=Tl=n)}function Zl(e,t,l,n,i=0){if(n.length>0&&e.auto(v,Vl)&&(null==t||null==t.min)){let t=q(xl,0),o=q(wl,n.length-1),s=null==l.min?3==e.distr?function(e,t,l){let n=ce,i=-ce;for(let o=t;l>=o;o++)e[o]>0&&(n=ie(n,e[o]),i=oe(i,e[o]));return[n==ce?1:n,i==-ce?10:i]}(n,t,o):function(e,t,l,n){let i=ce,o=-ce;if(1==n)i=e[t],o=e[l];else if(-1==n)i=e[l],o=e[t];else for(let n=t;l>=n;n++)null!=e[n]&&(i=ie(i,e[n]),o=oe(o,e[n]));return[i,o]}(n,t,o,i):[l.min,l.max];e.min=ie(e.min,l.min=s[0]),e.max=oe(e.max,l.max=s[1])}}function $l(e,t){let l=t?he[e].points:he[e];l._stroke=l.stroke(v,e),l._fill=l.fill(v,e)}function Ql(e,t){let l=t?he[e].points:he[e],n=l._stroke,i=l._fill,{stroke:o,fill:s,clip:r,flags:u}=l._paths,a=null,f=Me(l.width*y,3),c=f%2/2;t&&null==i&&(i=f>0?"#fff":n);let h=1==l.pxAlign;if(h&&V.translate(c,c),!t){let e=Wt,t=Yt,n=Ct,i=Ft,o=f*y/2;0==l.min&&(i+=o),0==l.max&&(t-=o,i+=o),a=new Path2D,a.rect(e,t,n,i)}t?en(n,f,l.dash,l.cap,i,o,s,u,r):function(e,t,l,n,i,o,s,r,u,a,f){let c=!1;ye.forEach(((h,d)=>{if(h.series[0]==e){let e,p=he[h.series[1]],m=g[h.series[1]],x=(p._paths||De).band;Ae(x)&&(x=1==h.dir?x[0]:x[1]);let w=null;p.show&&x&&function(e,t,l){for(t=q(t,0),l=q(l,e.length-1);l>=t;){if(null!=e[t])return!0;t++}return!1}(m,xl,wl)?(w=h.fill(v,d)||o,e=p._paths.clip):x=null,en(t,l,n,i,w,s,r,u,a,f,e,x),c=!0}})),c||en(t,l,n,i,o,s,r,u,a,f)}(e,n,f,l.dash,l.cap,i,o,s,u,a,r),h&&V.translate(-c,-c)}function en(e,t,l,n,i,o,s,r,u,a,f,c){Kl(e,t,l,n,i),(u||a||c)&&(V.save(),u&&V.clip(u),a&&V.clip(a)),c?3==(3&r)?(V.clip(c),f&&V.clip(f),ln(i,s),tn(e,o,t)):2&r?(ln(i,s),V.clip(c),tn(e,o,t)):1&r&&(V.save(),V.clip(c),f&&V.clip(f),ln(i,s),V.restore(),tn(e,o,t)):(ln(i,s),tn(e,o,t)),(u||a||c)&&V.restore()}function tn(e,t,l){l>0&&(t instanceof Map?t.forEach(((e,t)=>{V.strokeStyle=_l=t,V.stroke(e)})):null!=t&&e&&V.stroke(t))}function ln(e,t){t instanceof Map?t.forEach(((e,t)=>{V.fillStyle=kl=t,V.fill(e)})):null!=t&&e&&V.fill(t)}function nn(e,t,l,n,i,o,s,r,u,a){let f=s%2/2;1==te&&V.translate(f,f),Kl(r,s,u,a,r),V.beginPath();let c,h,d,p,m=i+(0==n||3==n?-o:o);0==l?(h=i,p=m):(c=i,d=m);for(let n=0;e.length>n;n++)null!=t[n]&&(0==l?c=d=e[n]:h=p=e[n],V.moveTo(c,h),V.lineTo(d,p));V.stroke(),1==te&&V.translate(-f,-f)}function on(e){let t=!0;return me.forEach(((l,n)=>{if(!l.show)return;let i=_e[l.scale];if(null==i.min)return void(l._show&&(t=!1,l._show=!1,rn(!1)));l._show||(t=!1,l._show=!0,rn(!1));let o=l.side,s=o%2,{min:r,max:u}=i,[a,f]=function(e,t,l,n){let i,o=me[e];if(n>0){let s=o._space=o.space(v,e,t,l,n);i=Ol(t,l,o._incrs=o.incrs(v,e,t,l,n,s),n,s)}else i=[0,0];return o._found=i}(n,r,u,0==s?zt:Dt);if(0==f)return;let c=l._splits=l.splits(v,n,r,u,a,f,2==i.distr),h=2==i.distr?c.map((e=>Bl[e])):c,d=2==i.distr?Bl[c[1]]-Bl[c[0]]:a,p=l._values=l.values(v,l.filter(v,h,n,f,d),n,f,d);l._rotate=2==o?l.rotate(v,p,n,f):0;let m=l._size;l._size=ne(l.size(v,p,n,e)),null!=m&&l._size!=m&&(t=!1)})),t}function sn(e){let t=!0;return pl.forEach(((l,n)=>{let i=l(v,n,hl,e);i!=ml[n]&&(t=!1),ml[n]=i})),t}function rn(e){he.forEach(((t,l)=>{l>0&&(t._paths=null,e&&(1==M?(t.min=null,t.max=null):t.facets.forEach((e=>{e.min=null,e.max=null}))))}))}v.setData=Jl;let un,an,fn,cn,hn,dn,pn,mn,gn,xn,wn,bn,_n=!1;function kn(){_n||(Ge(vn),_n=!0)}function vn(){Nt&&(function(){let e=Re(_e,Fe);for(let t in e){let l=e[t],n=je[t];if(null!=n&&null!=n.min)Ie(l,n),t==Se&&rn(!0);else if(t!=Se||2==M)if(0==gl&&null==l.from){let e=l.range(v,null,null,t);l.min=e[0],l.max=e[1]}else l.min=ce,l.max=-ce}if(gl>0){he.forEach(((t,l)=>{if(1==M){let n=t.scale,i=e[n],o=je[n];if(0==l){let e=i.range(v,i.min,i.max,n);i.min=e[0],i.max=e[1],xl=G(i.min,g[0]),wl=G(i.max,g[0]),wl-xl>1&&(i.min>g[0][xl]&&xl++,g[0][wl]>i.max&&wl--),t.min=Bl[xl],t.max=Bl[wl]}else t.show&&t.auto&&Zl(i,o,t,g[l],t.sorted);t.idxs[0]=xl,t.idxs[1]=wl}else if(l>0&&t.show&&t.auto){let[n,i]=t.facets,o=n.scale,s=i.scale,[r,u]=g[l];Zl(e[o],je[o],n,r,n.sorted),Zl(e[s],je[s],i,u,i.sorted),t.min=i.min,t.max=i.max}}));for(let t in e){let l=e[t],n=je[t];if(null==l.from&&(null==n||null==n.min)){let e=l.range(v,l.min==ce?null:l.min,l.max==-ce?null:l.max,t);l.min=e[0],l.max=e[1]}}}for(let t in e){let l=e[t];if(null!=l.from){let n=e[l.from];if(null==n.min)l.min=l.max=null;else{let e=l.range(v,n.min,n.max,t);l.min=e[0],l.max=e[1]}}}let t={},l=!1;for(let n in e){let i=e[n],o=_e[n];if(o.min!=i.min||o.max!=i.max){o.min=i.min,o.max=i.max;let e=o.distr;o._min=3==e?ue(o.min):4==e?fe(o.min,o.asinh):o.min,o._max=3==e?ue(o.max):4==e?fe(o.max,o.asinh):o.max,t[n]=l=!0}}if(l){he.forEach(((e,l)=>{2==M?l>0&&t.y&&(e._paths=null):t[e.scale]&&(e._paths=null)}));for(let e in t)Ut=!0,ni("setScale",e);ol.show&&ol.left>=0&&(Bt=Xt=!0)}for(let e in je)je[e]=null}(),Nt=!1),Ut&&(function(){let e=!1,t=0;for(;!e;){t++;let l=on(t),n=sn(t);e=3==t||l&&n,e||(il(v.width,v.height),jt=!0)}}(),Ut=!1),jt&&(z(X,s,Pt),z(X,i,At),z(X,l,zt),z(X,n,Dt),z(Z,s,Pt),z(Z,i,At),z(Z,l,zt),z(Z,n,Dt),z(K,l,vt),z(K,n,Et),B.width=le(vt*y),B.height=le(Et*y),me.forEach((({_el:t,_show:l,_size:n,_pos:i,side:o})=>{if(null!=t)if(l){let l=o%2==1;z(t,l?"left":"top",i-(3===o||0===o?n:0)),z(t,l?"width":"height",n),z(t,l?"top":"left",l?At:Pt),z(t,l?"height":"width",l?Dt:zt),E(t,e)}else S(t,e)})),_l=kl=vl=Ml=Sl=El=zl=Tl=yl=null,Ul=1,Vn(!0),ni("setSize"),jt=!1),vt>0&&Et>0&&(V.clearRect(0,0,B.width,B.height),ni("drawClear"),ze.forEach((e=>e())),ni("draw")),Dn.show&&Kt&&(Pn(Dn),Kt=!1),ol.show&&Bt&&(Un(null,!0,!1),Bt=!1),Ze.show&&Ze.live&&Xt&&(Nn(),Xt=!1),R||(R=!0,v.status=1,ni("ready")),Vl=!1,_n=!1}function yn(e,t){let l=_e[e];if(null==l.from){if(0==gl){let n=l.range(v,t.min,t.max,e);t.min=n[0],t.max=n[1]}if(t.min>t.max){let e=t.min;t.min=t.max,t.max=e}if(gl>1&&null!=t.min&&null!=t.max&&1e-16>t.max-t.min)return;e==Se&&2==l.distr&&gl>0&&(t.min=G(t.min,g[0]),t.max=G(t.max,g[0]),t.min==t.max&&t.max++),je[e]=t,Nt=!0,kn()}}v.redraw=(e,t)=>{Ut=t||!1,!1!==e?An(Se,He.min,He.max):kn()},v.setScale=yn;let Mn=!1;const Sn=ol.drag;let En=Sn.x,zn=Sn.y;ol.show&&(ol.x&&(un=T("u-cursor-x",Z)),ol.y&&(an=T("u-cursor-y",Z)),0==He.ori?(fn=un,cn=an):(fn=an,cn=un),wn=ol.left,bn=ol.top);const Dn=v.select=Ie({show:!0,over:!0,left:0,width:0,top:0,height:0},u.select),Tn=Dn.show?T("u-select",Dn.over?Z:X):null;function Pn(e,t){if(Dn.show){for(let t in e)Dn[t]=e[t],t in Kn&&z(Tn,t,e[t]);!1!==t&&ni("setSelect")}}function An(e,t,l){yn(e,{min:t,max:l})}function Wn(t,l,n,i){null!=l.focus&&function(e){if(e!=Fn){let t=null==e,l=1!=rl.alpha;he.forEach(((n,i)=>{let o=t||0==i||i==e;n._focus=t?null:o,l&&function(e,t){he[e].alpha=t,ol.show&&al[e]&&(al[e].style.opacity=t),$e&&it[e]&&(it[e].style.opacity=t)}(i,o?1:rl.alpha)})),Fn=e,l&&kn()}}(t),null!=l.show&&he.forEach(((n,i)=>{0>=i||t!=i&&null!=t||(n.show=l.show,function(t){let l=$e?it[t]:null;he[t].show?l&&E(l,e):(l&&S(l,e),al.length>1&&A(al[t],-10,-10,zt,Dt))}(i),An(2==M?n.facets[1].scale:n.scale,null,null),kn())})),!1!==n&&ni("setSeries",t,l),i&&ri("setSeries",v,t,l)}let Yn,Cn,Fn;v.setSelect=Pn,v.setSeries=Wn,v.addBand=function(e,t){e.fill=pe(e.fill||null),e.dir=q(e.dir,-1),ye.splice(t=null==t?ye.length:t,0,e)},v.setBand=function(e,t){Ie(ye[e],t)},v.delBand=function(e){null==e?ye.length=0:ye.splice(e,1)};const Hn={focus:!0};function Rn(e,t,l){let n=_e[t];l&&(e=e/y-(1==n.ori?At:Pt));let i=zt;1==n.ori&&(i=Dt,e=i-e),-1==n.dir&&(e=i-e);let o=n._min,s=o+e/i*(n._max-o),r=n.distr;return 3==r?se(10,s):4==r?((e,t=1)=>$.sinh(e)*t)(s,n.asinh):s}function In(e,t){z(Tn,s,Dn.left=e),z(Tn,l,Dn.width=t)}function Ln(e,t){z(Tn,i,Dn.top=e),z(Tn,n,Dn.height=t)}$e&&ul&&I(p,et,(()=>{ol._lock||null!=Fn&&Wn(null,Hn,!0,ii.setSeries)})),v.valToIdx=e=>G(e,g[0]),v.posToIdx=function(e,t){return G(Rn(e,Se,t),g[0],xl,wl)},v.posToVal=Rn,v.valToPos=(e,t,l)=>0==_e[t].ori?W(e,_e[t],l?Ct:zt,l?Wt:0):C(e,_e[t],l?Ft:Dt,l?Yt:0),v.batch=function(e){e(v),kn()},v.setCursor=(e,t,l)=>{wn=e.left,bn=e.top,Un(null,t,l)};let Gn=0==He.ori?In:Ln,On=1==He.ori?In:Ln;function Nn(e,t){null!=e&&(e.idxs?e.idxs.forEach(((e,t)=>{Xe[t]=e})):(e=>void 0===e)(e.idx)||Xe.fill(e.idx),Ze.idx=Xe[0]);for(let e=0;he.length>e;e++)(e>0||1==M&&!st)&&jn(e,Xe[e]);$e&&Ze.live&&function(){if($e&&Ze.live)for(let e=2==M?1:0;he.length>e;e++){if(0==e&&st)continue;let t=Ze.values[e],l=0;for(let n in t)ot[e][l++].firstChild.nodeValue=t[n]}}(),Xt=!1,!1!==t&&ni("setLegend")}function jn(e,t){let l,n=he[e],i=0==e&&2==Le?Bl:g[e];st?l=n.values(v,e,t)??rt:(l=n.value(v,null==t?null:i[t],e,t),l=null==l?rt:{_:l}),Ze.values[e]=l}function Un(e,t,l){let n;gn=wn,xn=bn,[wn,bn]=ol.move(v,wn,bn),ol.show&&(fn&&A(fn,le(wn),0,zt,Dt),cn&&A(cn,0,le(bn),zt,Dt)),Yn=ce;let i=0==He.ori?zt:Dt,o=1==He.ori?zt:Dt;if(0>wn||0==gl||xl>wl){n=null;for(let e=0;he.length>e;e++)e>0&&al.length>1&&A(al[e],-10,-10,zt,Dt);ul&&Wn(null,Hn,!0,null==e&&ii.setSeries),Ze.live&&(Xe.fill(n),Xt=!0)}else{let e,t,l;1==M&&(e=0==He.ori?wn:bn,t=Rn(e,Se),n=G(t,g[0],xl,wl),l=Oe(g[0][n],He,i,0));for(let e=2==M?1:0;he.length>e;e++){let s=he[e],r=Xe[e],u=1==M?g[e][r]:g[e][1][r],a=ol.dataIdx(v,e,n,t),f=1==M?g[e][a]:g[e][1][a];Xt=Xt||f!=u||a!=r,Xe[e]=a;let c=ve(a==n?l:Oe(1==M?g[0][a]:g[e][0][a],He,i,0),1);if(e>0&&s.show){let t,l,n=null==f?-10:ve(Ne(f,1==M?_e[s.scale]:_e[s.facets[1].scale],o,0),1);if(ul&&n>=0&&1==M){let t=ee(n-bn),l=rl.bias;if(0!=l){let n=Rn(1==He.ori?wn:bn,s.scale),i=0>n?-1:1;i==(0>f?-1:1)&&(t>=Yn||(1==i?1==l?n>f:f>n:1==l?f>n:n>f)||(Yn=t,Cn=e))}else Yn>t&&(Yn=t,Cn=e)}if(0==He.ori?(t=c,l=n):(t=n,l=c),Xt&&al.length>1){Y(al[e],ol.points.fill(v,e),ol.points.stroke(v,e));let n,i,o,s,r=!0,u=ol.points.bbox;if(null!=u){r=!1;let t=u(v,e);o=t.left,s=t.top,n=t.width,i=t.height}else o=t,s=l,n=i=ol.points.size(v,e);F(al[e],n,i,r),A(al[e],o,s,zt,Dt)}}}}if(ol.idx=n,ol.left=wn,ol.top=bn,Xt&&(Ze.idx=n,Nn()),Dn.show&&Mn)if(null!=e){let[t,l]=ii.scales,[n,s]=ii.match,[r,u]=e.cursor.sync.scales,a=e.cursor.drag;if(En=a._x,zn=a._y,En||zn){let a,f,c,h,d,{left:p,top:m,width:g,height:x}=e.select,w=e.scales[t].ori,b=e.posToVal,_=null!=t&&n(t,r),k=null!=l&&s(l,u);_&&En?(0==w?(a=p,f=g):(a=m,f=x),c=_e[t],h=Oe(b(a,r),c,i,0),d=Oe(b(a+f,r),c,i,0),Gn(ie(h,d),ee(d-h))):Gn(0,i),k&&zn?(1==w?(a=p,f=g):(a=m,f=x),c=_e[l],h=Ne(b(a,u),c,o,0),d=Ne(b(a+f,u),c,o,0),On(ie(h,d),ee(d-h))):On(0,o)}else Xn()}else{let e=ee(gn-hn),t=ee(xn-dn);if(1==He.ori){let l=e;e=t,t=l}En=Sn.x&&e>=Sn.dist,zn=Sn.y&&t>=Sn.dist;let l,n,s=Sn.uni;null!=s?En&&zn&&(En=e>=s,zn=t>=s,En||zn||(t>e?zn=!0:En=!0)):Sn.x&&Sn.y&&(En||zn)&&(En=zn=!0),En&&(0==He.ori?(l=pn,n=wn):(l=mn,n=bn),Gn(ie(l,n),ee(n-l)),zn||On(0,o)),zn&&(1==He.ori?(l=pn,n=wn):(l=mn,n=bn),On(ie(l,n),ee(n-l)),En||Gn(0,i)),En||zn||(Gn(0,0),On(0,0))}if(Sn._x=En,Sn._y=zn,null==e){if(l){if(null!=oi){let[e,t]=ii.scales;ii.values[0]=null!=e?Rn(0==He.ori?wn:bn,e):null,ii.values[1]=null!=t?Rn(1==He.ori?wn:bn,t):null}ri(f,v,wn,bn,zt,Dt,n)}if(ul){let e=l&&ii.setSeries,t=rl.prox;null==Fn?Yn>t||Wn(Cn,Hn,!0,e):Yn>t?Wn(null,Hn,!0,e):Cn!=Fn&&Wn(Cn,Hn,!0,e)}}!1!==t&&ni("setCursor")}v.setLegend=Nn;let Bn=null;function Vn(e){!0===e?Bn=null:(Bn=Z.getBoundingClientRect(),ni("syncRect",Bn))}function Jn(e,t,l,n,i,o){ol._lock||Mn&&null!=e&&0==e.movementX&&0==e.movementY||(qn(e,t,l,n,i,o,0,!1,null!=e),null!=e?Un(null,!0,!0):Un(t,!0,!1))}function qn(e,t,l,n,i,o,s,r,u){if(null==Bn&&Vn(!1),null!=e)l=e.clientX-Bn.left,n=e.clientY-Bn.top;else{if(0>l||0>n)return wn=-10,void(bn=-10);let[e,s]=ii.scales,r=t.cursor.sync,[u,a]=r.values,[f,c]=r.scales,[h,d]=ii.match,p=t.axes[0].side%2==1,m=0==He.ori?zt:Dt,g=1==He.ori?zt:Dt,x=p?o:i,w=p?i:o,b=p?n:l,_=p?l:n;if(l=null!=f?h(e,f)?H(u,_e[e],m,0):-10:m*(b/x),n=null!=c?d(s,c)?H(a,_e[s],g,0):-10:g*(_/w),1==He.ori){let e=l;l=n,n=e}}u&&(l>1&&zt-1>l||(l=ke(l,zt)),n>1&&Dt-1>n||(n=ke(n,Dt))),r?(hn=l,dn=n,[pn,mn]=ol.move(v,l,n)):(wn=l,bn=n)}const Kn={width:0,height:0,left:0,top:0};function Xn(){Pn(Kn,!1)}function Zn(e,t,l,n,i,o){Mn=!0,En=zn=Sn._x=Sn._y=!1,qn(e,t,l,n,i,o,0,!0,!1),null!=e&&(ht(h,_,$n),ri(c,v,pn,mn,zt,Dt,null))}function $n(e,t,l,n,i,o){Mn=Sn._x=Sn._y=!1,qn(e,t,l,n,i,o,0,!1,!0);let{left:s,top:r,width:u,height:a}=Dn,f=u>0||a>0;if(f&&Pn(Dn),Sn.setScale&&f){let e=s,t=u,l=r,n=a;if(1==He.ori&&(e=r,t=a,l=s,n=u),En&&An(Se,Rn(e,Se),Rn(e+t,Se)),zn)for(let e in _e){let t=_e[e];e!=Se&&null==t.from&&t.min!=ce&&An(e,Rn(l+n,e),Rn(l,e))}Xn()}else ol.lock&&(ol._lock=!ol._lock,ol._lock||Un(null,!0,!1));null!=e&&(dt(h,_),ri(h,v,wn,bn,zt,Dt,null))}function Qn(e){ql(),Xn(),null!=e&&ri(m,v,wn,bn,zt,Dt,null)}function ei(){me.forEach(jl),ll(v.width,v.height,!0)}I(x,k,ei);const ti={};ti.mousedown=Zn,ti.mousemove=Jn,ti.mouseup=$n,ti.dblclick=Qn,ti.setSeries=(e,t,l,n)=>{Wn(l,n,!0,!1)},ol.show&&(ht(c,Z,Zn),ht(f,Z,Jn),ht(d,Z,Vn),ht(p,Z,(function(){if(!ol._lock){let e=Mn;if(Mn){let e,t,l=!0,n=!0,i=10;0==He.ori?(e=En,t=zn):(e=zn,t=En),e&&t&&(l=i>=wn||wn>=zt-i,n=i>=bn||bn>=Dt-i),e&&l&&(wn=pn>wn?0:zt),t&&n&&(bn=mn>bn?0:Dt),Un(null,!0,!0),Mn=!1}wn=-10,bn=-10,Un(null,!0,!0),e&&(Mn=e)}})),ht(m,Z,Qn),Dl.add(v),v.syncRect=Vn);const li=v.hooks=u.hooks||{};function ni(e,t,l){e in li&&li[e].forEach((e=>{e.call(null,v,t,l)}))}(u.plugins||[]).forEach((e=>{for(let t in e.hooks)li[t]=(li[t]||[]).concat(e.hooks[t])}));const ii=Ie({key:null,setSeries:!1,filters:{pub:we,sub:we},scales:[Se,he[1]?he[1].scale:null],match:[be,be],values:[null,null]},ol.sync);ol.sync=ii;const oi=ii.key,si=nl(oi);function ri(e,t,l,n,i,o,s){ii.filters.pub(e,t,l,n,i,o,s)&&si.pub(e,t,l,n,i,o,s)}function ui(){ni("init",u,g),Jl(g||u.data,!1),je[Se]?yn(Se,je[Se]):ql(),Kt=Dn.show,Bt=Xt=!0,ll(u.width,u.height)}return si.sub(v),v.pub=function(e,t,l,n,i,o,s){ii.filters.sub(e,t,l,n,i,o,s)&&ti[e](null,t,l,n,i,o,s)},v.destroy=function(){si.unsub(v),Dl.delete(v),ct.clear(),L(x,k,ei),O.remove(),et?.remove(),ni("destroy")},he.forEach(cl),me.forEach((function(e,t){if(e._show=e.show,e.show){let l=_e[e.scale];null==l&&(e.scale=e.side%2?he[1].scale:Se,l=_e[e.scale]);let n=l.time;e.size=pe(e.size),e.space=pe(e.space),e.rotate=pe(e.rotate),e.incrs=pe(e.incrs||(2==l.distr?tt:n?1==ae?pt:xt:lt)),e.splits=pe(e.splits||(n&&1==l.distr?Ve:3==l.distr?Gt:4==l.distr?Ot:Lt)),e.stroke=pe(e.stroke),e.grid.stroke=pe(e.grid.stroke),e.ticks.stroke=pe(e.ticks.stroke),e.border.stroke=pe(e.border.stroke);let i=e.values;e.values=Ae(i)&&!Ae(i[0])?pe(i):n?Ae(i)?kt(Ue,_t(i,Be)):Ye(i)?function(e,t){let l=Ke(t);return(t,n)=>n.map((t=>l(e(t))))}(Ue,i):i||Je:i||It,e.filter=pe(e.filter||(3>l.distr||10!=l.log?ge:Vt)),e.font=Nl(e.font),e.labelFont=Nl(e.labelFont),e._size=e.size(v,null,t,0),e._space=e._rotate=e._incrs=e._found=e._splits=e._values=null,e._size>0&&(hl[t]=!0,e._el=T("u-axis",K))}})),b?b instanceof HTMLElement?(b.appendChild(O),ui()):b(v,ui):ui(),v}Ul.assign=Ie,Ul.fmtNum=Z,Ul.rangeNum=J,Ul.rangeLog=N,Ul.rangeAsinh=j,Ul.orient=il,Ul.pxRatio=y,Ul.join=function(e,t){let l=new Set;for(let t=0;e.length>t;t++){let n=e[t][0],i=n.length;for(let e=0;i>e;e++)l.add(n[e])}let n=[Array.from(l).sort(((e,t)=>e-t))],i=n[0].length,o=new Map;for(let e=0;i>e;e++)o.set(n[0][e],e);for(let l=0;e.length>l;l++){let s=e[l],r=s[0];for(let e=1;s.length>e;e++){let u=s[e],a=Array(i).fill(void 0),f=t?t[l][e]:1,c=[];for(let e=0;u.length>e;e++){let t=u[e],l=o.get(r[e]);null===t?0!=f&&(a[l]=t,2==f&&c.push(l)):a[l]=t}Le(a,c,i),n.push(a)}}return n},Ul.fmtDate=Ke,Ul.tzDate=function(e,t){let l;return"UTC"==t||"Etc/UTC"==t?l=new Date(+e+6e4*e.getTimezoneOffset()):t==Xe?l=e:(l=new Date(e.toLocaleString("en-US",{timeZone:t})),l.setMilliseconds(e.getMilliseconds())),l},Ul.sync=nl;{Ul.addGap=function(e,t,l){let n=e[e.length-1];n&&n[0]==t?n[1]=l:e.push([t,l])},Ul.clipGaps=ul;let e=Ul.paths={points:vl};e.linear=El,e.stepped=function(e){const t=q(e.align,1),l=q(e.ascDesc,!1),n=q(e.alignGaps,0),i=q(e.extend,!1);return(e,o,s,r)=>il(e,o,((u,a,f,c,h,d,p,m,g,x,w)=>{let b=u.pxRound,{left:_,width:k}=e.bbox,v=e=>b(d(e,c,x,m)),M=e=>b(p(e,h,w,g)),S=0==c.ori?pl:ml;const E={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},z=E.stroke,D=c.dir*(0==c.ori?1:-1);s=O(f,s,r,1),r=O(f,s,r,-1);let T=M(f[1==D?s:r]),P=v(a[1==D?s:r]),A=P,W=P;i&&-1==t&&(W=_,S(z,W,T)),S(z,P,T);for(let e=1==D?s:r;e>=s&&r>=e;e+=D){let l=f[e];if(null==l)continue;let n=v(a[e]),i=M(l);1==t?S(z,n,T):S(z,A,i),S(z,n,i),T=i,A=n}let Y=A;i&&1==t&&(Y=_+k,S(z,Y,T));let[C,F]=ol(e,o);if(null!=u.fill||0!=C){let t=E.fill=new Path2D(z),l=M(u.fillTo(e,o,u.min,u.max,C));S(t,Y,l),S(t,W,l)}if(!u.spanGaps){let i=[];i.push(...al(a,f,s,r,D,v,n));let h=u.width*y/2,d=l||1==t?h:-h,p=l||-1==t?-h:h;i.forEach((e=>{e[0]+=d,e[1]+=p})),E.gaps=i=u.gaps(e,o,s,r,i),E.clip=ul(i,c.ori,m,g,x,w)}return 0!=F&&(E.band=2==F?[rl(e,o,s,r,z,-1),rl(e,o,s,r,z,1)]:rl(e,o,s,r,z,F)),E}))},e.bars=function(e){const t=q((e=e||De).size,[.6,ce,1]),l=e.align||0,n=(e.gap||0)*y;let i=e.radius;i=null==i?[0,0]:"number"==typeof i?[i,0]:i;const o=pe(i),s=1-t[0],r=q(t[1],ce)*y,u=q(t[2],1)*y,a=q(e.disp,De),f=q(e.each,(()=>{})),{fill:c,stroke:h}=a;return(e,t,i,d)=>il(e,t,((p,m,g,x,w,b,_,k,v,M,S)=>{let E,z,D=p.pxRound;0==x.ori?[E,z]=o(e,t):[z,E]=o(e,t);const T=x.dir*(0==x.ori?1:-1),P=w.dir*(1==w.ori?1:-1);let A,W,Y=0==x.ori?gl:xl,C=0==x.ori?f:(e,t,l,n,i,o,s)=>{f(e,t,l,i,n,s,o)},[F,H]=ol(e,t),R=3==w.distr?1==F?w.max:w.min:0,I=_(R,w,S,v),L=D(p.width*y),G=!1,O=null,N=null,j=null,U=null;null==c||0!=L&&null==h||(G=!0,O=c.values(e,t,i,d),N=new Map,new Set(O).forEach((e=>{null!=e&&N.set(e,new Path2D)})),L>0&&(j=h.values(e,t,i,d),U=new Map,new Set(j).forEach((e=>{null!=e&&U.set(e,new Path2D)}))));let{x0:B,size:V}=a;if(null!=B&&null!=V){m=B.values(e,t,i,d),2==B.unit&&(m=m.map((t=>e.posToVal(k+t*M,x.key,!0))));let l=V.values(e,t,i,d);W=2==V.unit?l[0]*M:b(l[0],x,M,k)-b(0,x,M,k),W=D(W-L),A=1==T?-L/2:W+L/2}else{let e=M;if(m.length>1){let t=null;for(let l=0,n=1/0;m.length>l;l++)if(void 0!==g[l]){if(null!=t){let i=ee(m[l]-m[t]);n>i&&(n=i,e=ee(b(m[l],x,M,k)-b(m[t],x,M,k)))}t=l}}W=D(ie(r,oe(u,e-e*s))-L-n),A=(0==l?W/2:l==T?0:W)-l*T*n/2}const J={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:3};let K;0!=H&&(J.band=new Path2D,K=D(_(1==H?w.max:w.min,w,S,v)));const X=G?null:new Path2D,Z=J.band;let{y0:$,y1:Q}=a,le=null;null!=$&&null!=Q&&(g=Q.values(e,t,i,d),le=$.values(e,t,i,d));let ne=E*W,se=z*W;for(let l=1==T?i:d;l>=i&&d>=l;l+=T){let n=g[l];if(void 0===n)continue;let i=b(2!=x.distr||null!=a?m[l]:l,x,M,k),o=_(q(n,R),w,S,v);null!=le&&null!=n&&(I=_(le[l],w,S,v));let s=D(i-A),r=D(oe(o,I)),u=D(ie(o,I)),f=r-u;if(null!=n){let i=0>n?se:ne,o=0>n?ne:se;G?(L>0&&null!=j[l]&&Y(U.get(j[l]),s,u+te(L/2),W,oe(0,f-L),i,o),null!=O[l]&&Y(N.get(O[l]),s,u+te(L/2),W,oe(0,f-L),i,o)):Y(X,s,u+te(L/2),W,oe(0,f-L),i,o),C(e,t,l,s-L/2,u,W+L,f)}0!=H&&(P*H==1?(r=u,u=K):(u=r,r=K),f=r-u,Y(Z,s-L/2,u,W+L,oe(0,f),0,0))}return L>0&&(J.stroke=G?U:X),J.fill=G?N:X,J}))},e.spline=function(e){return function(e,t){const l=q(t?.alignGaps,0);return(t,n,i,o)=>il(t,n,((s,r,u,a,f,c,h,d,p,m,g)=>{let x,w,b,_=s.pxRound,k=e=>_(c(e,a,m,d)),v=e=>_(h(e,f,g,p));0==a.ori?(x=hl,b=pl,w=_l):(x=dl,b=ml,w=kl);const y=a.dir*(0==a.ori?1:-1);i=O(u,i,o,1),o=O(u,i,o,-1);let M=k(r[1==y?i:o]),S=M,E=[],z=[];for(let e=1==y?i:o;e>=i&&o>=e;e+=y)if(null!=u[e]){let t=k(r[e]);E.push(S=t),z.push(v(u[e]))}const D={stroke:e(E,z,x,b,w,_),fill:null,clip:null,band:null,gaps:null,flags:1},T=D.stroke;let[P,A]=ol(t,n);if(null!=s.fill||0!=P){let e=D.fill=new Path2D(T),l=v(s.fillTo(t,n,s.min,s.max,P));b(e,S,l),b(e,M,l)}if(!s.spanGaps){let e=[];e.push(...al(r,u,i,o,y,k,l)),D.gaps=e=s.gaps(t,n,i,o,e),D.clip=ul(e,a.ori,d,p,m,g)}return 0!=A&&(D.band=2==A?[rl(t,n,i,o,T,-1),rl(t,n,i,o,T,1)]:rl(t,n,i,o,T,A)),D}))}(zl,e)}}return Ul}();
{
"name": "uplot",
"version": "1.6.23",
"version": "1.6.24",
"description": "A small, fast chart for time series, lines, areas, ohlc & bars",

@@ -9,3 +9,3 @@ "main": "./dist/uPlot.cjs.js",

"scripts": {
"build": "rollup -c",
"build": "rollup -c --bundleConfigAsCjs",
"test": "echo \"Error: no test specified\" && exit 1"

@@ -43,5 +43,5 @@ },

"devDependencies": {
"rollup": "^2.79.0",
"rollup-plugin-terser": "^7.0.2"
"@rollup/plugin-terser": "^0.4.0",
"rollup": "^3.11.0"
}
}
## 📈 μPlot
A small ([~40 KB min](https://github.com/leeoniya/uPlot/tree/master/dist/uPlot.iife.min.js)), [fast](#performance) chart for time series, lines, areas, ohlc & bars _(MIT Licensed)_
A small ([~45 KB min](https://github.com/leeoniya/uPlot/tree/master/dist/uPlot.iife.min.js)), [fast](#performance) chart for time series, lines, areas, ohlc & bars _(MIT Licensed)_

@@ -8,3 +8,3 @@ ---

μPlot is a [fast, memory-efficient](#performance) [Canvas 2D](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D)-based chart for plotting [time series](https://en.wikipedia.org/wiki/Time_series), lines, areas, ohlc & bars; from a cold start it can create an interactive chart containing 150,000 data points in 135ms, scaling linearly at [~25,000 pts/ms](https://leeoniya.github.io/uPlot/bench/uPlot-10M.html). In addition to fast initial render, the zooming and cursor performance is by far the best of any similar charting lib; at ~40 KB, it's likely the smallest and fastest time series plotter that doesn't make use of [context-limited](https://bugs.chromium.org/p/chromium/issues/detail?id=771792) WebGL shaders or WASM, both of which have much higher startup cost and code size.
μPlot is a [fast, memory-efficient](#performance) [Canvas 2D](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D)-based chart for plotting [time series](https://en.wikipedia.org/wiki/Time_series), lines, areas, ohlc & bars; from a cold start it can create an interactive chart containing 150,000 data points in 135ms, scaling linearly at [~25,000 pts/ms](https://leeoniya.github.io/uPlot/bench/uPlot-10M.html). In addition to fast initial render, the zooming and cursor performance is by far the best of any similar charting lib; at ~45 KB, it's likely the smallest and fastest time series plotter that doesn't make use of [context-limited](https://bugs.chromium.org/p/chromium/issues/detail?id=771792) WebGL shaders or WASM, both of which have much higher startup cost and code size.

@@ -11,0 +11,0 @@ <h3 align="center">166,650 point bench: <a href="https://leeoniya.github.io/uPlot/bench/uPlot.html">https://leeoniya.github.io/uPlot/bench/uPlot.html</a></h3>

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc