mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-27 04:45:08 +01:00
2 lines
36 KiB
JavaScript
2 lines
36 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[878],{8878:(e,t,n)=>{n.r(t),n.d(t,{create:()=>ue});const o=window.devicePixelRatio||1,a={begin:.8,end:1},i=300,l=10,s=.5,r="300 10px Helvetica, Arial, sans-serif",c=i,d=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],u=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],f=["begin 200 fast","end 200 fast","labelFromIndex 200 fast floor","labelToIndex 200 fast ceil","xAxisScale 400","yMinViewport","yMaxViewport","yMinViewportSecond","yMaxViewportSecond","yMinMinimap","yMaxMinimap","yMinMinimapSecond","yMaxMinimapSecond","yAxisScale","yAxisScaleSecond"];function m(e){const t=e.length;let n=e[0],o=e[0];for(let a=0;a<t;a++){const t=e[a];t>n?n=t:t<o&&(o=t)}return{max:n,min:o}}function p(e){return[].concat.apply([],e)}function g(e){const t=[],n=e.length;for(let o=0,a=e[0].length;o<a;o++){t[o]=0;for(let a=0;a<n;a++)t[o]+=e[a][o]}return t}function y(e,t){return new Proxy({},{get:(n,o)=>void 0!==n[o]?n[o]:void 0!==t[o]?t[o]:e[o]})}function v(e,t){let n,o,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=null;return function(){n=!0;for(var l=arguments.length,s=new Array(l),r=0;r<l;r++)s[r]=arguments[r];o=s,i||(a&&(n=!1,e(...o)),i=window.setInterval((()=>{if(!n)return window.clearInterval(i),void(i=null);n=!1,e(...o)}),t))}}function x(e){let t,n=!1;return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];t=a,n||(n=!0,requestAnimationFrame((()=>{n=!1,e(...t)})))}}const M=[1,2,8,18,50,100,250,500,1e3,2500,5e3,1e4,25e3,5e4,1e5,25e4,5e5,1e6,25e5,5e6,1e7,25e6,5e7,1e8];function b(e){return M[e]||M[M.length-1]}function w(e,t,n){const o=Math.min(t+l,n-t);return o<=40&&(e=Math.min(1,e,o/40)),e}function k(e,t){return t-l<=20?Math.min(1,e,(t-l)/20):e}function S(e){return.45*Math.min(...e.getSize())}function L(e){return e>=1e3?Math.min(e/1e3,1):0}function F(e,t,n,o,a,i,l){const{begin:s,end:r}=n,c=e.xLabels.length-1,d=Math.max(0,Math.ceil(c*s)),u=Math.min(Math.floor(c*r),c),h=function(e,t,n){return o=(n-t)/Math.floor(e/45),Math.ceil(Math.log2(o||1));var o}(t.width,d,u),f=e.isStacked?function(e,t,n,o,a){const i=e.datasets.filter((e=>t[e.key])).map((e=>{let{values:t}=e;return t})),l=i.length?g(i):[],{max:s=a.yMaxMinimap}=m(l),{max:r=a.yMaxViewport}=m(l.slice(n,o+1));return{yMinViewport:0,yMaxViewport:r,yMinMinimap:0,yMaxMinimap:s}}(e,o,d,u,l):function(e,t,n,o,a){const i=e.hasSecondYAxis&&e.datasets.slice(-1)[0],l=e.datasets.filter((e=>t[e.key]&&e!==i)),s=T(e,n,o,a,l);if(i){const{yMinViewport:t,yMaxViewport:l,yMinMinimap:r,yMaxMinimap:c}=T(e,n,o,a,[i]);Object.assign(s,{yMinViewportSecond:t,yMaxViewportSecond:l,yMinMinimapSecond:r,yMaxMinimapSecond:c})}return s}(e,o,d,u,l),p=A(t.height,f.yMinViewport,f.yMaxViewport),y=e.hasSecondYAxis&&A(t.height,f.yMinViewportSecond,f.yMaxViewportSecond),v=b(p);if(f.yMinViewport-=f.yMinViewport%v,y){const e=b(y);f.yMinViewportSecond-=f.yMinViewportSecond%e}const x={};return e.datasets.forEach((e=>{let{key:t}=e;x[`opacity#${t}`]=o[t]?1:0})),Object.assign({totalXWidth:c,xAxisScale:h,yAxisScale:p,yAxisScaleSecond:y,labelFromIndex:Math.max(0,d-1),labelToIndex:Math.min(u+1,c),filter:Object.assign({},o),focusOn:void 0!==a?a:l.focusOn,minimapDelta:void 0!==i?i:l.minimapDelta},f,x,n)}function T(e,t,n,o,a){const{min:i=o.yMinMinimap,max:l=o.yMaxMinimap}=m(p(a.map((e=>{let{yMax:t,yMin:n}=e;return[t,n]})))),s=i/l>.1?i:0;let r,c;if(0===t&&n===e.xLabels.length-1)r=s,c=l;else{const e=m(p(a.map((e=>{let{values:t}=e;return t})).map((e=>e.slice(t,n+1))))),i=void 0!==e.min?e.min:o.yMinViewport;c=void 0!==e.max?e.max:o.yMaxViewport,r=i/c>.1?i:0}return{yMinViewport:r,yMaxViewport:c,yMinMinimap:s,yMaxMinimap:l}}function A(e,t,n){const o=e-30,a=n-t,i=Math.floor(o/50);return l=a/i,M.findIndex((e=>e>=l))||M.length-1;var l}const P=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div";return document.createElement(e)};function $(e,t,n){e.addEventListener(t,n)}function I(e,t,n){e.removeEventListener(t,n)}function V(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const a=e.parentNode;a.classList.add("lovely-chart--transition-container");const i=P(e.tagName);i.className=`${n} lovely-chart--transition lovely-chart--position-${o?"top":"bottom"} lovely-chart--state-hidden`,i.innerHTML=t;const l=n.length?`.${n.split(" ").join(".")}`:"",s=a.querySelectorAll(`${l}.lovely-chart--state-hidden`);return s.forEach((e=>e.remove())),e.classList.add("lovely-chart--transition"),e.classList.remove("lovely-chart--position-bottom","lovely-chart--position-top"),e.classList.add(o?"lovely-chart--position-bottom":"lovely-chart--position-top"),a.insertBefore(i,e.nextSibling),C(i),O(e),i}function C(e){e.classList.remove("lovely-chart--state-animated"),e.classList.add("lovely-chart--state-animated"),e.classList.remove("lovely-chart--state-hidden")}function O(e){e.classList.remove("lovely-chart--state-animated"),e.classList.add("lovely-chart--state-animated"),e.classList.add("lovely-chart--state-hidden")}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e>=1e6?W(e/1e6,t)+"M":e>=1e3?W(e/1e3,t)+"K":e}function W(e,t){return e.toFixed(t).replace(/(\d{3,})\.\d+/,"$1").replace(/\.0+$/,"")}function D(e){return String(e).replace(/\d(?=(\d{3})+$)/g,"$& ")}function Z(e){let{isShort:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return H(e,{isShort:t,displayWeekDay:!0})}function H(e){let{isShort:t=!1,displayWeekDay:n=!1,displayYear:o=!0,displayHours:a=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{value:i}=e,l=new Date(i),s=t?h:u;let r=`${l.getUTCDate()} ${d[l.getUTCMonth()]}`;return n&&(r=`${s[l.getUTCDay()]}, `+r),o&&(r+=` ${l.getUTCFullYear()}`),a&&(r+=`, ${("0"+l.getUTCHours()).slice(-2)}:${("0"+l.getUTCMinutes()).slice(-2)}`),r}function X(){return document.documentElement.classList.contains("theme-dark")?"skin-night":"skin-day"}let z=X();const N={"skin-day":{background:"#FFFFFF","text-color":"#222222","minimap-mask":"#E2EEF9/0.6","minimap-slider":"#C0D1E1","grid-lines":"#182D3B/0.1","zoom-out-text":"#108BE3","tooltip-background":"#FFFFFF","tooltip-arrow":"#D2D5D7",mask:"#FFFFFF/0.5","x-axis-text":"#252529/0.6","y-axis-text":"#252529/0.6"},"skin-night":{background:"#242F3E","text-color":"#FFFFFF","minimap-mask":"#304259/0.6","minimap-slider":"#56626D","grid-lines":"#FFFFFF/0.1","zoom-out-text":"#48AAF0","tooltip-background":"#1c2533","tooltip-arrow":"#D2D5D7",mask:"#242F3E/0.5","x-axis-text":"#A3B1C2/0.6","y-axis-text":"#A3B1C2/0.6"}},R=document.createElement("style");R.type="text/css",R.appendChild(document.createTextNode("")),document.head.appendChild(R);const Y=R.sheet;function B(e){const t={},n=".lovely-chart--color";return["skin-day","skin-night"].forEach((o=>{t[o]={},Object.keys(N[o]).forEach((e=>{t[o][e]=q(N[o][e])})),Object.keys(e).forEach((a=>{t[o][`dataset#${a}`]=q(e[a]),U(Y,`.lovely-chart--tooltip-dataset-value${n}-${e[a].slice(1)}`,`color: ${e[a]}`),U(Y,`.lovely-chart--button${n}-${e[a].slice(1)}`,`border-color: ${e[a]}; color: ${e[a]}`),U(Y,`.lovely-chart--button.lovely-chart--state-checked${n}-${e[a].slice(1)}`,`background-color: ${e[a]}`)}))})),t}function j(e,t,n){return function(e){let[t,n,o,a=1]=e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return`rgba(${t}, ${n}, ${o}, ${a*i})`}(e[z][t],n)}function q(e){const[t,n]=e.replace("#","").split("/");return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),n?parseFloat(n):1]}function U(e,t,n){e.insertRule(`${t} { ${n} }`,e.cssRules.length)}function J(e){const{begin:t,end:n,totalXWidth:o,yMin:a,yMax:i,availableWidth:l,availableHeight:s,xPadding:r=0,yPadding:c=0}=e;let d=l;0===t&&(d-=r),1===n&&(d-=r);const u=d/((n-t)*o);let h=t*o*u;0===t&&(h-=r);const f=s-c,m=f/(i-a),p=a*m;return{findClosestLabelIndex:function(e){return Math.round((e+h)/u)},copy:function(t,n){return J(y(e,t))},getCenter:function(){return[l/2,s-f/2]},getSize:function(){return[l,f]},getParams:function(){return e},getState:function(){return{xFactor:u,xOffsetPx:h,availableHeight:s,yFactor:m,yOffsetPx:p}}}}function _(e,t,n){const{xFactor:o,xOffsetPx:a,availableHeight:i,yFactor:l,yOffsetPx:s}=e.getState();return[t*o-a,i-(n*l-s)]}function K(e,t){let{width:n,height:a}=t;const i=P("canvas");i.width=n*o,i.height=a*o,i.style.width="100%",i.style.height=`${a}px`;const l=i.getContext("2d");return l.scale(o,o),e.appendChild(i),{canvas:i,context:l}}function G(e,t){t.clearRect(0,0,e.width,e.height)}function Q(e,t,n,o,a,i){let l=t.map((e=>{let{values:t}=e;return t.slice(n.from,n.to+1)}));e.isPie&&!i&&(l=function(e){return e.map((e=>[e.reduce(((e,t)=>e+t),0)]))}(l));const s=l.map(((t,a)=>t.map(((t,i)=>{let l=t;return e.isStacked&&(l*=o[a]),{labelIndex:n.from+i,value:t,visibleValue:l,stackOffset:0,stackValue:l}}))));return e.isPercentage&&function(e,t){const n=function(e){return g(e.map((e=>e.map((e=>{let{visibleValue:t}=e;return t})))))}(e);e.forEach((e=>{e.forEach(((e,o)=>{e.percent=e.visibleValue/n[o],e.visibleValue=e.percent*t.yMax}))}))}(s,a),e.isStacked&&function(e){const t=[];e.forEach((e=>{e.forEach(((e,n)=>{void 0===t[n]&&(t[n]=0),e.stackOffset=t[n],t[n]+=e.visibleValue,e.stackValue=t[n]}))}))}(s),s}document.documentElement.addEventListener("darkmode",(()=>{z=X()}));const ee=(()=>{let e=1/Math.pow(2,22),t=1e5;function n(e,t,n,o,a){let i,l=+t[0],s=+t[1];i=+((e[0]-l)*o[0]+(e[1]-s)*o[1])*a,i>1?(l=+n[0],s=+n[1]):i>0&&(l+=+o[0]*i,s+=+o[1]*i);let r=+e[0]-l,c=+e[1]-s;return+r*r+c*c}return function(o,a,i){if(o.length<6)return function(){return{points:o,indexes:a,removed:[]}};let l=function(o,a){let i,l=o.length,s=[],r=[];for(let e=0,t=o.length;e<t;++e)s[e]=0;a||(a=[]);let c=0;for(let e=0,n=a.length;e<n;++e)s[a[e]]=t;function d(){let l=r.pop(),c=function(l){let c=l.start,d=l.end,u=l.record,h=l.currentLimit,f=0;if(!u){let i=-1,l=[o[d][0]-o[c][0],o[d][1]-o[c][1]];for(let e=0,n=a.length;e<n;++e){let n=a[e];if(n>c){if(n<d){i=n,f=t;break}break}}if(i<0){if(Math.abs(l[0])>e||Math.abs(l[1])>e){let e=1/(l[0]*l[0]+l[1]*l[1]);for(let t=c+1;t<d;++t){let a=n(o[t],o[c],o[d],l,e);a>f&&(i=t,f=a)}}else i=Math.round(.5*(c+d)),f=h;s[i]=f}u={start:c,end:d,index:i,distance:f}}return u.index&&u.distance>i&&(u.index-c>=2&&r.push({start:c,end:u.index,record:u.left,currentLimit:u.distance,parent:u,parentProperty:"left"}),d-u.index>=2&&r.push({start:u.index,end:d,record:u.right,currentLimit:u.distance,parent:u,parentProperty:"right"})),u}(l);return l.parent&&l.parentProperty&&(l.parent[l.parentProperty]=c),c}return function(e){for(i=e,r.push({start:0,end:l-1,record:c,currentLimit:t}),c=d();r.length;)d();return s}}(o,i);return function(e){let t=[],n=[],i=[],s=e*e,r=l(s);for(let e=0,l=o.length;e<l;e++)r[e]>=s||0==e||e==l-1?(t.push(o[e]),n.push(a?a[e]:e)):i.push(e);return{points:t,indexes:n,removed:i}}}})();function te(e,t,n,o,a,i,l,r,c,d,u,h,f){if(n.datasets.forEach(((s,m)=>{let{key:g,type:y,hasOwnYAxis:v}=s;if(!d[m])return;const x={color:j(u,`dataset#${g}`),lineWidth:c,opacity:n.isStacked?1:d[m],simplification:f},M="pie"===y&&h?"bar":y;let b=v?l:a[m],w=v?r:i;if("area"===M){const{yMin:e,yMax:t}=i.getParams(),n=t-e,l=[{labelIndex:o.from,stackValue:0},{labelIndex:o.to,stackValue:0}],s=[{labelIndex:o.to,stackValue:n},{labelIndex:o.from,stackValue:n}];b=p([a[m-1]||l,s])}if("pie"===M&&(x.center=i.getCenter(),x.radius=S(i),x.pointerVector=t.focusOn),"bar"===M){const[e]=_(i,0,0),[n]=_(i,1,0);x.lineWidth=n-e,x.focusOn=t.focusOn}!function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];switch(e){case"line":return ne(...n);case"bar":return oe(...n);case"step":return ae(...n);case"area":return ie(...n);case"pie":le(...n)}}(M,e,b,w,x)})),t.focusOn&&(n.isBars||n.isSteps)){const[o]=_(i,0,0),[a]=_(i,1,0);!function(e,t,n){const[o,a]=t.getCenter(),[i,l]=t.getSize(),[r]=_(t,n.focusOn,0);e.fillStyle=n.color,e.fillRect(o-i/2,a-l/2,r-n.lineWidth/2+s,l),e.fillRect(r+n.lineWidth/2,a-l/2,i-(r+n.lineWidth/2),l)}(e,i,{focusOn:t.focusOn,color:j(u,"mask"),lineWidth:n.isSteps?a-o+c:a-o})}}function ne(e,t,n,o){e.beginPath();let a=[];for(let e=0,o=t.length;e<o;e++){const{labelIndex:o,stackValue:i}=t[e];a.push(_(n,o,i))}o.simplification&&(a=ee(a)(o.simplification).points),a.forEach((t=>{let[n,o]=t;e.lineTo(n,o)})),e.save(),e.strokeStyle=o.color,e.lineWidth=o.lineWidth,e.globalAlpha=o.opacity,e.lineJoin="bevel",e.lineCap="butt",e.stroke(),e.restore()}function oe(e,t,n,o){const{yMin:a}=n.getParams();e.save(),e.globalAlpha=o.opacity,e.fillStyle=o.color;for(let i=0,l=t.length;i<l;i++){const{labelIndex:l,stackValue:r,stackOffset:c=0}=t[i],[,d]=_(n,l,Math.max(c,a)),[u,h]=_(n,l,r),f=u-o.lineWidth/2,m=h,p=1===o.opacity?o.lineWidth+s:o.lineWidth+s*o.opacity,g=d-h;e.fillRect(f,m,p,g)}e.restore()}function ae(e,t,n,o){e.beginPath();let a=[];for(let e=0,o=t.length;e<o;e++){const{labelIndex:o,stackValue:i}=t[e];a.push(_(n,o-s,i),_(n,o+s,i))}a.forEach((t=>{let[n,o]=t;e.lineTo(n,o)})),e.save(),e.strokeStyle=o.color,e.lineWidth=o.lineWidth,e.globalAlpha=o.opacity,e.stroke(),e.restore()}function ie(e,t,n,o){e.beginPath();let a=[];for(let e=0,o=t.length;e<o;e++){const{labelIndex:o,stackValue:i}=t[e];a.push(_(n,o,i))}o.simplification&&(a=ee(a)(o.simplification).points),a.forEach((t=>{let[n,o]=t;e.lineTo(n,o)})),e.save(),e.fillStyle=o.color,e.lineWidth=o.lineWidth,e.globalAlpha=o.opacity,e.lineJoin="bevel",e.lineCap="butt",e.fill(),e.restore()}function le(e,t,n,o){const{visibleValue:a,stackValue:i,stackOffset:l=0}=t[0];if(!a)return;const{yMin:s,yMax:r}=n.getParams(),c=1/(r-s),d=a*c,u=l*c*Math.PI*2-Math.PI/2,h=i*c*Math.PI*2-Math.PI/2,{radius:f=120,center:[m,p],pointerVector:g}=o,y=g&&u<=g.angle&&g.angle<h&&g.distance<=f?10:0,v=(u+h)/2,x=Math.cos(v),M=Math.sin(v),b=x*y,w=M*y;e.save(),e.beginPath(),e.fillStyle=o.color,e.moveTo(m+b,p+w),e.arc(m+b,p+w,f,u,h),e.lineTo(m+b,p+w),e.fill(),e.font=`700 ${function(e,t){return(t+200*e)/10}(d,f)}px Helvetica, Arial, sans-serif`,e.textAlign="center",e.textBaseline="middle",e.fillStyle="white";const k=function(e,t,n){return e>=.99?0:Math.min(1-Math.log(30*e)/5,.8)*t}(d,f);e.fillText(`${Math.round(100*d)}%`,m+x*k+b,p+M*k+w),e.restore()}function se(e,t){let n=null,o=null;function a(e){n=e,"mousedown"===e.type?($(document,"mousemove",l),$(document,"mouseup",i)):"touchstart"===e.type&&($(document,"touchmove",l),$(document,"touchend",i),$(document,"touchcancel",i),void 0===e.pageX&&(e.pageX=e.touches[0].pageX)),t.draggingCursor&&document.documentElement.classList.add(`cursor-${t.draggingCursor}`),t.onCapture&&t.onCapture(e),t.onLongPress&&(o=setTimeout((()=>t.onLongPress()),500))}function i(e){n&&(o&&(clearTimeout(o),o=null),t.draggingCursor&&document.documentElement.classList.remove(`cursor-${t.draggingCursor}`),I(document,"mouseup",i),I(document,"mousemove",l),I(document,"touchcancel",i),I(document,"touchend",i),I(document,"touchmove",l),n=null,t.onRelease&&t.onRelease(e))}function l(e){n&&(o&&(clearTimeout(o),o=null),"touchmove"===e.type&&void 0===e.pageX&&(e.pageX=e.touches[0].pageX),t.onDrag&&t.onDrag(e,n,{dragOffsetX:e.pageX-n.pageX}))}$(e,"mousedown",a),$(e,"touchstart",a)}function re(e,t,n,o,a,i){let l,s,r,c,d,u,h,f,m,p,g,y=null,M=!1,b=!1;const w=x(C),k=v(E,100,!0,!0);function L(e){if(e.target===m||m.contains(e.target)||y)return;b=!1;const t=u.getBoundingClientRect();p=(e.touches?e.touches[0].clientX:e.clientX)-t.left,g=(e.touches?e.touches[0].clientY:e.clientY)-t.top,w()}function F(e){null===p||e.target===u||u.contains(e.target)||I()}function T(e){if(b)return;const n=y;y=null,L(e);const o=V();o!==n&&(y=o),t.isZoomable&&a(o)}function A(){if(m.classList.contains("lovely-chart--state-inactive"))return;const e=r.findClosestLabelIndex(p);a(e)}function I(e){p=null,y=null,G(h,f),W(),!e&&i&&i(null)}function V(){const e=r.findClosestLabelIndex(p);return e<l.labelFromIndex||e>l.labelToIndex?null:e}function C(e){if(!p||!l||b)return;const a=V();if(null===a)return void I(e);const u=Z(),y=!t.isPie||u.distance<=S(r);function v(e,n){return t.isPie?e.slice(l.labelFromIndex,l.labelToIndex+1).reduce(((e,t)=>e+t),0):e[n]}!e&&i&&(t.isPie?i(u):i(a));const[x]=_(r,a,0),M=t.datasets.map(((e,t)=>{let{key:n,name:o,values:i,hasOwnYAxis:l}=e;return{key:n,name:o,value:v(i,a),hasOwnYAxis:l,originalIndex:t}})).filter((e=>{let{key:t}=e;return l.filter[t]}));M.length&&y?function(e,n){m.style.transform=`translate3D(${function(e){const n=(l.labelFromIndex+l.labelToIndex)/2,{angle:o}=Z();return(t.isPie?o>Math.PI/2:e<n)?p+20:p-(m.offsetWidth+20)}(n)}px, ${t.isPie?`${g}px`:0}, 0)`,m.classList.add("lovely-chart--state-shown"),t.isPie?E(null,e):k(function(e,t){switch(e.tooltipFormatter){case"statsFormatDayHourFull":return`${e.xLabels[t].value}:00`;case"statsTooltipFormat('day')":return H(e.xLabels[t]);case"statsTooltipFormat('5min')":return n=e.xLabels[t],new Date(n.value).toString().match(/(\d+:\d+):/)[1];default:return e.xLabels[t].text}var n}(t,n),e)}(M,a):W(),G(h,f),(t.isLines||t.isAreas)&&(t.isLines&&function(e,t){e.forEach((e=>{let{value:n,key:a,hasOwnYAxis:i,originalIndex:u}=e;const h=t-l.labelFromIndex,m=i?c[h]:s[u][h];if(!m)return;const[p,g]=_(i?d:r,t,m.stackValue);!function(e,t,n){let[o,a]=e;f.strokeStyle=t,f.fillStyle=n,f.lineWidth=2,f.beginPath(),f.arc(o,a,4,0,2*Math.PI),f.fill(),f.stroke()}([p,g],j(o,`dataset#${a}`),j(o,"background"))}))}(M,a),function(e,t,n){f.strokeStyle=n,f.lineWidth=1,f.beginPath(),f.moveTo(e,0),f.lineTo(e,t),f.stroke()}(x,n.height-30,j(o,"grid-lines")))}function O(e,n,o){if(!t.isPercentage)return;if(t.isPie)return void Array.from(e.querySelectorAll(".lovely-chart--percentage-title")).forEach((e=>e.remove()));const a=o?Math.round(n/o*100):0,i=e.querySelector(".lovely-chart--percentage-title:not(.lovely-chart--state-hidden)");if(i)i.innerHTML=`${a}%`;else{const t=P("span");t.className="lovely-chart--percentage-title lovely-chart--position-left",t.innerHTML=`${a}%`,e.prepend(t)}}function E(e,n){!function(e){const n=m.children[0];if(t.isPie)n&&(n.style.display="none");else{"none"===n.style.display&&(n.style.display="");const t=n.querySelector(":not(.lovely-chart--state-hidden)");n.innerHTML&&t?t.innerHTML=e:n.innerHTML=`<span>${e}</span>`}}(e),function(e){const n=m.children[1];t.isPie&&n.classList.add("lovely-chart--tooltip-legend-pie"),Array.from(n.children).forEach((e=>{!t.isPie&&n.classList.contains("lovely-chart--tooltip-legend-pie")?e.remove():e.setAttribute("data-present","false")}));const o=e.reduce(((e,t)=>e+t.value),0),a=Z(),i=t.isPie?e.filter(((t,n)=>{let{value:i}=t;return function(e,t,n,o,a){const i=o>0?e.slice(0,o).reduce(((e,t)=>e+t.value),0):0,l=i/n*Math.PI*2-Math.PI/2,s=(i+t)/n*Math.PI*2-Math.PI/2;return a&&l<=a.angle&&a.angle<s&&a.distance<=S(r)}(e,i,o,n,a)})):e;i.forEach((e=>{const a=n.querySelector(`[data-name="${e.name}"]`);a?function(e){let{key:n,value:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0;e.setAttribute("data-present","true"),e.querySelector(`.lovely-chart--tooltip-dataset-value.lovely-chart--color-${t.colors[n].slice(1)}:not(.lovely-chart--state-hidden)`).innerHTML=D(o),O(e,o,a)}(a,e,o):function(e,n,o){let{name:a,key:i,value:l}=n;const s=`lovely-chart--tooltip-dataset-value lovely-chart--position-right lovely-chart--color-${t.colors[i].slice(1)}`,r=P();r.className="lovely-chart--tooltip-dataset",r.setAttribute("data-present","true"),r.setAttribute("data-name",a),r.innerHTML=`<span class="lovely-chart--dataset-title">${a}</span><span class="${s}">${D(l)}</span>`,O(r,l,o);const c=e.querySelector('[data-total="true"]');c?e.insertBefore(r,c):e.appendChild(r)}(n,e,o)})),(t.isBars||t.isSteps)&&t.isStacked&&function(e,t){const n=e.querySelector('[data-total="true"]');if(n)n.setAttribute("data-present","true"),n.querySelector(".lovely-chart--tooltip-dataset-value:not(.lovely-chart--state-hidden)").innerHTML=t;else{const n=P();n.className="lovely-chart--tooltip-dataset",n.setAttribute("data-present","true"),n.setAttribute("data-total","true"),n.innerHTML=`<span>All</span><span class="lovely-chart--tooltip-dataset-value lovely-chart--position-right">${t}</span>`,e.appendChild(n)}}(n,D(o)),Array.from(n.querySelectorAll('[data-present="false"]')).forEach((e=>{e.remove()}))}(n)}function W(){m.classList.remove("lovely-chart--state-shown")}function Z(){const{width:e,height:t}=u.getBoundingClientRect(),n=[e/2,t/2],o=Math.atan2(g-n[1],p-n[0]),a=Math.sqrt((p-n[0])**2+(g-n[1])**2);return{angle:o>=-Math.PI/2?o:2*Math.PI+o,distance:a}}return u=P(),u.className="lovely-chart--tooltip",function(){const{canvas:e,context:t}=K(u,n);h=e,f=t}(),m=P(),m.className="lovely-chart--tooltip-balloon"+(t.isZoomable?"":" lovely-chart--state-inactive"),m.innerHTML='<div class="lovely-chart--tooltip-title"></div><div class="lovely-chart--tooltip-legend"></div><div class="lovely-chart--spinner"></div>',"ontouchstart"in window&&t.isZoomable&&$(m,"click",A),u.appendChild(m),"ontouchstart"in window?($(u,"touchmove",L),$(u,"touchstart",L),$(document,"touchstart",F)):($(u,"mousemove",L),$(u,"click",T),$(document,"mousemove",F)),e.appendChild(u),{update:function(e,t,n,o,a){l=e,s=t,r=n,c=o,d=a,C(!0)},toggleLoading:function(e){m.classList.toggle("lovely-chart--state-loading",e),e||I()},toggleIsZoomed:function(e){e!==M&&(b=!0),M=e,m.classList.toggle("lovely-chart--state-inactive",e)}}}function ce(e){const{title:t,labelFormatter:n,tooltipFormatter:o,isStacked:a,isPercentage:i,hasSecondYAxis:l,onZoom:s,minimapRange:r,hideCaption:c,zoomOutLabel:u}=e,{datasets:h,labels:f}=function(e){const{type:t,labels:n,datasets:o,hasSecondYAxis:a}=e;return{labels:de(n),datasets:o.map(((e,n)=>{let{name:i,color:l,values:s}=e;const{min:r,max:c}=m(s);return{type:t,key:`y${n}`,name:i,color:l,values:de(s),hasOwnYAxis:a&&n===o.length-1,yMin:r,yMax:c}}))}}(e),p={};let g,y=1/0,v=-1/0;switch(h.forEach((e=>{let{key:t,color:n,yMin:o,yMax:a}=e;p[t]=n,o<y&&(y=o),a>v&&(v=a)})),n){case"statsFormatDayHour":g=function(e){return e.map((e=>({value:e,text:`${e}:00`})))}(f);break;case"statsFormat('day')":g=function(e){return e.map((e=>{const t=new Date(e);return{value:e,text:`${t.getDate()} ${d[t.getMonth()]}`}}))}(f);break;case"statsFormat('5min')":g=function(e){return e.map((e=>({value:e,text:new Date(e).toString().match(/(\d+:\d+):/)[1]})))}(f);break;default:g=function(e){return e.map(((e,t)=>({value:t,text:e})))}(f)}const x={title:t,labelFormatter:n,tooltipFormatter:o,xLabels:g,datasets:h,isStacked:a,isPercentage:i,hasSecondYAxis:l,onZoom:s,isLines:"line"===e.type,isBars:"bar"===e.type,isSteps:"step"===e.type,isAreas:"area"===e.type,isPie:"pie"===e.type,yMin:y,yMax:v,colors:p,minimapRange:r,hideCaption:c,zoomOutLabel:u};return x.shouldZoomToPie=!x.onZoom&&x.isPercentage,x.isZoomable=x.onZoom||x.shouldZoomToPie,x}function de(e){return e.slice(0)}function ue(e,t){let n,o,s,d,u,h,m,g,M,S,T,A,I=window.innerWidth;const C=ce(t),O=B(C.colors),W=function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=null;return function(){a?(clearTimeout(a),a=null):n&&e(),a=setTimeout((()=>{o&&e(),a=null}),t)}}((function(){Object.assign(C,ce(t)),o.remove(),D()}),500,!1,!0);function D(){o=P(),o.className="lovely-chart--container"+(C.shouldZoomToPie?" lovely-chart--container-type-pie":""),e.appendChild(o),h=function(e,t){let n,o,a,i,l,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Zoom out",r=arguments.length>3?arguments[3]:void 0;const c=v(d,100,!1);function d(e){l||(i.innerHTML=e)}function u(e){a=V(o,s,"lovely-chart--header-title lovely-chart--header-zoom-out-control"),setTimeout((()=>{$(a,"click",m)}),500),d(e)}function h(e){l=e}function f(){n=P(),n.className="lovely-chart--header",o=P(),o.className="lovely-chart--header-title",o.innerHTML=t,n.appendChild(o),i=P(),i.className="lovely-chart--header-caption lovely-chart--position-right",n.appendChild(i),e.appendChild(n)}function m(){o=V(a,t,"lovely-chart--header-title",!0),r()}return f(),{setCaption:c,zoom:u,toggleIsZooming:h}}(o,C.title,C.zoomOutLabel,q),function(){const{canvas:e,context:t}=K(o,{width:o.clientWidth,height:320});s=e,d=t,u={width:s.offsetWidth,height:s.offsetHeight}}(),n=function(e,t,n){const o={begin:0,end:1},a=function(){const t={};return e.datasets.forEach((e=>{let{key:n}=e;t[n]=!0})),t}(),l=function(){const t=[],n=e.datasets.map((e=>{let{key:t}=e;return`opacity#${t} 300`}));return p([f,n]).forEach((e=>{const[n,o,...a]=e.split(" ");t.push({prop:n,duration:o,options:a})})),t}(),s=function(e){const t={};let n=null,o=null,a=null,l=null,s=null,r=null;function c(e){delete t[e],d()||(cancelAnimationFrame(n),n=null)}function d(){return Boolean(Object.keys(t).length)}function u(e){return!(!e&&(r||s))&&(null===a||a>=4)}function h(){const r=!u();!o||Date.now()-o>=200?(l&&(a=l,s||u(!0)||(s=Date.now())),o=Date.now(),l=0):l++;const f={};Object.keys(t).forEach((e=>{const{startedAt:n,from:o,to:a,duration:l=i,options:s}=t[e],r=Math.min(1,(Date.now()-n)/l);let d=o+(a-o)*(u=r,1-Math.pow(1-u,1.675));var u;s.includes("ceil")?d=Math.ceil(d):s.includes("floor")&&(d=Math.floor(d)),t[e].current=d,t[e].progress=r,f[e]=d,1===r&&c(e)})),r||e(f),d()&&(n=requestAnimationFrame(h))}return{add:function(e,a,i,c,d){t[e]={from:a,to:i,duration:c,options:d,current:a,startedAt:Date.now(),progress:0},n||(o=null,l=null,s&&Date.now()-s>5e3&&(s=null),r=Boolean(s)||!u(!0),n=requestAnimationFrame(h))},remove:c,get:function(e){return t[e]},getState:function(){const e={};return Object.keys(t).forEach((n=>{const{current:o,from:a,to:i,progress:l}=t[n];e[n]=o,e[`${n}From`]=a,e[`${n}To`]=i,e[`${n}Progress`]=l})),e},isRunning:d,isFast:u}}(d),r=x(d);let c={};function d(){const e=s.isFast()?y(c,s.getState()):c;e.static=c,n(e)}return{update:function(){let{range:n={},filter:i={},focusOn:d,minimapDelta:u}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},h=arguments.length>1?arguments[1]:void 0;Object.assign(o,n),Object.assign(a,i);const f=c;c=F(e,t,o,a,d,u,f),h||l.forEach((e=>{let{prop:t,duration:n,options:o}=e;const a=s.get(t),i=a?a.to:f[t];if(void 0!==i&&i!==c[t]){const e=a?o.includes("fast")?f[t]:a.current:f[t];a&&s.remove(t),s.add(t,e,c[t],n,o)}})),s.isRunning()&&s.isFast()||r()},hasAnimations:function(){return s.isFast()}}}(C,u,X),m=function(e,t,n,o){function a(t,a,i,s,c){let d=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,h=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const f=b(i),m=Math.ceil(s/f)*f,p=Math.floor(c/f)*f;e.font=r,e.textAlign=h?"right":"left",e.textBaseline="bottom",e.lineWidth=1,e.beginPath();for(let t=m;t<=p;t+=f){const[,i]=_(a,0,t),s=k(d,i);e.fillStyle=j(o,u||"y-axis-text",s),h?e.fillText(E(t),n.width-l,i-5):e.fillText(E(t),l,i-5),h?(e.strokeStyle=j(o,u,d),e.moveTo(n.width-l,i),e.lineTo(n.width-20,i)):(e.moveTo(l,i),e.strokeStyle=j(o,"grid-lines",d),e.lineTo(n.width-l,i))}e.stroke()}return{drawXAxis:function(a,i){e.clearRect(0,n.height-30+1,n.width,31);const l=n.height-15,s=Math.floor(a.xAxisScale),c=function(e){return Math.pow(2,e)}(s),d=1-(a.xAxisScale-s);e.font=r,e.textAlign="center",e.textBaseline="middle";for(let s=a.labelFromIndex;s<=a.labelToIndex;s++){const a=s-1;if(a%c!=0)continue;const r=t.xLabels[s],[u]=_(i,s,0);let h=a%(2*c)==0?1:d;h=w(h,u,n.width),e.fillStyle=j(o,"x-axis-text",h),e.fillText(r.text,u,l)}},drawYAxis:function(i,s,c){const{yAxisScale:d,yAxisScaleFrom:u,yAxisScaleTo:h,yAxisScaleProgress:f=0,yMinViewport:m,yMinViewportFrom:p,yMinViewportTo:g,yMaxViewport:y,yMaxViewportFrom:v,yMaxViewportTo:x,yMinViewportSecond:M,yMinViewportSecondFrom:b,yMinViewportSecondTo:w,yMaxViewportSecond:k,yMaxViewportSecondFrom:S,yMaxViewportSecondTo:L}=i,F=c&&`dataset#${t.datasets[0].key}`,T=void 0!==p||void 0!==v;if(t.isPercentage?function(t){const[,a]=t.getSize();e.font=r,e.textAlign="left",e.textBaseline="bottom",e.lineWidth=1,e.beginPath(),[0,.25,.5,.75,1].forEach((t=>{const i=a-a*t+15;e.fillStyle=j(o,"y-axis-text",1),e.fillText(100*t+"%",l,i-2.5),e.moveTo(l,i),e.strokeStyle=j(o,"grid-lines",1),e.lineTo(n.width-l,i)})),e.stroke()}(s):a(i,s,Math.round(h||d),void 0!==g?g:m,void 0!==x?x:y,u?f:1,F),f>0&&T&&a(i,s,Math.round(u),void 0!==p?p:m,void 0!==v?v:y,1-f,F),c){const{yAxisScaleSecond:e,yAxisScaleSecondFrom:n,yAxisScaleSecondTo:o,yAxisScaleSecondProgress:l=0}=i,s=`dataset#${t.datasets[t.datasets.length-1].key}`,r=void 0!==b||void 0!==S;a(i,c,Math.round(o||e),void 0!==w?w:M,void 0!==L?L:k,n?l:1,s,!0),l>0&&r&&a(i,c,Math.round(n),void 0!==b?b:M,void 0!==S?S:k,1-l,s,!0)}}}}(d,C,u,O),g=function(e,t,n,o){let i,l,s,r,c,d,u,h,f={};const m=x((function(){const{begin:e,end:t}=f;c.children[0].style.width=100*e+"%",c.children[1].style.width=100*(t-e)+"%",c.children[2].style.width=100*(1-t)+"%"}));function p(e){e.preventDefault(),u=e.target.offsetLeft}function g(){u=null}function v(e,t){let n=Object.assign({},f,e);h&&h.minimapDelta&&!t&&(n=function(e){return{begin:Math.round(e.begin/h.minimapDelta)*h.minimapDelta,end:Math.round(e.end/h.minimapDelta)*h.minimapDelta}}(n)),n.begin===f.begin&&n.end===f.end||(f=n,m(),t||o(f))}return i=P(),i.className="lovely-chart--minimap",i.style.height="40px",function(){const{canvas:t,context:n}=K(i,{width:e.offsetWidth-20,height:40});l=t,s=n}(),c=P(),c.className="lovely-chart--minimap-ruler",c.innerHTML='<div class="lovely-chart--minimap-mask"></div><div class="lovely-chart--minimap-slider"><div class="lovely-chart--minimap-slider-handle"><span class="lovely-chart--minimap-slider-handle-pin"></span></div><div class="lovely-chart--minimap-slider-inner"></div><div class="lovely-chart--minimap-slider-handle"><span class="lovely-chart--minimap-slider-handle-pin"></span></div></div><div class="lovely-chart--minimap-mask"></div>',d=c.children[1],se(d.children[1],{onCapture:p,onDrag:function(e,t,n){let{dragOffsetX:o}=n;const a=r.width-d.offsetWidth,i=Math.max(0,Math.min(u+o-8,a)),l=i+d.offsetWidth;v({begin:i/r.width,end:l/r.width})},onRelease:g,draggingCursor:"grabbing"}),se(d.children[0],{onCapture:p,onDrag:function(e,t,n){let{dragOffsetX:o}=n;const a=d.offsetLeft+d.offsetWidth-16;v({begin:Math.min(a,Math.max(0,u+o))/r.width})},onRelease:g,draggingCursor:"ew-resize"}),se(d.children[2],{onCapture:p,onDrag:function(e,t,n){let{dragOffsetX:o}=n;const a=d.offsetLeft+16,i=r.width;v({end:Math.max(a,Math.min(u+8+o,i))/r.width})},onRelease:g,draggingCursor:"ew-resize"}),i.appendChild(c),e.appendChild(i),r={width:l.offsetWidth,height:l.offsetHeight},v(t.minimapRange||a),{update:function(e){const{begin:o,end:a}=e;u||v({begin:o,end:a},!0),t.datasets.length>=4&&(e=e.static),function(e){if(!h)return!0;const{datasets:n}=t;return!!n.some((t=>{let{key:n}=t;return h[`opacity#${n}`]!==e[`opacity#${n}`]}))||h.yMaxMinimap!==e.yMaxMinimap}(e)&&(h=y(e,{focusOn:null}),G(l,s),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{datasets:o}=t,a={from:0,to:e.totalXWidth},i={begin:0,end:1,totalXWidth:e.totalXWidth,yMin:e.yMinMinimap,yMax:e.yMaxMinimap,availableWidth:r.width,availableHeight:r.height,yPadding:1},l=o.map((e=>{let{key:t}=e;return h[`opacity#${t}`]})),c=Q(t,o,a,l,i,!0),d=J(i);let u=null,f=null;if(t.hasSecondYAxis){const n=o.find((e=>e.hasOwnYAxis)),i={yMin:e.yMinMinimapSecond,yMax:e.yMaxMinimapSecond};u=Q(t,[n],a,l,i)[0],f=d.copy(i)}const m=.5*L(c.reduce(((e,t)=>e+t.length),0));te(s,e,t,a,c,d,u,f,1,l,n,!0,m)}(h))},toggle:function(e){i.classList.toggle("lovely-chart--state-hidden",!e),requestAnimationFrame((()=>{i.classList.toggle("lovely-chart--state-transparent",!e)}))}}}(o,C,O,z),M=re(o,C,u,O,Y,R),S=function(e,t,n){let o;function a(){o=P(),o.className="lovely-chart--tools",t.datasets.length<2&&(o.className+=" lovely-chart--state-hidden"),t.datasets.forEach((e=>{let{key:n,name:a}=e;const l=P("a");l.href="#",l.dataset.key=n,l.className=`lovely-chart--button lovely-chart--color-${t.colors[n].slice(1)} lovely-chart--state-checked`,l.innerHTML=`<span class="lovely-chart--button-check"></span><span class="lovely-chart--button-label">${a}</span>`,l.addEventListener("click",(e=>{e.preventDefault(),l.dataset.clickPrevented||i(l),delete l.dataset.clickPrevented})),se(l,{onLongPress:()=>{l.dataset.clickPrevented="true",i(l,!0)}}),o.appendChild(l)})),e.appendChild(o)}function i(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const a=Array.from(o.getElementsByTagName("a")),i=1===o.querySelectorAll(".lovely-chart--state-checked").length;e&&(e.classList.contains("lovely-chart--state-checked")&&i?t?(a.forEach((e=>e.classList.add("lovely-chart--state-checked"))),e.classList.remove("lovely-chart--state-checked")):(e.classList.remove("lovely-chart--state-shake"),requestAnimationFrame((()=>{e.classList.add("lovely-chart--state-shake")}))):t?(a.forEach((e=>e.classList.remove("lovely-chart--state-checked"))),e.classList.add("lovely-chart--state-checked")):e.classList.toggle("lovely-chart--state-checked"));const l={};a.forEach((e=>{l[e.dataset.key]=e.classList.contains("lovely-chart--state-checked")})),n(l)}return a(),i(),{redraw:function(){if(o){const e=o;e.classList.add("lovely-chart--state-hidden"),setTimeout((()=>{e.parentNode.removeChild(e)}),500)}a(),o.classList.add("lovely-chart--state-transparent"),requestAnimationFrame((()=>{o.classList.remove("lovely-chart--state-transparent")}))}}}(o,C,N),T=C.isZoomable&&function(e,t,n,o,a,i,l,s,r){let d,u,h=!1;function f(t,f,m){s.toggleLoading(!1);const p=1/e.xLabels.length,g=f/(e.xLabels.length-1),y={};e.datasets.forEach((e=>{let{key:t}=e;return y[t]=!1}));const v=ce(t,h||e.shouldZoomToPie),x=Object.keys(e.datasets).length!==Object.keys(v.datasets).length;o.update({range:{begin:g-p/2,end:g+p/2},filter:y}),setTimeout((()=>{Object.assign(e,v),x&&t.colors&&Object.assign(n,B(t.colors)),x&&(l.toggle(h),r.redraw(),a.style.width=`${a.scrollWidth}px`,a.style.height=`${a.scrollHeight}px`),o.update({range:{begin:.4,end:.6},focusOn:null},!0);const s=1/(h||e.shouldZoomToPie?e.xLabels.length:e.xLabels.length/24)/2;let c,f;h?(c={begin:d.begin,end:d.end},f=x?d.filter:u.filter):x?(c={begin:0,end:1},f={},e.datasets.forEach((e=>{let{key:t}=e;return f[t]=!0}))):(c=e.shouldZoomToPie?{begin:.5-s,end:.5+s}:v.minimapRange,f=d.filter),o.update({range:c,filter:f,minimapDelta:h?null:c.end-c.begin}),m&&i.zoom(Z(m)),h=!h,i.toggleIsZooming(!1)}),o.hasAnimations()?c:0),setTimeout((()=>{e.shouldZoomToPie&&a.classList.remove("lovely-chart--state-animating")}),o.hasAnimations()?1e3:0)}return{zoomIn:function(n,o){if(h)return;const l=e.xLabels[o];d=n,i.toggleIsZooming(!0),s.toggleLoading(!0),s.toggleIsZoomed(!0),e.shouldZoomToPie&&(a.classList.add("lovely-chart--state-zoomed-in"),a.classList.add("lovely-chart--state-animating"));const{value:r}=l,c=e.shouldZoomToPie?Promise.resolve(function(e){return Object.assign({},t,{type:"pie",labels:t.labels.slice(e-3,e+4),datasets:t.datasets.map((t=>({...t,values:t.values.slice(e-3,e+4)})))})}(o)):e.onZoom(r);c.then((e=>f(e,o,l))).catch((()=>{s.toggleLoading(!1),s.toggleIsZoomed(!1),i.toggleIsZooming(!1)}))},zoomOut:function(n){if(!h)return;u=n,i.toggleIsZooming(!0),s.toggleLoading(!0),s.toggleIsZoomed(!1),e.shouldZoomToPie&&(a.classList.remove("lovely-chart--state-zoomed-in"),a.classList.add("lovely-chart--state-animating"));const o=Math.round((n.labelFromIndex+n.labelToIndex)/2);f(t,o)},isZoomed:function(){return h}}}(C,t,O,n,o,h,g,M,S)}function X(e){A=e;const{datasets:t}=C,n={from:e.labelFromIndex,to:e.labelToIndex},o={begin:e.begin,end:e.end,totalXWidth:e.totalXWidth,yMin:e.yMinViewport,yMax:e.yMaxViewport,availableWidth:u.width,availableHeight:u.height-30,xPadding:l,yPadding:15},a=t.map((t=>{let{key:n}=t;return e[`opacity#${n}`]})),i=Q(C,t,n,a,o),r=J(o);let c=null,f=null;if(C.hasSecondYAxis){const o=t.find((e=>e.hasOwnYAxis)),i={yMin:e.yMinViewportSecond,yMax:e.yMaxViewportSecond};c=Q(C,[o],n,a,i)[0],f=r.copy(i)}C.hideCaption||h.setCaption(function(e){let t,n;return T&&T.isZoomed()?(t=0===e.labelFromIndex?0:e.labelFromIndex+1,n=e.labelToIndex===e.totalXWidth-1?e.labelToIndex:e.labelToIndex-1):(t=e.labelFromIndex,n=e.labelToIndex),o=C.xLabels[t],a=C.xLabels[n],Math.abs(a.value-o.value)>864e5?`${H(C.xLabels[t])} — ${H(C.xLabels[n])}`:Z(C.xLabels[t]);var o,a}(e)),G(s,d);const p=1*L(i.reduce(((e,t)=>e+t.length),0));te(d,e,C,n,i,r,c,f,2,a,O,!1,p),C.isPie||(m.drawYAxis(e,r,f),m.drawXAxis(e,r)),g.update(e),M.update(e,i,r,c,f)}function z(e){n.update({range:e})}function N(e){n.update({filter:e})}function R(e){(C.isBars||C.isPie||C.isSteps)&&n.update({focusOn:e})}function Y(e){T.zoomIn(A,e)}function q(){T.zoomOut(A)}D(),document.documentElement.addEventListener("darkmode",(()=>{n.update()})),window.addEventListener("resize",(()=>{window.innerWidth!==I&&(I=window.innerWidth,W())})),window.addEventListener("orientationchange",(()=>{W()}))}}}]);
|
|
//# sourceMappingURL=878.ba2ac4194b79d543b70f.js.map
|