@frangoteam/fuxa
Version:
Web-based Process Visualization (SCADA/HMI/Dashboard) software
1 lines • 48.8 kB
JavaScript
var uPlot=function(){"use strict";const xl="u-off",ye="u-label",J="width",Vt="height",Dt="top",Xt="left",il="right",ol="#000",Ml=ol+"0",at="mousemove",ht="mousedown",Tl="mouseup",te="mouseenter",_e="mouseleave",ke="dblclick",Il="dppxchange",Pl="--",yl=typeof window<"u",Bl=yl?document:null,zl=yl?window:null,je=yl?navigator:null;let K,Ll;function Ot(t,e){if(null!=e){let o=t.classList;!o.contains(e)&&o.add(e)}}function Nl(t,e){let o=t.classList;o.contains(e)&&o.remove(e)}function gt(t,e,o){t.style[e]=o+"px"}function sl(t,e,o,n){let r=Bl.createElement(t);return null!=e&&Ot(r,e),o?.insertBefore(r,n),r}function hl(t,e){return sl("div",t,e)}const ti=new WeakMap;function le(t,e,o,n,r){let c="translate("+e+"px,"+o+"px)";c!=ti.get(t)&&(t.style.transform=c,ti.set(t,c),0>e||0>o||e>n||o>r?Ot(t,xl):Nl(t,xl))}const li=new WeakMap;function Ao(t,e,o){let n=e+o;n!=li.get(t)&&(li.set(t,n),t.style.background=e,t.style.borderColor=o)}const ei=new WeakMap;function Wo(t,e,o,n){let r=e+""+o;r!=ei.get(t)&&(ei.set(t,r),t.style.height=o+"px",t.style.width=e+"px",t.style.marginLeft=n?-e/2+"px":0,t.style.marginTop=n?-o/2+"px":0)}const gn={passive:!0},ni={...gn,capture:!0};function Al(t,e,o,n){e.addEventListener(t,o,n?ni:gn)}function xn(t,e,o,n){e.removeEventListener(t,o,n?ni:gn)}function Wl(t,e,o,n){let r;o=o||0;let c=2147483647>=(n=n||e.length-1);for(;n-o>1;)r=c?o+n>>1:dl((o+n)/2),t>e[r]?o=r:n=r;return t-e[o]>e[n]-t?n:o}function ee(t,e,o,n){for(let r=1==n?e:o;r>=e&&o>=r;r+=n)if(null!=t[r])return r;return-1}function Ge(t,e,o,n){let r=si(t),c=si(e),f=10==o?El:ri;t==e&&(-1==r?(t*=o,e/=o):(t/=o,e*=o));let d=1==c?Xe:dl,p=(1==r?dl:Xe)(f(Nt(t))),m=d(f(Nt(e))),b=ne(o,p),x=ne(o,m);return 10==o&&(0>p&&(b=ct(b,-p)),0>m&&(x=ct(x,-m))),n||2==o?(t=b*r,e=x*c):(t=di(t,b),e=oe(e,x)),[t,e]}function wn(t,e,o,n){let r=Ge(t,e,o,n);return 0==t&&(r[0]=0),0==e&&(r[1]=0),r}yl&&function t(){let e=devicePixelRatio;K!=e&&(K=e,Ll&&xn("change",Ll,t),Ll=matchMedia(`(min-resolution: ${K-.001}dppx) and (max-resolution: ${K+.001}dppx)`),Al("change",Ll,t),zl.dispatchEvent(new CustomEvent(Il)))}();const ii={mode:3,pad:.1},Me={pad:0,soft:null,mode:0},Co={min:Me,max:Me};function Ue(t,e,o,n){return Ke(o)?oi(t,e,o):(Me.pad=o,Me.soft=n?0:null,Me.mode=n?3:0,oi(t,e,Co))}function ut(t,e){return t??e}function oi(t,e,o){let n=o.min,r=o.max,c=ut(n.pad,0),f=ut(r.pad,0),d=ut(n.hard,-Z),p=ut(r.hard,Z),m=ut(n.soft,Z),b=ut(r.soft,-Z),x=ut(n.mode,0),w=ut(r.mode,0),W=e-t,A=El(W),z=zt(Nt(t),Nt(e)),I=El(z),O=Nt(I-A);(1e-9>W||O>10)&&(W=0,0!=t&&0!=e||(W=1e-9,2==x&&m!=Z&&(c=0),2==w&&b!=-Z&&(f=0)));let G=W||z||1e3,k=El(G),B=ne(10,dl(k)),M=ct(di(t-G*(0==W?0==t?.1:1:c),B/10),9),E=m>t||1!=x&&(3!=x||M>m)&&(2!=x||m>M)?Z:m,D=zt(d,E>M&&t>=E?E:Jt(E,M)),j=ct(oe(e+G*(0==W?0==e?.1:1:f),B/10),9),U=e>b||1!=w&&(3!=w||b>j)&&(2!=w||j>b)?-Z:b,R=Jt(p,j>U&&U>=e?U:zt(U,j));return D==R&&0==D&&(R=100),[D,R]}const Yo=new Intl.NumberFormat(yl?je.language:"en-US"),bn=t=>Yo.format(t),rl=Math,Ve=rl.PI,Nt=rl.abs,dl=rl.floor,Rt=rl.round,Xe=rl.ceil,Jt=rl.min,zt=rl.max,ne=rl.pow,si=rl.sign,El=rl.log10,ri=rl.log2,vn=(t,e=1)=>rl.asinh(t/e),Z=1/0;function ai(t){return 1+(0|El((t^t>>31)-(t>>31)))}function ui(t,e,o){return Jt(zt(t,e),o)}function $(t){return"function"==typeof t?t:()=>t}const Ho=t=>t,fi=(t,e)=>e,Oo=()=>null,ci=()=>!0,hi=(t,e)=>t==e,ie=t=>ct(t,14);function jl(t,e){return ie(ct(ie(t/e))*e)}function oe(t,e){return ie(Xe(ie(t/e))*e)}function di(t,e){return ie(dl(ie(t/e))*e)}function ct(t,e=0){if(Fo(t))return t;let o=10**e;return Rt(t*o*(1+Number.EPSILON))/o}const Je=new Map;function Ro(t){return((""+t).split(".")[1]||"").length}function ze(t,e,o,n){let r=[],c=n.map(Ro);for(let f=e;o>f;f++){let d=Nt(f),p=ct(ne(t,f),d);for(let m=0;n.length>m;m++){let b=n[m]*p,x=(0>b||0>f?d:0)+(c[m]>f?c[m]:0),w=ct(b,x);r.push(w),Je.set(w,x)}}return r}const Ee={},pi=[],se=[null,null],Gl=Array.isArray,Fo=Number.isInteger;function mi(t){return"string"==typeof t}function Ke(t){let e=!1;if(null!=t){let o=t.constructor;e=null==o||o==Object}return e}function gi(t){return null!=t&&"object"==typeof t}const Io=Object.getPrototypeOf(Uint8Array);function Ul(t,e=Ke){let o;if(Gl(t)){let n=t.find(r=>null!=r);if(Gl(n)||e(n)){o=Array(t.length);for(let r=0;t.length>r;r++)o[r]=Ul(t[r],e)}else o=t.slice()}else if(t instanceof Io)o=t.slice();else if(e(t)){o={};for(let n in t)o[n]=Ul(t[n],e)}else o=t;return o}function St(t){let e=arguments;for(let o=1;e.length>o;o++){let n=e[o];for(let r in n)Ke(t[r])?St(t[r],Ul(n[r])):t[r]=Ul(n[r])}return t}function Bo(t,e,o){for(let n,r=0,c=-1;e.length>r;r++){let f=e[r];if(f>c){for(n=f-1;n>=0&&null==t[n];)t[n--]=null;for(n=f+1;o>n&&null==t[n];)t[c=n++]=null}}}const Lo=typeof queueMicrotask>"u"?t=>Promise.resolve().then(t):queueMicrotask,xi=["January","February","March","April","May","June","July","August","September","October","November","December"],wi=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function bi(t){return t.slice(0,3)}const No=wi.map(bi),jo=xi.map(bi),Go={MMMM:xi,MMM:jo,WWWW:wi,WWW:No};function De(t){return(10>t?"0":"")+t}const Uo={YYYY:t=>t.getFullYear(),YY:t=>(t.getFullYear()+"").slice(2),MMMM:(t,e)=>e.MMMM[t.getMonth()],MMM:(t,e)=>e.MMM[t.getMonth()],MM:t=>De(t.getMonth()+1),M:t=>t.getMonth()+1,DD:t=>De(t.getDate()),D:t=>t.getDate(),WWWW:(t,e)=>e.WWWW[t.getDay()],WWW:(t,e)=>e.WWW[t.getDay()],HH:t=>De(t.getHours()),H:t=>t.getHours(),h:t=>{let e=t.getHours();return 0==e?12:e>12?e-12:e},AA:t=>12>t.getHours()?"AM":"PM",aa:t=>12>t.getHours()?"am":"pm",a:t=>12>t.getHours()?"a":"p",mm:t=>De(t.getMinutes()),m:t=>t.getMinutes(),ss:t=>De(t.getSeconds()),s:t=>t.getSeconds(),fff:t=>{return(10>(e=t.getMilliseconds())?"00":100>e?"0":"")+e;var e}};function yn(t,e){e=e||Go;let o,n=[],r=/\{([a-z]+)\}|[^{]+/gi;for(;o=r.exec(t);)n.push("{"==o[0][0]?Uo[o[1]]:o[0]);return c=>{let f="";for(let d=0;n.length>d;d++)f+="string"==typeof n[d]?n[d]:n[d](c,e);return f}}const Vo=(new Intl.DateTimeFormat).resolvedOptions().timeZone,vi=t=>t%1==0,Ze=[1,2,2.5,5],Xo=ze(10,-16,0,Ze),yi=ze(10,0,16,Ze),Jo=yi.filter(vi),Ko=Xo.concat(yi),ki="\n{YYYY}",Si="{M}/{D}",Te="\n"+Si,$e=Te+"/{YY}",re="{h}:{mm}{aa}",zi="\n"+re,ft=null;function Di(t){let e=1e3*t,o=60*e,n=60*o,r=24*n,c=30*r,f=365*r;return[(1==t?ze(10,0,3,Ze).filter(vi):ze(10,-3,0,Ze)).concat([e,5*e,10*e,15*e,30*e,o,5*o,10*o,15*o,30*o,n,2*n,3*n,4*n,6*n,8*n,12*n,r,2*r,3*r,4*r,5*r,6*r,7*r,8*r,9*r,10*r,15*r,c,2*c,3*c,4*c,6*c,f,2*f,5*f,10*f,25*f,50*f,100*f]),[[f,"{YYYY}",ft,ft,ft,ft,ft,ft,1],[28*r,"{MMM}",ki,ft,ft,ft,ft,ft,1],[r,Si,ki,ft,ft,ft,ft,ft,1],[n,"{h}{aa}",$e,ft,Te,ft,ft,ft,1],[o,re,$e,ft,Te,ft,ft,ft,1],[e,":{ss}",$e+" "+re,ft,Te+" "+re,ft,zi,ft,1],[t,":{ss}.{fff}",$e+" "+re,ft,Te+" "+re,ft,zi,ft,1]],function(d){return(p,m,b,x,w,W)=>{let A=[],z=w>=f,I=w>=c&&f>w,O=d(b),G=ct(O*t,3),k=_n(O.getFullYear(),z?0:O.getMonth(),I||z?1:O.getDate()),B=ct(k*t,3);if(I||z){let M=I?w/c:0,E=z?w/f:0,D=G==B?G:ct(_n(k.getFullYear()+E,k.getMonth()+M,1)*t,3),j=new Date(Rt(D/t)),U=j.getFullYear(),R=j.getMonth();for(let T=0;x>=D;T++){let F=_n(U+E*T,R+M*T,1),nt=F-d(ct(F*t,3));D=ct((+F+nt)*t,3),D>x||A.push(D)}}else{let M=r>w?w:r,E=B+(dl(b)-dl(G))+oe(G-B,M);A.push(E);let D=d(E),j=D.getHours()+D.getMinutes()/o+D.getSeconds()/n,U=w/n,R=W/p.axes[m]._space;for(;E=ct(E+w,1==t?0:3),x>=E;)if(U>1){let T=dl(ct(j+U,6))%24,F=d(E).getHours()-T;F>1&&(F=-1),E-=F*n,j=(j+U)%24,.7>ct((E-A[A.length-1])/w,3)*R||A.push(E)}else A.push(E)}return A}}]}const[Zo,$o,qo]=Di(1),[Qo,ts,ls]=Di(.001);function Ti(t,e){return t.map(o=>o.map((n,r)=>0==r||8==r||null==n?n:e(1==r||0==o[8]?n:o[1]+n)))}function Pi(t,e){return(o,n,r,c,f)=>{let d,p,m,b,x,w,W=e.find(A=>f>=A[0])||e[e.length-1];return n.map(A=>{let z=t(A),I=z.getFullYear(),O=z.getMonth(),G=z.getDate(),k=z.getHours(),B=z.getMinutes(),M=z.getSeconds(),E=I!=d&&W[2]||O!=p&&W[3]||G!=m&&W[4]||k!=b&&W[5]||B!=x&&W[6]||M!=w&&W[7]||W[1];return d=I,p=O,m=G,b=k,x=B,w=M,E(z)})}}function _n(t,e,o){return new Date(t,e,o)}function Ai(t,e){return e(t)}function Wi(t,e){return(o,n,r,c)=>null==c?Pl:e(t(n))}ze(2,-53,53,[1]);const es={show:!0,live:!0,isolate:!1,mount:()=>{},markers:{show:!0,width:2,stroke:function(t,e){let o=t.series[e];return o.width?o.stroke(t,e):o.points.width?o.points.stroke(t,e):null},fill:function(t,e){return t.series[e].fill(t,e)},dash:"solid"},idx:null,idxs:null,values:[]},kn=[0,0];function qe(t,e,o){return n=>{0==n.button&&o(n)}}function Sn(t,e,o){return o}const ns={show:!0,x:!0,y:!0,lock:!1,move:function(t,e,o){return kn[0]=e,kn[1]=o,kn},points:{show:function(t,e){let o=t.cursor.points,n=hl(),r=o.size(t,e);gt(n,J,r),gt(n,Vt,r);let c=r/-2;gt(n,"marginLeft",c),gt(n,"marginTop",c);let f=o.width(t,e,r);return f&>(n,"borderWidth",f),n},size:function(t,e){return t.series[e].points.size},width:0,stroke:function(t,e){let o=t.series[e].points;return o._stroke||o._fill},fill:function(t,e){let o=t.series[e].points;return o._fill||o._stroke}},bind:{mousedown:qe,mouseup:qe,click:qe,dblclick:qe,mousemove:Sn,mouseleave:Sn,mouseenter:Sn},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(t,e)=>{e.stopPropagation(),e.stopImmediatePropagation()},_x:!1,_y:!1},focus:{prox:-1,bias:0},left:-10,top:-10,idx:null,dataIdx:function(t,e,o){return o},idxs:null},Ci={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},Mn=St({},Ci,{filter:fi}),Yi=St({},Mn,{size:10}),Hi=St({},Ci,{show:!1}),zn='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"',Oi="bold "+zn,Ri={show:!0,scale:"x",stroke:ol,space:50,gap:5,size:50,labelGap:0,labelSize:30,labelFont:Oi,side:2,grid:Mn,ticks:Yi,border:Hi,font:zn,rotate:0},Fi={show:!0,scale:"x",auto:!1,sorted:1,min:Z,max:-Z,idxs:[]};function is(t,e){return e.map(o=>null==o?"":bn(o))}function os(t,e,o,n,r,c,f){let d=[],p=Je.get(r)||0;for(let m=o=f?o:ct(oe(o,r),p);n>=m;m=ct(m+r,p))d.push(Object.is(m,-0)?0:m);return d}function En(t,e,o,n,r){const c=[],f=t.scales[t.axes[e].scale].log,d=dl((10==f?El:ri)(o));r=ne(f,d),10==f&&0>d&&(r=ct(r,-d));let p=o;do{c.push(p),p+=r,10==f&&(p=ct(p,Je.get(r))),r*f>p||(r=p)}while(n>=p);return c}function ss(t,e,o,n,r){let c=t.scales[t.axes[e].scale].asinh,f=n>c?En(t,e,zt(c,o),n,r):[c],d=0>n||o>0?[]:[0];return(-c>o?En(t,e,zt(c,-n),-o,r):[c]).reverse().map(p=>-p).concat(d,f)}const rs=/./,as=/[12357]/,us=/[125]/,fs=/1/;function cs(t,e,o){let n=t.axes[o],r=n.scale,c=t.scales[r];if(3==c.distr&&2==c.log)return e;let f=t.valToPos,d=n._space,p=f(10,r),m=f(9,r)-p<d?f(7,r)-p<d?f(5,r)-p<d?fs:us:as:rs;return e.map(b=>4==c.distr&&0==b||m.test(b)?b:null)}function hs(t,e,o,n){return null==n?Pl:null==e?"":bn(e)}const Ii={show:!0,scale:"y",stroke:ol,space:30,gap:5,size:50,labelGap:0,labelSize:30,labelFont:Oi,side:3,grid:Mn,ticks:Yi,border:Hi,font:zn,rotate:0},Bi={scale:null,auto:!0,sorted:0,min:Z,max:-Z},Li=(t,e,o,n,r)=>r,Ni={show:!0,auto:!0,sorted:0,gaps:Li,alpha:1,facets:[St({},Bi,{scale:"x"}),St({},Bi,{scale:"y"})]},ji={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:Li,alpha:1,points:{show:function(t,e){let{scale:o,idxs:n}=t.series[0],r=t._data[0],c=t.valToPos(r[n[0]],o,!0),f=t.valToPos(r[n[1]],o,!0);return Nt(f-c)/(t.series[e].points.space*K)>=n[1]-n[0]},filter:null},values:null,min:Z,max:-Z,idxs:[],path:null,clip:null};function ds(t,e,o){return o/10}const Gi={time:!0,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},ps=St({},Gi,{time:!1,ori:1}),Ui={};function Vi(t){let e=Ui[t];return e||(e={key:t,plots:[],sub(o){e.plots.push(o)},unsub(o){e.plots=e.plots.filter(n=>n!=o)},pub(o,n,r,c,f,d,p){for(let m=0;e.plots.length>m;m++)e.plots[m]!=n&&e.plots[m].pub(o,n,r,c,f,d,p)}},null!=t&&(Ui[t]=e)),e}function Vl(t,e,o){const n=t.mode,r=t.series[e],c=2==n?t._data[e]:t._data,f=t.scales,d=t.bbox;let p=c[0],m=2==n?c[1]:c[e],b=2==n?f[r.facets[0].scale]:f[t.series[0].scale],x=2==n?f[r.facets[1].scale]:f[r.scale],w=d.left,W=d.top,A=d.width,z=d.height,I=t.valToPosH,O=t.valToPosV;return 0==b.ori?o(r,p,m,b,x,I,O,w,W,A,z,ln,ae,nn,Ki,$i):o(r,p,m,b,x,O,I,W,w,z,A,en,ue,Tn,Zi,qi)}function Qe(t,e){let o=0,n=0,r=ut(t.bands,pi);for(let c=0;r.length>c;c++){let f=r[c];f.series[0]==e?o=f.dir:f.series[1]==e&&(n|=1==f.dir?1:2)}return[o,1==n?-1:2==n?1:3==n?2:0]}function ms(t,e,o,n,r){let c=t.series[e],f=t.scales[2==t.mode?c.facets[1].scale:c.scale];return-1==r?f.min:1==r?f.max:3==f.distr?1==f.dir?f.min:f.max:0}function Dl(t,e,o,n,r,c){return Vl(t,e,(f,d,p,m,b,x,w,W,A,z,I)=>{let O=f.pxRound;const G=0==m.ori?ae:ue;let k,B;m.dir*(0==m.ori?1:-1)==1?(k=o,B=n):(k=n,B=o);let M=O(x(d[k],m,z,W)),E=O(w(p[k],b,I,A)),D=O(x(d[B],m,z,W)),j=O(w(1==c?b.max:b.min,b,I,A)),U=new Path2D(r);return G(U,D,j),G(U,M,j),G(U,M,E),U})}function tn(t,e,o,n,r,c){let f=null;if(t.length>0){f=new Path2D;const d=0==e?nn:Tn;let p=o;for(let b=0;t.length>b;b++){let x=t[b];if(x[1]>x[0]){let w=x[0]-p;w>0&&d(f,p,n,w,n+c),p=x[1]}}let m=o+r-p;m>0&&d(f,p,n,m,n+c)}return f}function Dn(t,e,o,n,r,c,f){let d=[],p=t.length;for(let m=1==r?o:n;m>=o&&n>=m;m+=r)if(null===e[m]){let b=m,x=m;if(1==r)for(;++m<=n&&null===e[m];)x=m;else for(;--m>=o&&null===e[m];)x=m;let w=c(t[b]),W=x==b?w:c(t[x]),A=b-r;w=f>0||0>A||A>=p?w:c(t[A]);let z=x+r;W=0>f||0>z||z>=p?W:c(t[z]),w>W||d.push([w,W])}return d}function Xi(t){return 0==t?Ho:1==t?Rt:e=>jl(e,t)}function Ji(t){let e=0==t?ln:en,o=0==t?(r,c,f,d,p,m)=>{r.arcTo(c,f,d,p,m)}:(r,c,f,d,p,m)=>{r.arcTo(f,c,p,d,m)},n=0==t?(r,c,f,d,p)=>{r.rect(c,f,d,p)}:(r,c,f,d,p)=>{r.rect(f,c,p,d)};return(r,c,f,d,p,m=0,b=0)=>{0==m&&0==b?n(r,c,f,d,p):(m=Jt(m,d/2,p/2),b=Jt(b,d/2,p/2),e(r,c+m,f),o(r,c+d,f,c+d,f+p,m),o(r,c+d,f+p,c,f+p,b),o(r,c,f+p,c,f,b),o(r,c,f,c+d,f,m),r.closePath())}}const ln=(t,e,o)=>{t.moveTo(e,o)},en=(t,e,o)=>{t.moveTo(o,e)},ae=(t,e,o)=>{t.lineTo(e,o)},ue=(t,e,o)=>{t.lineTo(o,e)},nn=Ji(0),Tn=Ji(1),Ki=(t,e,o,n,r,c)=>{t.arc(e,o,n,r,c)},Zi=(t,e,o,n,r,c)=>{t.arc(o,e,n,r,c)},$i=(t,e,o,n,r,c,f)=>{t.bezierCurveTo(e,o,n,r,c,f)},qi=(t,e,o,n,r,c,f)=>{t.bezierCurveTo(o,e,r,n,f,c)};function Qi(){return(t,e,o,n,r)=>Vl(t,e,(c,f,d,p,m,b,x,w,W,A,z)=>{let I,O,{pxRound:G,points:k}=c;0==p.ori?(I=ln,O=Ki):(I=en,O=Zi);const B=ct(k.width*K,3);let M=(k.size-k.width)/2*K,E=ct(2*M,3),D=new Path2D,j=new Path2D,{left:U,top:R,width:T,height:F}=t.bbox;nn(j,U-E,R-E,T+2*E,F+2*E);const nt=tt=>{if(null!=d[tt]){let q=G(b(f[tt],p,A,w)),dt=G(x(d[tt],m,z,W));I(D,q+M,dt),O(D,q,dt,M,0,2*Ve)}};if(r)r.forEach(nt);else for(let tt=o;n>=tt;tt++)nt(tt);return{stroke:B>0?D:null,fill:D,clip:j,flags:3}})}function to(t){return(e,o,n,r,c,f)=>{n!=r&&(c!=n&&f!=n&&t(e,o,n),c!=r&&f!=r&&t(e,o,r),t(e,o,f))}}const gs=to(ae),xs=to(ue);function lo(t){const e=ut(t?.alignGaps,0);return(o,n,r,c)=>Vl(o,n,(f,d,p,m,b,x,w,W,A,z,I)=>{let O,G,k=f.pxRound,B=Y=>k(x(Y,m,z,W)),M=Y=>k(w(Y,b,I,A));0==m.ori?(O=ae,G=gs):(O=ue,G=xs);const E=m.dir*(0==m.ori?1:-1),D={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},j=D.stroke;let U,R,T,F=Z,nt=-Z,tt=B(d[1==E?r:c]),q=ee(p,r,c,1*E),dt=ee(p,r,c,-1*E),Kt=B(d[q]),Zt=B(d[dt]),N=!1;for(let Y=1==E?r:c;Y>=r&&c>=Y;Y+=E){let pt=B(d[Y]),it=p[Y];pt==tt?null!=it?(R=M(it),F==Z&&(O(j,pt,R),U=R),F=Jt(R,F),nt=zt(R,nt)):null===it&&(N=!0):(F!=Z&&(G(j,tt,F,nt,U,R),T=tt),null!=it?(R=M(it),O(j,pt,R),F=nt=U=R):(F=Z,nt=-Z,null===it&&(N=!0)),tt=pt)}F!=Z&&F!=nt&&T!=tt&&G(j,tt,F,nt,U,R);let[Tt,X]=Qe(o,n);if(null!=f.fill||0!=Tt){let Y=D.fill=new Path2D(j),pt=M(f.fillTo(o,n,f.min,f.max,Tt));O(Y,Zt,pt),O(Y,Kt,pt)}if(!f.spanGaps){let Y=[];N&&Y.push(...Dn(d,p,r,c,E,B,e)),D.gaps=Y=f.gaps(o,n,r,c,Y),D.clip=tn(Y,m.ori,W,A,z,I)}return 0!=X&&(D.band=2==X?[Dl(o,n,r,c,j,-1),Dl(o,n,r,c,j,1)]:Dl(o,n,r,c,j,X)),D})}function ws(t,e,o,n,r){const c=t.length;if(2>c)return null;const f=new Path2D;if(o(f,t[0],e[0]),2==c)n(f,t[1],e[1]);else{let d=Array(c),p=Array(c-1),m=Array(c-1),b=Array(c-1);for(let x=0;c-1>x;x++)m[x]=e[x+1]-e[x],b[x]=t[x+1]-t[x],p[x]=m[x]/b[x];d[0]=p[0];for(let x=1;c-1>x;x++)0===p[x]||0===p[x-1]||p[x-1]>0!=p[x]>0?d[x]=0:(d[x]=3*(b[x-1]+b[x])/((2*b[x]+b[x-1])/p[x-1]+(b[x]+2*b[x-1])/p[x]),isFinite(d[x])||(d[x]=0));d[c-1]=p[c-2];for(let x=0;c-1>x;x++)r(f,t[x]+b[x]/3,e[x]+d[x]*b[x]/3,t[x+1]-b[x]/3,e[x+1]-d[x+1]*b[x]/3,t[x+1],e[x+1])}return f}const Pn=new Set;function eo(){for(let t of Pn)t.syncRect(!0)}yl&&(Al("resize",zl,eo),Al("scroll",zl,eo,!0),Al(Il,zl,()=>{jt.pxRatio=K}));const bs=lo(),vs=Qi();function no(t,e,o,n){return(n?[t[0],t[1]].concat(t.slice(2)):[t[0]].concat(t.slice(1))).map((r,c)=>An(r,c,e,o))}function An(t,e,o,n){return St({},0==e?o:n,t)}function io(t,e,o){return null==e?se:[e,o]}const ys=io;function _s(t,e,o){return null==e?se:Ue(e,o,.1,!0)}function oo(t,e,o,n){return null==e?se:Ge(e,o,t.scales[n].log,!1)}const ks=oo;function so(t,e,o,n){return null==e?se:wn(e,o,t.scales[n].log,!1)}const Ss=so;function ro(t){let e,o;return[t=t.replace(/(\d+)px/,(n,r)=>(e=Rt((o=+r)*K))+"px"),e,o]}function zs(t){t.show&&[t.font,t.labelFont].forEach(e=>{let o=ct(e[2]*K,1);e[0]=e[0].replace(/[0-9.]+px/,o+"px"),e[1]=o})}function jt(t,e,o){const n={mode:ut(t.mode,1)},r=n.mode;function c(l,i){return((3==i.distr?El(l>0?l:i.clamp(n,l,i.min,i.max,i.key)):4==i.distr?vn(l,i.asinh):l)-i._min)/(i._max-i._min)}function f(l,i,s,a){let u=c(l,i);return a+s*(-1==i.dir?1-u:u)}function d(l,i,s,a){let u=c(l,i);return a+s*(-1==i.dir?u:1-u)}function p(l,i,s,a){return 0==i.ori?f(l,i,s,a):d(l,i,s,a)}n.valToPosH=f,n.valToPosV=d;let m=!1;n.status=0;const b=n.root=hl("uplot");null!=t.id&&(b.id=t.id),Ot(b,t.class),t.title&&(hl("u-title",b).textContent=t.title);const x=sl("canvas"),w=n.ctx=x.getContext("2d"),W=hl("u-wrap",b);Al("click",W,l=>{(wt!=me||bt!=ge)&&Ft.click(n,l)},!0);const A=n.under=hl("u-under",W);W.appendChild(x);const z=n.over=hl("u-over",W),I=+ut((t=Ul(t)).pxAlign,1),O=Xi(I);(t.plugins||[]).forEach(l=>{l.opts&&(t=l.opts(n,t)||t)});const G=t.ms||.001,k=n.series=1==r?no(t.series||[],Fi,ji,!1):(i=Ni,(t.series||[null]).map((s,a)=>0==a?null:St({},i,s))),B=n.axes=no(t.axes||[],Ri,Ii,!0),M=n.scales={},E=n.bands=t.bands||[];var i;E.forEach(l=>{l.fill=$(l.fill||null),l.dir=ut(l.dir,-1)});const D=2==r?k[1].facets[0].scale:k[0].scale,j={axes:function(){for(let l=0;B.length>l;l++){let i=B[l];if(!i.show||!i._show)continue;let s,a,u=i.side,h=u%2,g=i.stroke(n,l),_=0==u||3==u?-1:1;if(i.label){let Qt=Rt((i._lpos+i.labelGap*_)*K);po(i.labelFont[0],g,"center",2==u?Dt:"bottom"),w.save(),1==h?(s=a=0,w.translate(Qt,Rt(kt+$t/2)),w.rotate((3==u?-Ve:Ve)/2)):(s=Rt(Q+Pt/2),a=Qt),w.fillText(i.label,s,a),w.restore()}let[y,v]=i._found;if(0==v)continue;let S=M[i.scale],P=0==h?Pt:$t,et=0==h?Q:kt,H=Rt(i.gap*K),C=i._splits,st=2==S.distr?C.map(Qt=>vl[Qt]):C,V=2==S.distr?vl[C[1]]-vl[C[0]]:y,rt=i.ticks,vt=i.border,yt=rt.show?Rt(rt.size*K):0,xt=i._rotate*-Ve/180,mt=O(i._pos*K),Mt=mt+(yt+H)*_;a=0==h?Mt:0,s=1==h?Mt:0,po(i.font[0],g,1==i.align?Xt:2==i.align?il:xt>0?Xt:0>xt?il:0==h?"center":3==u?il:Xt,xt||1==h?"middle":2==u?Dt:"bottom");let qt=1.5*i.font[1],nl=C.map(Qt=>O(p(Qt,S,P,et))),Lt=i._values;for(let Qt=0;Lt.length>Qt;Qt++){let Sl=Lt[Qt];if(null!=Sl){0==h?s=nl[Qt]:a=nl[Qt],Sl=""+Sl;let mn=-1==Sl.indexOf("\n")?[Sl]:Sl.split(/\n/gm);for(let cl=0;mn.length>cl;cl++){let Le=mn[cl];xt?(w.save(),w.translate(s,a+cl*qt),w.rotate(xt),w.fillText(Le,0,0),w.restore()):w.fillText(Le,s,a+cl*qt)}}}rt.show&&jn(nl,rt.filter(n,st,l,v,V),h,u,mt,yt,ct(rt.width*K,3),rt.stroke(n,l),rt.dash,rt.cap);let Rl=i.grid;Rl.show&&jn(nl,Rl.filter(n,st,l,v,V),h,0==h?2:1,0==h?kt:Q,0==h?$t:Pt,ct(Rl.width*K,3),Rl.stroke(n,l),Rl.dash,Rl.cap),vt.show&&jn([mt],[1],0==h?1:0,0==h?1:2,1==h?kt:Q,1==h?$t:Pt,ct(vt.width*K,3),vt.stroke(n,l),vt.dash,vt.cap)}It("drawAxes")},series:function(){At>0&&(k.forEach((l,i)=>{if(i>0&&l.show&&null==l._paths){let s=2==r?[0,e[i][0].length-1]:function(a){let u=ui(Wt-1,0,At-1),h=ui(Ct+1,0,At-1);for(;null==a[u]&&u>0;)u--;for(;null==a[h]&&At-1>h;)h++;return[u,h]}(e[i]);l._paths=l.paths(n,i,s[0],s[1])}}),k.forEach((l,i)=>{if(i>0&&l.show){Ce!=l.alpha&&(w.globalAlpha=Ce=l.alpha),mo(i,!1),l._paths&&go(i,!1);{mo(i,!0);let s=l._paths?l._paths.gaps:null,a=l.points.show(n,i,Wt,Ct,s),u=l.points.filter(n,i,a,s);(a||u)&&(l.points._paths=l.points.paths(n,i,Wt,Ct,u),go(i,!0))}1!=Ce&&(w.globalAlpha=Ce=1),It("drawSeries",i)}}))}},U=(t.drawOrder||["axes","series"]).map(l=>j[l]);function R(l){let i=M[l];if(null==i){let s=(t.scales||Ee)[l]||Ee;if(null!=s.from)R(s.from),M[l]=St({},M[s.from],s,{key:l});else{i=M[l]=St({},l==D?Gi:ps,s),i.key=l;let a=i.time,u=i.range,h=Gl(u);if((l!=D||2==r&&!a)&&(!h||null!=u[0]&&null!=u[1]||(u={min:null==u[0]?ii:{mode:1,hard:u[0],soft:u[0]},max:null==u[1]?ii:{mode:1,hard:u[1],soft:u[1]}},h=!1),!h&&Ke(u))){let g=u;u=(_,y,v)=>null==y?se:Ue(y,v,g)}i.range=$(u||(a?ys:l==D?3==i.distr?ks:4==i.distr?Ss:io:3==i.distr?oo:4==i.distr?so:_s)),i.auto=$(!h&&i.auto),i.clamp=$(i.clamp||ds),i._min=i._max=null}}}R("x"),R("y"),1==r&&k.forEach(l=>{R(l.scale)}),B.forEach(l=>{R(l.scale)});for(let l in t.scales)R(l);const T=M[D],F=T.distr;let nt,tt;0==T.ori?(Ot(b,"u-hz"),nt=f,tt=d):(Ot(b,"u-vt"),nt=d,tt=f);const q={};for(let l in M){let i=M[l];null==i.min&&null==i.max||(q[l]={min:i.min,max:i.max},i.min=i.max=null)}const dt=t.tzDate||(l=>new Date(Rt(l/G))),Kt=t.fmtDate||yn,Zt=1==G?qo(dt):ls(dt),N=Pi(dt,Ti(1==G?$o:ts,Kt)),Tt=Wi(dt,Ai("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",Kt)),X=[],Y=n.legend=St({},es,t.legend),pt=Y.show,it=Y.markers;let Gt;Y.idxs=X,it.width=$(it.width),it.dash=$(it.dash),it.stroke=$(it.stroke),it.fill=$(it.fill);let _t,wl=[],Cl=[],pl=!1,Yl={};if(Y.live){const l=k[1]?k[1].values:null;pl=null!=l,_t=pl?l(n,1,0):{_:0};for(let i in _t)Yl[i]=Pl}if(pt)if(Gt=sl("table","u-legend",b),Y.mount(n,Gt),pl){let l=sl("tr","u-thead",Gt);for(var fe in sl("th",null,l),_t)sl("th",ye,l).textContent=fe}else Ot(Gt,"u-inline"),Y.live&&Ot(Gt,"u-live");const ce={show:!0},Pe={show:!1},bl=new Map;function ml(l,i,s){const a=bl.get(i)||{},u=L.bind[l](n,i,s);u&&(Al(l,i,a[l]=u),bl.set(i,a))}function he(l,i){const s=bl.get(i)||{};for(let a in s)null!=l&&a!=l||(xn(a,i,s[a]),delete s[a]);null==l&&bl.delete(i)}let de=0,Xl=0,ot=0,lt=0,al=0,ul=0,Q=0,kt=0,Pt=0,$t=0;n.bbox={};let tl=!1,gl=!1,Et=!1,fl=!1,Jl=!1,Ut=!1;function Wn(l,i,s){(s||l!=n.width||i!=n.height)&&ao(l,i),Ye(!1),Et=!0,gl=!0,0>L.left||(fl=Ut=!0),$l()}function ao(l,i){n.width=de=ot=l,n.height=Xl=lt=i,al=ul=0,function(){let a=!1,u=!1,h=!1,g=!1;B.forEach(_=>{if(_.show&&_._show){let{side:y,_size:v}=_,S=v+(null!=_.label?_.labelSize:0);S>0&&(y%2?(ot-=S,3==y?(al+=S,g=!0):h=!0):(lt-=S,0==y?(ul+=S,a=!0):u=!0))}}),Zl[0]=a,Zl[1]=h,Zl[2]=u,Zl[3]=g,ot-=Hl[1]+Hl[3],al+=Hl[3],lt-=Hl[2]+Hl[0],ul+=Hl[0]}(),function(){let a=al+ot,u=ul+lt,h=al,g=ul;function _(y,v){switch(y){case 1:return a+=v,a-v;case 2:return u+=v,u-v;case 3:return h-=v,h+v;case 0:return g-=v,g+v}}B.forEach(y=>{if(y.show&&y._show){let v=y.side;y._pos=_(v,y._size),null!=y.label&&(y._lpos=_(v,y.labelSize))}})}();let s=n.bbox;Q=s.left=jl(al*K,.5),kt=s.top=jl(ul*K,.5),Pt=s.width=jl(ot*K,.5),$t=s.height=jl(lt*K,.5)}n.setSize=function({width:l,height:i}){Wn(l,i)};const L=n.cursor=St({},ns,{drag:{y:2==r}},t.cursor);{L.idxs=X,L._lock=!1;let l=L.points;l.show=$(l.show),l.size=$(l.size),l.stroke=$(l.stroke),l.width=$(l.width),l.fill=$(l.fill)}const Kl=n.focus=St({},t.focus||{alpha:.3},L.focus);0!=Kl.bias&&(Kl.prox=1e5);const Ae=Kl.prox>=0;let ll=[null];function uo(l,i){if(1==r||i>0){let s=1==r&&M[l.scale].time,a=l.value;l.value=s?mi(a)?Wi(dt,Ai(a,Kt)):a||Tt:a||hs,l.label=l.label||(s?"Time":"Value")}if(i>0){l.width=null==l.width?1:l.width,l.paths=l.paths||bs||Oo,l.fillTo=$(l.fillTo||ms),l.pxAlign=+ut(l.pxAlign,I),l.pxRound=Xi(l.pxAlign),l.stroke=$(l.stroke||null),l.fill=$(l.fill||null),l._stroke=l._fill=l._paths=l._focus=null;let s=ct(1*(3+2*(zt(1,l.width)||1)),3),a=l.points=St({},{size:s,width:zt(1,.2*s),stroke:l.stroke,space:2*s,paths:vs,_stroke:null,_fill:null},l.points);a.show=$(a.show),a.filter=$(a.filter),a.fill=$(a.fill),a.stroke=$(a.stroke),a.paths=$(a.paths),a.pxAlign=l.pxAlign}if(pt){let s=function(a,u){if(0==u&&(pl||!Y.live||2==r))return se;let h=[],g=sl("tr","u-series",Gt,Gt.childNodes[u]);Ot(g,a.class),a.show||Ot(g,xl);let _=sl("th",null,g);if(it.show){let S=hl("u-marker",_);if(u>0){let P=it.width(n,u);P&&(S.style.border=P+"px "+it.dash(n,u)+" "+it.stroke(n,u)),S.style.background=it.fill(n,u)}}let y=hl(ye,_);for(var v in y.textContent=a.label,u>0&&(it.show||(y.style.color=a.width>0?it.stroke(n,u):it.fill(n,u)),ml("click",_,S=>{if(L._lock)return;let P=k.indexOf(a);if((S.ctrlKey||S.metaKey)!=Y.isolate){let et=k.some((H,C)=>C>0&&C!=P&&H.show);k.forEach((H,C)=>{C>0&&_l(C,et?C==P?ce:Pe:ce,!0,Bt.setSeries)})}else _l(P,{show:!a.show},!0,Bt.setSeries)}),Ae&&ml(te,_,()=>{L._lock||_l(k.indexOf(a),we,!0,Bt.setSeries)})),_t){let S=sl("td","u-value",g);S.textContent="--",h.push(S)}return[g,h]}(l,i);wl.splice(i,0,s[0]),Cl.splice(i,0,s[1]),Y.values.push(null)}if(L.show){X.splice(i,0,null);let s=function(a,u){if(u>0){let h=L.points.show(n,u);if(h)return Ot(h,"u-cursor-pt"),Ot(h,a.class),le(h,-10,-10,ot,lt),z.insertBefore(h,ll[u]),h}}(l,i);s&&ll.splice(i,0,s)}It("addSeries",i)}n.addSeries=function(l,i){i=i??k.length,l=1==r?An(l,i,Fi,ji):An(l,i,null,Ni),k.splice(i,0,l),uo(k[i],i)},n.delSeries=function(l){if(k.splice(l,1),pt){Y.values.splice(l,1),Cl.splice(l,1);let i=wl.splice(l,1)[0];he(null,i.firstChild),i.remove()}L.show&&(X.splice(l,1),ll.length>1&&ll.splice(l,1)[0].remove()),It("delSeries",l)};const Zl=[!1,!1,!1,!1];function We(l,i,s){let[a,u,h,g]=s,_=i%2,y=0;return 0==_&&(g||u)&&(y=0==i&&!a||2==i&&!h?Rt(Ri.size/3):0),1==_&&(a||h)&&(y=1==i&&!u||3==i&&!g?Rt(Ii.size/2):0),y}const fo=n.padding=(t.padding||[We,We,We,We]).map(l=>$(ut(l,We))),Hl=n._padding=fo.map((l,i)=>l(n,i,Zl,0));let At,Wt=null,Ct=null;const on=1==r?k[0].idxs:null;let sn,pe,Cn,Yn,Hn,On,Rn,Fn,In,Ce,vl=null,rn=!1;function co(l,i){if(e=null==l?[]:Ul(l,gi),2==r){At=0;for(let s=1;k.length>s;s++)At+=e[s][0].length;n.data=e=l}else if(null==e[0]&&(e[0]=[]),n.data=e.slice(),vl=e[0],At=vl.length,2==F){e[0]=Array(At);for(let s=0;At>s;s++)e[0][s]=s}if(n._data=e,Ye(!0),It("setData"),2==F&&(Et=!0),!1!==i){let s=T;s.auto(n,rn)?Bn():xe(D,s.min,s.max),fl=L.left>=0,Ut=!0,$l()}}function Bn(){let l,i;rn=!0,1==r&&(At>0?(Wt=on[0]=0,Ct=on[1]=At-1,l=e[0][Wt],i=e[0][Ct],2==F?(l=Wt,i=Ct):1==At&&(3==F?[l,i]=Ge(l,l,T.log,!1):4==F?[l,i]=wn(l,l,T.log,!1):T.time?i=l+Rt(86400/G):[l,i]=Ue(l,i,.1,!0))):(Wt=on[0]=l=null,Ct=on[1]=i=null)),xe(D,l,i)}function ho(l,i,s,a,u,h){l??=Ml,s??=pi,a??="butt",u??=Ml,h??="round",l!=sn&&(w.strokeStyle=sn=l),u!=pe&&(w.fillStyle=pe=u),i!=Cn&&(w.lineWidth=Cn=i),h!=Hn&&(w.lineJoin=Hn=h),a!=On&&(w.lineCap=On=a),s!=Yn&&w.setLineDash(Yn=s)}function po(l,i,s,a){i!=pe&&(w.fillStyle=pe=i),l!=Rn&&(w.font=Rn=l),s!=Fn&&(w.textAlign=Fn=s),a!=In&&(w.textBaseline=In=a)}function Ln(l,i,s,a,u=0){if(a.length>0&&l.auto(n,rn)&&(null==i||null==i.min)){let h=ut(Wt,0),g=ut(Ct,a.length-1),_=null==s.min?3==l.distr?function(y,v,S){let P=Z,et=-Z;for(let H=v;S>=H;H++)y[H]>0&&(P=Jt(P,y[H]),et=zt(et,y[H]));return[P==Z?1:P,et==-Z?10:et]}(a,h,g):function(y,v,S,P){let et=Z,H=-Z;if(1==P)et=y[v],H=y[S];else if(-1==P)et=y[S],H=y[v];else for(let C=v;S>=C;C++)null!=y[C]&&(et=Jt(et,y[C]),H=zt(H,y[C]));return[et,H]}(a,h,g,u):[s.min,s.max];l.min=Jt(l.min,s.min=_[0]),l.max=zt(l.max,s.max=_[1])}}function mo(l,i){let s=i?k[l].points:k[l];s._stroke=s.stroke(n,l),s._fill=s.fill(n,l)}function go(l,i){let s=i?k[l].points:k[l],a=s._stroke,u=s._fill,{stroke:h,fill:g,clip:_,flags:y}=s._paths,v=null,S=ct(s.width*K,3),P=S%2/2;i&&null==u&&(u=S>0?"#fff":a);let et=1==s.pxAlign;if(et&&w.translate(P,P),!i){let H=Q,C=kt,st=Pt,V=$t,rt=S*K/2;0==s.min&&(V+=rt),0==s.max&&(C-=rt,V+=rt),v=new Path2D,v.rect(H,C,st,V)}i?Nn(a,S,s.dash,s.cap,u,h,g,y,_):function(H,C,st,V,rt,vt,yt,xt,mt,Mt,qt){let nl=!1;E.forEach((Lt,Rl)=>{if(Lt.series[0]==H){let Qt,Sl=k[Lt.series[1]],mn=e[Lt.series[1]],cl=(Sl._paths||Ee).band;Gl(cl)&&(cl=1==Lt.dir?cl[0]:cl[1]);let Le=null;Sl.show&&cl&&function(Po,Ne,Qn){for(Ne=ut(Ne,0),Qn=ut(Qn,Po.length-1);Qn>=Ne;){if(null!=Po[Ne])return!0;Ne++}return!1}(mn,Wt,Ct)?(Le=Lt.fill(n,Rl)||vt,Qt=Sl._paths.clip):cl=null,Nn(C,st,V,rt,Le,yt,xt,mt,Mt,qt,Qt,cl),nl=!0}}),nl||Nn(C,st,V,rt,vt,yt,xt,mt,Mt,qt)}(l,a,S,s.dash,s.cap,u,h,g,y,v,_),et&&w.translate(-P,-P)}function Nn(l,i,s,a,u,h,g,_,y,v,S,P){ho(l,i,s,a,u),(y||v||P)&&(w.save(),y&&w.clip(y),v&&w.clip(v)),P?3&~_?2&_?(un(u,g),w.clip(P),an(l,h,i)):1&_&&(w.save(),w.clip(P),S&&w.clip(S),un(u,g),w.restore(),an(l,h,i)):(w.clip(P),S&&w.clip(S),un(u,g),an(l,h,i)):(un(u,g),an(l,h,i)),(y||v||P)&&w.restore()}function an(l,i,s){s>0&&(i instanceof Map?i.forEach((a,u)=>{w.strokeStyle=sn=u,w.stroke(a)}):null!=i&&l&&w.stroke(i))}function un(l,i){i instanceof Map?i.forEach((s,a)=>{w.fillStyle=pe=a,w.fill(s)}):null!=i&&l&&w.fill(i)}function jn(l,i,s,a,u,h,g,_,y,v){let S=g%2/2;1==I&&w.translate(S,S),ho(_,g,y,v,_),w.beginPath();let P,et,H,C,st=u+(0==a||3==a?-h:h);0==s?(et=u,C=st):(P=u,H=st);for(let V=0;l.length>V;V++)null!=i[V]&&(0==s?P=H=l[V]:et=C=l[V],w.moveTo(P,et),w.lineTo(H,C));w.stroke(),1==I&&w.translate(-S,-S)}function Es(l){let i=!0;return B.forEach((s,a)=>{if(!s.show)return;let u=M[s.scale];if(null==u.min)return void(s._show&&(i=!1,s._show=!1,Ye(!1)));s._show||(i=!1,s._show=!0,Ye(!1));let h=s.side,g=h%2,{min:_,max:y}=u,[v,S]=function(V,rt,vt,yt){let xt,mt=B[V];if(yt>0){let Mt=mt._space=mt.space(n,V,rt,vt,yt);xt=function Ms(t,e,o,n,r){let c=zt(ai(t),ai(e)),f=e-t,d=Wl(r/n*f,o);do{let p=o[d],m=n*p/f;if(m>=r&&17>=c+(5>p?Je.get(p):0))return[p,m]}while(++d<o.length);return[0,0]}(rt,vt,mt._incrs=mt.incrs(n,V,rt,vt,yt,Mt),yt,Mt)}else xt=[0,0];return mt._found=xt}(a,_,y,0==g?ot:lt);if(0==S)return;let P=s._splits=s.splits(n,a,_,y,v,S,2==u.distr),et=2==u.distr?P.map(V=>vl[V]):P,H=2==u.distr?vl[P[1]]-vl[P[0]]:v,C=s._values=s.values(n,s.filter(n,et,a,S,H),a,S,H);s._rotate=2==h?s.rotate(n,C,a,S):0;let st=s._size;s._size=Xe(s.size(n,C,a,l)),null!=st&&s._size!=st&&(i=!1)}),i}function Ds(l){let i=!0;return fo.forEach((s,a)=>{let u=s(n,a,Zl,l);u!=Hl[a]&&(i=!1),Hl[a]=u}),i}function Ye(l){k.forEach((i,s)=>{s>0&&(i._paths=null,l&&(1==r?(i.min=null,i.max=null):i.facets.forEach(a=>{a.min=null,a.max=null})))})}n.setData=co;let Gn,Un,fn,cn,xo,wo,me,ge,bo,vo,wt,bt,Vn=!1;function $l(){Vn||(Lo(Ts),Vn=!0)}function Ts(){tl&&(function(){let l=Ul(M,gi);for(let a in l){let u=l[a],h=q[a];if(null!=h&&null!=h.min)St(u,h),a==D&&Ye(!0);else if(a!=D||2==r)if(0==At&&null==u.from){let g=u.range(n,null,null,a);u.min=g[0],u.max=g[1]}else u.min=Z,u.max=-Z}if(At>0){k.forEach((a,u)=>{if(1==r){let h=a.scale,g=l[h],_=q[h];if(0==u){let y=g.range(n,g.min,g.max,h);g.min=y[0],g.max=y[1],Wt=Wl(g.min,e[0]),Ct=Wl(g.max,e[0]),Ct-Wt>1&&(g.min>e[0][Wt]&&Wt++,e[0][Ct]>g.max&&Ct--),a.min=vl[Wt],a.max=vl[Ct]}else a.show&&a.auto&&Ln(g,_,a,e[u],a.sorted);a.idxs[0]=Wt,a.idxs[1]=Ct}else if(u>0&&a.show&&a.auto){let[h,g]=a.facets,_=h.scale,y=g.scale,[v,S]=e[u];Ln(l[_],q[_],h,v,h.sorted),Ln(l[y],q[y],g,S,g.sorted),a.min=g.min,a.max=g.max}});for(let a in l){let u=l[a],h=q[a];if(null==u.from&&(null==h||null==h.min)){let g=u.range(n,u.min==Z?null:u.min,u.max==-Z?null:u.max,a);u.min=g[0],u.max=g[1]}}}for(let a in l){let u=l[a];if(null!=u.from){let h=l[u.from];if(null==h.min)u.min=u.max=null;else{let g=u.range(n,h.min,h.max,a);u.min=g[0],u.max=g[1]}}}let i={},s=!1;for(let a in l){let u=l[a],h=M[a];if(h.min!=u.min||h.max!=u.max){h.min=u.min,h.max=u.max;let g=h.distr;h._min=3==g?El(h.min):4==g?vn(h.min,h.asinh):h.min,h._max=3==g?El(h.max):4==g?vn(h.max,h.asinh):h.max,i[a]=s=!0}}if(s){k.forEach((a,u)=>{2==r?u>0&&i.y&&(a._paths=null):i[a.scale]&&(a._paths=null)});for(let a in i)Et=!0,It("setScale",a);L.show&&L.left>=0&&(fl=Ut=!0)}for(let a in q)q[a]=null}(),tl=!1),Et&&(function(){let l=!1,i=0;for(;!l;){i++;let s=Es(i),a=Ds(i);l=3==i||s&&a,l||(ao(n.width,n.height),gl=!0)}}(),Et=!1),gl&&(gt(A,Xt,al),gt(A,Dt,ul),gt(A,J,ot),gt(A,Vt,lt),gt(z,Xt,al),gt(z,Dt,ul),gt(z,J,ot),gt(z,Vt,lt),gt(W,J,de),gt(W,Vt,Xl),x.width=Rt(de*K),x.height=Rt(Xl*K),B.forEach(({_el:l,_show:i,_size:s,_pos:a,side:u})=>{if(null!=l)if(i){let h=u%2==1;gt(l,h?"left":"top",a-(3===u||0===u?s:0)),gt(l,h?"width":"height",s),gt(l,h?"top":"left",h?ul:al),gt(l,h?"height":"width",h?lt:ot),Nl(l,xl)}else Ot(l,xl)}),sn=pe=Cn=Hn=On=Rn=Fn=In=Yn=null,Ce=1,dn(!0),It("setSize"),gl=!1),de>0&&Xl>0&&(w.clearRect(0,0,x.width,x.height),It("drawClear"),U.forEach(l=>l()),It("draw")),el.show&&Jl&&(hn(el),Jl=!1),L.show&&fl&&(Ql(null,!0,!1),fl=!1),Y.show&&Y.live&&Ut&&(Jn(),Ut=!1),m||(m=!0,n.status=1,It("ready")),rn=!1,Vn=!1}function Xn(l,i){let s=M[l];if(null==s.from){if(0==At){let a=s.range(n,i.min,i.max,l);i.min=a[0],i.max=a[1]}if(i.min>i.max){let a=i.min;i.min=i.max,i.max=a}if(At>1&&null!=i.min&&null!=i.max&&1e-16>i.max-i.min)return;l==D&&2==s.distr&&At>0&&(i.min=Wl(i.min,e[0]),i.max=Wl(i.max,e[0]),i.min==i.max&&i.max++),q[l]=i,tl=!0,$l()}}n.redraw=(l,i)=>{Et=i||!1,!1!==l?xe(D,T.min,T.max):$l()},n.setScale=Xn;let Ol=!1;const Ft=L.drag;let Yt=Ft.x,Ht=Ft.y;L.show&&(L.x&&(Gn=hl("u-cursor-x",z)),L.y&&(Un=hl("u-cursor-y",z)),0==T.ori?(fn=Gn,cn=Un):(fn=Un,cn=Gn),wt=L.left,bt=L.top);const el=n.select=St({show:!0,over:!0,left:0,width:0,top:0,height:0},t.select),He=el.show?hl("u-select",el.over?z:A):null;function hn(l,i){if(el.show){for(let s in l)el[s]=l[s],s in So&>(He,s,l[s]);!1!==i&&It("setSelect")}}function xe(l,i,s){Xn(l,{min:i,max:s})}function _l(l,i,s,a){null!=i.focus&&function(u){if(u!=Re){let h=null==u,g=1!=Kl.alpha;k.forEach((_,y)=>{let v=h||0==y||y==u;var S,P;_._focus=h?null:v,g&&(k[S=y].alpha=P=v?1:Kl.alpha,L.show&&ll[S]&&(ll[S].style.opacity=P),pt&&wl[S]&&(wl[S].style.opacity=P))}),Re=u,g&&$l()}}(l),null!=i.show&&k.forEach((u,h)=>{0>=h||l!=h&&null!=l||(u.show=i.show,function(g){let _=pt?wl[g]:null;k[g].show?_&&Nl(_,xl):(_&&Ot(_,xl),ll.length>1&&le(ll[g],-10,-10,ot,lt))}(h),xe(2==r?u.facets[1].scale:u.scale,null,null),$l())}),!1!==s&&It("setSeries",l,i),a&&Be("setSeries",n,l,i)}let ql,Oe,Re;n.setSelect=hn,n.setSeries=_l,n.addBand=function(l,i){l.fill=$(l.fill||null),l.dir=ut(l.dir,-1),E.splice(i=i??E.length,0,l)},n.setBand=function(l,i){St(E[l],i)},n.delBand=function(l){null==l?E.length=0:E.splice(l,1)};const we={focus:!0};function kl(l,i,s){let a=M[i];s&&(l=l/K-(1==a.ori?ul:al));let u=ot;1==a.ori&&(u=lt,l=u-l),-1==a.dir&&(l=u-l);let h=a._min,g=h+l/u*(a._max-h),_=a.distr;return 3==_?ne(10,g):4==_?((y,v=1)=>rl.sinh(y)*v)(g,a.asinh):g}function yo(l,i){gt(He,Xt,el.left=l),gt(He,J,el.width=i)}function _o(l,i){gt(He,Dt,el.top=l),gt(He,Vt,el.height=i)}pt&&Ae&&Al(_e,Gt,()=>{L._lock||null!=Re&&_l(null,we,!0,Bt.setSeries)}),n.valToIdx=l=>Wl(l,e[0]),n.posToIdx=function(l,i){return Wl(kl(l,D,i),e[0],Wt,Ct)},n.posToVal=kl,n.valToPos=(l,i,s)=>0==M[i].ori?f(l,M[i],s?Pt:ot,s?Q:0):d(l,M[i],s?$t:lt,s?kt:0),n.batch=function(l){l(n),$l()},n.setCursor=(l,i,s)=>{wt=l.left,bt=l.top,Ql(null,i,s)};let Fe=0==T.ori?yo:_o,Ie=1==T.ori?yo:_o;function Jn(l,i){null!=l&&(l.idxs?l.idxs.forEach((s,a)=>{X[a]=s}):(s=>void 0===s)(l.idx)||X.fill(l.idx),Y.idx=X[0]);for(let s=0;k.length>s;s++)(s>0||1==r&&!pl)&&Ps(s,X[s]);pt&&Y.live&&function(){if(pt&&Y.live)for(let s=2==r?1:0;k.length>s;s++){if(0==s&&pl)continue;let a=Y.values[s],u=0;for(let h in a)Cl[s][u++].firstChild.nodeValue=a[h]}}(),Ut=!1,!1!==i&&It("setLegend")}function Ps(l,i){let s,a=k[l],u=0==l&&2==F?vl:e[l];pl?s=a.values(n,l,i)??Yl:(s=a.value(n,null==i?null:u[i],l,i),s=null==s?Yl:{_:s}),Y.values[l]=s}function Ql(l,i,s){let a;bo=wt,vo=bt,[wt,bt]=L.move(n,wt,bt),L.show&&(fn&&le(fn,Rt(wt),0,ot,lt),cn&&le(cn,0,Rt(bt),ot,lt)),ql=Z;let u=0==T.ori?ot:lt,h=1==T.ori?ot:lt;if(0>wt||0==At||Wt>Ct){a=null;for(let g=0;k.length>g;g++)g>0&&ll.length>1&&le(ll[g],-10,-10,ot,lt);Ae&&_l(null,we,!0,null==l&&Bt.setSeries),Y.live&&(X.fill(a),Ut=!0)}else{let g,_,y;1==r&&(g=0==T.ori?wt:bt,_=kl(g,D),a=Wl(_,e[0],Wt,Ct),y=nt(e[0][a],T,u,0));for(let v=2==r?1:0;k.length>v;v++){let S=k[v],P=X[v],et=1==r?e[v][P]:e[v][1][P],H=L.dataIdx(n,v,a,_),C=1==r?e[v][H]:e[v][1][H];Ut=Ut||C!=et||H!=P,X[v]=H;let st=oe(H==a?y:nt(1==r?e[0][H]:e[v][0][H],T,u,0),1);if(v>0&&S.show){let V,rt,vt=null==C?-10:oe(tt(C,1==r?M[S.scale]:M[S.facets[1].scale],h,0),1);if(Ae&&vt>=0&&1==r){let yt=Nt(vt-bt),xt=Kl.bias;if(0!=xt){let mt=kl(1==T.ori?wt:bt,S.scale),Mt=0>mt?-1:1;Mt==(0>C?-1:1)&&(yt>=ql||(1==Mt?1==xt?mt>C:C>mt:1==xt?C>mt:mt>C)||(ql=yt,Oe=v))}else ql>yt&&(ql=yt,Oe=v)}if(0==T.ori?(V=st,rt=vt):(V=vt,rt=st),Ut&&ll.length>1){Ao(ll[v],L.points.fill(n,v),L.points.stroke(n,v));let yt,xt,mt,Mt,qt=!0,nl=L.points.bbox;if(null!=nl){qt=!1;let Lt=nl(n,v);mt=Lt.left,Mt=Lt.top,yt=Lt.width,xt=Lt.height}else mt=V,Mt=rt,yt=xt=L.points.size(n,v);Wo(ll[v],yt,xt,qt),le(ll[v],mt,Mt,ot,lt)}}}}if(L.idx=a,L.left=wt,L.top=bt,Ut&&(Y.idx=a,Jn()),el.show&&Ol)if(null!=l){let[g,_]=Bt.scales,[y,v]=Bt.match,[S,P]=l.cursor.sync.scales,et=l.cursor.drag;if(Yt=et._x,Ht=et._y,Yt||Ht){let H,C,st,V,rt,{left:vt,top:yt,width:xt,height:mt}=l.select,Mt=l.scales[g].ori,qt=l.posToVal,nl=null!=g&&y(g,S),Lt=null!=_&&v(_,P);nl&&Yt?(0==Mt?(H=vt,C=xt):(H=yt,C=mt),st=M[g],V=nt(qt(H,S),st,u,0),rt=nt(qt(H+C,S),st,u,0),Fe(Jt(V,rt),Nt(rt-V))):Fe(0,u),Lt&&Ht?(1==Mt?(H=vt,C=xt):(H=yt,C=mt),st=M[_],V=tt(qt(H,P),st,h,0),rt=tt(qt(H+C,P),st,h,0),Ie(Jt(V,rt),Nt(rt-V))):Ie(0,h)}else Zn()}else{let g=Nt(bo-xo),_=Nt(vo-wo);if(1==T.ori){let P=g;g=_,_=P}Yt=Ft.x&&g>=Ft.dist,Ht=Ft.y&&_>=Ft.dist;let y,v,S=Ft.uni;null!=S?Yt&&Ht&&(Yt=g>=S,Ht=_>=S,Yt||Ht||(_>g?Ht=!0:Yt=!0)):Ft.x&&Ft.y&&(Yt||Ht)&&(Yt=Ht=!0),Yt&&(0==T.ori?(y=me,v=wt):(y=ge,v=bt),Fe(Jt(y,v),Nt(v-y)),Ht||Ie(0,h)),Ht&&(1==T.ori?(y=me,v=wt):(y=ge,v=bt),Ie(Jt(y,v),Nt(v-y)),Yt||Fe(0,u)),Yt||Ht||(Fe(0,0),Ie(0,0))}if(Ft._x=Yt,Ft._y=Ht,null==l){if(s){if(null!=To){let[g,_]=Bt.scales;Bt.values[0]=null!=g?kl(0==T.ori?wt:bt,g):null,Bt.values[1]=null!=_?kl(1==T.ori?wt:bt,_):null}Be(at,n,wt,bt,ot,lt,a)}if(Ae){let g=s&&Bt.setSeries,_=Kl.prox;null==Re?ql>_||_l(Oe,we,!0,g):ql>_?_l(null,we,!0,g):Oe!=Re&&_l(Oe,we,!0,g)}}!1!==i&&It("setCursor")}n.setLegend=Jn;let be=null;function dn(l){!0===l?be=null:(be=z.getBoundingClientRect(),It("syncRect",be))}function ko(l,i,s,a,u,h){L._lock||Ol&&null!=l&&0==l.movementX&&0==l.movementY||(Kn(l,i,s,a,u,h,0,!1,null!=l),null!=l?Ql(null,!0,!0):Ql(i,!0,!1))}function Kn(l,i,s,a,u,h,g,_,y){if(null==be&&dn(!1),null!=l)s=l.clientX-be.left,a=l.clientY-be.top;else{if(0>s||0>a)return wt=-10,void(bt=-10);let[v,S]=Bt.scales,P=i.cursor.sync,[et,H]=P.values,[C,st]=P.scales,[V,rt]=Bt.match,vt=i.axes[0].side%2==1,yt=0==T.ori?ot:lt,xt=1==T.ori?ot:lt,mt=vt?h:u,Mt=vt?u:h,qt=vt?a:s,nl=vt?s:a;if(s=null!=C?V(v,C)?p(et,M[v],yt,0):-10:yt*(qt/mt),a=null!=st?rt(S,st)?p(H,M[S],xt,0):-10:xt*(nl/Mt),1==T.ori){let Lt=s;s=a,a=Lt}}y&&(s>1&&ot-1>s||(s=jl(s,ot)),a>1&<-1>a||(a=jl(a,lt))),_?(xo=s,wo=a,[me,ge]=L.move(n,s,a)):(wt=s,bt=a)}const So={width:0,height:0,left:0,top:0};function Zn(){hn(So,!1)}function Mo(l,i,s,a,u,h){Ol=!0,Yt=Ht=Ft._x=Ft._y=!1,Kn(l,i,s,a,u,h,0,!0,!1),null!=l&&(ml(Tl,Bl,zo),Be(ht,n,me,ge,ot,lt,null))}function zo(l,i,s,a,u,h){Ol=Ft._x=Ft._y=!1,Kn(l,i,s,a,u,h,0,!1,!0);let{left:g,top:_,width:y,height:v}=el,S=y>0||v>0;if(S&&hn(el),Ft.setScale&&S){let P=g,et=y,H=_,C=v;if(1==T.ori&&(P=_,et=v,H=g,C=y),Yt&&xe(D,kl(P,D),kl(P+et,D)),Ht)for(let st in M){let V=M[st];st!=D&&null==V.from&&V.min!=Z&&xe(st,kl(H+C,st),kl(H,st))}Zn()}else L.lock&&(L._lock=!L._lock,L._lock||Ql(null,!0,!1));null!=l&&(he(Tl,Bl),Be(Tl,n,wt,bt,ot,lt,null))}function Eo(l){Bn(),Zn(),null!=l&&Be(ke,n,wt,bt,ot,lt,null)}function Do(){B.forEach(zs),Wn(n.width,n.height,!0)}Al(Il,zl,Do);const ve={};ve.mousedown=Mo,ve.mousemove=ko,ve.mouseup=zo,ve.dblclick=Eo,ve.setSeries=(l,i,s,a)=>{_l(s,a,!0,!1)},L.show&&(ml(ht,z,Mo),ml(at,z,ko),ml(te,z,dn),ml(_e,z,function(){if(!L._lock){let l=Ol;if(Ol){let i,s,a=!0,u=!0,h=10;0==T.ori?(i=Yt,s=Ht):(i=Ht,s=Yt),i&&s&&(a=h>=wt||wt>=ot-h,u=h>=bt||bt>=lt-h),i&&a&&(wt=me>wt?0:ot),s&&u&&(bt=ge>bt?0:lt),Ql(null,!0,!0),Ol=!1}wt=-10,bt=-10,Ql(null,!0,!0),l&&(Ol=l)}}),ml(ke,z,Eo),Pn.add(n),n.syncRect=dn);const pn=n.hooks=t.hooks||{};function It(l,i,s){l in pn&&pn[l].forEach(a=>{a.call(null,n,i,s)})}(t.plugins||[]).forEach(l=>{for(let i in l.hooks)pn[i]=(pn[i]||[]).concat(l.hooks[i])});const Bt=St({key:null,setSeries:!1,filters:{pub:ci,sub:ci},scales:[D,k[1]?k[1].scale:null],match:[hi,hi],values:[null,null]},L.sync);L.sync=Bt;const To=Bt.key,$n=Vi(To);function Be(l,i,s,a,u,h,g){Bt.filters.pub(l,i,s,a,u,h,g)&&$n.pub(l,i,s,a,u,h,g)}function qn(){It("init",t,e),co(e||t.data,!1),q[D]?Xn(D,q[D]):Bn(),Jl=el.show,fl=Ut=!0,Wn(t.width,t.height)}return $n.sub(n),n.pub=function(l,i,s,a,u,h,g){Bt.filters.sub(l,i,s,a,u,h,g)&&ve[l](null,i,s,a,u,h,g)},n.destroy=function(){$n.unsub(n),Pn.delete(n),bl.clear(),xn(Il,zl,Do),b.remove(),Gt?.remove(),It("destroy")},k.forEach(uo),B.forEach(function(l,i){if(l._show=l.show,l.show){let s=M[l.scale];null==s&&(l.scale=l.side%2?k[1].scale:D,s=M[l.scale]);let a=s.time;l.size=$(l.size),l.space=$(l.space),l.rotate=$(l.rotate),l.incrs=$(l.incrs||(2==s.distr?Jo:a?1==G?Zo:Qo:Ko)),l.splits=$(l.splits||(a&&1==s.distr?Zt:3==s.distr?En:4==s.distr?ss:os)),l.stroke=$(l.stroke),l.grid.stroke=$(l.grid.stroke),l.ticks.stroke=$(l.ticks.stroke),l.border.stroke=$(l.border.stroke);let u=l.values;l.values=Gl(u)&&!Gl(u[0])?$(u):a?Gl(u)?Pi(dt,Ti(u,Kt)):mi(u)?function(h,g){let _=yn(g);return(y,v)=>v.map(S=>_(h(S)))}(dt,u):u||N:u||is,l.filter=$(l.filter||(3>s.distr||10!=s.log?fi:cs)),l.font=ro(l.font),l.labelFont=ro(l.labelFont),l._size=l.size(n,null,i,0),l._space=l._rotate=l._incrs=l._found=l._splits=l._values=null,l._size>0&&(Zl[i]=!0,l._el=hl("u-axis",W))}}),o?o instanceof HTMLElement?(o.appendChild(b),qn()):o(n,qn):qn(),n}jt.assign=St,jt.fmtNum=bn,jt.rangeNum=Ue,jt.rangeLog=Ge,jt.rangeAsinh=wn,jt.orient=Vl,jt.pxRatio=K,jt.join=function(t,e){let o=new Set;for(let f=0;t.length>f;f++){let d=t[f][0],p=d.length;for(let m=0;p>m;m++)o.add(d[m])}let n=[Array.from(o).sort((f,d)=>f-d)],r=n[0].length,c=new Map;for(let f=0;r>f;f++)c.set(n[0][f],f);for(let f=0;t.length>f;f++){let d=t[f],p=d[0];for(let m=1;d.length>m;m++){let b=d[m],x=Array(r).fill(void 0),w=e?e[f][m]:1,W=[];for(let A=0;b.length>A;A++){let z=b[A],I=c.get(p[A]);null===z?0!=w&&(x[I]=z,2==w&&W.push(I)):x[I]=z}Bo(x,W,r),n.push(x)}}return n},jt.fmtDate=yn,jt.tzDate=function(t,e){let o;return"UTC"==e||"Etc/UTC"==e?o=new Date(+t+6e4*t.getTimezoneOffset()):e==Vo?o=t:(o=new Date(t.toLocaleString("en-US",{timeZone:e})),o.setMilliseconds(t.getMilliseconds())),o},jt.sync=Vi;{jt.addGap=function(e,o,n){let r=e[e.length-1];r&&r[0]==o?r[1]=n:e.push([o,n])},jt.clipGaps=tn;let t=jt.paths={points:Qi};t.linear=lo,t.stepped=function(e){const o=ut(e.align,1),n=ut(e.ascDesc,!1),r=ut(e.alignGaps,0),c=ut(e.extend,!1);return(f,d,p,m)=>Vl(f,d,(b,x,w,W,A,z,I,O,G,k,B)=>{let M=b.pxRound,{left:E,width:D}=f.bbox,j=X=>M(z(X,W,k,O)),U=X=>M(I(X,A,B,G)),R=0==W.ori?ae:ue;const T={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},F=T.stroke,nt=W.dir*(0==W.ori?1:-1);p=ee(w,p,m,1),m=ee(w,p,m,-1);let tt=U(w[1==nt?p:m]),q=j(x[1==nt?p:m]),dt=q,Kt=q;c&&-1==o&&(Kt=E,R(F,Kt,tt)),R(F,q,tt);for(let X=1==nt?p:m;X>=p&&m>=X;X+=nt){let Y=w[X];if(null==Y)continue;let pt=j(x[X]),it=U(Y);1==o?R(F,pt,tt):R(F,dt,it),R(F,pt,it),tt=it,dt=pt}let Zt=dt;c&&1==o&&(Zt=E+D,R(F,Zt,tt));let[N,Tt]=Qe(f,d);if(null!=b.fill||0!=N){let X=T.fill=new Path2D(F),Y=U(b.fillTo(f,d,b.min,b.max,N));R(X,Zt,Y),R(X,Kt,Y)}if(!b.spanGaps){let X=[];X.push(...Dn(x,w,p,m,nt,j,r));let Y=b.width*K/2,pt=n||1==o?Y:-Y,it=n||-1==o?-Y:Y;X.forEach(Gt=>{Gt[0]+=pt,Gt[1]+=it}),T.gaps=X=b.gaps(f,d,p,m,X),T.clip=tn(X,W.ori,O,G,k,B)}return 0!=Tt&&(T.band=2==Tt?[Dl(f,d,p,m,F,-1),Dl(f,d,p,m,F,1)]:Dl(f,d,p,m,F,Tt)),T})},t.bars=function(e){const o=ut((e=e||Ee).size,[.6,Z,1]),n=e.align||0,r=(e.gap||0)*K;let c=e.radius;c=null==c?[0,0]:"number"==typeof c?[c,0]:c;const f=$(c),d=1-o[0],p=ut(o[1],Z)*K,m=ut(o[2],1)*K,b=ut(e.disp,Ee),x=ut(e.each,()=>{}),{fill:w,stroke:W}=b;return(A,z,I,O)=>Vl(A,z,(G,k,B,M,E,D,j,U,R,T,F)=>{let nt,tt,q=G.pxRound;0==M.ori?[nt,tt]=f(A,z):[tt,nt]=f(A,z);const dt=M.dir*(0==M.ori?1:-1),Kt=E.dir*(1==E.ori?1:-1);let Zt,N,Tt=0==M.ori?nn:Tn,X=0==M.ori?x:(Q,kt,Pt,$t,tl,gl,Et)=>{x(Q,kt,Pt,tl,$t,Et,gl)},[Y,pt]=Qe(A,z),it=3==E.distr?1==Y?E.max:E.min:0,Gt=j(it,E,F,R),_t=q(G.width*K),wl=!1,Cl=null,pl=null,Yl=null,fe=null;null==w||0!=_t&&null==W||(wl=!0,Cl=w.values(A,z,I,O),pl=new Map,new Set(Cl).forEach(Q=>{null!=Q&&pl.set(Q,new Path2D)}),_t>0&&(Yl=W.values(A,z,I,O),fe=new Map,new Set(Yl).forEach(Q=>{null!=Q&&fe.set(Q,new Path2D)})));let{x0:ce,size:Pe}=b;if(null!=ce&&null!=Pe){k=ce.values(A,z,I,O),2==ce.unit&&(k=k.map(kt=>A.posToVal(U+kt*T,M.key,!0)));let Q=Pe.values(A,z,I,O);N=2==Pe.unit?Q[0]*T:D(Q[0],M,T,U)-D(0,M,T,U),N=q(N-_t),Zt=1==dt?-_t/2:N+_t/2}else{let Q=T;if(k.length>1){let kt=null;for(let Pt=0,$t=1/0;k.length>Pt;Pt++)if(void 0!==B[Pt]){if(null!=kt){let tl=Nt(k[Pt]-k[kt]);$t>tl&&($t=tl,Q=Nt(D(k[Pt],M,T,U)-D(k[kt],M,T,U)))}kt=Pt}}N=q(Jt(p,zt(m,Q-Q*d))-_t-r),Zt=(0==n?N/2:n==dt?0:N)-n*dt*r/2}const bl={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:3};let ml;0!=pt&&(bl.band=new Path2D,ml=q(j(1==pt?E.max:E.min,E,F,R)));const he=wl?null:new Path2D,de=bl.band;let{y0:Xl,y1:ot}=b,lt=null;null!=Xl&&null!=ot&&(B=ot.values(A,z,I,O),lt=Xl.values(A,z,I,O));let al=nt*N,ul=tt*N;for(let Q=1==dt?I:O;Q>=I&&O>=Q;Q+=dt){let kt=B[Q];if(void 0===kt)continue;let Pt=D(2!=M.distr||null!=b?k[Q]:Q,M,T,U),$t=j(ut(kt,it),E,F,R);null!=lt&&null!=kt&&(Gt=j(lt[Q],E,F,R));let tl=q(Pt-Zt),gl=q(zt($t,Gt)),Et=q(Jt($t,Gt)),fl=gl-Et;if(null!=kt){let Jl=0>kt?ul:al,Ut=0>kt?al:ul;wl?(_t>0&&null!=Yl[Q]&&Tt(fe.get(Yl[Q]),tl,Et+dl(_t/2),N,zt(0,fl-_t),Jl,Ut),null!=Cl[Q]&&Tt(pl.get(Cl[Q]),tl,Et+dl(_t/2),N,zt(0,fl-_t),Jl,Ut)):Tt(he,tl,Et+dl(_t/2),N,zt(0,fl-_t),Jl,Ut),X(A,z,Q,tl-_t/2,Et,N+_t,fl)}0!=pt&&(Kt*pt==1?(gl=Et,Et=ml):(Et=gl,gl=ml),fl=gl-Et,Tt(de,tl-_t/2,Et,N+_t,zt(0,fl),0,0))}return _t>0&&(bl.stroke=wl?fe:he),bl.fill=wl?pl:he,bl})},t.spline=function(e){return function(o,n){const r=ut(n?.alignGaps,0);return(c,f,d,p)=>Vl(c,f,(m,b,x,w,W,A,z,I,O,G,k)=>{let B,M,E,D=m.pxRound,j=N=>D(A(N,w,G,I)),U=N=>D(z(N,W,k,O));0==w.ori?(B=ln,E=ae,M=$i):(B=en,E=ue,M=qi);const R=w.dir*(0==w.ori?1:-1);d=ee(x,d,p,1),p=ee(x,d,p,-1);let T=j(b[1==R?d:p]),F=T,nt=[],tt=[];for(let N=1==R?d:p;N>=d&&p>=N;N+=R)if(null!=x[N]){let Tt=j(b[N]);nt.push(F=Tt),tt.push(U(x[N]))}const q={stroke:o(nt,tt,B,E,M,D),fill:null,clip:null,band:null,gaps:null,flags:1},dt=q.stroke;let[Kt,Zt]=Qe(c,f);if(null!=m.fill||0!=Kt){let N=q.fill=new Path2D(dt),Tt=U(m.fillTo(c,f,m.min,m.max,Kt));E(N,F,Tt),E(N,T,Tt)}if(!m.spanGaps){let N=[];N.push(...Dn(b,x,d,p,R,j,r)),q.gaps=N=m.gaps(c,f,d,p,N),q.clip=tn(N,w.ori,I,O,G,k)}return 0!=Zt&&(q.band=2==Zt?[Dl(c,f,d,p,dt,-1),Dl(c,f,d,p,dt,1)]:Dl(c,f,d,p,dt,Zt)),q})}(ws,e)}}return jt}(),placement=function(){"use strict";var xl={size:["height","width"],clientSize:["clientHeight","clientWidth"],offsetSize:["offsetHeight","offsetWidth"],maxSize:["maxHeight","maxWidth"],before:["top","left"],marginBefore:["marginTop","marginLeft"],after:["bottom","right"],marginAfter:["marginBottom","marginRight"],scrollOffset:["pageYOffset","pageXOffset"]};function ye(J){return{top:J.top,bottom:J.bottom,left:J.left,right:J.right}}return function(J,Vt,Dt,Fl,Xt){void 0===Dt&&(Dt="bottom"),void 0===Fl&&(Fl="center"),void 0===Xt&&(Xt={}),(Vt instanceof Element||Vt instanceof Range)&&(Vt=ye(Vt.getBoundingClientRect()));var il=Object.assign({top:Vt.bottom,bottom:Vt.top,left:Vt.right,right:Vt.left},Vt),ol={top:0,left:0,bottom:window.innerHeight,right:window.innerWidth};Xt.bound&&((Xt.bound instanceof Element||Xt.bound instanceof Range)&&(Xt.bound=ye(Xt.bound.getBoundingClientRect())),Object.assign(ol,Xt.bound));var Ml=getComputedStyle(J),at={},ht={};for(var Tl in xl)at[Tl]=xl[Tl]["top"===Dt||"bottom"===Dt?0:1],ht[Tl]=xl[Tl]["top"===Dt||"bottom"===Dt?1:0];J.style.position="absolute",J.style.maxWidth="",J.style.maxHeight="";var te=parseInt(Ml[ht.marginBefore]),_e=parseInt(Ml[ht.marginAfter]),ke=te+_e,Se=ol[ht.after]-ol[ht.before]-ke,Il=parseInt(Ml[ht.maxSize]);(!Il||Se<Il)&&(J.style[ht.maxSize]=Se+"px");var Pl=parseInt(Ml[at.marginBefore])+parseInt(Ml[at.marginAfter]),yl=il[at.before]-ol[at.before]-Pl,Bl=ol[at.after]-il[at.after]-Pl;(Dt===at.before&&J[at.offsetSize]>yl||Dt===at.after&&J[at.offsetSize]>Bl)&&(Dt=yl>Bl?at.before:at.after);var zl=Dt===at.before?yl:Bl,je=parseInt(Ml[at.maxSize]);(!je||zl<je)&&(J.style[at.maxSize]=zl+"px");var K=window[at.scrollOffset],Ll=function(sl){return Math.max(ol[at.before],Math.min(sl,ol[at.after]-J[at.offsetSize]-Pl))};Dt===at.before?(J.style[at.before]=K+Ll(il[at.before]-J[at.offsetSize]-Pl)+"px",J.style[at.after]="auto"):(J.style[at.before]=K+Ll(il[at.after])+"px",J.style[at.after]="auto");var Ot=window[ht.scrollOffset],Nl=function(sl){return Math.max(ol[ht.before],Math.min(sl,ol[ht.after]-J[ht.offsetSize]-ke))};switch(Fl){case"start":J.style[ht.before]=Ot+Nl(il[ht.before]-te)+"px",J.style[ht.after]="auto";break;case"end":J.style[ht.before]="auto",J.style[ht.after]=Ot+Nl(document.documentElement[ht.clientSize]-il[ht.after]-_e)+"px";break;default:J.style[ht.before]=Ot+Nl(il[ht.before]+(il[ht.after]-il[ht.before])/2-J[ht.offsetSize]/2-te)+"px",J.style[ht.after]="auto"}J.dataset.side=Dt,J.dataset.align=Fl}}();