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