import{_ as t,a as e,i,s as n,b as a,c as r,S as o,d as s,e as l,g as u,j as h,k as c,l as f,n as d,o as v,p as g,t as p,q as m,r as y,u as b,v as x,A as _,w as k,f as w,x as M,h as S,m as P,P as D,y as O,H as A,z as C,D as T,E as R,F as E,G as L,B as I,C as z,a3 as F,X as V,a4 as B,a5 as N,a6 as W,a7 as j,a8 as H,a9 as $,L as Y,aa as U,ab as X,ac as q,ad as K}from"./client.c6d88b36.js";import{_ as G,h as Z,L as J,c as Q,a as tt,b as et}from"./createOctokit.b155e6a6.js";function it(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=s(t);if(e){var a=s(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return l(this,i)}}function nt(t){var e,i,n,a,r,o,s,l,v,g,p,m,y,b,x=t[1].name+"",T=("up"===t[1].status?_.i18n.up:_.i18n.down)+"",R=_.i18n.overallUptimeTitle+"",E=t[1].uptime+"",L=(void 0===t[1].showAverageResponseTime||t[1].showAverageResponseTime)&&rt(t);return{c:function(){e=u("h1"),i=u("a"),n=k(x),r=w(),o=u("span"),s=k(T),v=w(),g=u("dl"),p=u("dt"),m=k(R),y=u("dd"),b=k(E),L&&L.c(),this.h()},l:function(t){e=h(t,"H1",{});var a=c(e);i=h(a,"A",{class:!0,href:!0});var l=c(i);n=M(l,x),l.forEach(f),r=S(a),o=h(a,"SPAN",{class:!0});var u=c(o);s=M(u,T),u.forEach(f),a.forEach(f),v=S(t),g=h(t,"DL",{});var d=c(g);p=h(d,"DT",{});var _=c(p);m=M(_,R),_.forEach(f),y=h(d,"DD",{});var k=c(y);b=M(k,E),k.forEach(f),L&&L.l(d),d.forEach(f),this.h()},h:function(){P(i,"class","no-underline svelte-1d3m0a"),P(i,"href",a=t[1].url.startsWith("$")?"#":t[1].url),P(o,"class",l=D("tag ".concat(t[1].status))+" svelte-1d3m0a")},m:function(t,a){d(t,e,a),O(e,i),O(i,n),O(e,r),O(e,o),O(o,s),d(t,v,a),d(t,g,a),O(g,p),O(p,m),O(g,y),O(y,b),L&&L.m(g,null)},p:function(t,e){2&e&&x!==(x=t[1].name+"")&&A(n,x),2&e&&a!==(a=t[1].url.startsWith("$")?"#":t[1].url)&&P(i,"href",a),2&e&&T!==(T=("up"===t[1].status?_.i18n.up:_.i18n.down)+"")&&A(s,T),2&e&&l!==(l=D("tag ".concat(t[1].status))+" svelte-1d3m0a")&&P(o,"class",l),2&e&&E!==(E=t[1].uptime+"")&&A(b,E),void 0===t[1].showAverageResponseTime||t[1].showAverageResponseTime?L?L.p(t,e):((L=rt(t)).c(),L.m(g,null)):L&&(L.d(1),L=null)},i:C,o:C,d:function(t){t&&f(e),t&&f(v),t&&f(g),L&&L.d()}}}function at(t){var e,i;return e=new J({}),{c:function(){T(e.$$.fragment)},l:function(t){R(e.$$.fragment,t)},m:function(t,n){E(e,t,n),i=!0},p:C,i:function(t){i||(y(e.$$.fragment,t),i=!0)},o:function(t){p(e.$$.fragment,t),i=!1},d:function(t){L(e,t)}}}function rt(t){var e,i,n,a,r,o=_.i18n.averageResponseTimeTitle+"",s=t[1].time+"",l=_.i18n.ms+"";return{c:function(){e=u("dt"),i=k(o),n=u("dd"),a=k(s),r=k(l)},l:function(t){e=h(t,"DT",{});var u=c(e);i=M(u,o),u.forEach(f),n=h(t,"DD",{});var d=c(n);a=M(d,s),r=M(d,l),d.forEach(f)},m:function(t,o){d(t,e,o),O(e,i),d(t,n,o),O(n,a),O(n,r)},p:function(t,e){2&e&&s!==(s=t[1].time+"")&&A(a,s)},d:function(t){t&&f(e),t&&f(n)}}}function ot(t){var e,i,n,a,r=[at,nt],o=[];function s(t,e){return t[0]?0:t[1]?1:-1}return~(i=s(t))&&(n=o[i]=r[i](t)),{c:function(){e=u("section"),n&&n.c()},l:function(t){e=h(t,"SECTION",{});var i=c(e);n&&n.l(i),i.forEach(f)},m:function(t,n){d(t,e,n),~i&&o[i].m(e,null),a=!0},p:function(t,a){var l=v(a,1)[0],u=i;(i=s(t))===u?~i&&o[i].p(t,l):(n&&(g(),p(o[u],1,1,(function(){o[u]=null})),m()),~i?((n=o[i])?n.p(t,l):(n=o[i]=r[i](t)).c(),y(n,1),n.m(e,null)):n=null)},i:function(t){a||(y(n),a=!0)},o:function(t){p(n),a=!1},d:function(t){t&&f(e),~i&&o[i].d()}}}function st(t,e,i){var n=e.slug,a=!0,r=_["status-website"]||{};r.apiBaseUrl;var o=r.userContentBaseUrl;o||(o="https://raw.githubusercontent.com");var s=_.owner,l=_.repo,u=null;return b(G(x.mark((function t(){var e;return x.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("".concat(o,"/").concat(s,"/").concat(l,"/master/history/summary.json"));case 3:return e=t.sent,t.t0=i,t.next=7,e.json();case 7:t.t1=u=t.sent.find((function(t){return t.slug===n})),(0,t.t0)(1,t.t1),t.next=14;break;case 11:t.prev=11,t.t2=t.catch(0),Z(t.t2);case 14:i(0,a=!1);case 15:case"end":return t.stop()}}),t,null,[[0,11]])})))),t.$$set=function(t){"slug"in t&&i(2,n=t.slug)},[a,u,n]}var lt=function(s){t(u,o);var l=it(u);function u(t){var r;return e(this,u),r=l.call(this),i(a(r),t,st,ot,n,{slug:2}),r}return r(u)}();function ut(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=s(t);if(e){var a=s(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return l(this,i)}}function ht(t,e,i){var n=t.slice();return n[6]=e[i],n}function ct(t){for(var e,i,n,a,r=_.i18n.pastIncidents+"",o=t[1],s=[],l=0;l=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw r}}}}function bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=0;a--)e.call(i,t[a],a);else for(a=0;al&&u3&&void 0!==arguments[3]?arguments[3]:1e-6;return t>=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function ge(t,e,i){i=i||function(i){return t[i]1;)i(n=r+a>>1)?r=n:a=n;return{lo:r,hi:a}}var pe=function(t,e,i,n){return ge(t,i,n?function(n){return t[n][e]<=i}:function(n){return t[n][e]=i}))};var ye=["push","pop","shift","splice","unshift"];function be(t,e){var i=t._chartjs;if(i){var n=i.listeners,a=n.indexOf(e);-1!==a&&n.splice(a,1),n.length>0||(ye.forEach((function(e){delete t[e]})),delete t._chartjs)}}function xe(t){var e,i,n=new Set;for(e=0,i=t.length;e=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){return De(t)?t:Oe(t,.075,.3)},easeOutElastic:function(t){return De(t)?t:Ae(t,.075,.3)},easeInOutElastic:function(t){var e=.1125;return De(t)?t:t<.5?.5*Oe(2*t,e,.45):.5+.5*Ae(2*t-1,e,.45)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-Ce.easeOutBounce(1-t)},easeOutBounce:function(t){var e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*Ce.easeInBounce(2*t):.5*Ce.easeOutBounce(2*t-1)+.5}}; /*! * @kurkle/color v0.2.1 * https://github.com/kurkle/color#readme * (c) 2022 Jukka Kurkela * Released under the MIT License */ function Te(t){return t+.5|0}var Re=function(t,e,i){return Math.max(Math.min(t,i),e)};function Ee(t){return Re(Te(2.55*t),0,255)}function Le(t){return Re(Te(255*t),0,255)}function Ie(t){return Re(Te(t/2.55)/100,0,1)}function ze(t){return Re(Te(100*t),0,100)}var Fe={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ve=F("0123456789ABCDEF"),Be=function(t){return Ve[15&t]},Ne=function(t){return Ve[(240&t)>>4]+Ve[15&t]},We=function(t){return(240&t)>>4==(15&t)};function je(t){var e=function(t){return We(t.r)&&We(t.g)&&We(t.b)&&We(t.a)}(t)?Be:Ne;return t?"#"+e(t.r)+e(t.g)+e(t.b)+function(t,e){return t<255?e(t):""}(t.a,e):void 0}var He=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function $e(t,e,i){var n=e*Math.min(i,1-i),a=function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+t/30)%12;return i-n*Math.max(Math.min(a-3,9-a,1),-1)};return[a(0),a(8),a(4)]}function Ye(t,e,i){var n=function(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(n+t/60)%6;return i-i*e*Math.max(Math.min(a,4-a,1),0)};return[n(5),n(3),n(1)]}function Ue(t,e,i){var n,a=$e(t,1,.5);for(e+i>1&&(e*=n=1/(e+i),i*=n),n=0;n<3;n++)a[n]*=1-e-i,a[n]+=e;return a}function Xe(t){var e,i,n,a=t.r/255,r=t.g/255,o=t.b/255,s=Math.max(a,r,o),l=Math.min(a,r,o),u=(s+l)/2;return s!==l&&(n=s-l,i=u>.5?n/(2-s-l):n/(s+l),e=function(t,e,i,n,a){return t===a?(e-i)/n+(e>16&255,i>>8&255,255&i]}return r}()).transparent=[0,0,0,0]);var e=Je[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}var ii=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;var ni=function(t){return t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055},ai=function(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)};function ri(t,e,i){if(t){var n=Xe(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=Ke(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function oi(t,e){return t?Object.assign(e||{},t):t}function si(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Le(t[3]))):(e=oi(t,{r:0,g:0,b:0,a:1})).a=Le(e.a),e}function li(t){return"r"===t.charAt(0)?function(t){var e,i,n,a=ii.exec(t),r=255;if(a){if(a[7]!==e){var o=+a[7];r=a[8]?Ee(o):Re(255*o,0,255)}return e=+a[1],i=+a[3],n=+a[5],{r:e=255&(a[2]?Ee(e):Re(e,0,255)),g:i=255&(a[4]?Ee(i):Re(i,0,255)),b:n=255&(a[6]?Ee(n):Re(n,0,255)),a:r}}}(t):Ze(t)}var ui=function(){function t(i){if(e(this,t),i instanceof t)return i;var n,a,r,o,s=V(i);"object"===s?n=si(i):"string"===s&&(o=(a=i).length,"#"===a[0]&&(4===o||5===o?r={r:255&17*Fe[a[1]],g:255&17*Fe[a[2]],b:255&17*Fe[a[3]],a:5===o?17*Fe[a[4]]:255}:7!==o&&9!==o||(r={r:Fe[a[1]]<<4|Fe[a[2]],g:Fe[a[3]]<<4|Fe[a[4]],b:Fe[a[5]]<<4|Fe[a[6]],a:9===o?Fe[a[7]]<<4|Fe[a[8]]:255})),n=r||ei(i)||li(i)),this._rgb=n,this._valid=!!n}return r(t,[{key:"valid",get:function(){return this._valid}},{key:"rgb",get:function(){var t=oi(this._rgb);return t&&(t.a=Ie(t.a)),t},set:function(t){this._rgb=si(t)}},{key:"rgbString",value:function(){return this._valid?(t=this._rgb)&&(t.a<255?"rgba(".concat(t.r,", ").concat(t.g,", ").concat(t.b,", ").concat(Ie(t.a),")"):"rgb(".concat(t.r,", ").concat(t.g,", ").concat(t.b,")")):void 0;var t}},{key:"hexString",value:function(){return this._valid?je(this._rgb):void 0}},{key:"hslString",value:function(){return this._valid?function(t){if(t){var e=Xe(t),i=e[0],n=ze(e[1]),a=ze(e[2]);return t.a<255?"hsla(".concat(i,", ").concat(n,"%, ").concat(a,"%, ").concat(Ie(t.a),")"):"hsl(".concat(i,", ").concat(n,"%, ").concat(a,"%)")}}(this._rgb):void 0}},{key:"mix",value:function(t,e){if(t){var i,n=this.rgb,a=t.rgb,r=e===i?.5:e,o=2*r-1,s=n.a-a.a,l=((o*s==-1?o:(o+s)/(1+o*s))+1)/2;i=1-l,n.r=255&l*n.r+i*a.r+.5,n.g=255&l*n.g+i*a.g+.5,n.b=255&l*n.b+i*a.b+.5,n.a=r*n.a+(1-r)*a.a,this.rgb=n}return this}},{key:"interpolate",value:function(t,e){return t&&(this._rgb=function(t,e,i){var n=ai(Ie(t.r)),a=ai(Ie(t.g)),r=ai(Ie(t.b));return{r:Le(ni(n+i*(ai(Ie(e.r))-n))),g:Le(ni(a+i*(ai(Ie(e.g))-a))),b:Le(ni(r+i*(ai(Ie(e.b))-r))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}},{key:"clone",value:function(){return new t(this.rgb)}},{key:"alpha",value:function(t){return this._rgb.a=Le(t),this}},{key:"clearer",value:function(t){return this._rgb.a*=1-t,this}},{key:"greyscale",value:function(){var t=this._rgb,e=Te(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}},{key:"opaquer",value:function(t){return this._rgb.a*=1+t,this}},{key:"negate",value:function(){var t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}},{key:"lighten",value:function(t){return ri(this._rgb,2,t),this}},{key:"darken",value:function(t){return ri(this._rgb,2,-t),this}},{key:"saturate",value:function(t){return ri(this._rgb,1,t),this}},{key:"desaturate",value:function(t){return ri(this._rgb,1,-t),this}},{key:"rotate",value:function(t){return function(t,e){var i=Xe(t);i[0]=Ge(i[0]+e),i=Ke(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}]),t}();function hi(t){return new ui(t)}function ci(t){if(t&&"object"===V(t)){var e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function fi(t){return ci(t)?t:hi(t)}function di(t){return ci(t)?t:hi(t).saturate(.5).darken(.1).hexString()}var vi=Object.create(null),gi=Object.create(null);function pi(t,e){if(!e)return t;for(var i=e.split("."),n=0,a=i.length;nn&&(n=r),n}function _i(t,e,i,n){var a=(n=n||{}).data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(a=n.data={},r=n.garbageCollect=[],n.font=e),t.save(),t.font=e;var o,s,l,u,h,c=0,f=i.length;for(o=0;oi.length){for(o=0;o0&&t.stroke()}}function Pi(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y5&&void 0!==arguments[5]?arguments[5]:{},l=Mt(e)?e:[e],u=s.strokeWidth>0&&""!==s.strokeColor;for(t.save(),t.font=a.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]);wt(e.rotation)||t.rotate(e.rotation);e.color&&(t.fillStyle=e.color);e.textAlign&&(t.textAlign=e.textAlign);e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,s),r=0;r1&&void 0!==arguments[1]?arguments[1]:[""],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,a=arguments.length>3?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return t[0]};jt(a)||(a=nn("_fallback",t));var o=(et(e={},Symbol.toStringTag,"Object"),et(e,"_cacheable",!0),et(e,"_scopes",t),et(e,"_rootScopes",n),et(e,"_fallback",a),et(e,"_getTarget",r),et(e,"override",(function(e){return Yi([e].concat(F(t)),i,n,a)})),e);return new Proxy(o,{deleteProperty:function(e,i){return delete e[i],delete e._keys,delete t[0][i],!0},get:function(e,n){return Gi(e,n,(function(){return function(t,e,i,n){var a,r,o=yt(e);try{for(o.s();!(r=o.n()).done;){var s=r.value;if(a=nn(qi(s,t),i),jt(a))return Ki(t,a)?tn(i,n,t,a):a}}catch(t){o.e(t)}finally{o.f()}}(n,i,t,e)}))},getOwnPropertyDescriptor:function(t,e){return Reflect.getOwnPropertyDescriptor(t._scopes[0],e)},getPrototypeOf:function(){return Reflect.getPrototypeOf(t[0])},has:function(t,e){return an(t).includes(e)},ownKeys:function(t){return an(t)},set:function(t,e,i){var n=t._storage||(t._storage=r());return t[e]=n[e]=i,delete t._keys,!0}})}function Ui(t,e,i,n){var a={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Xi(t,n),setContext:function(e){return Ui(t,e,i,n)},override:function(a){return Ui(t.override(a),e,i,n)}};return new Proxy(a,{deleteProperty:function(e,i){return delete e[i],delete t[i],!0},get:function(t,e,i){return Gi(t,e,(function(){return function(t,e,i){var n=t._proxy,a=t._context,r=t._subProxy,o=t._descriptors,s=n[e];Ht(s)&&o.isScriptable(e)&&(s=function(t,e,i,n){var a=i._proxy,r=i._context,o=i._subProxy,s=i._stack;if(s.has(t))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);s.add(t),e=e(r,o||n),s.delete(t),Ki(t,e)&&(e=tn(a._scopes,a,t,e));return e}(e,s,t,i));Mt(s)&&s.length&&(s=function(t,e,i,n){var a=i._proxy,r=i._context,o=i._subProxy,s=i._descriptors;if(jt(r.index)&&n(t))e=e[r.index%e.length];else if(St(e[0])){var l=e,u=a._scopes.filter((function(t){return t!==l}));e=[];var h,c=yt(l);try{for(c.s();!(h=c.n()).done;){var f=tn(u,a,t,h.value);e.push(Ui(f,r,o&&o[t],s))}}catch(t){c.e(t)}finally{c.f()}}return e}(e,s,t,o.isIndexable));Ki(e,s)&&(s=Ui(s,a,r&&r[e],o));return s}(t,e,i)}))},getOwnPropertyDescriptor:function(e,i){return e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf:function(){return Reflect.getPrototypeOf(t)},has:function(e,i){return Reflect.has(t,i)},ownKeys:function(){return Reflect.ownKeys(t)},set:function(e,i,n){return t[i]=n,delete e[i],!0}})}function Xi(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{scriptable:!0,indexable:!0},i=t._scriptable,n=void 0===i?e.scriptable:i,a=t._indexable,r=void 0===a?e.indexable:a,o=t._allKeys;return{allKeys:void 0===o?e.allKeys:o,scriptable:n,indexable:r,isScriptable:Ht(n)?n:function(){return n},isIndexable:Ht(r)?r:function(){return r}}}var qi=function(t,e){return t?t+Wt(e):e},Ki=function(t,e){return St(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object)};function Gi(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];var n=i();return t[e]=n,n}function Zi(t,e,i){return Ht(t)?t(e,i):t}var Ji=function(t,e){return!0===t?e:"string"==typeof t?Nt(e,t):void 0};function Qi(t,e,i,n,a){var r,o=yt(e);try{for(o.s();!(r=o.n()).done;){var s=r.value,l=Ji(i,s);if(l){t.add(l);var u=Zi(l._fallback,i,a);if(jt(u)&&u!==i&&u!==n)return u}else if(!1===l&&jt(n)&&i!==n)return null}}catch(t){o.e(t)}finally{o.f()}return!1}function tn(t,e,i,n){var a=e._rootScopes,r=Zi(e._fallback,i,n),o=[].concat(F(t),F(a)),s=new Set;s.add(n);var l=en(s,o,i,r||i,n);return null!==l&&((!jt(r)||r===i||null!==(l=en(s,o,r,l,n)))&&Yi(Array.from(s),[""],a,r,(function(){return function(t,e,i){var n=t._getTarget();e in n||(n[e]={});var a=n[e];if(Mt(a)&&St(i))return i;return a}(e,i,n)})))}function en(t,e,i,n,a){for(;i;)i=Qi(t,e,i,n,a);return i}function nn(t,e){var i,n=yt(e);try{for(n.s();!(i=n.n()).done;){var a=i.value;if(a){var r=a[t];if(jt(r))return r}}}catch(t){n.e(t)}finally{n.f()}}function an(t){var e=t._keys;return e||(e=t._keys=function(t){var e,i=new Set,n=yt(t);try{for(n.s();!(e=n.n()).done;){var a,r=e.value,o=yt(Object.keys(r).filter((function(t){return!t.startsWith("_")})));try{for(o.s();!(a=o.n()).done;){var s=a.value;i.add(s)}}catch(t){o.e(t)}finally{o.f()}}}catch(t){n.e(t)}finally{n.f()}return Array.from(i)}(t._scopes)),e}function rn(t,e,i,n){var a,r,o,s,l=t.iScale,u=this._parsing.key,h=void 0===u?"r":u,c=new Array(n);for(a=0,r=n;a1&&void 0!==arguments[1]?arguments[1]:"x",r=ln(a),o=t.length,s=Array(o).fill(0),l=Array(o),u=sn(t,0);for(e=0;e2&&void 0!==arguments[2]?arguments[2]:"x",o=ln(r),s=t.length,l=sn(t,0),u=0;u0||e>0)&&(!i||!i.shadowRoot)};function bn(t,e){if("native"in t)return t;var i=e.canvas,n=e.currentDevicePixelRatio,a=gn(i),r="border-box"===a.boxSizing,o=mn(a,"padding"),s=mn(a,"border","width"),l=function(t,e){var i,n,a=t.touches,r=a&&a.length?a[0]:t,o=r.offsetX,s=r.offsetY,l=!1;if(yn(o,s,t.target))i=o,n=s;else{var u=e.getBoundingClientRect();i=r.clientX-u.left,n=r.clientY-u.top,l=!0}return{x:i,y:n,box:l}}(t,i),u=l.x,h=l.y,c=l.box,f=o.left+(c&&s.left),d=o.top+(c&&s.top),v=e.width,g=e.height;return r&&(v-=o.width+s.width,g-=o.height+s.height),{x:Math.round((u-f)/v*i.width/n),y:Math.round((h-d)/g*i.height/n)}}var xn=function(t){return Math.round(10*t)/10};function _n(t,e,i,n){var a=gn(t),r=mn(a,"margin"),o=vn(a.maxWidth,t,"clientWidth")||qt,s=vn(a.maxHeight,t,"clientHeight")||qt,l=function(t,e,i){var n,a;if(void 0===e||void 0===i){var r=dn(t);if(r){var o=r.getBoundingClientRect(),s=gn(r),l=mn(s,"border","width"),u=mn(s,"padding");e=o.width-u.width-l.width,i=o.height-u.height-l.height,n=vn(s.maxWidth,r,"clientWidth"),a=vn(s.maxHeight,r,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||qt,maxHeight:a||qt}}(t,e,i),u=l.width,h=l.height;if("content-box"===a.boxSizing){var c=mn(a,"border","width"),f=mn(a,"padding");u-=f.width+c.width,h-=f.height+c.height}return u=Math.max(0,u-r.width),h=Math.max(0,n?Math.floor(u/n):h-r.height),u=xn(Math.min(u,o,l.maxWidth)),h=xn(Math.min(h,s,l.maxHeight)),u&&!h&&(h=xn(u/2)),{width:u,height:h}}function kn(t,e,i){var n=e||1,a=Math.floor(t.height*n),r=Math.floor(t.width*n);t.height=a/n,t.width=r/n;var o=t.canvas;return o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height="".concat(t.height,"px"),o.style.width="".concat(t.width,"px")),(t.currentDevicePixelRatio!==n||o.height!==a||o.width!==r)&&(t.currentDevicePixelRatio=n,o.height=a,o.width=r,t.ctx.setTransform(n,0,0,n,0,0),!0)}var wn=function(){var t=!1;try{var e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Mn(t,e){var i=function(t,e){return gn(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Sn(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Pn(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function Dn(t,e,i,n){var a={x:t.cp2x,y:t.cp2y},r={x:e.cp1x,y:e.cp1y},o=Sn(t,a,i),s=Sn(a,r,i),l=Sn(r,e,i),u=Sn(o,s,i),h=Sn(s,l,i);return Sn(u,h,i)}var On=new Map;function An(t,e,i){return function(t,e){e=e||{};var i=t+JSON.stringify(e),n=On.get(i);return n||(n=new Intl.NumberFormat(t,e),On.set(i,n)),n}(e,i).format(t)}function Cn(t,e,i){return t?function(t,e){return{x:function(i){return t+t+e-i},setWidth:function(t){e=t},textAlign:function(t){return"center"===t?t:"right"===t?"left":"right"},xPlus:function(t,e){return t-e},leftForLtr:function(t,e){return t-e}}}(e,i):{x:function(t){return t},setWidth:function(t){},textAlign:function(t){return t},xPlus:function(t,e){return t+e},leftForLtr:function(t,e){return t}}}function Tn(t,e){var i,n;"ltr"!==e&&"rtl"!==e||(n=[(i=t.canvas.style).getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function Rn(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function En(t){return"angle"===t?{between:fe,compare:he,normalize:ce}:{between:ve,compare:function(t,e){return t-e},normalize:function(t){return t}}}function Ln(t){var e=t.start,i=t.end,n=t.count;return{start:e%n,end:i%n,loop:t.loop&&(i-e+1)%n==0,style:t.style}}function In(t,e,i){if(!i)return[t];for(var n,a,r,o=i.property,s=i.start,l=i.end,u=e.length,h=En(o),c=h.compare,f=h.between,d=h.normalize,v=function(t,e,i){var n,a,r=i.property,o=i.start,s=i.end,l=En(r),u=l.between,h=l.normalize,c=e.length,f=t.start,d=t.end,v=t.loop;if(v){for(f+=c,d+=c,n=0,a=c;n=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw r}}}}function $n(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:Date.now(),i=0;this._charts.forEach((function(n,a){if(n.running&&n.items.length){for(var r,o=n.items,s=o.length-1,l=!1;s>=0;--s)(r=o[s])._active?(r._total>n.duration&&(n.duration=r._total),r.tick(e),l=!0):(o[s]=o[o.length-1],o.pop());l&&(a.draw(),t._notify(a,n,e,"progress")),o.length||(n.running=!1,t._notify(a,n,e,"complete"),n.initial=!1),i+=o.length}})),this._lastDate=e,0===i&&(this._running=!1)}},{key:"_getAnims",value:function(t){var e=this._charts,i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}},{key:"listen",value:function(t,e,i){this._getAnims(t).listeners[e].push(i)}},{key:"add",value:function(t,e){var i;e&&e.length&&(i=this._getAnims(t).items).push.apply(i,F(e))}},{key:"has",value:function(t){return this._getAnims(t).items.length>0}},{key:"start",value:function(t){var e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((function(t,e){return Math.max(t,e._duration)}),0),this._refresh())}},{key:"running",value:function(t){if(!this._running)return!1;var e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}},{key:"stop",value:function(t){var e=this._charts.get(t);if(e&&e.items.length){for(var i=e.items,n=i.length-1;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}}},{key:"remove",value:function(t){return this._charts.delete(t)}}]),t}()),Un="transparent",Xn={boolean:function(t,e,i){return i>.5?e:t},color:function(t,e,i){var n=fi(t||Un),a=n.valid&&fi(e||Un);return a&&a.valid?a.mix(n,i).hexString():e},number:function(t,e,i){return t+(e-t)*i}},qn=function(){function t(i,n,a,r){e(this,t);var o=n[a];r=Hi([i.to,r,o,i.from]);var s=Hi([i.from,o,r]);this._active=!0,this._fn=i.fn||Xn[i.type||V(s)],this._easing=Ce[i.easing]||Ce.linear,this._start=Math.floor(Date.now()+(i.delay||0)),this._duration=this._total=Math.floor(i.duration),this._loop=!!i.loop,this._target=n,this._prop=a,this._from=s,this._to=r,this._promises=void 0}return r(t,[{key:"active",value:function(){return this._active}},{key:"update",value:function(t,e,i){if(this._active){this._notify(!1);var n=this._target[this._prop],a=i-this._start,r=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=Hi([t.to,e,n,t.from]),this._from=Hi([t.from,n,e])}}},{key:"cancel",value:function(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}},{key:"tick",value:function(t){var e,i=t-this._start,n=this._duration,a=this._prop,r=this._from,o=this._loop,s=this._to;if(this._active=r!==s&&(o||i1?2-e:e,e=this._easing(Math.min(1,Math.max(0,e))),this._target[a]=this._fn(r,s,e))}},{key:"wait",value:function(){var t=this._promises||(this._promises=[]);return new Promise((function(e,i){t.push({res:e,rej:i})}))}},{key:"_notify",value:function(t){for(var e=t?"res":"rej",i=this._promises||[],n=0;n=0;--i){var l=o[i];if("$"!==l.charAt(0))if("options"!==l){var u=e[l],h=r[l],c=n.get(l);if(h){if(c&&h.active()){h.update(c,u,s);continue}h.cancel()}c&&c.duration?(r[l]=h=new qn(c,t,l,u),a.push(h)):t[l]=u}else a.push.apply(a,F(this._animateOptions(t,e)))}return a}},{key:"update",value:function(t,e){if(0!==this._properties.size){var i=this._createAnimations(t,e);return i.length?(Yn.add(this._chart,i),!0):void 0}Object.assign(t,e)}}]),t}();function Zn(t,e){var i=t&&t.options||{},n=i.reverse,a=void 0===i.min?e:0,r=void 0===i.max?e:0;return{start:n?r:a,end:n?a:r}}function Jn(t,e){var i,n,a=[],r=t._getSortedDatasetMetas(e);for(i=0,n=r.length;i3&&void 0!==arguments[3]?arguments[3]:{},l=t.keys,u="single"===s.mode;if(null!==e){for(n=0,a=l.length;n0||!i&&s<0)return o.index}}catch(t){r.e(t)}finally{r.f()}return null}function na(t,e){for(var i,n=t.chart,a=t._cachedMeta,r=n._stacks||(n._stacks={}),o=a.iScale,s=a.vScale,l=a.index,u=o.axis,h=s.axis,c=function(t,e,i){return"".concat(t.id,".").concat(e.id,".").concat(i.stack||i.type)}(o,s,a),f=e.length,d=0;d0&&r._parsed[t-1];if(!1===this._parsing)r._parsed=o,r._sorted=!0,a=o;else{a=Mt(o[t])?this.parseArrayData(r,o,t,e):St(o[t])?this.parseObjectData(r,o,t,e):this.parsePrimitiveData(r,o,t,e);for(i=0;ie||d=0;--i)if(!v()){this.updateRangeFromParsed(h,t,n,u);break}return h}},{key:"getAllParsedValues",value:function(t){var e,i,n,a=this._cachedMeta._parsed,r=[];for(e=0,i=a.length;e=0&&t1&&void 0!==arguments[1]?arguments[1]:"default",n=arguments.length>2?arguments[2]:void 0,a="active"===i,r=this._cachedDataOpts,o=t+"-"+i,s=r[o],l=this.enableOptionSharing&&jt(n);if(s)return sa(s,l);var u=this.chart.config,h=u.datasetElementScopeKeys(this._type,t),c=a?["".concat(t,"Hover"),"hover",t,""]:[t,""],f=u.getOptionScopes(this.getDataset(),h),d=Object.keys(bi.elements[t]),v=u.resolveNamedOptions(f,d,(function(){return e.getContext(n,a)}),c);return v.$shared&&(v.$shared=l,r[o]=Object.freeze(sa(v,l))),v}},{key:"_resolveAnimations",value:function(t,e,i){var n,a=this.chart,r=this._cachedDataOpts,o="animation-".concat(e),s=r[o];if(s)return s;if(!1!==a.options.animation){var l=this.chart.config,u=l.datasetAnimationScopeKeys(this._type,e),h=l.getOptionScopes(this.getDataset(),u);n=l.createResolver(h,this.getContext(t,i,e))}var c=new Gn(a,n&&n.animations);return n&&n._cacheable&&(r[o]=Object.freeze(c)),c}},{key:"getSharedOptions",value:function(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}},{key:"includeOptions",value:function(t,e){return!e||oa(t)||this.chart._animationsDisabled}},{key:"_getSharedOptions",value:function(t,e){var i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,a=this.getSharedOptions(i),r=this.includeOptions(e,a)||a!==n;return this.updateSharedOptions(a,e,i),{sharedOptions:a,includeOptions:r}}},{key:"updateElement",value:function(t,e,i,n){oa(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}},{key:"updateSharedOptions",value:function(t,e,i){t&&!oa(e)&&this._resolveAnimations(void 0,e).update(t,i)}},{key:"_setStyle",value:function(t,e,i,n){t.active=n;var a=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(a)||a})}},{key:"removeHoverStyle",value:function(t,e,i){this._setStyle(t,i,"active",!1)}},{key:"setHoverStyle",value:function(t,e,i){this._setStyle(t,i,"active",!0)}},{key:"_removeDatasetHoverStyle",value:function(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}},{key:"_setDatasetHoverStyle",value:function(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}},{key:"_resyncElements",value:function(t){var e,i=this._data,n=this._cachedMeta.data,a=Hn(this._syncList);try{for(a.s();!(e=a.n()).done;){var r=v(e.value,3),o=r[0],s=r[1],l=r[2];this[o](s,l)}}catch(t){a.e(t)}finally{a.f()}this._syncList=[];var u=n.length,h=i.length,c=Math.min(h,u);c&&this.parse(0,c),h>u?this._insertElements(u,h-u,t):h2&&void 0!==arguments[2])||arguments[2],a=this._cachedMeta,r=a.data,o=t+e,s=function(t){for(t.length+=e,i=t.length-1;i>=o;i--)t[i]=t[i-e]};for(s(r),i=t;iMath.abs(s)&&(l=s,u=o),e[i.axis]=u,e._custom={barStart:l,barEnd:u,start:a,end:r,min:o,max:s}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function ca(t,e,i,n){var a,r,o,s,l=t.iScale,u=t.vScale,h=l.getLabels(),c=l===u,f=[];for(a=i,r=i+n;at.x,i="left",n="right"):(e=t.base=i?1:-1)}(i,a,u)*l,d===u&&(m-=i/2);var y=a.getPixelForDecimal(0),b=a.getPixelForDecimal(1),x=Math.min(y,b),_=Math.max(y,b);e=(m=Math.max(Math.min(m,_),x))+i}if(m===a.getPixelForValue(u)){var k=te(i)*a.getLineWidthForValue(u)/2;m+=k,i-=k}return{size:i,base:m,head:e,center:e+i/2}}},{key:"_calculateBarIndexPixels",value:function(t,e){var i,n,a=e.scale,r=this.options,o=r.skipNull,s=Ot(r.maxBarThickness,1/0);if(e.grouped){var l=o?this._getStackCount(t):e.stackCount,u="flex"===r.barThickness?function(t,e,i,n){var a=e.pixels,r=a[t],o=t>0?a[t-1]:null,s=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}},{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,i=e.xScale,n=e.yScale,a=this.getParsed(t),r=i.getLabelForValue(a.x),o=n.getLabelForValue(a.y),s=a._custom;return{label:e.label,value:"("+r+", "+o+(s?", "+s:"")+")"}}},{key:"update",value:function(t){var e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}},{key:"updateElements",value:function(t,e,i,n){for(var a="reset"===n,r=this._cachedMeta,o=r.iScale,s=r.vScale,l=this._getSharedOptions(e,n),u=l.sharedOptions,h=l.includeOptions,c=o.axis,f=s.axis,d=e;d0&&!isNaN(t)?Ut*(Math.abs(t)/e):0}},{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,i=this.chart,n=i.data.labels||[],a=An(e._parsed[t],i.options.locale);return{label:n[t]||"",value:a}}},{key:"getMaxBorderWidth",value:function(t){var e,i,n,a,r,o=0,s=this.chart;if(!t)for(e=0,i=s.data.datasets.length;e0&&this.getParsed(e-1),_=e;_0&&Math.abs(w[d]-x[d])>y,m&&(M.parsed=w,M.raw=u.data[_]),f&&(M.options=c||this.resolveDataElementOptions(_,k.active?"active":n)),b||this.updateElement(k,_,M,n),x=w}}},{key:"getMaxOverflow",value:function(){var t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;var a=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,a,r)/2}},{key:"draw",value:function(){var t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),B(s(a.prototype),"draw",this).call(this)}}]),a}();xa.id="line",xa.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},xa.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var _a=function(i){t(a,la);var n=jn(a);function a(t,i){var r;return e(this,a),(r=n.call(this,t,i)).innerRadius=void 0,r.outerRadius=void 0,r}return r(a,[{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,i=this.chart,n=i.data.labels||[],a=An(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:a}}},{key:"parseObjectData",value:function(t,e,i,n){return rn.bind(this)(t,e,i,n)}},{key:"update",value:function(t){var e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}},{key:"getMinMax",value:function(){var t=this,e=this._cachedMeta,i={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((function(e,n){var a=t.getParsed(n).r;!isNaN(a)&&t.chart.getDataVisibility(n)&&(ai.max&&(i.max=a))})),i}},{key:"_updateRadius",value:function(){var t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(n/2,0),r=(a-Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=a-r*this.index,this.innerRadius=this.outerRadius-r}},{key:"updateElements",value:function(t,e,i,n){var a,r="reset"===n,o=this.chart,s=o.options.animation,l=this._cachedMeta.rScale,u=l.xCenter,h=l.yCenter,c=l.getIndexAngle(0)-.5*Yt,f=c,d=360/this.countVisibleElements();for(a=0;a1){var o=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(o<1e-4||o>1e15)&&(n="scientific"),r=function(t,e){var i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}var s=Qt(Math.abs(r)),l=Math.max(Math.min(-1*Math.floor(s),20),0),u={notation:n,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(u,this.options.ticks.format),An(t,a,u)},logarithmic:function(t,e,i){if(0===t)return"0";var n=t/Math.pow(10,Math.floor(Qt(t)));return 1===n||2===n||5===n?Sa.numeric.call(this,t,e,i):""}};var Pa={formatters:Sa};function Da(t,e){var i=t.options.ticks,n=i.maxTicksLimit||function(t){var e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),a=t._maxLength/i;return Math.floor(Math.min(n,a))}(t),a=i.major.enabled?function(t){var e,i,n=[];for(e=0,i=t.length;en)return function(t,e,i,n){var a,r=0,o=i[0];for(n=Math.ceil(n),a=0;aa)return l}return Math.max(a,1)}(a,e,n);if(r>0){var h,c,f=r>1?Math.round((s-o)/(r-1)):null;for(Oa(e,l,u,wt(f)?0:o-f,o),h=0,c=r-1;hs+l)))return u}function Ra(t){return t.drawTicks?t.tickLength:0}function Ea(t,e){if(!t.display)return 0;var i=ji(t.font,e),n=Wi(t.padding);return(Mt(t.text)?t.text.length:1)*i.lineHeight+n.height}function La(t,e,i){var n=we(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=function(t){return"left"===t?"right":"right"===t?"left":t}(n)),n}var Ia=function(i){t(a,Ma);var n=jn(a);function a(t){var i;return e(this,a),(i=n.call(this)).id=t.id,i.type=t.type,i.options=void 0,i.ctx=t.ctx,i.chart=t.chart,i.top=void 0,i.bottom=void 0,i.left=void 0,i.right=void 0,i.width=void 0,i.height=void 0,i._margins={left:0,right:0,top:0,bottom:0},i.maxWidth=void 0,i.maxHeight=void 0,i.paddingTop=void 0,i.paddingBottom=void 0,i.paddingLeft=void 0,i.paddingRight=void 0,i.axis=void 0,i.labelRotation=void 0,i.min=void 0,i.max=void 0,i._range=void 0,i.ticks=[],i._gridLineItems=null,i._labelItems=null,i._labelSizes=null,i._length=0,i._maxLength=0,i._longestTextCache={},i._startPixel=void 0,i._endPixel=void 0,i._reversePixels=!1,i._userMax=void 0,i._userMin=void 0,i._suggestedMax=void 0,i._suggestedMin=void 0,i._ticksLength=0,i._borderValue=0,i._cache={},i._dataLimitsCached=!1,i.$context=void 0,i}return r(a,[{key:"init",value:function(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}},{key:"parse",value:function(t,e){return t}},{key:"getUserBounds",value:function(){var t=this._userMin,e=this._userMax,i=this._suggestedMin,n=this._suggestedMax;return t=Dt(t,Number.POSITIVE_INFINITY),e=Dt(e,Number.NEGATIVE_INFINITY),i=Dt(i,Number.POSITIVE_INFINITY),n=Dt(n,Number.NEGATIVE_INFINITY),{min:Dt(t,i),max:Dt(e,n),minDefined:Pt(t),maxDefined:Pt(e)}}},{key:"getMinMax",value:function(t){var e,i=this.getUserBounds(),n=i.min,a=i.max,r=i.minDefined,o=i.maxDefined;if(r&&o)return{min:n,max:a};for(var s=this.getMatchingVisibleMetas(),l=0,u=s.length;la?a:n,Dt(a=r&&n>a?n:a,n)),max:Dt(a,Dt(n,a))}}},{key:"getPadding",value:function(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}},{key:"getTicks",value:function(){return this.ticks}},{key:"getLabels",value:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}},{key:"beforeLayout",value:function(){this._cache={},this._dataLimitsCached=!1}},{key:"beforeUpdate",value:function(){Ct(this.options.beforeUpdate,[this])}},{key:"update",value:function(t,e,i){var n=this.options,a=n.beginAtZero,r=n.grace,o=n.ticks,s=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){var n=t.min,a=t.max,r=At(e,(a-n)/2),o=function(t,e){return i&&0===t?0:t+e};return{min:o(n,-Math.abs(r)),max:o(a,r)}}(this,r,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();var l=s=s||r<=1||!this.isHorizontal())this.labelRotation=o;else{var u=this._getLabelSizes(),h=u.widest.width,c=u.highest.height,f=de(this.chart.width-h,0,this.maxWidth);h+6>(t=n.offset?this.maxWidth/r:f/(r-1))&&(t=f/(r-(n.offset?.5:1)),e=this.maxHeight-Ra(n.grid)-a.padding-Ea(n.title,this.chart.options.font),i=Math.sqrt(h*h+c*c),l=oe(Math.min(Math.asin(de((u.highest.height+6)/t,-1,1)),Math.asin(de(e/i,-1,1))-Math.asin(de(c/i,-1,1)))),l=Math.max(o,Math.min(s,l))),this.labelRotation=l}}},{key:"afterCalculateLabelRotation",value:function(){Ct(this.options.afterCalculateLabelRotation,[this])}},{key:"afterAutoSkip",value:function(){}},{key:"beforeFit",value:function(){Ct(this.options.beforeFit,[this])}},{key:"fit",value:function(){var t={width:0,height:0},e=this.chart,i=this.options,n=i.ticks,a=i.title,r=i.grid,o=this._isVisible(),s=this.isHorizontal();if(o){var l=Ea(a,e.options.font);if(s?(t.width=this.maxWidth,t.height=Ra(r)+l):(t.height=this.maxHeight,t.width=Ra(r)+l),n.display&&this.ticks.length){var u=this._getLabelSizes(),h=u.first,c=u.last,f=u.widest,d=u.highest,v=2*n.padding,g=re(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(s){var y=n.mirror?0:m*f.width+p*d.height;t.height=Math.min(this.maxHeight,t.height+y+v)}else{var b=n.mirror?0:p*f.width+m*d.height;t.width=Math.min(this.maxWidth,t.width+b+v)}this._calculatePadding(h,c,m,p)}}this._handleMargins(),s?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}},{key:"_calculatePadding",value:function(t,e,i,n){var a=this.options,r=a.ticks,o=r.align,s=r.padding,l=a.position,u=0!==this.labelRotation,h="top"!==l&&"x"===this.axis;if(this.isHorizontal()){var c=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1),d=0,v=0;u?h?(d=n*t.width,v=i*e.height):(d=i*t.height,v=n*e.width):"start"===o?v=e.width:"end"===o?d=t.width:"inner"!==o&&(d=t.width/2,v=e.width/2),this.paddingLeft=Math.max((d-c+s)*this.width/(this.width-c),0),this.paddingRight=Math.max((v-f+s)*this.width/(this.width-f),0)}else{var g=e.height/2,p=t.height/2;"start"===o?(g=0,p=t.height):"end"===o&&(g=e.height,p=0),this.paddingTop=g+s,this.paddingBottom=p+s}}},{key:"_handleMargins",value:function(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}},{key:"afterFit",value:function(){Ct(this.options.afterFit,[this])}},{key:"isHorizontal",value:function(){var t=this.options,e=t.axis,i=t.position;return"top"===i||"bottom"===i||"x"===e}},{key:"isFullSize",value:function(){return this.options.fullSize}},{key:"_convertTicksToLabels",value:function(t){var e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;ee){for(i=0;ie.length-1?null:this.getPixelForValue(e[t].value)}},{key:"getPixelForDecimal",value:function(t){this._reversePixels&&(t=1-t);var e=this._startPixel+t*this._length;return de(this._alignToPixels?ki(this.chart,e,0):e,-32768,32767)}},{key:"getDecimalForPixel",value:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}},{key:"getBasePixel",value:function(){return this.getPixelForValue(this.getBaseValue())}},{key:"getBaseValue",value:function(){var t=this.min,e=this.max;return t<0&&e<0?e:t>0&&e>0?t:0}},{key:"getContext",value:function(t){var e=this.ticks||[];if(t>=0&&to*n?o/i:s/n:s*n0}},{key:"_computeGridLineItems",value:function(t){var e,i,n,a,r,o,s,l,u,h,c,f,d=this.axis,v=this.chart,g=this.options,p=g.grid,m=g.position,y=p.offset,b=this.isHorizontal(),x=this.ticks.length+(y?1:0),_=Ra(p),k=[],w=p.setContext(this.getContext()),M=w.drawBorder?w.borderWidth:0,S=M/2,P=function(t){return ki(v,t,M)};if("top"===m)e=P(this.bottom),o=this.bottom-_,l=e-S,h=P(t.top)+S,f=t.bottom;else if("bottom"===m)e=P(this.top),h=t.top,f=P(t.bottom)-S,o=e+S,l=this.top+_;else if("left"===m)e=P(this.right),r=this.right-_,s=e-S,u=P(t.left)+S,c=t.right;else if("right"===m)e=P(this.left),u=t.left,c=P(t.right)-S,r=e+S,s=this.left+_;else if("x"===d){if("center"===m)e=P((t.top+t.bottom)/2+.5);else if(St(m)){var D=Object.keys(m)[0],O=m[D];e=P(this.chart.scales[D].getPixelForValue(O))}h=t.top,f=t.bottom,l=(o=e+S)+_}else if("y"===d){if("center"===m)e=P((t.left+t.right)/2);else if(St(m)){var A=Object.keys(m)[0],C=m[A];e=P(this.chart.scales[A].getPixelForValue(C))}s=(r=e-S)-_,u=t.left,c=t.right}var T=Ot(g.ticks.maxTicksLimit,x),R=Math.max(1,Math.ceil(x/T));for(i=0;i=0?e.setContext(this.getContext(i)).lineWidth:0}},{key:"drawGrid",value:function(t){var e,i,n=this.options.grid,a=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o=function(t,e,i){i.width&&i.color&&(a.save(),a.lineWidth=i.width,a.strokeStyle=i.color,a.setLineDash(i.borderDash||[]),a.lineDashOffset=i.borderDashOffset,a.beginPath(),a.moveTo(t.x,t.y),a.lineTo(e.x,e.y),a.stroke(),a.restore())};if(n.display)for(e=0,i=r.length;e0&&this.getParsed(e-1),_=e;_0&&Math.abs(w[d]-x[d])>y,m&&(M.parsed=w,M.raw=u.data[_]),f&&(M.options=c||this.resolveDataElementOptions(_,k.active?"active":n)),b||this.updateElement(k,_,M,n),x=w}this.updateSharedOptions(c,n,h)}},{key:"getMaxOverflow",value:function(){var t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){for(var i=0,n=e.length-1;n>=0;--n)i=Math.max(i,e[n].size(this.resolveDataElementOptions(n))/2);return i>0&&i}var a=t.dataset,r=a.options&&a.options.borderWidth||0;if(!e.length)return r;var o=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,o,s)/2}}]),a}();Ba.id="scatter",Ba.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1},Ba.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:function(){return""},label:function(t){return"("+t.label+", "+t.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var Na=Object.freeze({__proto__:null,BarController:ma,BubbleController:ya,DoughnutController:ba,LineController:xa,PolarAreaController:_a,PieController:ka,RadarController:wa,ScatterController:Ba});function Wa(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var ja=function(){function t(i){e(this,t),this.options=i||{}}return r(t,[{key:"init",value:function(t){}},{key:"formats",value:function(){return Wa()}},{key:"parse",value:function(t,e){return Wa()}},{key:"format",value:function(t,e){return Wa()}},{key:"add",value:function(t,e,i){return Wa()}},{key:"diff",value:function(t,e,i){return Wa()}},{key:"startOf",value:function(t,e,i){return Wa()}},{key:"endOf",value:function(t,e){return Wa()}}]),t}();ja.override=function(t){Object.assign(ja.prototype,t)};var Ha={_date:ja};function $a(t,e,i,n){var a=t.controller,r=t.data,o=t._sorted,s=a._cachedMeta.iScale;if(s&&e===s.axis&&"r"!==e&&o&&r.length){var l=s._reversePixels?me:pe;if(!n)return l(r,e,i);if(a._sharedOptions){var u=r[0],h="function"==typeof u.getRange&&u.getRange(e);if(h){var c=l(r,e,i-h),f=l(r,e,i+h);return{lo:c.lo,hi:f.hi}}}}return{lo:0,hi:r.length-1}}function Ya(t,e,i,n,a){for(var r=t.getSortedVisibleDatasetMetas(),o=i[e],s=0,l=r.length;s0){var l=s[0].datasetIndex,u=t.getDatasetMeta(l).data;s=[];for(var h=0;h3&&void 0!==arguments[3]?arguments[3]:[""],a={$shared:!0},r=jr(this._resolverCache,t,n),o=r.resolver,s=r.subPrefixes,l=o;(function(t,e){var i,n=Xi(t),a=n.isScriptable,r=n.isIndexable,o=Hn(e);try{for(o.s();!(i=o.n()).done;){var s=i.value,l=a(s),u=r(s),h=(u||l)&&t[s];if(l&&(Ht(h)||Hr(h))||u&&Mt(h))return!0}}catch(t){o.e(t)}finally{o.f()}return!1})(o,e)&&(a.$shared=!1,l=Ui(o,i=Ht(i)?i():i,this.createResolver(t,i,s)));var u,h=Hn(e);try{for(h.s();!(u=h.n()).done;){var c=u.value;a[c]=l[c]}}catch(t){h.e(t)}finally{h.f()}return a}},{key:"createResolver",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""],n=arguments.length>3?arguments[3]:void 0,a=jr(this._resolverCache,t,i).resolver;return St(e)?Ui(a,e,void 0,n):a}}]),t}();function jr(t,e,i){var n=t.get(e);n||(n=new Map,t.set(e,n));var a=i.join(),r=n.get(a);r||(r={resolver:Yi(e,i),subPrefixes:i.filter((function(t){return!t.toLowerCase().includes("hover")}))},n.set(a,r));return r}var Hr=function(t){return St(t)&&Object.getOwnPropertyNames(t).reduce((function(e,i){return e||Ht(t[i])}),!1)};var $r=["top","bottom","left","right","chartArea"];function Yr(t,e){return"top"===t||"bottom"===t||-1===$r.indexOf(t)&&"x"===e}function Ur(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function Xr(t){var e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),Ct(i&&i.onComplete,[t],e)}function qr(t){var e=t.chart,i=e.options.animation;Ct(i&&i.onProgress,[t],e)}function Kr(t){return fn()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}var Gr={},Zr=function(t){var e=Kr(t);return Object.values(Gr).filter((function(t){return t.canvas===e})).pop()};function Jr(t,e,i){for(var n=0,a=Object.keys(t);n=e){var s=t[r];delete t[r],(i>0||o>e)&&(t[o+i]=s)}}}var Qr=function(){function t(i,n){var a=this;e(this,t);var r=this.config=new Wr(n),o=Kr(i),s=Zr(o);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");var l=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||function(t){return!fn()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?vr:Ar}(o)),this.platform.updateConfig(r);var u,h,c,f=this.platform.acquireContext(o,l.aspectRatio),d=f&&f.canvas,v=d&&d.height,g=d&&d.width;this.id=kt(),this.ctx=f,this.canvas=d,this.width=g,this.height=v,this._options=l,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Cr,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(u=function(t){return a.update(t)},h=l.resizeDelay||0,function(){for(var t=arguments.length,e=new Array(t),i=0;ie){for(var n=e;ni.length&&delete this._stacks,e.forEach((function(e,n){0===i.filter((function(t){return t===e._dataset})).length&&t._destroyDatasetMeta(n)}))}},{key:"buildOrUpdateControllers",value:function(){var t,e,i=[],n=this.data.datasets;for(this._removeUnreferencedMetasets(),t=0,e=n.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}}},{key:"_drawDataset",value:function(t){var e=this.ctx,i=t._clip,n=!i.disabled,a=this.chartArea,r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(n&&Di(e,{left:!1===i.left?0:a.left-i.left,right:!1===i.right?this.width:a.right+i.right,top:!1===i.top?0:a.top-i.top,bottom:!1===i.bottom?this.height:a.bottom+i.bottom}),t.controller.draw(),n&&Oi(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}},{key:"isPointInArea",value:function(t){return Pi(t,this.chartArea,this._minPadding)}},{key:"getElementsAtEventForMode",value:function(t,e,i,n){var a=Ga.modes[e];return"function"==typeof a?a(this,t,i,n):[]}},{key:"getDatasetMeta",value:function(t){var e=this.data.datasets[t],i=this._metasets,n=i.filter((function(t){return t&&t._dataset===e})).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}},{key:"getContext",value:function(){return this.$context||(this.$context=$i(null,{chart:this,type:"chart"}))}},{key:"getVisibleDatasetCount",value:function(){return this.getSortedVisibleDatasetMetas().length}},{key:"isDatasetVisible",value:function(t){var e=this.data.datasets[t];if(!e)return!1;var i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}},{key:"setDatasetVisibility",value:function(t,e){this.getDatasetMeta(t).hidden=!e}},{key:"toggleDataVisibility",value:function(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}},{key:"getDataVisibility",value:function(t){return!this._hiddenIndices[t]}},{key:"_updateVisibility",value:function(t,e,i){var n=i?"show":"hide",a=this.getDatasetMeta(t),r=a.controller._resolveAnimations(void 0,n);jt(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(a,{visible:i}),this.update((function(e){return e.datasetIndex===t?n:void 0})))}},{key:"hide",value:function(t,e){this._updateVisibility(t,e,!1)}},{key:"show",value:function(t,e){this._updateVisibility(t,e,!0)}},{key:"_destroyDatasetMeta",value:function(t){var e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}},{key:"_stop",value:function(){var t,e;for(this.stop(),Yn.remove(this),t=0,e=this.data.datasets.length;ta?(u=a/l,t.arc(r,o,l,i+u,n-u,!0)):t.arc(r,o,a,i+Gt,n-Gt),t.closePath(),t.clip()}function no(t,e,i,n){var a=Vi(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),r=(i-e)/2,o=Math.min(r,n*e/2),s=function(t){var e=(i-Math.min(r,t))*n/2;return de(t,0,Math.min(r,e))};return{outerStart:s(a.outerStart),outerEnd:s(a.outerEnd),innerStart:de(a.innerStart,0,o),innerEnd:de(a.innerEnd,0,o)}}function ao(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function ro(t,e,i,n,a,r){var o=e.x,s=e.y,l=e.startAngle,u=e.pixelMargin,h=e.innerRadius,c=Math.max(e.outerRadius+n+i-u,0),f=h>0?h+n+i+u:0,d=0,v=a-l;if(n){var g=((h>0?h-n:0)+(c>0?c-n:0))/2;d=(v-(0!==g?v*g/(g+n):v))/2}var p=(v-Math.max(.001,v*c-i/Yt)/c)/2,m=l+p+d,y=a-p-d,b=no(e,f,c,y-m),x=b.outerStart,_=b.outerEnd,k=b.innerStart,w=b.innerEnd,M=c-x,S=c-_,P=m+x/M,D=y-_/S,O=f+k,A=f+w,C=m+k/O,T=y-w/A;if(t.beginPath(),r){if(t.arc(o,s,c,P,D),_>0){var R=ao(S,D,o,s);t.arc(R.x,R.y,_,D,y+Gt)}var E=ao(A,y,o,s);if(t.lineTo(E.x,E.y),w>0){var L=ao(A,T,o,s);t.arc(L.x,L.y,w,y+Gt,T+Math.PI)}if(t.arc(o,s,f,y-w/f,m+k/f,!0),k>0){var I=ao(O,C,o,s);t.arc(I.x,I.y,k,C+Math.PI,m-Gt)}var z=ao(M,m,o,s);if(t.lineTo(z.x,z.y),x>0){var F=ao(M,P,o,s);t.arc(F.x,F.y,x,m-Gt,P)}}else{t.moveTo(o,s);var V=Math.cos(P)*c+o,B=Math.sin(P)*c+s;t.lineTo(V,B);var N=Math.cos(D)*c+o,W=Math.sin(D)*c+s;t.lineTo(N,W)}t.closePath()}function oo(t,e,i,n,a,r){var o=e.options,s=o.borderWidth,l=o.borderJoinStyle,u="inner"===o.borderAlign;s&&(u?(t.lineWidth=2*s,t.lineJoin=l||"round"):(t.lineWidth=s,t.lineJoin=l||"bevel"),e.fullCircles&&function(t,e,i){var n,a=e.x,r=e.y,o=e.startAngle,s=e.pixelMargin,l=e.fullCircles,u=Math.max(e.outerRadius-s,0),h=e.innerRadius+s;for(i&&io(t,e,o+Ut),t.beginPath(),t.arc(a,r,h,o+Ut,o,!0),n=0;n=Ut||fe(a,s,l),v=ve(r,u+f,h+f);return d&&v}},{key:"getCenterPoint",value:function(t){var e=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),i=e.x,n=e.y,a=e.startAngle,r=e.endAngle,o=e.innerRadius,s=e.outerRadius,l=this.options,u=l.offset,h=(a+r)/2,c=(o+s+l.spacing+u)/2;return{x:i+Math.cos(h)*c,y:n+Math.sin(h)*c}}},{key:"tooltipPosition",value:function(t){return this.getCenterPoint(t)}},{key:"draw",value:function(t){var e=this.options,i=this.circumference,n=(e.offset||0)/2,a=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>Ut?Math.floor(i/Ut):0,!(0===i||this.innerRadius<0||this.outerRadius<0)){t.save();var o=0;if(n){o=n/2;var s=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(s)*o,Math.sin(s)*o),this.circumference>=Yt&&(o=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;var l=function(t,e,i,n,a){var r=e.fullCircles,o=e.startAngle,s=e.circumference,l=e.endAngle;if(r){ro(t,e,i,n,o+Ut,a);for(var u=0;u2&&void 0!==arguments[2]?arguments[2]:e;t.lineCap=Ot(i.borderCapStyle,e.borderCapStyle),t.setLineDash(Ot(i.borderDash,e.borderDash)),t.lineDashOffset=Ot(i.borderDashOffset,e.borderDashOffset),t.lineJoin=Ot(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Ot(i.borderWidth,e.borderWidth),t.strokeStyle=Ot(i.borderColor,e.borderColor)}function uo(t,e,i){t.lineTo(i.x,i.y)}function ho(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.length,a=i.start,r=void 0===a?0:a,o=i.end,s=void 0===o?n-1:o,l=e.start,u=e.end,h=Math.max(r,l),c=Math.min(s,u),f=ru&&s>u;return{count:n,start:h,loop:e.loop,ilen:cl&&(l=M),b=(x*b+w)/++x):(k(),t.lineTo(w,M),o=S,x=0,s=l=M),u=M}k()}function vo(t){var e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?fo:co}so.id="arc",so.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0},so.defaultRoutes={backgroundColor:"backgroundColor"};var go="function"==typeof Path2D;function po(t,e,i,n){go&&!e.options.segment?function(t,e,i,n){var a=e._path;a||(a=e._path=new Path2D,e.path(a,i,n)&&a.closePath()),lo(t,e.options),t.stroke(a)}(t,e,i,n):function(t,e,i,n){var a,r=e.segments,o=e.options,s=vo(e),l=Hn(r);try{for(l.s();!(a=l.n()).done;){var u=a.value;lo(t,o,u.style),t.beginPath(),s(t,e,u,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}}catch(t){l.e(t)}finally{l.f()}}(t,e,i,n)}var mo=function(i){t(o,Ma);var n=jn(o);function o(t){var i;return e(this,o),(i=n.call(this)).animated=!0,i.options=void 0,i._chart=void 0,i._loop=void 0,i._fullLoop=void 0,i._path=void 0,i._points=void 0,i._segments=void 0,i._decimated=!1,i._pointsUpdated=!1,i._datasetIndex=void 0,t&&Object.assign(a(i),t),i}return r(o,[{key:"updateControlPoints",value:function(t,e){var i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){var n=i.spanGaps?this._loop:this._fullLoop;cn(this._points,i,t,n,e),this._pointsUpdated=!0}}},{key:"points",get:function(){return this._points},set:function(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}},{key:"segments",get:function(){return this._segments||(this._segments=function(t,e){var i=t.points,n=t.options.spanGaps,a=i.length;if(!a)return[];var r=!!t._loop,o=function(t,e,i,n){var a=0,r=e-1;if(i&&!n)for(;aa&&t[r%e].skip;)r--;return{start:a,end:r%=e}}(i,a,r,n),s=o.start,l=o.end;return Fn(t,!0===n?[{start:s,end:l,loop:r}]:function(t,e,i,n){var a,r=t.length,o=[],s=e,l=t[e];for(a=e+1;a<=i;++a){var u=t[a%r];u.skip||u.stop?l.skip||(n=!1,o.push({start:e%r,end:(a-1)%r,loop:n}),e=s=u.stop?a:null):(s=a,l.skip&&(e=a)),l=u}return null!==s&&o.push({start:e%r,end:s%r,loop:n}),o}(i,s,l2&&void 0!==arguments[2]?arguments[2]:{},n=t.x!==i.x?-e:0,a=t.y!==i.y?-e:0,r=(t.x+t.w!==i.x+i.w?e:0)-n,o=(t.y+t.h!==i.y+i.h?e:0)-a;return{x:t.x+n,y:t.y+a,w:t.w+r,h:t.h+o,radius:t.radius}}bo.id="point",bo.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},bo.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var Po=function(i){t(o,Ma);var n=jn(o);function o(t){var i;return e(this,o),(i=n.call(this)).options=void 0,i.horizontal=void 0,i.base=void 0,i.width=void 0,i.height=void 0,i.inflateAmount=void 0,t&&Object.assign(a(i),t),i}return r(o,[{key:"draw",value:function(t){var e,i=this.inflateAmount,n=this.options,a=n.borderColor,r=n.backgroundColor,o=ko(this),s=o.inner,l=o.outer,u=(e=l.radius).topLeft||e.topRight||e.bottomLeft||e.bottomRight?Ei:Mo;t.save(),l.w===s.w&&l.h===s.h||(t.beginPath(),u(t,So(l,i,s)),t.clip(),u(t,So(s,-i,l)),t.fillStyle=a,t.fill("evenodd")),t.beginPath(),u(t,So(s,i)),t.fillStyle=r,t.fill(),t.restore()}},{key:"inRange",value:function(t,e,i){return wo(this,t,e,i)}},{key:"inXRange",value:function(t,e){return wo(this,t,null,e)}},{key:"inYRange",value:function(t,e){return wo(this,null,t,e)}},{key:"getCenterPoint",value:function(t){var e=this.getProps(["x","y","base","horizontal"],t),i=e.x,n=e.y,a=e.base,r=e.horizontal;return{x:r?(i+a)/2:i,y:r?n:(n+a)/2}}},{key:"getRange",value:function(t){return"x"===t?this.width/2:this.height/2}}]),o}();Po.id="bar",Po.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},Po.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var Do=Object.freeze({__proto__:null,ArcElement:so,LineElement:mo,PointElement:bo,BarElement:Po});function Oo(t){if(t._decimated){var e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function Ao(t){t.data.datasets.forEach((function(t){Oo(t)}))}var Co={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:function(t,e,i){if(i.enabled){var n=t.width;t.data.datasets.forEach((function(e,a){var r=e._data,o=e.indexAxis,s=t.getDatasetMeta(a),l=r||e.data;if("y"!==Hi([o,t.options.indexAxis])&&s.controller.supportsDecimation){var u=t.scales[s.xAxisID];if(("linear"===u.type||"time"===u.type)&&!t.options.parsing){var h=function(t,e){var i=e.length,n=0,a=t.iScale,r=a.getUserBounds(),o=r.min,s=r.max,l=r.minDefined,u=r.maxDefined;return l&&(n=de(pe(e,a.axis,o).lo,0,i-1)),{start:n,count:u?de(pe(e,a.axis,s).hi+1,n,i)-n:i-n}}(s,l),c=h.start,f=h.count;if(f<=(i.threshold||4*n))Oo(e);else{var d;switch(wt(r)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":d=function(t,e,i,n,a){var r=a.samples||n;if(r>=i)return t.slice(e,e+i);var o,s,l,u,h,c=[],f=(i-2)/(r-2),d=0,v=e+i-1,g=e;for(c[d++]=t[g],o=0;ol&&(l=u,s=t[y],h=y);c[d++]=s,g=h}return c[d++]=t[v],c}(l,c,f,n,i);break;case"min-max":d=function(t,e,i,n){var a,r,o,s,l,u,h,c,f,d,v=0,g=0,p=[],m=e+i-1,y=t[e].x,b=t[m].x-y;for(a=e;ad&&(d=s,h=a),v=(g*v+r.x)/++g;else{var _=a-1;if(!wt(u)&&!wt(h)){var k=Math.min(u,h),w=Math.max(u,h);k!==c&&k!==_&&p.push(Wn(Wn({},t[k]),{},{x:v})),w!==c&&w!==_&&p.push(Wn(Wn({},t[w]),{},{x:v}))}a>0&&_!==c&&p.push(t[_]),p.push(r),l=x,g=0,f=d=s,u=h=c=a}}return p}(l,c,f,n);break;default:throw new Error("Unsupported decimation algorithm '".concat(i.algorithm,"'"))}e._decimated=d}}}}))}else Ao(t)},destroy:function(t){Ao(t)}};function To(t,e,i,n){if(!n){var a=e[t],r=i[t];return"angle"===t&&(a=ce(a),r=ce(r)),{property:t,start:a,end:r}}}function Ro(t,e,i){for(;e>t;e--){var n=i[e];if(!isNaN(n.x)&&!isNaN(n.y))break}return e}function Eo(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Lo(t,e){var i=[],n=!1;return Mt(t)?(n=!0,i=t):i=function(t,e){var i=t||{},n=i.x,a=void 0===n?null:n,r=i.y,o=void 0===r?null:r,s=e.points,l=[];return e.segments.forEach((function(t){var e=t.start,i=t.end;i=Ro(e,i,s);var n=s[e],r=s[i];null!==o?(l.push({x:n.x,y:o}),l.push({x:r.x,y:o})):null!==a&&(l.push({x:a,y:n.y}),l.push({x:a,y:r.y}))})),l}(t,e),i.length?new mo({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function Io(t){return t&&!1!==t.fill}function zo(t,e,i){var n,a=t[e].fill,r=[e];if(!i)return a;for(;!1!==a&&-1===r.indexOf(a);){if(!Pt(a))return a;if(!(n=t[a]))return!1;if(n.visible)return a;r.push(a),a=n.fill}return!1}function Fo(t,e,i){var n=function(t){var e=t.options,i=e.fill,n=Ot(i&&i.target,i);void 0===n&&(n=!!e.backgroundColor);if(!1===n||null===n)return!1;if(!0===n)return"origin";return n}(t);if(St(n))return!isNaN(n.value)&&n;var a=parseFloat(n);return Pt(a)&&Math.floor(a)===a?function(t,e,i,n){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=n)return!1;return i}(n[0],e,a,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function Vo(t,e,i){for(var n=[],a=0;a=0;--o){var s=a[o].$filler;s&&(s.line.updateControlPoints(r,s.axis),n&&s.fill&&jo(t.ctx,s,r))}},beforeDatasetsDraw:function(t,e,i){if("beforeDatasetsDraw"===i.drawTime)for(var n=t.getSortedVisibleDatasetMetas(),a=n.length-1;a>=0;--a){var r=n[a].$filler;Io(r)&&jo(t.ctx,r,t.chartArea)}},beforeDatasetDraw:function(t,e,i){var n=e.meta.$filler;Io(n)&&"beforeDatasetDraw"===i.drawTime&&jo(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},qo=function(t,e){var i=t.boxHeight,n=void 0===i?e:i,a=t.boxWidth,r=void 0===a?e:a;return t.usePointStyle&&(n=Math.min(n,e),r=t.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(e,n)}},Ko=function(i){t(a,Ma);var n=jn(a);function a(t){var i;return e(this,a),(i=n.call(this))._added=!1,i.legendHitBoxes=[],i._hoveredItem=null,i.doughnutMode=!1,i.chart=t.chart,i.options=t.options,i.ctx=t.ctx,i.legendItems=void 0,i.columnSizes=void 0,i.lineWidths=void 0,i.maxHeight=void 0,i.maxWidth=void 0,i.top=void 0,i.bottom=void 0,i.left=void 0,i.right=void 0,i.height=void 0,i.width=void 0,i._margins=void 0,i.position=void 0,i.weight=void 0,i.fullSize=void 0,i}return r(a,[{key:"update",value:function(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}},{key:"setDimensions",value:function(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}},{key:"buildLabels",value:function(){var t=this,e=this.options.labels||{},i=Ct(e.generateLabels,[this.chart],this)||[];e.filter&&(i=i.filter((function(i){return e.filter(i,t.chart.data)}))),e.sort&&(i=i.sort((function(i,n){return e.sort(i,n,t.chart.data)}))),this.options.reverse&&i.reverse(),this.legendItems=i}},{key:"fit",value:function(){var t=this.options,e=this.ctx;if(t.display){var i,n,a=t.labels,r=ji(a.font),o=r.size,s=this._computeTitleHeight(),l=qo(a,o),u=l.boxWidth,h=l.itemHeight;e.font=r.string,this.isHorizontal()?(i=this.maxWidth,n=this._fitRows(s,o,u,h)+10):(n=this.maxHeight,i=this._fitCols(s,o,u,h)+10),this.width=Math.min(i,t.maxWidth||this.maxWidth),this.height=Math.min(n,t.maxHeight||this.maxHeight)}else this.width=this.height=0}},{key:"_fitRows",value:function(t,e,i,n){var a=this.ctx,r=this.maxWidth,o=this.options.labels.padding,s=this.legendHitBoxes=[],l=this.lineWidths=[0],u=n+o,h=t;a.textAlign="left",a.textBaseline="middle";var c=-1,f=-u;return this.legendItems.forEach((function(t,d){var v=i+e/2+a.measureText(t.text).width;(0===d||l[l.length-1]+v+2*o>r)&&(h+=u,l[l.length-(d>0?0:1)]=0,f+=u,c++),s[d]={left:0,top:f,row:c,width:v,height:n},l[l.length-1]+=v+o})),h}},{key:"_fitCols",value:function(t,e,i,n){var a=this.ctx,r=this.maxHeight,o=this.options.labels.padding,s=this.legendHitBoxes=[],l=this.columnSizes=[],u=r-t,h=o,c=0,f=0,d=0,v=0;return this.legendItems.forEach((function(t,r){var g=i+e/2+a.measureText(t.text).width;r>0&&f+n+2*o>u&&(h+=c+o,l.push({width:c,height:f}),d+=c+o,v++,c=f=0),s[r]={left:d,top:f,col:v,width:g,height:n},c=Math.max(c,g),f+=n+o})),h+=c,l.push({width:c,height:f}),h}},{key:"adjustHitBoxes",value:function(){if(this.options.display){var t=this._computeTitleHeight(),e=this.legendHitBoxes,i=this.options,n=i.align,a=i.labels.padding,r=Cn(i.rtl,this.left,this.width);if(this.isHorizontal()){var o,s=0,l=Me(n,this.left+a,this.right-this.lineWidths[s]),u=Hn(e);try{for(u.s();!(o=u.n()).done;){var h=o.value;s!==h.row&&(s=h.row,l=Me(n,this.left+a,this.right-this.lineWidths[s])),h.top+=this.top+t+a,h.left=r.leftForLtr(r.x(l),h.width),l+=h.width+a}}catch(t){u.e(t)}finally{u.f()}}else{var c,f=0,d=Me(n,this.top+t+a,this.bottom-this.columnSizes[f].height),v=Hn(e);try{for(v.s();!(c=v.n()).done;){var g=c.value;g.col!==f&&(f=g.col,d=Me(n,this.top+t+a,this.bottom-this.columnSizes[f].height)),g.top=d,g.left+=this.left+a,g.left=r.leftForLtr(r.x(g.left),g.width),d+=g.height+a}}catch(t){v.e(t)}finally{v.f()}}}}},{key:"isHorizontal",value:function(){return"top"===this.options.position||"bottom"===this.options.position}},{key:"draw",value:function(){if(this.options.display){var t=this.ctx;Di(t,this),this._draw(),Oi(t)}}},{key:"_draw",value:function(){var t,e=this,i=this.options,n=this.columnSizes,a=this.lineWidths,r=this.ctx,o=i.align,s=i.labels,l=bi.color,u=Cn(i.rtl,this.left,this.width),h=ji(s.font),c=s.color,f=s.padding,d=h.size,v=d/2;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=h.string;var g=qo(s,d),p=g.boxWidth,m=g.boxHeight,y=g.itemHeight,b=this.isHorizontal(),x=this._computeTitleHeight();t=b?{x:Me(o,this.left+f,this.right-a[0]),y:this.top+f+x,line:0}:{x:this.left+f,y:Me(o,this.top+x+f,this.bottom-n[0].height),line:0},Tn(this.ctx,i.textDirection);var _=y+f;this.legendItems.forEach((function(g,k){r.strokeStyle=g.fontColor||c,r.fillStyle=g.fontColor||c;var w=r.measureText(g.text).width,M=u.textAlign(g.textAlign||(g.textAlign=s.textAlign)),S=p+v+w,P=t.x,D=t.y;u.setWidth(e.width),b?k>0&&P+S+f>e.right&&(D=t.y+=_,t.line++,P=t.x=Me(o,e.left+f,e.right-a[t.line])):k>0&&D+_>e.bottom&&(P=t.x=P+n[t.line].width+f,t.line++,D=t.y=Me(o,e.top+x+f,e.bottom-n[t.line].height)),function(t,e,i){if(!(isNaN(p)||p<=0||isNaN(m)||m<0)){r.save();var n=Ot(i.lineWidth,1);if(r.fillStyle=Ot(i.fillStyle,l),r.lineCap=Ot(i.lineCap,"butt"),r.lineDashOffset=Ot(i.lineDashOffset,0),r.lineJoin=Ot(i.lineJoin,"miter"),r.lineWidth=n,r.strokeStyle=Ot(i.strokeStyle,l),r.setLineDash(Ot(i.lineDash,[])),s.usePointStyle){var a={radius:m*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},o=u.xPlus(t,p/2);Si(r,a,o,e+v,s.pointStyleWidth&&p)}else{var h=e+Math.max((d-m)/2,0),c=u.leftForLtr(t,p),f=Ni(i.borderRadius);r.beginPath(),Object.values(f).some((function(t){return 0!==t}))?Ei(r,{x:c,y:h,w:p,h:m,radius:f}):r.rect(c,h,p,m),r.fill(),0!==n&&r.stroke()}r.restore()}}(u.x(P),D,g),P=function(t,e,i,n){return t===(n?"left":"right")?i:"center"===t?(e+i)/2:e}(M,P+p+v,b?P+S:e.right,i.rtl),function(t,e,i){Ti(r,i.text,t,e+y/2,h,{strikethrough:i.hidden,textAlign:u.textAlign(i.textAlign)})}(u.x(P),D,g),b?t.x+=S+f:t.y+=_})),Rn(this.ctx,i.textDirection)}},{key:"drawTitle",value:function(){var t=this.options,e=t.title,i=ji(e.font),n=Wi(e.padding);if(e.display){var a,r=Cn(t.rtl,this.left,this.width),o=this.ctx,s=e.position,l=i.size/2,u=n.top+l,h=this.left,c=this.width;if(this.isHorizontal())c=Math.max.apply(Math,F(this.lineWidths)),a=this.top+u,h=Me(t.align,h,this.right-c);else{var f=this.columnSizes.reduce((function(t,e){return Math.max(t,e.height)}),0);a=u+Me(t.align,this.top,this.bottom-f-t.labels.padding-this._computeTitleHeight())}var d=Me(s,h,h+c);o.textAlign=r.textAlign(we(s)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Ti(o,e.text,d,a,i)}}},{key:"_computeTitleHeight",value:function(){var t=this.options.title,e=ji(t.font),i=Wi(t.padding);return t.display?e.lineHeight+i.height:0}},{key:"_getLegendItemAt",value:function(t,e){var i,n,a;if(ve(t,this.left,this.right)&&ve(e,this.top,this.bottom))for(a=this.legendHitBoxes,i=0;i-1?t.split("\n"):t}function as(t,e){var i=e.element,n=e.datasetIndex,a=e.index,r=t.getDatasetMeta(n).controller,o=r.getLabelAndValue(a),s=o.label,l=o.value;return{chart:t,label:s,parsed:r.getParsed(a),raw:t.data.datasets[n].data[a],formattedValue:l,dataset:r.getDataset(),dataIndex:a,datasetIndex:n,element:i}}function rs(t,e){var i=t.chart.ctx,n=t.body,a=t.footer,r=t.title,o=e.boxWidth,s=e.boxHeight,l=ji(e.bodyFont),u=ji(e.titleFont),h=ji(e.footerFont),c=r.length,f=a.length,d=n.length,v=Wi(e.padding),g=v.height,p=0,m=n.reduce((function(t,e){return t+e.before.length+e.lines.length+e.after.length}),0);(m+=t.beforeBody.length+t.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),m)&&(g+=d*(e.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(m-d)*l.lineHeight+(m-1)*e.bodySpacing);f&&(g+=e.footerMarginTop+f*h.lineHeight+(f-1)*e.footerSpacing);var y=0,b=function(t){p=Math.max(p,i.measureText(t).width+y)};return i.save(),i.font=u.string,Tt(t.title,b),i.font=l.string,Tt(t.beforeBody.concat(t.afterBody),b),y=e.displayColors?o+2+e.boxPadding:0,Tt(n,(function(t){Tt(t.before,b),Tt(t.lines,b),Tt(t.after,b)})),y=0,i.font=h.string,Tt(t.footer,b),i.restore(),{width:p+=v.width,height:g}}function os(t,e,i,n){var a=i.x,r=i.width,o=t.width,s=t.chartArea,l=s.left,u=s.right,h="center";return"center"===n?h=a<=(l+u)/2?"left":"right":a<=r/2?h="left":a>=o-r/2&&(h="right"),function(t,e,i,n){var a=n.x,r=n.width,o=i.caretSize+i.caretPadding;return"left"===t&&a+r+o>e.width||"right"===t&&a-r-o<0||void 0}(h,t,e,i)&&(h="center"),h}function ss(t,e,i){var n=i.yAlign||e.yAlign||function(t,e){var i=e.y,n=e.height;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||os(t,e,i,n),yAlign:n}}function ls(t,e,i,n){var a=t.caretSize,r=t.caretPadding,o=t.cornerRadius,s=i.xAlign,l=i.yAlign,u=a+r,h=Ni(o),c=h.topLeft,f=h.topRight,d=h.bottomLeft,v=h.bottomRight,g=function(t,e){var i=t.x,n=t.width;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,s),p=function(t,e,i){var n=t.y,a=t.height;return"top"===e?n+=i:n-="bottom"===e?a+i:a/2,n}(e,l,u);return"center"===l?"left"===s?g+=u:"right"===s&&(g-=u):"left"===s?g-=Math.max(c,d)+a:"right"===s&&(g+=Math.max(f,v)+a),{x:de(g,0,n.width-e.width),y:de(p,0,n.height-e.height)}}function us(t,e,i){var n=Wi(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function hs(t){return is([],ns(t))}function cs(t,e){var i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}var fs=function(i){t(a,Ma);var n=jn(a);function a(t){var i;return e(this,a),(i=n.call(this)).opacity=0,i._active=[],i._eventPosition=void 0,i._size=void 0,i._cachedAnimations=void 0,i._tooltipItems=[],i.$animations=void 0,i.$context=void 0,i.chart=t.chart||t._chart,i._chart=i.chart,i.options=t.options,i.dataPoints=void 0,i.title=void 0,i.beforeBody=void 0,i.body=void 0,i.afterBody=void 0,i.footer=void 0,i.xAlign=void 0,i.yAlign=void 0,i.x=void 0,i.y=void 0,i.height=void 0,i.width=void 0,i.caretX=void 0,i.caretY=void 0,i.labelColors=void 0,i.labelPointStyles=void 0,i.labelTextColors=void 0,i}return r(a,[{key:"initialize",value:function(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}},{key:"_resolveAnimations",value:function(){var t=this._cachedAnimations;if(t)return t;var e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,a=new Gn(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}},{key:"getContext",value:function(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,i=this._tooltipItems,$i(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}},{key:"getTitle",value:function(t,e){var i=e.callbacks,n=i.beforeTitle.apply(this,[t]),a=i.title.apply(this,[t]),r=i.afterTitle.apply(this,[t]),o=[];return o=is(o,ns(n)),o=is(o,ns(a)),o=is(o,ns(r))}},{key:"getBeforeBody",value:function(t,e){return hs(e.callbacks.beforeBody.apply(this,[t]))}},{key:"getBody",value:function(t,e){var i=this,n=e.callbacks,a=[];return Tt(t,(function(t){var e={before:[],lines:[],after:[]},r=cs(n,t);is(e.before,ns(r.beforeLabel.call(i,t))),is(e.lines,r.label.call(i,t)),is(e.after,ns(r.afterLabel.call(i,t))),a.push(e)})),a}},{key:"getAfterBody",value:function(t,e){return hs(e.callbacks.afterBody.apply(this,[t]))}},{key:"getFooter",value:function(t,e){var i=e.callbacks,n=i.beforeFooter.apply(this,[t]),a=i.footer.apply(this,[t]),r=i.afterFooter.apply(this,[t]),o=[];return o=is(o,ns(n)),o=is(o,ns(a)),o=is(o,ns(r))}},{key:"_createItems",value:function(t){var e,i,n=this,a=this._active,r=this.chart.data,o=[],s=[],l=[],u=[];for(e=0,i=a.length;e0&&e.stroke()}},{key:"_updateAnimationTarget",value:function(t){var e=this.chart,i=this.$animations,n=i&&i.x,a=i&&i.y;if(n||a){var r=es[t.position].call(this,this._active,this._eventPosition);if(!r)return;var o=this._size=rs(this,t),s=Object.assign({},r,this._size),l=ss(e,t,s),u=ls(t,s,l,e);n._to===u.x&&a._to===u.y||(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=o.width,this.height=o.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,u))}}},{key:"_willRender",value:function(){return!!this.opacity}},{key:"draw",value:function(t){var e=this.options.setContext(this.getContext()),i=this.opacity;if(i){this._updateAnimationTarget(e);var n={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;var r=Wi(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,n,e),Tn(t,e.textDirection),a.y+=r.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),Rn(t,e.textDirection),t.restore())}}},{key:"getActiveElements",value:function(){return this._active||[]}},{key:"setActiveElements",value:function(t,e){var i=this,n=this._active,a=t.map((function(t){var e=t.datasetIndex,n=t.index,a=i.chart.getDatasetMeta(e);if(!a)throw new Error("Cannot find a dataset at index "+e);return{datasetIndex:e,element:a.data[n],index:n}})),r=!Rt(n,a),o=this._positionChanged(a,e);(r||o)&&(this._active=a,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}},{key:"handleEvent",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;var n=this.options,a=this._active||[],r=this._getActiveElements(t,a,e,i),o=this._positionChanged(r,t),s=e||!Rt(r,a)||o;return s&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),s}},{key:"_getActiveElements",value:function(t,e,i,n){var a=this.options;if("mouseout"===t.type)return[];if(!n)return e;var r=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&r.reverse(),r}},{key:"_positionChanged",value:function(t,e){var i=this.caretX,n=this.caretY,a=this.options,r=es[a.position].call(this,t,e);return!1!==r&&(i!==r.x||n!==r.y)}}]),a}();fs.positioners=es;var ds={id:"tooltip",_element:fs,positioners:es,afterInit:function(t,e,i){i&&(t.tooltip=new fs({chart:t,options:i}))},beforeUpdate:function(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset:function(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw:function(t){var e=t.tooltip;if(e&&e._willRender()){var i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",i))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent:function(t,e){if(t.tooltip){var i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:function(t,e){return e.bodyFont.size},boxWidth:function(t,e){return e.bodyFont.size},multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:xt,title:function(t){if(t.length>0){var e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex=0&&te.length-1?null:this.getPixelForValue(e[t].value)}},{key:"getValueForPixel",value:function(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}},{key:"getBasePixel",value:function(){return this.bottom}}]),a}();function ms(t,e){var i,n,a,r,o,s,l,u=[],h=t.bounds,c=t.step,f=t.min,d=t.max,v=t.precision,g=t.count,p=t.maxTicks,m=t.maxDigits,y=t.includeBounds,b=c||1,x=p-1,_=e.min,k=e.max,w=!wt(f),M=!wt(d),S=!wt(g),P=(k-_)/(m+1),D=ee((k-_)/x/b)*b;if(D<1e-14&&!w&&!M)return[{value:_},{value:k}];(r=Math.ceil(k/D)-Math.floor(_/D))>x&&(D=ee(r*D/x/b)*b),wt(v)||(i=Math.pow(10,v),D=Math.ceil(D*i)/i),"ticks"===h?(n=Math.floor(_/D)*D,a=Math.ceil(k/D)*D):(n=_,a=k),w&&M&&c&&(o=(d-f)/c,s=D/1e3,(l=Math.round(o))-s<=o&&l+s>=o)?(D=(d-f)/(r=Math.round(Math.min((d-f)/D,p))),n=f,a=d):S?D=((a=M?d:a)-(n=w?f:n))/(r=g-1):r=ne(r=(a-n)/D,Math.round(r),D/1e3)?Math.round(r):Math.ceil(r);var O=Math.max(se(D),se(n));i=Math.pow(10,wt(v)?O:v),n=Math.round(n*i)/i,a=Math.round(a*i)/i;var A=0;for(w&&(y&&n!==f?(u.push({value:f}),n0&&u>0&&o(0)}if(a===r){var h=1;(r>=Number.MAX_SAFE_INTEGER||a<=Number.MIN_SAFE_INTEGER)&&(h=Math.abs(.05*r)),s(r+h),t||o(a-h)}this.min=a,this.max=r}},{key:"getTickLimit",value:function(){var t,e=this.options.ticks,i=e.maxTicksLimit,n=e.stepSize;return n?(t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1)>1e3&&(console.warn("scales.".concat(this.id,".ticks.stepSize: ").concat(n," would result generating up to ").concat(t," ticks. Limiting to 1000.")),t=1e3):(t=this.computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t}},{key:"computeTickLimit",value:function(){return Number.POSITIVE_INFINITY}},{key:"buildTicks",value:function(){var t=this.options,e=t.ticks,i=this.getTickLimit(),n=ms({maxTicks:i=Math.max(2,i),bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&ae(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}},{key:"configure",value:function(){var t=this.ticks,e=this.min,i=this.max;if(B(s(a.prototype),"configure",this).call(this),this.options.offset&&t.length){var n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}},{key:"getLabelForValue",value:function(t){return An(t,this.chart.options.locale,this.options.ticks.format)}}]),a}(),xs=function(i){t(a,bs);var n=jn(a);function a(){return e(this,a),n.apply(this,arguments)}return r(a,[{key:"determineDataLimits",value:function(){var t=this.getMinMax(!0),e=t.min,i=t.max;this.min=Pt(e)?e:0,this.max=Pt(i)?i:1,this.handleTickRangeOptions()}},{key:"computeTickLimit",value:function(){var t=this.isHorizontal(),e=t?this.width:this.height,i=re(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,a.lineHeight/n))}},{key:"getPixelForValue",value:function(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}},{key:"getValueForPixel",value:function(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}]),a}();function _s(t){return 1===t/Math.pow(10,Math.floor(Qt(t)))}xs.id="linear",xs.defaults={ticks:{callback:Pa.formatters.numeric}};var ks=function(i){t(a,Ia);var n=jn(a);function a(t){var i;return e(this,a),(i=n.call(this,t)).start=void 0,i.end=void 0,i._startValue=void 0,i._valueRange=0,i}return r(a,[{key:"parse",value:function(t,e){var i=bs.prototype.parse.apply(this,[t,e]);if(0!==i)return Pt(i)&&i>0?i:null;this._zero=!0}},{key:"determineDataLimits",value:function(){var t=this.getMinMax(!0),e=t.min,i=t.max;this.min=Pt(e)?Math.max(0,e):null,this.max=Pt(i)?Math.max(0,i):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}},{key:"handleTickRangeOptions",value:function(){var t=this.getUserBounds(),e=t.minDefined,i=t.maxDefined,n=this.min,a=this.max,r=function(t){return n=e?n:t},o=function(t){return a=i?a:t},s=function(t,e){return Math.pow(10,Math.floor(Qt(t))+e)};n===a&&(n<=0?(r(1),o(10)):(r(s(n,-1)),o(s(a,1)))),n<=0&&r(s(a,-1)),a<=0&&o(s(n,1)),this._zero&&this.min!==this._suggestedMin&&n===s(this.min,0)&&r(s(n,-1)),this.min=n,this.max=a}},{key:"buildTicks",value:function(){var t=this.options,e=function(t,e){var i=Math.floor(Qt(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),a=[],r=Dt(t.min,Math.pow(10,Math.floor(Qt(e.min)))),o=Math.floor(Qt(r)),s=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do{a.push({value:r,major:_s(r)}),10==++s&&(s=1,l=++o>=0?1:l),r=Math.round(s*Math.pow(10,o)*l)/l}while(oa?{start:e-i,end:e}:{start:e,end:e+i}}function Ss(t){for(var e,i,n,a={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},r=Object.assign({},a),o=[],s=[],l=t._pointLabels.length,u=t.options.pointLabels,h=u.centerPointLabels?Yt/l:0,c=0;ce.r&&(s=(n.end-e.r)/r,t.r=Math.max(t.r,e.r+s)),a.starte.b&&(l=(a.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function Ds(t){return 0===t||180===t?"center":t<180?"left":"right"}function Os(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function As(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function Cs(t,e,i,n){var a=t.ctx;if(i)a.arc(t.xCenter,t.yCenter,e,0,Ut);else{var r=t.getPointPosition(0,e);a.moveTo(r.x,r.y);for(var o=1;o=0&&t2&&void 0!==arguments[2]?arguments[2]:0,n=this.getIndexAngle(t)-Gt+i;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}},{key:"getPointPositionForValue",value:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}},{key:"getBasePosition",value:function(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}},{key:"getPointLabelPosition",value:function(t){var e=this._pointLabelItems[t];return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}},{key:"drawBackground",value:function(){var t=this.options,e=t.backgroundColor,i=t.grid.circular;if(e){var n=this.ctx;n.save(),n.beginPath(),Cs(this,this.getDistanceFromCenterForValue(this._endValue),i,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}},{key:"drawGrid",value:function(){var t,e,i,n=this,a=this.ctx,r=this.options,o=r.angleLines,s=r.grid,l=this._pointLabels.length;if(r.pointLabels.display&&function(t,e){for(var i=t.ctx,n=t.options.pointLabels,a=e-1;a>=0;a--){var r=n.setContext(t.getPointLabelContext(a)),o=ji(r.font),s=t._pointLabelItems[a],l=s.x,u=s.y,h=s.textAlign,c=s.left,f=s.top,d=s.right,v=s.bottom,g=r.backdropColor;if(!wt(g)){var p=Ni(r.borderRadius),m=Wi(r.backdropPadding);i.fillStyle=g;var y=c-m.left,b=f-m.top,x=d-c+m.width,_=v-f+m.height;Object.values(p).some((function(t){return 0!==t}))?(i.beginPath(),Ei(i,{x:y,y:b,w:x,h:_,radius:p}),i.fill()):i.fillRect(y,b,x,_)}Ti(i,t._pointLabels[a],l,u+o.lineHeight/2,o,{color:r.color,textAlign:h,textBaseline:"middle"})}}(this,l),s.display&&this.ticks.forEach((function(t,i){if(0!==i){e=n.getDistanceFromCenterForValue(t.value);var a=s.setContext(n.getContext(i-1));!function(t,e,i,n){var a=t.ctx,r=e.circular,o=e.color,s=e.lineWidth;!r&&!n||!o||!s||i<0||(a.save(),a.strokeStyle=o,a.lineWidth=s,a.setLineDash(e.borderDash),a.lineDashOffset=e.borderDashOffset,a.beginPath(),Cs(t,i,r,n),a.closePath(),a.stroke(),a.restore())}(n,a,e,l)}})),o.display){for(a.save(),t=l-1;t>=0;t--){var u=o.setContext(this.getPointLabelContext(t)),h=u.color,c=u.lineWidth;c&&h&&(a.lineWidth=c,a.strokeStyle=h,a.setLineDash(u.borderDash),a.lineDashOffset=u.borderDashOffset,e=this.getDistanceFromCenterForValue(r.ticks.reverse?this.min:this.max),i=this.getPointPosition(t,e),a.beginPath(),a.moveTo(this.xCenter,this.yCenter),a.lineTo(i.x,i.y),a.stroke())}a.restore()}}},{key:"drawBorder",value:function(){}},{key:"drawLabels",value:function(){var t=this,e=this.ctx,i=this.options,n=i.ticks;if(n.display){var a,r,o=this.getIndexAngle(0);e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(o),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((function(o,s){if(0!==s||i.reverse){var l=n.setContext(t.getContext(s)),u=ji(l.font);if(a=t.getDistanceFromCenterForValue(t.ticks[s].value),l.showLabelBackdrop){e.font=u.string,r=e.measureText(o.label).width,e.fillStyle=l.backdropColor;var h=Wi(l.backdropPadding);e.fillRect(-r/2-h.left,-a-u.size/2-h.top,r+h.width,u.size+h.height)}Ti(e,o.label,0,-a,u,{color:l.color})}})),e.restore()}}},{key:"drawTitle",value:function(){}}]),a}();Ts.id="radialLinear",Ts.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Pa.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:function(t){return t},padding:5,centerPointLabels:!1}},Ts.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},Ts.descriptors={angleLines:{_fallback:"grid"}};var Rs={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Es=Object.keys(Rs);function Ls(t,e){return t-e}function Is(t,e){if(wt(e))return null;var i=t._adapter,n=t._parseOpts,a=n.parser,r=n.round,o=n.isoWeekday,s=e;return"function"==typeof a&&(s=a(s)),Pt(s)||(s="string"==typeof a?i.parse(s,a):i.parse(s)),null===s?null:(r&&(s="week"!==r||!ie(o)&&!0!==o?i.startOf(s,r):i.startOf(s,"isoWeek",o)),+s)}function zs(t,e,i,n){for(var a=Es.length,r=Es.indexOf(t);r=e?i[a]:i[r]]=!0}}else t[e]=!0}function Vs(t,e,i){var n,a,r=[],o={},s=e.length;for(n=0;n=0&&(e[r].major=!0);return e}(t,r,o,i):r}var Bs=function(i){t(a,Ia);var n=jn(a);function a(t){var i;return e(this,a),(i=n.call(this,t))._cache={data:[],labels:[],all:[]},i._unit="day",i._majorUnit=void 0,i._offsets={},i._normalized=!1,i._parseOpts=void 0,i}return r(a,[{key:"init",value:function(t,e){var i=t.time||(t.time={}),n=this._adapter=new Ha._date(t.adapters.date);n.init(e),Ft(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},B(s(a.prototype),"init",this).call(this,t),this._normalized=e.normalized}},{key:"parse",value:function(t,e){return void 0===t?null:Is(this,t)}},{key:"beforeLayout",value:function(){B(s(a.prototype),"beforeLayout",this).call(this),this._cache={data:[],labels:[],all:[]}}},{key:"determineDataLimits",value:function(){var t=this.options,e=this._adapter,i=t.time.unit||"day",n=this.getUserBounds(),a=n.min,r=n.max,o=n.minDefined,s=n.maxDefined;function l(t){o||isNaN(t.min)||(a=Math.min(a,t.min)),s||isNaN(t.max)||(r=Math.max(r,t.max))}o&&s||(l(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||l(this.getMinMax(!1))),a=Pt(a)&&!isNaN(a)?a:+e.startOf(Date.now(),i),r=Pt(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(a,r-1),this.max=Math.max(a+1,r)}},{key:"_getLabelBounds",value:function(){var t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}},{key:"buildTicks",value:function(){var t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);var a=this.min,r=function(t,e,i){for(var n=0,a=t.length;nn&&t[a-1]>i;)a--;return n>0||a=Es.indexOf(i);r--){var o=Es[r];if(Rs[o].common&&t._adapter.diff(a,n,o)>=e-1)return o}return Es[i?Es.indexOf(i):0]}(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(var e=Es.indexOf(t)+1,i=Es.length;e1e5*l)throw new Error(n+" and "+a+" are too far apart with stepSize of "+l+" "+s);var d="data"===r.ticks.source&&this.getDataTimestamps();for(t=f,e=0;t0?o:1}},{key:"getDataTimestamps",value:function(){var t,e,i=this._cache.data||[];if(i.length)return i;var n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[s].pos&&e<=t[l].pos){var u=pe(t,"pos",e);s=u.lo,l=u.hi}var h=t[s];n=h.pos,r=h.time;var c=t[l];a=c.pos,o=c.time}else{if(e>=t[s].time&&e<=t[l].time){var f=pe(t,"time",e);s=f.lo,l=f.hi}var d=t[s];n=d.time,r=d.pos;var v=t[l];a=v.time,o=v.pos}var g=a-n;return g?r+(o-r)*(e-n)/g:r}Bs.id="time",Bs.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};var Ws=function(i){t(a,Bs);var n=jn(a);function a(t){var i;return e(this,a),(i=n.call(this,t))._table=[],i._minPos=void 0,i._tableRange=void 0,i}return r(a,[{key:"initOffsets",value:function(){var t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ns(e,this.min),this._tableRange=Ns(e,this.max)-this._minPos,B(s(a.prototype),"initOffsets",this).call(this,t)}},{key:"buildLookupTable",value:function(t){var e,i,n,a,r,o=this.min,s=this.max,l=[],u=[];for(e=0,i=t.length;e=o&&a<=s&&l.push(a);if(l.length<2)return[{time:o,pos:0},{time:s,pos:1}];for(e=0,i=l.length;e