mirror of https://github.com/ColorlibHQ/AdminLTE
3 lines
34 KiB
JavaScript
3 lines
34 KiB
JavaScript
/*! https://github.com/leeoniya/uPlot (v1.5.2) */
|
|
var uPlot=function(){"use strict";function n(n,t,e,r){var i;e=e||0;for(var o=2147483647>=(r=r||t.length-1);r-e>1;)n>t[i=o?e+r>>1:h((e+r)/2)]?e=i:r=i;return n-t[e]>t[r]-n?r:e}function t(n,t,e,r){for(var i=1==r?t:e;i>=t&&e>=i;i+=r)if(null!=n[i])return i;return-1}var e=[0,0];function r(n,t,r,i){return e[0]=0>r?P(n,-r):n,e[1]=0>i?P(t,-i):t,e}function i(n,t,e,i){var o,l,a,u=10==e?b:_;return n==t&&(n/=e,t*=e),i?(o=h(u(n)),l=p(u(t)),n=(a=r(w(e,o),w(e,l),o,l))[0],t=a[1]):(o=h(u(n)),l=h(u(t)),n=Y(n,(a=r(w(e,o),w(e,l),o,l))[0]),t=E(t,a[1])),[n,t]}var o={pad:0,soft:null,mode:0},l={min:o,max:o};function a(n,t,e,r){return N(e)?s(n,t,e):(o.pad=e,o.soft=r?0:null,o.mode=r?2:0,s(n,t,l))}function u(n,t){return null==n?t:n}function s(n,t,e){var r=e.min,i=e.max,o=u(r.pad,0),l=u(i.pad,0),a=u(r.hard,-y),s=u(i.hard,y),f=u(r.soft,y),c=u(i.soft,-y),d=u(r.mode,0),p=u(i.mode,0),x=t-n,_=x||v(t)||1e3,k=b(_),M=w(10,h(k)),T=P(Y(n-_*(0==x?0==n?.1:1:o),M/100),6),S=n>=f&&(1==d||2==d&&f>T)?f:y,z=g(a,S>T&&n>=S?S:m(S,T)),D=P(E(t+_*(0==x?0==t?.1:1:l),M/100),6),W=c>=t&&(1==p||2==p&&D>c)?c:-y,A=m(s,D>W&&W>=t?W:g(W,D));return z==A&&0==z&&(A=100),[z,A]}var f=new Intl.NumberFormat(navigator.language).format,c=Math,v=c.abs,h=c.floor,d=c.round,p=c.ceil,m=c.min,g=c.max,w=c.pow,x=c.sqrt,b=c.log10,_=c.log2,k=c.PI,y=1/0;function M(n,t){return d(n/t)*t}function T(n,t,e){return m(g(n,t),e)}function S(n){return"function"==typeof n?n:function(){return n}}var z=function(n,t){return t},D=function(){return null};function E(n,t){return p(n/t)*t}function Y(n,t){return h(n/t)*t}function P(n,t){return d(n*(t=Math.pow(10,t)))/t}var W=new Map;function A(n){return((""+n).split(".")[1]||"").length}function C(n,t,e,r){for(var i=[],o=r.map(A),l=t;e>l;l++)for(var a=v(l),u=P(w(n,l),a),s=0;r.length>s;s++){var f=r[s]*u,c=(0>f||0>l?a:0)+(o[s]>l?o[s]:0),h=P(f,c);i.push(h),W.set(h,c)}return i}var F={},G=Array.isArray;function H(n){return"string"==typeof n}function N(n){var t=!1;if(null!=n){var e=n.constructor;t=null==e||e==Object}return t}function I(n){var t;if(G(n))t=n.map(I);else if(N(n))for(var e in t={},n)t[e]=I(n[e]);else t=n;return t}function V(n){for(var t=arguments,e=1;t.length>e;e++){var r=t[e];for(var i in r)N(n[i])?V(n[i],I(r[i])):n[i]=I(r[i])}return n}var L="undefined"==typeof queueMicrotask?function(n){return Promise.resolve().then(n)}:queueMicrotask,O="width",j="height",B="top",R="bottom",U="left",q="right",J="#000",X="#0000",Z="mousemove",K="mousedown",Q="mouseup",$="mouseenter",nn="mouseleave",tn="dblclick",en="resize",rn="scroll",on="u-off",ln="u-label",an=requestAnimationFrame,un=document,sn=window,fn=devicePixelRatio;function cn(n,t){null!=t&&n.classList.add(t)}function vn(n,t){n.classList.remove(t)}function hn(n,t,e){n.style[t]=e+"px"}function dn(n,t,e,r){var i=un.createElement(n);return null!=t&&cn(i,t),null!=e&&e.insertBefore(i,r),i}function pn(n,t){return dn("div",n,t)}function mn(n,t,e,r,i){n.style.transform="translate("+t+"px,"+e+"px)",0>t||0>e||t>r||e>i?cn(n,on):vn(n,on)}var gn={passive:!0};function wn(n,t,e){t.addEventListener(n,e,gn)}function xn(n,t,e){t.removeEventListener(n,e,gn)}var bn=["January","February","March","April","May","June","July","August","September","October","November","December"],_n=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function kn(n){return n.slice(0,3)}var yn=_n.map(kn),Mn=bn.map(kn),Tn={MMMM:bn,MMM:Mn,WWWW:_n,WWW:yn};function Sn(n){return(10>n?"0":"")+n}var zn={YYYY:function(n){return n.getFullYear()},YY:function(n){return(n.getFullYear()+"").slice(2)},MMMM:function(n,t){return t.MMMM[n.getMonth()]},MMM:function(n,t){return t.MMM[n.getMonth()]},MM:function(n){return Sn(n.getMonth()+1)},M:function(n){return n.getMonth()+1},DD:function(n){return Sn(n.getDate())},D:function(n){return n.getDate()},WWWW:function(n,t){return t.WWWW[n.getDay()]},WWW:function(n,t){return t.WWW[n.getDay()]},HH:function(n){return Sn(n.getHours())},H:function(n){return n.getHours()},h:function(n){var t=n.getHours();return 0==t?12:t>12?t-12:t},AA:function(n){return 12>n.getHours()?"AM":"PM"},aa:function(n){return 12>n.getHours()?"am":"pm"},a:function(n){return 12>n.getHours()?"a":"p"},mm:function(n){return Sn(n.getMinutes())},m:function(n){return n.getMinutes()},ss:function(n){return Sn(n.getSeconds())},s:function(n){return n.getSeconds()},fff:function(n){return function(n){return(10>n?"00":100>n?"0":"")+n}(n.getMilliseconds())}};function Dn(n,t){t=t||Tn;for(var e,r=[],i=/\{([a-z]+)\}|[^{]+/gi;e=i.exec(n);)r.push("{"==e[0][0]?zn[e[1]]:e[0]);return function(n){for(var e="",i=0;r.length>i;i++)e+="string"==typeof r[i]?r[i]:r[i](n,t);return e}}var En=(new Intl.DateTimeFormat).resolvedOptions().timeZone,Yn=function(n){return n%1==0},Pn=[1,2,2.5,5],Wn=C(10,-16,0,Pn),An=C(10,0,16,Pn),Cn=An.filter(Yn),Fn=Wn.concat(An),Gn="{YYYY}",Hn="\n"+Gn,Nn="{M}/{D}",In="\n"+Nn,Vn=In+"/{YY}",Ln="{aa}",On="{h}:{mm}"+Ln,jn="\n"+On,Bn=":{ss}",Rn=null;function Un(n){var t=1e3*n,e=60*t,r=60*e,i=24*r,o=30*i,l=365*i;return[(1==n?C(10,0,3,Pn).filter(Yn):C(10,-3,0,Pn)).concat([t,5*t,10*t,15*t,30*t,e,5*e,10*e,15*e,30*e,r,2*r,3*r,4*r,6*r,8*r,12*r,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,l,2*l,5*l,10*l,25*l,50*l,100*l]),[[l,Gn,Rn,Rn,Rn,Rn,Rn,Rn,1],[28*i,"{MMM}",Hn,Rn,Rn,Rn,Rn,Rn,1],[i,Nn,Hn,Rn,Rn,Rn,Rn,Rn,1],[r,"{h}"+Ln,Vn,Rn,In,Rn,Rn,Rn,1],[e,On,Vn,Rn,In,Rn,Rn,Rn,1],[t,Bn,Vn+" "+On,Rn,In+" "+On,Rn,jn,Rn,1],[n,Bn+".{fff}",Vn+" "+On,Rn,In+" "+On,Rn,jn,Rn,1]],function(t){return function(a,u,s,f,c,v){var d=[],p=c>=l,m=c>=o&&l>c,g=t(s),w=g*n,x=rt(g.getFullYear(),p?0:g.getMonth(),m||p?1:g.getDate()),b=x*n;if(m||p)for(var _=m?c/o:0,k=p?c/l:0,y=w==b?w:rt(x.getFullYear()+k,x.getMonth()+_,1)*n,M=new Date(y/n),T=M.getFullYear(),S=M.getMonth(),z=0;f>=y;z++){var D=rt(T+k*z,S+_*z,1);(y=(+D+(D-t(D*n)))*n)>f||d.push(y)}else{var Y=i>c?c:i,W=b+(h(s)-h(w))+E(w-b,Y);d.push(W);for(var A=t(W),C=A.getHours()+A.getMinutes()/e+A.getSeconds()/r,F=c/r,G=v/a.axes[u]._space;(W=P(W+c,1==n?0:3))<=f;)if(F>1){var H=h(P(C+F,6))%24,N=t(W).getHours()-H;N>1&&(N=-1),C=(C+F)%24,.7>P(((W-=N*r)-d[d.length-1])/c,3)*G||d.push(W)}else d.push(W)}return d}}]}var qn=Un(1),Jn=qn[0],Xn=qn[1],Zn=qn[2],Kn=Un(.001),Qn=Kn[0],$n=Kn[1],nt=Kn[2];function tt(n,t){return n.map((function(n){return n.map((function(e,r){return 0==r||8==r||null==e?e:t(1==r||0==n[8]?e:n[1]+e)}))}))}function et(n,t){return function(e,r,i,o,l){var a,u,s,f,c,v,h=t.find((function(n){return l>=n[0]}))||t[t.length-1];return r.map((function(t){var e=n(t),r=e.getFullYear(),i=e.getMonth(),o=e.getDate(),l=e.getHours(),d=e.getMinutes(),p=e.getSeconds(),m=r!=a&&h[2]||i!=u&&h[3]||o!=s&&h[4]||l!=f&&h[5]||d!=c&&h[6]||p!=v&&h[7]||h[1];return a=r,u=i,s=o,f=l,c=d,v=p,m(e)}))}}function rt(n,t,e){return new Date(n,t,e)}function it(n,t){return t(n)}function ot(n,t){return function(e,r){return t(n(r))}}function lt(n,t){var e=n.series[t];return e.width?e.stroke(n,t):e.points.width?e.points.stroke(n,t):null}function at(n,t){return n.series[t].fill(n,t)}C(2,-53,53,[1]);var ut=[0,0];function st(n,t,e){return function(n){0==n.button&&e(n)}}function ft(n,t,e){return e}var ct={show:!0,x:!0,y:!0,lock:!1,move:function(n,t,e){return ut[0]=t,ut[1]=e,ut},points:{show:function(n,t){var e=n.cursor.points,r=pn(),i=e.stroke(n,t),o=e.fill(n,t);r.style.background=o||i;var l=e.size(n,t),a=e.width(n,t,l);a&&(r.style.border=a+"px solid "+i);var u=l/-2;return hn(r,O,l),hn(r,j,l),hn(r,"marginLeft",u),hn(r,"marginTop",u),r},size:function(n,t){return Dt(n.series[t].width,1)},width:0,stroke:function(n,t){return n.series[t].stroke(n,t)},fill:function(n,t){return n.series[t].stroke(n,t)}},bind:{mousedown:st,mouseup:st,click:st,dblclick:st,mousemove:ft,mouseleave:ft,mouseenter:ft},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,_x:!1,_y:!1},focus:{prox:-1},left:-10,top:-10,idx:null,dataIdx:function(n,t,e){return e}},vt={show:!0,stroke:"rgba(0,0,0,0.07)",width:2,filter:z},ht=V({},vt,{size:10}),dt='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"',pt="bold "+dt,mt={show:!0,scale:"x",space:50,gap:5,size:50,labelSize:30,labelFont:pt,side:2,grid:vt,ticks:ht,font:dt,rotate:0},gt={show:!0,scale:"x",auto:!1,sorted:1,min:y,max:-y,idxs:[]};function wt(n,t){return t.map((function(n){return null==n?"":f(n)}))}function xt(n,t,e,r,i,o,l){for(var a=[],u=W.get(i)||0,s=e=l?e:P(E(e,i),u);r>=s;s=P(s+i,u))a.push(Object.is(s,-0)?0:s);return a}function bt(n,t,e,r,i){var o=[],l=n.scales[n.axes[t].scale].log,a=h((10==l?b:_)(e));i=w(l,a),0>a&&(i=P(i,-a));var u=e;do{o.push(u),i*l>(u=P(u+i,W.get(i)))||(i=u)}while(r>=u);return o}var _t=/./,kt=/[12357]/,yt=/[125]/,Mt=/1/;function Tt(n,t,e){var r=n.axes[e],i=r.scale;if(2==n.scales[i].log)return t;var o=n.valToPos,l=r._space,a=o(10,i),u=o(9,i)-a<l?o(7,i)-a<l?o(5,i)-a<l?Mt:yt:kt:_t;return t.map((function(n){return u.test(n)?n:null}))}function St(n,t){return null==t?"":f(t)}var zt={show:!0,scale:"y",space:30,gap:5,size:50,labelSize:30,labelFont:pt,side:3,grid:vt,ticks:ht,font:dt,rotate:0};function Dt(n,t){return P((3+2*(n||1))*t,3)}function Et(n,t){var e=n.scales[n.series[t].scale];return 3==e.distr?e.min:0}var Yt={scale:"y",auto:!0,sorted:0,show:!0,band:!1,spanGaps:!1,isGap:function(){return!0},alpha:1,points:{show:function(n,t){var e=n.series[t],r=(Dt(e.width,fn),n.series[0].idxs);return n.bbox.width/(e.points.space*fn)>=r[1]-r[0]}},values:null,min:y,max:-y,idxs:[],path:null,clip:null};function Pt(n,t,e){return e/10}var Wt={time:!0,auto:!0,distr:1,log:10,min:null,max:null},At=V({},Wt,{time:!1}),Ct={};function Ft(){var n=[];return{sub:function(t){n.push(t)},unsub:function(t){n=n.filter((function(n){return n!=t}))},pub:function(t,e,r,i,o,l,a){n.length>1&&n.forEach((function(n){n!=e&&n.pub(t,e,r,i,o,l,a)}))}}}var Gt=[,,,,,,,,,,,];function Ht(n,t){var e=n.series[t],r=n.scales,i=n.bbox;return Gt[0]=e,Gt[1]=n._data[0],Gt[2]=n._data[t],Gt[3]=r[n.series[0].scale],Gt[4]=r[e.scale],Gt[5]=n.valToPosX,Gt[6]=n.valToPosY,Gt[7]=i.left,Gt[8]=i.top,Gt[9]=i.width,Gt[10]=i.height,Gt}function Nt(n,t,e,r,i,o){var l=null;if(n.length>0&&(l=new Path2D,1==t)){for(var a=e,u=0;n.length>u;u++){var s=n[u];l.rect(a,r,s[0]-a,r+o),a=s[1]}l.rect(a,r,e+i-a,r+o)}return l}function It(n,t,e){if(e>t){var r=n[n.length-1];r&&r[0]==t?r[1]=e:n.push([t,e])}}var Vt=1;function Lt(n,t,e,r,i){n.lineTo(t,e),n.lineTo(t,r),n.lineTo(t,i)}function Ot(){return function(n,e,r,i){var o,l,a,u=Ht(n,e),s=u[0],f=u[1],c=u[2],v=u[3],h=u[4],p=u[5],w=u[6],x=u[7],b=u[8],_=u[9],k=u[10],T=s.isGap,S=1==Vt?{stroke:new Path2D,fill:null,clip:null}:n.series[e-1]._paths,z=S.stroke,D=P(s.width*fn,3),E=y,Y=-y,W=[],A=d(p(f[1==Vt?r:i],v,_,x)),C=!1,F=t(c,r,i,1),G=t(c,r,i,-1),H=M(p(f[F],v,_,x),.5),N=M(p(f[G],v,_,x),.5);H>x&&It(W,x,H),s.band&&1==Vt&&z.lineTo(H-2*D,d(w(c[r],h,k,b)));for(var I=1==Vt?r:i;I>=r&&i>=I;I+=Vt){var V=d(p(f[I],v,_,x));if(V==A)null!=c[I]?(o=d(w(c[I],h,k,b)),E==y&&z.lineTo(V,o),E=m(o,E),Y=g(o,Y)):!C&&T(n,e,I)&&(C=!0);else{var L=!1;E!=y?(Lt(z,A,E,Y,o),l=a=A):C&&(L=!0,C=!1),null!=c[I]?(o=d(w(c[I],h,k,b)),z.lineTo(V,o),E=Y=o,V-A>1&&null==c[I-1]&&T(n,e,I-1)&&(L=!0)):(E=y,Y=-y,!C&&T(n,e,I)&&(C=!0)),L&&It(W,l,V),A=V}}if(E!=y&&E!=Y&&a!=A&&Lt(z,A,E,Y,o),x+_>N&&It(W,N,x+_),s.band){var O,j,B,R=n._data;1==Vt?(O=N+2*D,j=G,B=R[e+1]):(O=H-2*D,j=F,B=R[e-1]),z.lineTo(O,d(w(c[j],h,k,b))),z.lineTo(O,d(w(B[j],h,k,b)))}if(1==Vt&&(s.spanGaps||(S.clip=Nt(W,1,x,b,_,k)),null!=s.fill)){var U=S.fill=new Path2D(z),q=d(w(s.fillTo(n,e,s.min,s.max),h,k,b));U.lineTo(N,q),U.lineTo(H,q)}return s.band&&(Vt*=-1),S}}var jt=Ot();function Bt(n,t,e,r){return(r?[n[0],n[1]].concat(n.slice(2)):[n[0]].concat(n.slice(1))).map((function(n,r){return Rt(n,r,t,e)}))}function Rt(n,t,e,r){return V({},0==t||n&&n.side%2==0?e:r,n)}var Ut=[null,null];function qt(n,t,e){return null==t?Ut:[t,e]}var Jt=qt;function Xt(n,t,e){return null==t?Ut:a(t,e,.1,!0)}function Zt(n,t,e,r){return null==t?Ut:i(t,e,n.scales[r].log,!1)}var Kt=Zt;function Qt(n){var t;return[n=n.replace(/(\d+)px/,(function(n,e){return(t=d(e*fn))+"px"})),t]}function $t(t,e,r){var o={};function l(n,t){return 3==t.distr?b((n>0?n:t.clamp(o,n,t.min,t.max,t.key))/t.min)/b(t.max/t.min):(n-t.min)/(t.max-t.min)}function s(n,t,e,r){return r+l(n,t)*e}function f(n,t,e,r){return r+(1-l(n,t))*e}o.valToPosX=s,o.valToPosY=f;var c=!1;o.status=0;var x=o.root=pn("uplot");null!=t.id&&(x.id=t.id),cn(x,t.class),t.title&&(pn("u-title",x).textContent=t.title);var _=dn("canvas"),Y=o.ctx=_.getContext("2d"),A=pn("u-wrap",x),C=pn("u-under",A);A.appendChild(_);var gn=pn("u-over",A);((t=I(t)).plugins||[]).forEach((function(n){n.opts&&(t=n.opts(o,t)||t)}));var bn=t.ms||.001,_n=o.series=Bt(t.series||[],gt,Yt,!1),kn=o.axes=Bt(t.axes||[],mt,zt,!0),yn=o.scales={},Mn=_n[0].scale,Tn={axes:function(){kn.forEach((function(n,t){if(n.show&&n._show){var e=yn[n.scale],r=n.side,i=r%2,l=0==i?s:f,a=0==i?Mt:Gt,u=0==i?kt:yt,c=d(n.gap*fn),v=n.ticks,h=v.show?d(v.size*fn):0,p=n._found,m=p[0],g=p[1],w=n._splits,x=2==e.distr?w.map((function(n){return de[n]})):w,b=2==e.distr?de[w[1]]-de[w[0]]:m,_=n._rotate*-k/180,y=d(n._pos*fn),M=y+(h+c)*(0==i&&0==r||1==i&&3==r?-1:1),T=0==i?M:0,S=1==i?M:0;Y.font=n.font[0],Y.fillStyle=n.stroke||J,Y.textAlign=1==n.align?U:2==n.align?q:_>0?U:0>_?q:0==i?"center":3==r?q:U,Y.textBaseline=_||1==i?"middle":2==r?B:R;var z=1.5*n.font[1],D=w.map((function(n){return d(l(n,e,a,u))}));if(n._values.forEach((function(n,t){null!=n&&(0==i?S=D[t]:T=D[t],(""+n).split(/\n/gm).forEach((function(n,t){_?(Y.save(),Y.translate(S,T+t*z),Y.rotate(_),Y.fillText(n,0,0),Y.restore()):Y.fillText(n,S,T+t*z)})))})),n.label){Y.save();var E=d(n._lpos*fn);1==i?(S=T=0,Y.translate(E,d(yt+Gt/2)),Y.rotate((3==r?-k:k)/2)):(S=d(kt+Mt/2),T=E),Y.font=n.labelFont[0],Y.textAlign="center",Y.textBaseline=2==r?B:R,Y.fillText(n.label,S,T),Y.restore()}v.show&&be(D,v.filter(o,x,t,g,b),i,r,y,h,P(v.width*fn,3),v.stroke);var W=n.grid;W.show&&be(D,W.filter(o,x,t,g,b),i,0==i?2:1,0==i?yt:kt,0==i?Gt:Mt,P(W.width*fn,3),W.stroke,W.dash)}})),hr("drawAxes")},series:function(){ue>0&&(_n.forEach((function(n,t){if(t>0&&n.show&&null==n._paths){var r=function(n){for(var t=T(ce-1,0,ue-1),e=T(ve+1,0,ue-1);null==n[t]&&t>0;)t--;for(;null==n[e]&&ue-1>e;)e++;return[t,e]}(e[t]);n._paths=n.paths(o,t,r[0],r[1])}})),_n.forEach((function(n,t){t>0&&n.show&&(n._paths&&function(n){var t=_n[n];if(1==xe){var e=t._paths,r=e.stroke,i=e.fill,l=e.clip,a=P(t.width*fn,3),u=a%2/2,s=t._stroke=t.stroke(o,n),f=t._fill=t.fill(o,n);we(s,a,t.dash,f),Y.globalAlpha=t.alpha,Y.translate(u,u),Y.save();var c=kt,v=yt,h=Mt,d=Gt,p=a*fn/2;0==t.min&&(d+=p),0==t.max&&(v-=p,d+=p),Y.beginPath(),Y.rect(c,v,h,d),Y.clip(),null!=l&&Y.clip(l),t.band?(Y.fill(r),a&&Y.stroke(r)):(null!=f&&Y.fill(i),a&&Y.stroke(r)),Y.restore(),Y.translate(-u,-u),Y.globalAlpha=1}t.band&&(xe*=-1)}(t),n.points.show(o,t,ce,ve)&&function(n){var t=_n[n],r=t.points,i=P(r.width*fn,3),l=i%2/2,a=r.width>0,u=(r.size-r.width)/2*fn,c=P(2*u,3);Y.translate(l,l),Y.save(),Y.beginPath(),Y.rect(kt-c,yt-c,Mt+2*c,Gt+2*c),Y.clip(),Y.globalAlpha=t.alpha;for(var v=new Path2D,h=ce;ve>=h;h++)if(null!=e[n][h]){var p=d(s(e[0][h],yn[Mn],Mt,kt)),m=d(f(e[n][h],yn[t.scale],Gt,yt));v.moveTo(p+u,m),v.arc(p,m,u,0,2*k)}var g=r._stroke=r.stroke(o,n),w=r._fill=r.fill(o,n);we(g,i,r.dash,w||(a?"#fff":t._stroke)),Y.fill(v),a&&Y.stroke(v),Y.globalAlpha=1,Y.restore(),Y.translate(-l,-l)}(t),hr("drawSeries",t))})))}},Sn=(t.drawOrder||["axes","series"]).map((function(n){return Tn[n]}));function zn(n){var e=yn[n];if(null==e){var r=(t.scales||F)[n]||F;if(null!=r.from)zn(r.from),yn[n]=V({},yn[r.from],r);else{(e=yn[n]=V({},n==Mn?Wt:At,r)).key=n;var i=e.time,o=3==e.distr,l=e.range;if(n!=Mn&&!G(l)&&N(l)){var u=l;l=function(n,t,e){return null==t?Ut:a(t,e,u)}}e.range=S(l||(i?Jt:n==Mn?o?Kt:qt:o?Zt:Xt)),e.auto=S(e.auto),e.clamp=S(e.clamp||Pt)}}}for(var En in zn("x"),zn("y"),_n.forEach((function(n){zn(n.scale)})),t.scales)zn(En);var Yn=yn[Mn].distr,Pn={};for(var Wn in yn){var An=yn[Wn];null==An.min&&null==An.max||(Pn[Wn]={min:An.min,max:An.max})}var Gn,Hn=t.tzDate||function(n){return new Date(n/bn)},Nn=t.fmtDate||Dn,In=1==bn?Zn(Hn):nt(Hn),Vn=et(Hn,tt(1==bn?Xn:$n,Nn)),Ln=ot(Hn,it("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",Nn)),On=V({show:!0,live:!0},t.legend),jn=On.show;On.stroke=S(On.stroke||lt),On.fill=S(On.fill||at);var Bn,Rn=[],Un=!1;if(jn){Gn=dn("table","u-legend",x);var qn=_n[1]?_n[1].values:null;if(Un=null!=qn){var Kn=dn("tr","u-thead",Gn);for(var rt in dn("th",null,Kn),Bn=qn(o,1,0))dn("th",ln,Kn).textContent=rt}else Bn={_:0},cn(Gn,"u-inline"),On.live&&cn(Gn,"u-live")}var ut=new Map;function st(n,t,e){var r=ut.get(t)||{},i=ne.bind[n](o,t,e);i&&(wn(n,t,r[n]=i),ut.set(t,r))}var ft=0,vt=0,ht=0,dt=0,pt=0,_t=0,kt=0,yt=0,Mt=0,Gt=0;o.bbox={};var Ht=!1,Nt=!1,It=!1,Vt=!1,Lt=!1;function Ot(n,t){n==o.width&&t==o.height||$t(n,t),ye(!1),It=!0,Nt=!0,Vt=!0,Lt=!0,Fe()}function $t(n,t){o.width=ft=ht=n,o.height=vt=dt=t,pt=_t=0,function(){var n=!1,t=!1,e=!1,r=!1;kn.forEach((function(i){if(i.show&&i._show){var o=i.side,l=o%2,a=i._size+(i.labelSize=null!=i.label?i.labelSize||30:0);a>0&&(l?(ht-=a,3==o?(pt+=a,r=!0):e=!0):(dt-=a,0==o?(_t+=a,n=!0):t=!0))}})),le[0]=n,le[1]=e,le[2]=t,le[3]=r,ht-=fe[1]+fe[3],pt+=fe[3],dt-=fe[2]+fe[0],_t+=fe[0]}(),function(){var n=pt+ht,t=_t+dt,e=pt,r=_t;function i(i,o){switch(i){case 1:return(n+=o)-o;case 2:return(t+=o)-o;case 3:return(e-=o)+o;case 0:return(r-=o)+o}}kn.forEach((function(n){if(n.show&&n._show){var t=n.side;n._pos=i(t,n._size),null!=n.label&&(n._lpos=i(t,n.labelSize))}}))}();var e=o.bbox;kt=e.left=M(pt*fn,.5),yt=e.top=M(_t*fn,.5),Mt=e.width=M(ht*fn,.5),Gt=e.height=M(dt*fn,.5)}o.setSize=function(n){Ot(n.width,n.height)};var ne=o.cursor=V({},ct,t.cursor);ne._lock=!1;var te=ne.points;te.show=S(te.show),te.size=S(te.size),te.stroke=S(te.stroke),te.width=S(te.width),te.fill=S(te.fill);var ee=o.focus=V({},t.focus||{alpha:.3},ne.focus),re=ee.prox>=0,ie=[null];function oe(n,t){var e=yn[n.scale].time,r=n.value;if(n.value=e?H(r)?ot(Hn,it(r,Nn)):r||Ln:r||St,n.label=n.label||(e?"Time":"Value"),t>0){n.width=null==n.width?1:n.width,n.paths=n.paths||jt||D,n.fillTo=S(n.fillTo||Et),n.stroke=S(n.stroke||J),n.fill=S(n.fill||null),n._stroke=n._fill=n._paths=null;var i=Dt(n.width,1),l=n.points=V({},{size:i,width:g(1,.2*i),stroke:n.stroke,space:2*i,_stroke:null,_fill:null},n.points);l.show=S(l.show),l.fill=S(l.fill),l.stroke=S(l.stroke)}if(jn&&Rn.splice(t,0,function(n,t){if(0==t&&(Un||!On.live))return null;var e=[],r=dn("tr","u-series",Gn,Gn.childNodes[t]);cn(r,n.class),n.show||cn(r,on);var i=dn("th",null,r),l=pn("u-marker",i);t>0&&(l.style.borderColor=On.stroke(o,t),l.style.backgroundColor=On.fill(o,t));var a=pn(ln,i);for(var u in a.textContent=n.label,t>0&&(st("click",i,(function(){ne._lock||Ze(_n.indexOf(n),{show:!n.show},dr.setSeries)})),re&&st($,i,(function(){ne._lock||Ze(_n.indexOf(n),{focus:!0},dr.setSeries)}))),Bn){var s=dn("td","u-value",r);s.textContent="--",e.push(s)}return e}(n,t)),ne.show){var a=function(n,t){if(t>0){var e=ne.points.show(o,t);if(e)return cn(e,"u-cursor-pt"),cn(e,n.class),mn(e,-10,-10,ht,dt),gn.insertBefore(e,ie[t]),e}}(n,t);a&&ie.splice(t,0,a)}}o.addSeries=function(n,t){n=Rt(n,t=null==t?_n.length:t,gt,Yt),_n.splice(t,0,n),oe(_n[t],t)},o.delSeries=function(n){_n.splice(n,1),jn&&Rn.splice(n,1)[0][0].parentNode.remove(),ie.length>1&&ie.splice(n,1)[0].remove()},_n.forEach(oe);var le=[!1,!1,!1,!1];function ae(n,t,e){var r=e[0],i=e[1],o=e[2],l=e[3],a=t%2,u=0;return 0==a&&(l||i)&&(u=0==t&&!r||2==t&&!o?d(mt.size/3):0),1==a&&(r||o)&&(u=1==t&&!i||3==t&&!l?d(zt.size/2):0),u}kn.forEach((function(n,t){if(n._show=n.show,n.show){var e=yn[n.scale];null==e&&(n.scale=n.side%2?_n[1].scale:Mn,e=yn[n.scale]);var r=e.time;n.size=S(n.size),n.space=S(n.space),n.rotate=S(n.rotate),n.incrs=S(n.incrs||(2==e.distr?Cn:r?1==bn?Jn:Qn:Fn)),n.splits=S(n.splits||(r&&1==e.distr?In:3==e.distr?bt:xt));var i=n.values;n.values=r?G(i)?et(Hn,tt(i,Nn)):H(i)?function(n,t){var e=Dn(t);return function(t,r){return r.map((function(t){return e(n(t))}))}}(Hn,i):i||Vn:i||wt,n.filter=S(n.filter||(3==e.distr?Tt:z)),n.font=Qt(n.font),n.labelFont=Qt(n.labelFont),n._size=n.size(o,null,t,0),n._space=n._rotate=n._incrs=n._found=n._splits=n._values=null,n._size>0&&(le[t]=!0)}}));var ue,se=o.padding=(t.padding||[ae,ae,ae,ae]).map((function(n){return S(u(n,ae))})),fe=o._padding=se.map((function(n,t){return n(o,t,le,0)})),ce=null,ve=null,he=_n[0].idxs,de=null,pe=!1;function me(n,t){if(!G(n)&&N(n)&&(n.isGap&&_n.forEach((function(t){t.isGap=n.isGap})),n=n.data),(n=n||[])[0]=n[0]||[],o.data=n,e=n.slice(),ue=(de=e[0]).length,2==Yn&&(e[0]=de.map((function(n,t){return t}))),o._data=e,ye(!0),hr("setData"),!1!==t){var r=yn[Mn];r.auto(o,pe)?ge():Xe(Mn,r.min,r.max),Vt=!0,Lt=!0,Fe()}}function ge(){var n,t,r,o;pe=!0,ue>0?(ce=he[0]=0,ve=he[1]=ue-1,r=e[0][ce],o=e[0][ve],2==Yn?(r=ce,o=ve):1==ue&&(3==Yn?(r=(n=i(r,r,yn[Mn].log,!1))[0],o=n[1]):yn[Mn].time?o=r+86400/bn:(r=(t=a(r,o,.1,!0))[0],o=t[1]))):(ce=he[0]=r=null,ve=he[1]=o=null),Xe(Mn,r,o)}function we(n,t,e,r){Y.strokeStyle=n||X,Y.lineWidth=t,Y.lineJoin="round",Y.setLineDash(e||[]),Y.fillStyle=r||X}o.setData=me;var xe=1;function be(n,t,e,r,i,o,l,a,u){var s=l%2/2;Y.translate(s,s),we(a,l,u),Y.beginPath();var f,c,v,h,d=i+(0==r||3==r?-o:o);0==e?(c=i,h=d):(f=i,v=d),n.forEach((function(n,r){null!=t[r]&&(0==e?f=v=n:c=h=n,Y.moveTo(f,c),Y.lineTo(v,h))})),Y.stroke(),Y.translate(-s,-s)}function _e(n){var t=!0;return kn.forEach((function(e,r){if(e.show){var i=yn[e.scale];if(null!=i.min){e._show||(t=!1,e._show=!0,ye(!1));var l=e.side,a=i.min,u=i.max,s=function(n,t,e,r){var i,l=kn[n];if(r>0){var a=l._space=l.space(o,n,t,e,r),u=l._incrs=l.incrs(o,n,t,e,r,a);i=l._found=function(n,t,e,r,i){for(var o=r/(t-n),l=(""+h(n)).length,a=0;e.length>a;a++){var u=e[a]*o,s=10>e[a]?W.get(e[a]):0;if(u>=i&&17>l+s)return[e[a],u]}return[0,0]}(t,e,u,r,a)}else i=[0,0];return i}(r,a,u,0==l%2?ht:dt),f=s[0],c=s[1];if(0!=c){var v=e._splits=e.splits(o,r,a,u,f,c,2==i.distr),d=2==i.distr?v.map((function(n){return de[n]})):v,m=2==i.distr?de[v[1]]-de[v[0]]:f,g=e._values=e.values(o,e.filter(o,d,r,c,m),r,c,m);e._rotate=2==l?e.rotate(o,g,r,c):0;var w=e._size;e._size=p(e.size(o,g,r,n)),null!=w&&e._size!=w&&(t=!1)}}else e._show&&(t=!1,e._show=!1,ye(!1))}})),t}function ke(n){var t=!0;return se.forEach((function(e,r){var i=e(o,r,le,n);i!=fe[r]&&(t=!1),fe[r]=i})),t}function ye(n){_n.forEach((function(t,e){e>0&&(t._paths=null,n&&(t.min=null,t.max=null))}))}var Me,Te,Se,ze,De,Ee,Ye,Pe,We,Ae,Ce=!1;function Fe(){Ce||(L(Ge),Ce=!0)}function Ge(){Ht&&(function(){var t=I(yn);for(var r in t){var i=t[r],l=Pn[r];if(null!=l&&null!=l.min)V(i,l),r==Mn&&ye(!0);else if(r!=Mn)if(0==ue&&null==i.from){var a=i.range(o,null,null,r);i.min=a[0],i.max=a[1]}else i.min=y,i.max=-y}if(ue>0)for(var u in _n.forEach((function(r,i){var l=r.scale,a=t[l],u=Pn[l];if(0==i){var s=a.range(o,a.min,a.max,l);a.min=s[0],a.max=s[1],ce=n(a.min,e[0]),ve=n(a.max,e[0]),a.min>e[0][ce]&&ce++,e[0][ve]>a.max&&ve--,r.min=de[ce],r.max=de[ve]}else if(r.show&&r.auto&&a.auto(o,pe)&&(null==u||null==u.min)){var f=null==r.min?3==a.distr?function(n,t,e){for(var r=y,i=-y,o=t;e>=o;o++)n[o]>0&&(r=m(r,n[o]),i=g(i,n[o]));return[r==y?1:r,i==-y?10:i]}(e[i],ce,ve):function(n,t,e,r){var i=y,o=-y;if(1==r)i=n[t],o=n[e];else if(-1==r)i=n[e],o=n[t];else for(var l=t;e>=l;l++)null!=n[l]&&(i=m(i,n[l]),o=g(o,n[l]));return[i,o]}(e[i],ce,ve,r.sorted):[r.min,r.max];a.min=m(a.min,r.min=f[0]),a.max=g(a.max,r.max=f[1])}r.idxs[0]=ce,r.idxs[1]=ve})),t){var s=t[u],f=Pn[u];if(null==s.from&&(null==f||null==f.min)){var c=s.range(o,s.min==y?null:s.min,s.max==-y?null:s.max,u);s.min=c[0],s.max=c[1]}}for(var v in t){var h=t[v];if(null!=h.from){var d=t[h.from],p=h.range(o,d.min,d.max,v);h.min=p[0],h.max=p[1]}}var w={},x=!1;for(var b in t){var _=t[b],k=yn[b];k.min==_.min&&k.max==_.max||(k.min=_.min,k.max=_.max,w[b]=x=!0)}if(x){for(var M in _n.forEach((function(n){w[n.scale]&&(n._paths=null)})),w)It=!0,hr("setScale",M);ne.show&&(Vt=!0)}for(var T in Pn)Pn[T]=null}(),Ht=!1),It&&(function(){for(var n=!1,t=0;!n;){var e=_e(++t),r=ke(t);(n=e&&r)||($t(o.width,o.height),Nt=!0)}}(),It=!1),Nt&&(hn(C,U,pt),hn(C,B,_t),hn(C,O,ht),hn(C,j,dt),hn(gn,U,pt),hn(gn,B,_t),hn(gn,O,ht),hn(gn,j,dt),hn(A,O,ft),hn(A,j,vt),_.width=d(ft*fn),_.height=d(vt*fn),er(),hr("setSize"),Nt=!1),ne.show&&Vt&&(nr(),Vt=!1),ft>0&&vt>0&&(Y.clearRect(0,0,_.width,_.height),hr("drawClear"),Sn.forEach((function(n){return n()})),hr("draw")),c||(c=!0,o.status=1,hr("ready")),pe=!1,Ce=!1}function He(t,r){var i=yn[t];if(null==i.from){if(0==ue){var l=i.range(o,r.min,r.max,t);r.min=l[0],r.max=l[1]}if(ue>1&&null!=r.min&&null!=r.max&&1e-16>r.max-r.min)return;t==Mn&&2==i.distr&&ue>0&&(r.min=n(r.min,e[0]),r.max=n(r.max,e[0])),Pn[t]=r,Ht=!0,Fe()}}o.redraw=function(n){!1!==n?Xe(Mn,yn[Mn].min,yn[Mn].max):Fe()},o.setScale=He;var Ne=!1,Ie=ne.drag,Ve=Ie.x,Le=Ie.y;ne.show&&(ne.x&&(We=ne.left,Me=pn("u-cursor-x",gn)),ne.y&&(Ae=ne.top,Te=pn("u-cursor-y",gn)));var Oe,je,Be,Re=o.select=V({show:!0,over:!0,left:0,width:0,top:0,height:0},t.select),Ue=Re.show?pn("u-select",Re.over?gn:C):null;function qe(n,t){if(Re.show){for(var e in n)hn(Ue,e,Re[e]=n[e]);!1!==t&&hr("setSelect")}}function Je(n){var t=jn?Rn[n][0].parentNode:null;_n[n].show?t&&vn(t,on):(t&&cn(t,on),ie.length>1&&mn(ie[n],-10,-10,ht,dt))}function Xe(n,t,e){He(n,{min:t,max:e})}function Ze(n,t,e){var r=_n[n];if(null!=t.focus&&function(n){n!=Be&&(_n.forEach((function(t,e){!function(n,t){var e=_n[n];Ke(n,t),e.band&&Ke(_n[n+1].band?n+1:n-1,t)}(e,null==n||0==e||e==n?1:ee.alpha)})),Be=n,Fe())}(n),null!=t.show){if(r.show=t.show,Je(n),r.band){var i=_n[n+1]&&_n[n+1].band?n+1:n-1;_n[i].show=r.show,Je(i)}Xe(r.scale,null,null),Fe()}hr("setSeries",n,t),e&&mr.pub("setSeries",o,n,t)}function Ke(n,t){_n[n].alpha=t,ne.show&&ie[n]&&(ie[n].style.opacity=t),jn&&Rn[n]&&(Rn[n][0].parentNode.style.opacity=t)}function Qe(n,t){var e=ht;t!=Mn&&(n=(e=dt)-n);var r=n/e,i=yn[t],o=i.min,l=i.max;return 3==i.distr?(o=b(o),l=b(l),w(10,o+(l-o)*r)):o+(l-o)*r}o.setSelect=qe,o.setSeries=Ze,jn&&re&&wn(nn,Gn,(function(){ne._lock||(Ze(null,{focus:!1},dr.setSeries),nr())})),o.valToIdx=function(t){return n(t,e[0])},o.posToIdx=function(t){return n(Qe(t,Mn),e[0],ce,ve)},o.posToVal=Qe,o.valToPos=function(n,t,e){return t==Mn?s(n,yn[t],e?Mt:ht,e?kt:0):f(n,yn[t],e?Gt:dt,e?yt:0)},o.batch=function(n){n(o),Fe()},o.setCursor=function(n){We=n.left,Ae=n.top,nr()};var $e=0;function nr(t,r){var i,l;if($e=0,Ye=We,Pe=Ae,i=ne.move(o,We,Ae),We=i[0],Ae=i[1],ne.show&&(ne.x&&mn(Me,d(We),0,ht,dt),ne.y&&mn(Te,0,d(Ae),ht,dt)),Oe=y,0>We||0==ue||ce>ve){l=null;for(var a=0;_n.length>a;a++)if(a>0&&ie.length>1&&mn(ie[a],-10,-10,ht,dt),jn&&On.live){if(0==a&&Un)continue;for(var u=0;Rn[a].length>u;u++)Rn[a][u].firstChild.nodeValue="--"}re&&Ze(null,{focus:!0},dr.setSeries)}else{var h=Qe(We,Mn);l=n(h,e[0],ce,ve);for(var p=yn[Mn],g=E(s(e[0][l],p,ht,0),.5),w=0;_n.length>w;w++){var x=_n[w],b=ne.dataIdx(o,w,l,h),_=b==l?g:E(s(e[0][b],p,ht,0),.5);if(w>0&&x.show){var k=e[w][b],M=null==k?-10:E(f(k,yn[x.scale],dt,0),.5);if(M>0){var T=v(M-Ae);T>Oe||(Oe=T,je=w)}ie.length>1&&mn(ie[w],_,M,ht,dt)}if(jn&&On.live){if(b==ne.idx&&!Lt||0==w&&Un)continue;var S=0==w&&2==Yn?de:e[w],z=Un?x.values(o,w,b):{_:x.value(o,S[b],w,b)},D=0;for(var Y in z)Rn[w][D++].firstChild.nodeValue=z[Y]}}Lt=!1}if(Re.show&&Ne)if(null!=r){var P=dr.scales,W=P[0],A=P[1],C=r.cursor.drag;if(Ve=C._x,Le=C._y,W){var F=yn[W],G=r.posToVal(r.select.left,W),H=r.posToVal(r.select.left+r.select.width,W);Re.left=s(G,F,ht,0),Re.width=v(Re.left-s(H,F,ht,0)),hn(Ue,U,Re.left),hn(Ue,O,Re.width),A||(hn(Ue,B,Re.top=0),hn(Ue,j,Re.height=dt))}if(A){var N=yn[A],I=r.posToVal(r.select.top,A),V=r.posToVal(r.select.top+r.select.height,A);Re.top=f(I,N,dt,0),Re.height=v(Re.top-f(V,N,dt,0)),hn(Ue,B,Re.top),hn(Ue,j,Re.height),W||(hn(Ue,U,Re.left=0),hn(Ue,O,Re.width=ht))}}else{var L=v(Ye-Se),R=v(Pe-ze);Ve=Ie.x&&L>=Ie.dist,Le=Ie.y&&R>=Ie.dist;var q=Ie.uni;if(null!=q?Ve&&Le&&(Le=R>=q,(Ve=L>=q)||Le||(R>L?Le=!0:Ve=!0)):Ie.x&&Ie.y&&(Ve||Le)&&(Ve=Le=!0),Ve){var J=m(De,We),X=v(We-De);hn(Ue,U,Re.left=J),hn(Ue,O,Re.width=X),Le||(hn(Ue,B,Re.top=0),hn(Ue,j,Re.height=dt))}if(Le){var K=m(Ee,Ae),Q=v(Ae-Ee);hn(Ue,B,Re.top=K),hn(Ue,j,Re.height=Q),Ve||(hn(Ue,U,Re.left=0),hn(Ue,O,Re.width=ht))}Ve||Le||(hn(Ue,j,Re.height=0),hn(Ue,O,Re.width=0))}ne.idx=l,ne.left=We,ne.top=Ae,Ie._x=Ve,Ie._y=Le,null!=t&&(mr.pub(Z,o,We,Ae,ht,dt,l),re&&Ze(Oe>ee.prox?null:je,{focus:!0},dr.setSeries)),c&&hr("setCursor")}var tr=null;function er(){tr=gn.getBoundingClientRect()}function rr(n,t,e,r,i,o){ne._lock||(ir(n,t,e,r,i,o,0,!1,null!=n),null!=n?0==$e&&($e=an(nr)):nr(null,t))}function ir(n,t,e,r,i,l,a,u,c){var v;if(null!=n)e=n.clientX-tr.left,r=n.clientY-tr.top;else{if(0>e||0>r)return We=-10,void(Ae=-10);var h=dr.scales,d=h[0],p=h[1];e=null!=d?s(t.posToVal(e,d),yn[d],ht,0):ht*(e/i),r=null!=p?f(t.posToVal(r,p),yn[p],dt,0):dt*(r/l)}c&&(e>1&&ht-1>e||(e=M(e,ht)),r>1&&dt-1>r||(r=M(r,dt))),u?(Se=e,ze=r,v=ne.move(o,e,r),De=v[0],Ee=v[1]):(We=e,Ae=r)}function or(){qe({width:0,height:0},!1)}function lr(n,t,e,r,i,l){Ne=!0,Ve=Le=Ie._x=Ie._y=!1,ir(n,t,e,r,i,l,0,!0,!1),null!=n&&(st(Q,un,ar),mr.pub(K,o,De,Ee,ht,dt,null))}function ar(n,t,e,r,i,l){Ne=Ie._x=Ie._y=!1,ir(n,t,e,r,i,l,0,!1,!0);var a=Re.width>0||Re.height>0;if(a&&qe(Re),Ie.setScale&&a){if(Ve&&Xe(Mn,Qe(Re.left,Mn),Qe(Re.left+Re.width,Mn)),Le)for(var u in yn){var s=yn[u];u!=Mn&&null==s.from&&s.min!=y&&Xe(u,Qe(Re.top+Re.height,u),Qe(Re.top,u))}or()}else ne.lock&&(ne._lock=!ne._lock,ne._lock||nr());null!=n&&(function(n,t){var e=ut.get(t)||{};xn(n,t,e[n]),e[n]=null}(Q,un),mr.pub(Q,o,We,Ae,ht,dt,null))}function ur(){if(!ne._lock){var n=Ne;if(Ne){var t=!0,e=!0;if(Ve&&Le&&(t=10>=We||We>=ht-10,e=10>=Ae||Ae>=dt-10),Ve&&t){var r=We,i=ht-We,o=m(r,i);o==r&&(We=0),o==i&&(We=ht)}if(Le&&e){var l=Ae,a=dt-Ae,u=m(l,a);u==l&&(Ae=0),u==a&&(Ae=dt)}nr(1),Ne=!1}We=-10,Ae=-10,nr(1),n&&(Ne=n)}}function sr(n){ge(),or(),null!=n&&mr.pub(tn,o,We,Ae,ht,dt,null)}var fr,cr={};cr.mousedown=lr,cr.mousemove=rr,cr.mouseup=ar,cr.dblclick=sr,cr.setSeries=function(n,t,e,r){Ze(e,r)},ne.show&&(st(K,gn,lr),st(Z,gn,rr),st($,gn,er),st(nn,gn,(function(){an(ur)})),st(tn,gn,sr),fr=function(n){var t=null;function e(){t=null,n()}return function(){clearTimeout(t),t=setTimeout(e,100)}}(er),wn(en,sn,fr),wn(rn,sn,fr),o.syncRect=er);var vr=o.hooks=t.hooks||{};function hr(n,t,e){n in vr&&vr[n].forEach((function(n){n.call(null,o,t,e)}))}(t.plugins||[]).forEach((function(n){for(var t in n.hooks)vr[t]=(vr[t]||[]).concat(n.hooks[t])}));var dr=V({key:null,setSeries:!1,scales:[Mn,null]},ne.sync),pr=dr.key,mr=null!=pr?Ct[pr]=Ct[pr]||Ft():Ft();function gr(){hr("init",t,e),me(e||t.data,!1),Pn[Mn]?He(Mn,Pn[Mn]):ge(),Ot(t.width,t.height),qe(Re,!1)}return mr.sub(o),o.pub=function(n,t,e,r,i,o,l){cr[n](null,t,e,r,i,o,l)},o.destroy=function(){mr.unsub(o),xn(en,sn,fr),xn(rn,sn,fr),x.remove(),hr("destroy")},r?r instanceof HTMLElement?(r.appendChild(x),gr()):r(o,gr):gr(),o}$t.assign=V,$t.fmtNum=f,$t.rangeNum=a,$t.rangeLog=i,$t.join=function(n,t){if(1==n.length)return{data:n[0],isGap:t?function(n,e){return 0!=t[0][e]}:function(){return!0}};for(var e=new Set,r=[new Set],i=0;n.length>i;i++){for(var o=n[i],l=o[0],a=l.length,u=0;a>u;u++)e.add(l[u]);for(var s=1;o.length>s;s++){var f=new Set;if(null==t||1==t[i][s]||2==t[i][s])for(var c=o[s],v=0;a>v;v++)null==c[v]&&f.add(l[v]);r.push(f)}}for(var h=[Array.from(e).sort((function(n,t){return n-t}))],d=h[0].length,p=new Map,m=0;d>m;m++)p.set(h[0][m],m);for(var g=1,w=0;n.length>w;w++)for(var x=n[w],b=x[0],_=1;x.length>_;_++){for(var k=x[_],M=Array(d).fill(null),T=0;k.length>T;T++)M[p.get(b[T])]=k[T];if(t&&2==t[w][_]){var S=r[g],z=S.size,D=0,E=void 0,Y=-y;for(var P of S.values()){if(D++==z)break;if(P>Y){var W=p.get(P);for(E=W-1;null===M[E];)S.add(h[0][E]),E--;for(E=W+1;null===M[E];)S.add(Y=h[0][E]),E++}}}h.push(M),g++}return{data:h,isGap:function(n,t,e){return r[t].has(n._data[0][e])}}},$t.fmtDate=Dn,$t.tzDate=function(n,t){var e;return"Etc/UTC"==t?e=new Date(+n+6e4*n.getTimezoneOffset()):t==En?e=n:(e=new Date(n.toLocaleString("en-US",{timeZone:t}))).setMilliseconds(n.getMilliseconds()),e},$t.addGap=It,$t.clipGaps=Nt;var ne=$t.paths={};return ne.linear=Ot,ne.spline=function(){return function(n,e,r,i){var o=Ht(n,e),l=o[0],a=o[1],u=o[2],s=o[3],f=o[4],c=o[5],v=o[6],h=o[7],p=o[8],m=o[9],g=o[10];r=t(u,r,i,1),i=t(u,r,i,-1);for(var b=[],_=!1,k=d(c(a[r],s,m,h)),y=k,M=[],T=[],S=r;i>=S;S++){var z=u[S],D=c(a[S],s,m,h);null!=z?(_&&(It(b,y,D),_=!1),M.push(y=D),T.push(v(u[S],f,g,p))):l.isGap(n,e,S)&&(It(b,y,D),_=!0)}var E=function(n,t,e){var r,i,o,l,a,u,s,f,c,v,h,p,m,g,b,_,k,y,M,T,S,z,D,E,Y,P=new Path2D,W=n.length;P.moveTo(d(n[0]),d(t[0]));for(var A=0;W-1>A;A++){var C=0==A?0:A-1;i=t[C],l=t[A],a=n[A+1],u=t[A+1],W>A+2?(s=n[A+2],f=t[A+2]):(s=a,f=u),m=x(w((r=n[C])-(o=n[A]),2)+w(i-l,2)),g=x(w(o-a,2)+w(l-u,2)),b=x(w(a-s,2)+w(u-f,2)),T=w(b,e),z=w(b,1),S=w(g,e),D=w(g,1),(y=3*(Y=w(m,e))*(Y+S))>0&&(y=1/y),(M=3*T*(T+S))>0&&(M=1/M),v=(-D*i+(_=2*(E=w(m,1))+3*Y*S+D)*l+E*u)*y,p=(z*l+(k=2*z+3*T*S+D)*u-D*f)*M,0==(c=(-D*r+_*o+E*a)*y)&&0==v&&(c=o,v=l),0==(h=(z*o+k*a-D*s)*M)&&0==p&&(h=a,p=u),P.bezierCurveTo(c,v,h,p,a,u)}return P}(M,T,.5),Y=new Path2D(E),P=l.fillTo(n,e,l.min,l.max),W=d(v(P,f,g,p));return Y.lineTo(y,W),Y.lineTo(k,W),{stroke:E,fill:Y,clip:l.spanGaps?null:Nt(b,1,h,p,m,g)}}},ne.stepped=function(n){var e=u(n.align,1);return function(n,r,i,o){var l=Ht(n,r),a=l[0],u=l[1],s=l[2],f=l[3],c=l[4],v=l[5],h=l[6],p=l[7],m=l[8],g=l[9],w=l[10],x=new Path2D;i=t(s,i,o,1),o=t(s,i,o,-1);var b=[],_=!1,k=d(h(s[i],c,w,m)),y=d(v(u[i],f,g,p)),M=y;x.moveTo(y,k);for(var T=i+1;o>=T;T++){var S=s[T],z=d(v(u[T],f,g,p));if(null!=S){var D=d(h(S,c,w,m));if(_){if(It(b,M,z),k!=D){var E=a.width*fn/2,Y=b[b.length-1];Y[0]+=E,Y[1]-=E}_=!1}1==e?x.lineTo(z,k):x.lineTo(M,D),x.lineTo(z,D),k=D,M=z}else a.isGap(n,r,T)&&(It(b,M,z),_=!0)}var P=new Path2D(x),W=a.fillTo(n,r,a.min,a.max),A=d(h(W,c,w,m));return P.lineTo(M,A),P.lineTo(y,A),{stroke:x,fill:P,clip:a.spanGaps?null:Nt(b,1,p,m,g,w)}}},ne.bars=function(n){var t=u((n=n||F).size,[.6,y]),e=1-t[0],r=u(t[1],y)*fn;return function(n,t,i,o){for(var l=Ht(n,t),a=l[0],u=l[1],s=l[2],f=l[3],c=l[4],v=l[5],h=l[6],p=l[7],w=l[8],x=l[9],b=l[10],_=v(u[1],f,x,p)-v(u[0],f,x,p),k=_*e,y=h(a.fillTo(n,t,a.min,a.max),c,b,w),M=d(a.width*fn),T=d(m(r,_-k)-M),S=new Path2D,z=i;o>=z;z++){var D=s[z];if(null!=D){var E=v(2==f.distr?z:u[z],f,x,p),Y=h(D,c,b,w),P=d(E-T/2),W=d(g(Y,y)),A=d(m(Y,y));S.rect(P,A,T,W-A)}}return{stroke:S,fill:null!=a.fill?new Path2D(S):void 0}}},$t}();
|