|
1
|
|
-(()=>{"use strict";var t={1455:t=>{t.exports=window.wp.apiFetch},11344:(t,e,i)=>{i.d(e,{A:()=>a});var s=i(51609),n=i(27723),o=i(81921);function a({config:t}){const e=t.connectUrl||t.settingsUrl||"";return(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__empty"},(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__illustration"},(0,s.createElement)(o.A,null)),(0,s.createElement)("h3",{className:"thinkrank-dashboard-widget__title"},(0,n.__)("Unlock SEO Insights Using Google Search Console","thinkrank")),(0,s.createElement)("p",{className:"thinkrank-dashboard-widget__subtext"},(0,n.__)("Connect Google Search Console to gain search insights and monitor your growth.","thinkrank")),(0,s.createElement)("a",{className:"thinkrank-dashboard-widget__cta",href:e},(0,n.__)("Connect to Google Search Console","thinkrank")))}},25689:(t,e,i)=>{i.d(e,{A:()=>d});var s=i(51609),n=i(27723),o=i(51529),a=i(44656);a.t1.register(a.PP,a.kc,a.FN,a.No,a.hE,a.m_,a.s$,a.dN);const r={clicks:"#4794ff",impressions:"#6f52ff",ctr:"#bd52ff",position:"#ff8026"},l="#e9ebf1",h="#7c828d";function c(t,e,i,s){return{label:t,data:e,borderColor:i,backgroundColor:"transparent",borderWidth:2,tension:.4,fill:!1,pointRadius:0,pointHoverRadius:5,pointHoverBackgroundColor:i,pointHoverBorderColor:"#ffffff",pointHoverBorderWidth:2,yAxisID:s}}function d({rows:t}){if(!Array.isArray(t)||0===t.length)return null;const e={labels:t.map(t=>{const e=new Date(`${t.date}T00:00:00`);return Number.isNaN(e.getTime())?t.date:e.toLocaleDateString("en-US",{month:"short",day:"numeric"})}),datasets:[c((0,n.__)("Clicks","thinkrank"),t.map(t=>t.clicks),r.clicks,"yLeft"),c((0,n.__)("Impressions","thinkrank"),t.map(t=>t.impressions),r.impressions,"yLeft"),c((0,n.__)("Avg. CTR (%)","thinkrank"),t.map(t=>t.ctr),r.ctr,"yRight"),c((0,n.__)("Avg. Position","thinkrank"),t.map(t=>t.position),r.position,"yRight")]},i={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!0,position:"bottom",labels:{usePointStyle:!0,pointStyle:"circle",padding:14,font:{size:12},color:h}},tooltip:{enabled:!0}},scales:{x:{grid:{color:l,drawBorder:!1},ticks:{color:h,font:{size:11},maxTicksLimit:7,maxRotation:0},border:{display:!1}},yLeft:{position:"left",grid:{color:l,drawBorder:!1},ticks:{color:h,font:{size:11},callback:t=>t>=1e3?`${(t/1e3).toFixed(0)}k`:t},border:{display:!1}},yRight:{position:"right",grid:{display:!1},ticks:{color:h,font:{size:11},callback:t=>`${t}`},border:{display:!1}}}};return(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__chart"},(0,s.createElement)(o.N1,{data:e,options:i}))}},27723:t=>{t.exports=window.wp.i18n},39682:(t,e,i)=>{i.d(e,{A:()=>a});var s=i(51609),n=i(27723),o=i(69966);function a({config:t}){if(t.isPro)return null;const e=t.upgradeUrl||"https://thinkrank.ai/#pricing";return(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__teaser"},(0,s.createElement)(o.A,{size:24,className:"thinkrank-dashboard-widget__teaser-mark"}),(0,s.createElement)("span",{className:"thinkrank-dashboard-widget__teaser-text"},(0,n.__)("Turn these numbers into action with AI insights and ranking alerts","thinkrank")),(0,s.createElement)("a",{className:"thinkrank-dashboard-widget__teaser-cta",href:e,target:"_blank",rel:"noopener noreferrer"},(0,n.__)("Upgrade","thinkrank")))}},44594:(t,e,i)=>{function s(t){return t+.5|0}i.d(e,{Q1:()=>T});const n=(t,e,i)=>Math.max(Math.min(t,i),e);function o(t){return n(s(2.55*t),0,255)}function a(t){return n(s(255*t),0,255)}function r(t){return n(s(t/2.55)/100,0,1)}function l(t){return n(s(100*t),0,100)}const h={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},c=[..."0123456789ABCDEF"],d=t=>c[15&t],u=t=>c[(240&t)>>4]+c[15&t],f=t=>(240&t)>>4==(15&t);const p=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function g(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function m(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function x(t,e,i){const s=g(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function b(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),o=Math.min(e,i,s),a=(n+o)/2;let r,l,h;return n!==o&&(h=n-o,l=a>.5?h/(2-n-o):h/(n+o),r=function(t,e,i,s,n){return t===n?(e-i)/s+(e<i?6:0):e===n?(i-t)/s+2:(t-e)/s+4}(e,i,s,h,n),r=60*r+.5),[0|r,l||0,a]}function _(t,e,i,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,s)).map(a)}function y(t,e,i){return _(g,t,e,i)}function v(t){return(t%360+360)%360}const k={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},w={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let M;const C=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,S=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,E=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function A(t,e,i){if(t){let s=b(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=y(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function O(t,e){return t?Object.assign(e||{},t):t}function D(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=a(t[3]))):(e=O(t,{r:0,g:0,b:0,a:1})).a=a(e.a),e}function P(t){return"r"===t.charAt(0)?function(t){const e=C.exec(t);let i,s,a,r=255;if(e){if(e[7]!==i){const t=+e[7];r=e[8]?o(t):n(255*t,0,255)}return i=+e[1],s=+e[3],a=+e[5],i=255&(e[2]?o(i):n(i,0,255)),s=255&(e[4]?o(s):n(s,0,255)),a=255&(e[6]?o(a):n(a,0,255)),{r:i,g:s,b:a,a:r}}}(t):function(t){const e=p.exec(t);let i,s=255;if(!e)return;e[5]!==i&&(s=e[6]?o(+e[5]):a(+e[5]));const n=v(+e[2]),r=+e[3]/100,l=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return _(x,t,e,i)}(n,r,l):"hsv"===e[1]?function(t,e,i){return _(m,t,e,i)}(n,r,l):y(n,r,l),{r:i[0],g:i[1],b:i[2],a:s}}(t)}class T{constructor(t){if(t instanceof T)return t;const e=typeof t;let i;var s,n,o;"object"===e?i=D(t):"string"===e&&(o=(s=t).length,"#"===s[0]&&(4===o||5===o?n={r:255&17*h[s[1]],g:255&17*h[s[2]],b:255&17*h[s[3]],a:5===o?17*h[s[4]]:255}:7!==o&&9!==o||(n={r:h[s[1]]<<4|h[s[2]],g:h[s[3]]<<4|h[s[4]],b:h[s[5]]<<4|h[s[6]],a:9===o?h[s[7]]<<4|h[s[8]]:255})),i=n||function(t){M||(M=function(){const t={},e=Object.keys(w),i=Object.keys(k);let s,n,o,a,r;for(s=0;s<e.length;s++){for(a=r=e[s],n=0;n<i.length;n++)o=i[n],r=r.replace(o,k[o]);o=parseInt(w[a],16),t[r]=[o>>16&255,o>>8&255,255&o]}return t}(),M.transparent=[0,0,0,0]);const e=M[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||P(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=O(this._rgb);return t&&(t.a=r(t.a)),t}set rgb(t){this._rgb=D(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${r(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?(t=this._rgb,e=(t=>f(t.r)&&f(t.g)&&f(t.b)&&f(t.a))(t)?d:u,t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0):void 0;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=b(t),i=e[0],s=l(e[1]),n=l(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${n}%, ${r(t.a)})`:`hsl(${i}, ${s}%, ${n}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let n;const o=e===n?.5:e,a=2*o-1,r=i.a-s.a,l=((a*r===-1?a:(a+r)/(1+a*r))+1)/2;n=1-l,i.r=255&l*i.r+n*s.r+.5,i.g=255&l*i.g+n*s.g+.5,i.b=255&l*i.b+n*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const s=E(r(t.r)),n=E(r(t.g)),o=E(r(t.b));return{r:a(S(s+i*(E(r(e.r))-s))),g:a(S(n+i*(E(r(e.g))-n))),b:a(S(o+i*(E(r(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new T(this.rgb)}alpha(t){return this._rgb.a=a(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=s(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return A(this._rgb,2,t),this}darken(t){return A(this._rgb,2,-t),this}saturate(t){return A(this._rgb,1,t),this}desaturate(t){return A(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=b(t);i[0]=v(i[0]+e),i=y(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}},44656:(t,e,i)=>{i.d(e,{FN:()=>te,No:()=>Kt,PP:()=>Ne,ZT:()=>k,dN:()=>xe,hE:()=>we,kc:()=>je,m_:()=>ze,s$:()=>ve,t1:()=>jt});var s=i(99284);i(44594);class n{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],o=e.duration;n.forEach(s=>s({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=s.r.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var o=new n;const a="transparent",r={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=(0,s.c)(t||a),o=n.valid&&(0,s.c)(e||a);return o&&o.valid?o.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class l{constructor(t,e,i,n){const o=e[i];n=(0,s.a)([t.to,n,o,t.from]);const a=(0,s.a)([t.from,o,n]);this._active=!0,this._fn=t.fn||r[t.type||typeof a],this._easing=s.e[t.easing]||s.e.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=(0,s.a)([t.to,e,n,t.from]),this._from=(0,s.a)([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||e<i),!this._active)return this._target[s]=a,void this._notify(!0);e<0?this._target[s]=n:(r=e/i%2,r=o&&r>1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class h{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!(0,s.i)(t))return;const e=Object.keys(s.d.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!(0,s.i)(o))return;const a={};for(const t of e)a[t]=o[t];((0,s.b)(o.properties)&&o.properties||[n]).forEach(t=>{t!==n&&i.has(t)||i.set(t,a)})})}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){const n=t[s[e]];n&&n.active()&&i.push(n.wait())}return Promise.all(i)}(t.options.$animations,i).then(()=>{t.options=i},()=>{}),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let r;for(r=o.length-1;r>=0;--r){const h=o[r];if("$"===h.charAt(0))continue;if("options"===h){s.push(...this._animateOptions(t,e));continue}const c=e[h];let d=n[h];const u=i.get(h);if(d){if(u&&d.active()){d.update(u,c,a);continue}d.cancel()}u&&u.duration?(n[h]=d=new l(u,t,h,c),s.push(d)):t[h]=c}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(o.add(this._chart,i),!0):void 0}}function c(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function d(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n<o;++n)i.push(s[n].index);return i}function u(t,e,i,n={}){const o=t.keys,a="single"===n.mode;let r,l,h,c;if(null===e)return;let d=!1;for(r=0,l=o.length;r<l;++r){if(h=+o[r],h===i){if(d=!0,n.all)continue;break}c=t.values[h],(0,s.g)(c)&&(a||0===e||(0,s.s)(e)===(0,s.s)(c))&&(e+=c)}return d||n.all?e:0}function f(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function p(t,e,i){const s=t[e]||(t[e]={});return s[i]||(s[i]={})}function g(t,e,i,s){for(const n of e.getMatchingVisibleMetas(s).reverse()){const e=t[n.index];if(i&&e>0||!i&&e<0)return n.index}return null}function m(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,h=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,a,s),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[l]:o,[h]:d}=i;u=(i._stacks||(i._stacks={}))[h]=p(n,c,o),u[r]=d,u._top=g(u,a,!0,s.type),u._bottom=g(u,a,!1,s.type),(u._visualValues||(u._visualValues={}))[r]=d}}function x(t,e){const i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function b(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i],void 0!==e[s]._visualValues&&void 0!==e[s]._visualValues[i]&&delete e[s]._visualValues[i]}}}const _=t=>"reset"===t||"none"===t,y=(t,e)=>e?t:Object.assign({},t);class v{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=f(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&b(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,o=e.xAxisID=(0,s.v)(i.xAxisID,x(t,"x")),a=e.yAxisID=(0,s.v)(i.yAxisID,x(t,"y")),r=e.rAxisID=(0,s.v)(i.rAxisID,x(t,"r")),l=e.indexAxis,h=e.iAxisID=n(l,o,a,r),c=e.vAxisID=n(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&(0,s.u)(this._data,this),t._stacked&&b(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if((0,s.i)(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:s}=e,n="x"===i.axis?"x":"y",o="x"===s.axis?"x":"y",a=Object.keys(t),r=new Array(a.length);let l,h,c;for(l=0,h=a.length;l<h;++l)c=a[l],r[l]={[n]:c,[o]:t[c]};return r}(e,t)}else if(i!==e){if(i){(0,s.u)(i,this);const t=this._cachedMeta;b(t),t._parsed=[]}e&&Object.isExtensible(e)&&(0,s.l)(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=f(e.vScale,e),e.stack!==i.stack&&(s=!0,b(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&(m(this,e._parsed),e._stacked=f(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:o,_stacked:a}=i,r=o.axis;let l,h,c,d=0===t&&e===n.length||i._sorted,u=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=(0,s.b)(n[t])?this.parseArrayData(i,n,t,e):(0,s.i)(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const o=()=>null===h[r]||u&&h[r]<u[r];for(l=0;l<e;++l)i._parsed[l+t]=h=c[l],d&&(o()&&(d=!1),u=h);i._sorted=d}a&&m(this,c)}parsePrimitiveData(t,e,i,s){const{iScale:n,vScale:o}=t,a=n.axis,r=o.axis,l=n.getLabels(),h=n===o,c=new Array(s);let d,u,f;for(d=0,u=s;d<u;++d)f=d+i,c[d]={[a]:h||n.parse(l[f],f),[r]:o.parse(e[f],f)};return c}parseArrayData(t,e,i,s){const{xScale:n,yScale:o}=t,a=new Array(s);let r,l,h,c;for(r=0,l=s;r<l;++r)h=r+i,c=e[h],a[r]={x:n.parse(c[0],h),y:o.parse(c[1],h)};return a}parseObjectData(t,e,i,n){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,h=new Array(n);let c,d,u,f;for(c=0,d=n;c<d;++c)u=c+i,f=e[u],h[c]={x:o.parse((0,s.f)(f,r),u),y:a.parse((0,s.f)(f,l),u)};return h}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,n=this._cachedMeta,o=e[t.axis];return u({keys:d(s,!0),values:e._stacks[t.axis]._visualValues},o,n.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const n=i[e.axis];let o=null===n?NaN:n;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=u(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,n=i._parsed,o=i._sorted&&t===i.iScale,a=n.length,r=this._getOtherScale(t),l=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:d(i,!0),values:null})(e,i,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(r);let f,p;function g(){p=n[f];const e=p[r.axis];return!(0,s.g)(p[t.axis])||c>e||u<e}for(f=0;f<a&&(g()||(this.updateRangeFromParsed(h,t,p,l),!o));++f);if(o)for(f=a-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(h,t,p,l);break}return h}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,o,a;for(n=0,o=e.length;n<o;++n)a=e[n][t.axis],(0,s.g)(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,n=this.getParsed(t);return{label:i?""+i.getLabelForValue(n[i.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,n,o;return(0,s.i)(t)?(e=t.top,i=t.right,n=t.bottom,o=t.left):e=i=n=o=t,{top:e,right:i,bottom:n,left:o,disabled:!1===t}}((0,s.v)(this.options.clip,function(t,e,i){if(!1===i)return!1;const s=c(t,i),n=c(e,i);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],n=e.chartArea,o=[],a=this._drawStart||0,r=this._drawCount||s.length-a,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,n,a,r),h=a;h<a+r;++h){const e=s[h];e.hidden||(e.active&&l?o.push(e):e.draw(t,n))}for(h=0;h<o.length;++h)o[h].draw(t,n)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];o=e.$context||(e.$context=function(t,e,i){return(0,s.j)(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=function(t,e){return(0,s.j)(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const n="active"===e,o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&(0,s.h)(i);if(r)return y(r,l);const h=this.chart.config,c=h.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],u=h.getOptionScopes(this.getDataset(),c),f=Object.keys(s.d.elements[t]),p=h.resolveNamedOptions(u,f,()=>this.getContext(i,n,e),d);return p.$shared&&(p.$shared=l,o[a]=Object.freeze(y(p,l))),p}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,a=n[o];if(a)return a;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(o,this.getContext(t,i,e))}const l=new h(s,r&&r.animations);return r&&r._cacheable&&(n[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||_(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,s){_(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!_(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,e,i=!0){const s=this._cachedMeta,n=s.data,o=t+e;let a;const r=t=>{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(n),a=t;a<o;++a)n[a]=new this.dataElementType;this._parsing&&r(s._parsed),this.parse(t,e),i&&this.updateElements(n,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&b(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}class k extends v{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:l}=(0,s.q)(e,n,a);this._drawStart=r,this._drawCount=l,(0,s.w)(e)&&(r=0,l=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=n;const h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:h},t),this.updateElements(n,r,l,t)}updateElements(t,e,i,n){const o="reset"===n,{iScale:a,vScale:r,_stacked:l,_dataset:h}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(e,n),u=a.axis,f=r.axis,{spanGaps:p,segment:g}=this.options,m=(0,s.x)(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||"none"===n,b=e+i,_=t.length;let y=e>0&&this.getParsed(e-1);for(let i=0;i<_;++i){const p=t[i],_=x?p:{};if(i<e||i>=b){_.skip=!0;continue}const v=this.getParsed(i),k=(0,s.k)(v[f]),w=_[u]=a.getPixelForValue(v[u],i),M=_[f]=o||k?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,v,l):v[f],i);_.skip=isNaN(w)||isNaN(M)||k,_.stop=i>0&&Math.abs(v[u]-y[u])>m,g&&(_.parsed=v,_.raw=h.data[i]),d&&(_.options=c||this.resolveDataElementOptions(i,p.active?"active":n)),x||this.updateElement(p,i,_,n),y=v}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function w(t,e,i,n){const{controller:o,data:a,_sorted:r}=t,l=o._cachedMeta.iScale,h=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(l&&e===l.axis&&"r"!==e&&r&&a.length){const r=l._reversePixels?s.A:s.B;if(!n){const n=r(a,e,i);if(h){const{vScale:e}=o._cachedMeta,{_parsed:i}=t,a=i.slice(0,n.lo+1).reverse().findIndex(t=>!(0,s.k)(t[e.axis]));n.lo-=Math.max(0,a);const r=i.slice(n.hi).findIndex(t=>!(0,s.k)(t[e.axis]));n.hi+=Math.max(0,r)}return n}if(o._sharedOptions){const t=a[0],s="function"==typeof t.getRange&&t.getRange(e);if(s){const t=r(a,e,i-s),n=r(a,e,i+s);return{lo:t.lo,hi:n.hi}}}}return{lo:0,hi:a.length-1}}function M(t,e,i,s,n){const o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=o.length;t<i;++t){const{index:i,data:r}=o[t],{lo:l,hi:h}=w(o[t],e,a,n);for(let t=l;t<=h;++t){const e=r[t];e.skip||s(e,i,t)}}}function C(t,e,i,n,o){const a=[];return o||t.isPointInArea(e)?(M(t,i,e,function(i,r,l){(o||(0,s.C)(i,t.chartArea,0))&&i.inRange(e.x,e.y,n)&&a.push({element:i,datasetIndex:r,index:l})},!0),a):a}function S(t,e,i,n,o,a){return a||t.isPointInArea(e)?"r"!==i||n?function(t,e,i,s,n,o){let a=[];const r=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,s){const n=e?Math.abs(t.x-s.x):0,o=i?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2))}}(i);let l=Number.POSITIVE_INFINITY;return M(t,i,e,function(i,h,c){const d=i.inRange(e.x,e.y,n);if(s&&!d)return;const u=i.getCenterPoint(n);if(!o&&!t.isPointInArea(u)&&!d)return;const f=r(e,u);f<l?(a=[{element:i,datasetIndex:h,index:c}],l=f):f===l&&a.push({element:i,datasetIndex:h,index:c})}),a}(t,e,i,n,o,a):function(t,e,i,n){let o=[];return M(t,i,e,function(t,i,a){const{startAngle:r,endAngle:l}=t.getProps(["startAngle","endAngle"],n),{angle:h}=(0,s.D)(t,{x:e.x,y:e.y});(0,s.p)(h,r,l)&&o.push({element:t,datasetIndex:i,index:a})}),o}(t,e,i,o):[]}function E(t,e,i,s,n){const o=[],a="x"===i?"inXRange":"inYRange";let r=!1;return M(t,i,e,(t,s,l)=>{t[a]&&t[a](e[i],n)&&(o.push({element:t,datasetIndex:s,index:l}),r=r||t.inRange(e.x,e.y,n))}),s&&!r?[]:o}var A={evaluateInteractionItems:M,modes:{index(t,e,i,n){const o=(0,s.z)(e,t),a=i.axis||"x",r=i.includeInvisible||!1,l=i.intersect?C(t,o,a,n,r):S(t,o,a,!1,n,r),h=[];return l.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=l[0].index,i=t.data[e];i&&!i.skip&&h.push({element:i,datasetIndex:t.index,index:e})}),h):[]},dataset(t,e,i,n){const o=(0,s.z)(e,t),a=i.axis||"xy",r=i.includeInvisible||!1;let l=i.intersect?C(t,o,a,n,r):S(t,o,a,!1,n,r);if(l.length>0){const e=l[0].datasetIndex,i=t.getDatasetMeta(e).data;l=[];for(let t=0;t<i.length;++t)l.push({element:i[t],datasetIndex:e,index:t})}return l},point:(t,e,i,n)=>C(t,(0,s.z)(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){const o=(0,s.z)(e,t),a=i.axis||"xy",r=i.includeInvisible||!1;return S(t,o,a,i.intersect,n,r)},x:(t,e,i,n)=>E(t,(0,s.z)(e,t),"x",i.intersect,n),y:(t,e,i,n)=>E(t,(0,s.z)(e,t),"y",i.intersect,n)}};const O=["left","top","right","bottom"];function D(t,e){return t.filter(t=>t.pos===e)}function P(t,e){return t.filter(t=>-1===O.indexOf(t.pos)&&t.box.axis===e)}function T(t,e){return t.sort((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight})}function F(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function I(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function L(t,e,i,n){const{pos:o,box:a}=i,r=t.maxPadding;if(!(0,s.i)(o)){i.size&&(t[o]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?a.height:a.width),i.size=e.size/e.count,t[o]+=i.size}a.getPadding&&I(r,a.getPadding());const l=Math.max(0,e.outerWidth-F(r,t,"left","right")),h=Math.max(0,e.outerHeight-F(r,t,"top","bottom")),c=l!==t.w,d=h!==t.h;return t.w=l,t.h=h,i.horizontal?{same:c,other:d}:{same:d,other:c}}function B(t,e){const i=e.maxPadding;return function(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{s[t]=Math.max(e[t],i[t])}),s}(t?["left","right"]:["top","bottom"])}function R(t,e,i,s){const n=[];let o,a,r,l,h,c;for(o=0,a=t.length,h=0;o<a;++o){r=t[o],l=r.box,l.update(r.width||e.w,r.height||e.h,B(r.horizontal,e));const{same:a,other:d}=L(e,i,r,s);h|=a&&n.length,c=c||d,l.fullSize||n.push(r)}return h&&R(n,e,i,s)||c}function z(t,e,i,s,n){t.top=i,t.left=e,t.right=e+s,t.bottom=i+n,t.width=s,t.height=n}function H(t,e,i,n){const o=i.padding;let{x:a,y:r}=e;for(const l of t){const t=l.box,h=n[l.stack]||{count:1,placed:0,weight:1},c=l.stackWeight/h.weight||1;if(l.horizontal){const n=e.w*c,a=h.size||t.height;(0,s.h)(h.start)&&(r=h.start),t.fullSize?z(t,o.left,r,i.outerWidth-o.right-o.left,a):z(t,e.left+h.placed,r,n,a),h.start=r,h.placed+=n,r=t.bottom}else{const n=e.h*c,r=h.size||t.width;(0,s.h)(h.start)&&(a=h.start),t.fullSize?z(t,a,o.top,r,i.outerHeight-o.bottom-o.top):z(t,a,e.top+h.placed,r,n),h.start=a,h.placed+=n,a=t.right}}e.x=a,e.y=r}var N={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,n){if(!t)return;const o=(0,s.E)(t.options.layout.padding),a=Math.max(e-o.width,0),r=Math.max(i-o.height,0),l=function(t){const e=function(t){const e=[];let i,s,n,o,a,r;for(i=0,s=(t||[]).length;i<s;++i)n=t[i],({position:o,options:{stack:a,stackWeight:r=1}}=n),e.push({index:i,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return e}(t),i=T(e.filter(t=>t.box.fullSize),!0),s=T(D(e,"left"),!0),n=T(D(e,"right")),o=T(D(e,"top"),!0),a=T(D(e,"bottom")),r=P(e,"x"),l=P(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:D(e,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}(t.boxes),h=l.vertical,c=l.horizontal;(0,s.F)(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const d=h.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:o,availableWidth:a,availableHeight:r,vBoxMaxWidth:a/2/d,hBoxMaxHeight:r/2}),f=Object.assign({},o);I(f,(0,s.E)(n));const p=Object.assign({maxPadding:f,w:a,h:r,x:o.left,y:o.top},o),g=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!O.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let o,a,r;for(o=0,a=t.length;o<a;++o){r=t[o];const{fullSize:a}=r.box,l=i[r.stack],h=l&&r.stackWeight/l.weight;r.horizontal?(r.width=h?h*s:a&&e.availableWidth,r.height=n):(r.width=s,r.height=h?h*n:a&&e.availableHeight)}return i}(h.concat(c),u);R(l.fullSize,p,u,g),R(h,p,u,g),R(c,p,u,g)&&R(h,p,u,g),function(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(p),H(l.leftAndTop,p,u,g),p.x+=p.w,p.y+=p.h,H(l.rightAndBottom,p,u,g),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},(0,s.F)(l.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class W{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class V extends W{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const j="$chartjs",$={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},U=t=>null===t||""===t,G=!!s.K&&{passive:!0};function Y(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,G)}function X(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Q(t,e,i){const s=t.canvas,n=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||X(i.addedNodes,s),e=e&&!X(i.removedNodes,s);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}function Z(t,e,i){const s=t.canvas,n=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||X(i.removedNodes,s),e=e&&!X(i.addedNodes,s);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}const q=new Map;let K=0;function J(){const t=window.devicePixelRatio;t!==K&&(K=t,q.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function tt(t,e,i){const n=t.canvas,o=n&&(0,s.I)(n);if(!o)return;const a=(0,s.L)((t,e)=>{const s=o.clientWidth;i(t,e),s<o.clientWidth&&i()},window),r=new ResizeObserver(t=>{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||a(i,s)});return r.observe(o),function(t,e){q.size||window.addEventListener("resize",J),q.set(t,e)}(t,a),r}function et(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){q.delete(t),q.size||window.removeEventListener("resize",J)}(t)}function it(t,e,i){const n=t.canvas,o=(0,s.L)(e=>{null!==t.ctx&&i(function(t,e){const i=$[t.type]||t.type,{x:n,y:o}=(0,s.z)(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==o?o:null}}(e,t))},t);return function(t,e,i){t&&t.addEventListener(e,i,G)}(n,e,o),o}class st extends W{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),o=t.getAttribute("width");if(t[j]={initial:{height:n,width:o,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",U(o)){const e=(0,s.J)(t,"width");void 0!==e&&(t.width=e)}if(U(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=(0,s.J)(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[j])return!1;const i=e[j].initial;["height","width"].forEach(t=>{const n=i[t];(0,s.k)(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e[j],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:Q,detach:Z,resize:tt}[e]||it;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];s&&(({attach:et,detach:et,resize:et}[e]||Y)(t,e,s),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return(0,s.G)(t,e,i,n)}isAttached(t){const e=t&&(0,s.I)(t);return!(!e||!e.isConnected)}}class nt{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return(0,s.x)(this.x)&&(0,s.x)(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),s}}function ot(t,e,i,n,o){const a=(0,s.v)(n,0),r=Math.min((0,s.v)(o,t.length),t.length);let l,h,c,d=0;for(i=Math.ceil(i),o&&(l=o-n,i=l/Math.floor(l/i)),c=a;c<0;)d++,c=Math.round(a+d*i);for(h=Math.max(a,0);h<r;h++)h===c&&(e.push(t[h]),d++,c=Math.round(a+d*i))}const at=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,rt=(t,e)=>Math.min(e||t,t);function lt(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;o<n;o+=s)i.push(t[Math.floor(o)]);return i}function ht(t,e,i){const s=t.ticks.length,n=Math.min(e,s-1),o=t._startPixel,a=t._endPixel,r=1e-6;let l,h=t.getPixelForTick(n);if(!(i&&(l=1===s?Math.max(h-o,a-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(n-1))/2,h+=n<e?l:-l,h<o-r||h>a+r)))return h}function ct(t){return t.drawTicks?t.tickLength:0}function dt(t,e){if(!t.display)return 0;const i=(0,s.a0)(t.font,e),n=(0,s.E)(t.padding);return((0,s.b)(t.text)?t.text.length:1)*i.lineHeight+n.height}function ut(t,e,i){let n=(0,s.a1)(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class ft extends nt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(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)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=(0,s.O)(t,Number.POSITIVE_INFINITY),e=(0,s.O)(e,Number.NEGATIVE_INFINITY),i=(0,s.O)(i,Number.POSITIVE_INFINITY),n=(0,s.O)(n,Number.NEGATIVE_INFINITY),{min:(0,s.O)(t,i),max:(0,s.O)(e,n),minDefined:(0,s.g)(t),maxDefined:(0,s.g)(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:o,maxDefined:a}=this.getUserBounds();if(o&&a)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let s=0,l=r.length;s<l;++s)e=r[s].controller.getMinMax(this,t),o||(i=Math.min(i,e.min)),a||(n=Math.max(n,e.max));return i=a&&i>n?n:i,n=o&&i>n?i:n,{min:(0,s.O)(i,(0,s.O)(n,i)),max:(0,s.O)(n,(0,s.O)(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){(0,s.Q)(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:o,ticks:a}=this.options,r=a.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=(0,s.R)(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?lt(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||"auto"===a.source)&&(this.ticks=function(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}(t),o=Math.min(i.maxTicksLimit||n,n),a=i.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;i<s;i++)t[i].major&&e.push(i);return e}(e):[],r=a.length,l=a[0],h=a[r-1],c=[];if(r>o)return function(t,e,i,s){let n,o=0,a=i[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===a&&(e.push(t[n]),o++,a=i[o*s])}(e,c,a,r/o),c;const d=function(t,e,i){const n=function(t){const e=t.length;let i,s;if(e<2)return!1;for(s=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==s)return!1;return s}(t),o=e.length/i;if(!n)return Math.max(o,1);const a=(0,s.N)(n);for(let t=0,e=a.length-1;t<e;t++){const e=a[t];if(e>o)return e}return Math.max(o,1)}(a,e,o);if(r>0){let t,i;const n=r>1?Math.round((h-l)/(r-1)):null;for(ot(e,c,d,(0,s.k)(n)?0:l-n,l),t=0,i=r-1;t<i;t++)ot(e,c,d,a[t],a[t+1]);return ot(e,c,d,h,(0,s.k)(n)?e.length:h+n),c}return ot(e,c,d),c}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){(0,s.Q)(this.options.afterUpdate,[this])}beforeSetDimensions(){(0,s.Q)(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){(0,s.Q)(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),(0,s.Q)(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){(0,s.Q)(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,n,o;for(i=0,n=t.length;i<n;i++)o=t[i],o.label=(0,s.Q)(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){(0,s.Q)(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){(0,s.Q)(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=rt(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let a,r,l,h=n;if(!this._isVisible()||!e.display||n>=o||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),d=c.widest.width,u=c.highest.height,f=(0,s.S)(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),r=this.maxHeight-ct(t.grid)-e.padding-dt(t.title,this.chart.options.font),l=Math.sqrt(d*d+u*u),h=(0,s.U)(Math.min(Math.asin((0,s.S)((c.highest.height+6)/a,-1,1)),Math.asin((0,s.S)(r/l,-1,1))-Math.asin((0,s.S)(u/l,-1,1)))),h=Math.max(n,Math.min(o,h))),this.labelRotation=h}afterCalculateLabelRotation(){(0,s.Q)(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){(0,s.Q)(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const a=dt(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=ct(o)+a):(t.height=this.maxHeight,t.width=ct(o)+a),i.display&&this.ticks.length){const{first:e,last:n,widest:o,highest:a}=this._getLabelSizes(),l=2*i.padding,h=(0,s.t)(this.labelRotation),c=Math.cos(h),d=Math.sin(h);if(r){const e=i.mirror?0:d*o.width+c*a.height;t.height=Math.min(this.maxHeight,t.height+e+l)}else{const e=i.mirror?0:c*o.width+d*a.height;t.width=Math.min(this.maxWidth,t.width+e+l)}this._calculatePadding(e,n,d,c)}}this._handleMargins(),r?(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)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?l?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-h+o)*this.width/(this.width-h),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){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))}afterFit(){(0,s.Q)(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)(0,s.k)(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=lt(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:n,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/rt(e,i));let h,c,d,u,f,p,g,m,x,b,_,y=0,v=0;for(h=0;h<e;h+=l){if(u=t[h].label,f=this._resolveTickFontOptions(h),n.font=p=f.string,g=o[p]=o[p]||{data:{},gc:[]},m=f.lineHeight,x=b=0,(0,s.k)(u)||(0,s.b)(u)){if((0,s.b)(u))for(c=0,d=u.length;c<d;++c)_=u[c],(0,s.k)(_)||(0,s.b)(_)||(x=(0,s.V)(n,g.data,g.gc,x,_),b+=m)}else x=(0,s.V)(n,g.data,g.gc,x,u),b=m;a.push(x),r.push(b),y=Math.max(x,y),v=Math.max(b,v)}!function(t,e){(0,s.F)(t,t=>{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n<s;++n)delete t.data[i[n]];i.splice(0,s)}})}(o,e);const k=a.indexOf(y),w=r.indexOf(v),M=t=>({width:a[t]||0,height:r[t]||0});return{first:M(0),last:M(e-1),widest:M(k),highest:M(w),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return(0,s.W)(this._alignToPixels?(0,s.X)(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return(0,s.j)(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=(i=this.chart.getContext(),(0,s.j)(i,{scale:this,type:"scale"})));var i}_tickSize(){const t=this.options.ticks,e=(0,s.t)(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*i>r*n?r/i:l/n:l*n<r*i?l/i:r/n}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:o,position:a,border:r}=n,l=o.offset,h=this.isHorizontal(),c=this.ticks.length+(l?1:0),d=ct(o),u=[],f=r.setContext(this.getContext()),p=f.display?f.width:0,g=p/2,m=function(t){return(0,s.X)(i,t,p)};let x,b,_,y,v,k,w,M,C,S,E,A;if("top"===a)x=m(this.bottom),k=this.bottom-d,M=x-g,S=m(t.top)+g,A=t.bottom;else if("bottom"===a)x=m(this.top),S=t.top,A=m(t.bottom)-g,k=x+g,M=this.top+d;else if("left"===a)x=m(this.right),v=this.right-d,w=x-g,C=m(t.left)+g,E=t.right;else if("right"===a)x=m(this.left),C=t.left,E=m(t.right)-g,v=x+g,w=this.left+d;else if("x"===e){if("center"===a)x=m((t.top+t.bottom)/2+.5);else if((0,s.i)(a)){const t=Object.keys(a)[0],e=a[t];x=m(this.chart.scales[t].getPixelForValue(e))}S=t.top,A=t.bottom,k=x+g,M=k+d}else if("y"===e){if("center"===a)x=m((t.left+t.right)/2);else if((0,s.i)(a)){const t=Object.keys(a)[0],e=a[t];x=m(this.chart.scales[t].getPixelForValue(e))}v=x-g,w=v-d,C=t.left,E=t.right}const O=(0,s.v)(n.ticks.maxTicksLimit,c),D=Math.max(1,Math.ceil(c/O));for(b=0;b<c;b+=D){const t=this.getContext(b),e=o.setContext(t),n=r.setContext(t),a=e.lineWidth,c=e.color,d=n.dash||[],f=n.dashOffset,p=e.tickWidth,g=e.tickColor,m=e.tickBorderDash||[],x=e.tickBorderDashOffset;_=ht(this,b,l),void 0!==_&&(y=(0,s.X)(i,_,a),h?v=w=C=E=y:k=M=S=A=y,u.push({tx1:v,ty1:k,tx2:w,ty2:M,x1:C,y1:S,x2:E,y2:A,width:a,color:c,borderDash:d,borderDashOffset:f,tickWidth:p,tickColor:g,tickBorderDash:m,tickBorderDashOffset:x}))}return this._ticksLength=c,this._borderValue=x,u}_computeLabelItems(t){const e=this.axis,i=this.options,{position:n,ticks:o}=i,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:h,padding:c,mirror:d}=o,u=ct(i.grid),f=u+c,p=d?-c:f,g=-(0,s.t)(this.labelRotation),m=[];let x,b,_,y,v,k,w,M,C,S,E,A,O="middle";if("top"===n)k=this.bottom-p,w=this._getXAxisLabelAlignment();else if("bottom"===n)k=this.top+p,w=this._getXAxisLabelAlignment();else if("left"===n){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,v=t.x}else if("right"===n){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,v=t.x}else if("x"===e){if("center"===n)k=(t.top+t.bottom)/2+f;else if((0,s.i)(n)){const t=Object.keys(n)[0],e=n[t];k=this.chart.scales[t].getPixelForValue(e)+f}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===n)v=(t.left+t.right)/2-f;else if((0,s.i)(n)){const t=Object.keys(n)[0],e=n[t];v=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(u).textAlign}"y"===e&&("start"===l?O="top":"end"===l&&(O="bottom"));const D=this._getLabelSizes();for(x=0,b=r.length;x<b;++x){_=r[x],y=_.label;const t=o.setContext(this.getContext(x));M=this.getPixelForTick(x)+o.labelOffset,C=this._resolveTickFontOptions(x),S=C.lineHeight,E=(0,s.b)(y)?y.length:1;const e=E/2,i=t.color,l=t.textStrokeColor,c=t.textStrokeWidth;let u,f=w;if(a?(v=M,"inner"===w&&(f=x===b-1?this.options.reverse?"left":"right":0===x?this.options.reverse?"right":"left":"center"),A="top"===n?"near"===h||0!==g?-E*S+S/2:"center"===h?-D.highest.height/2-e*S+S:-D.highest.height+S/2:"near"===h||0!==g?S/2:"center"===h?D.highest.height/2-e*S:D.highest.height-E*S,d&&(A*=-1),0===g||t.showLabelBackdrop||(v+=S/2*Math.sin(g))):(k=M,A=(1-E)*S/2),t.showLabelBackdrop){const e=(0,s.E)(t.backdropPadding),i=D.heights[x],n=D.widths[x];let o=A-e.top,a=0-e.left;switch(O){case"middle":o-=i/2;break;case"bottom":o-=i}switch(w){case"center":a-=n/2;break;case"right":a-=n;break;case"inner":x===b-1?a-=n:x>0&&(a-=n/2)}u={left:a,top:o,width:n+e.width,height:i+e.height,color:t.backdropColor}}m.push({label:y,font:C,textOffset:A,options:{rotation:g,color:i,strokeColor:l,strokeWidth:c,textAlign:f,textBaseline:O,translation:[v,k],backdrop:u}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-(0,s.t)(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,o=t+n,a=this._getLabelSizes().widest.width;let r,l;return"left"===e?s?(l=this.right+n,"near"===i?r="left":"center"===i?(r="center",l+=a/2):(r="right",l+=a)):(l=this.right-o,"near"===i?r="right":"center"===i?(r="center",l-=a/2):(r="left",l=this.left)):"right"===e?s?(l=this.left+n,"near"===i?r="right":"center"===i?(r="center",l-=a/2):(r="left",l-=a)):(l=this.left+o,"near"===i?r="left":"center"===i?(r="center",l+=a/2):(r="right",l=this.right)):r="right",{textAlign:r,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(e=>e.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const a=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n<o;++n){const t=s[n];e.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&a({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:n}}=this,o=i.setContext(this.getContext()),a=i.display?o.width:0;if(!a)return;const r=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let h,c,d,u;this.isHorizontal()?(h=(0,s.X)(t,this.left,a)-a/2,c=(0,s.X)(t,this.right,r)+r/2,d=u=l):(d=(0,s.X)(t,this.top,a)-a/2,u=(0,s.X)(t,this.bottom,r)+r/2,h=c=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(h,d),e.lineTo(c,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&(0,s.Y)(e,i);const n=this.getLabelItems(t);for(const t of n){const i=t.options,n=t.font,o=t.label,a=t.textOffset;(0,s.Z)(e,o,0,a,n,i)}i&&(0,s.$)(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const o=(0,s.a0)(i.font),a=(0,s.E)(i.padding),r=i.align;let l=o.lineHeight/2;"bottom"===e||"center"===e||(0,s.i)(e)?(l+=a.bottom,(0,s.b)(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:h,titleY:c,maxWidth:d,rotation:u}=function(t,e,i,n){const{top:o,left:a,bottom:r,right:l,chart:h}=t,{chartArea:c,scales:d}=h;let u,f,p,g=0;const m=r-o,x=l-a;if(t.isHorizontal()){if(f=(0,s.a2)(n,a,l),(0,s.i)(i)){const t=Object.keys(i)[0],s=i[t];p=d[t].getPixelForValue(s)+m-e}else p="center"===i?(c.bottom+c.top)/2+m-e:at(t,i,e);u=l-a}else{if((0,s.i)(i)){const t=Object.keys(i)[0],s=i[t];f=d[t].getPixelForValue(s)-x+e}else f="center"===i?(c.left+c.right)/2-x+e:at(t,i,e);p=(0,s.a2)(n,r,o),g="left"===i?-s.H:s.H}return{titleX:f,titleY:p,maxWidth:u,rotation:g}}(this,l,e,r);(0,s.Z)(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:u,textAlign:ut(r,e,n),textBaseline:"middle",translation:[h,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=(0,s.v)(t.grid&&t.grid.z,-1),n=(0,s.v)(t.border&&t.border.z,0);return this._isVisible()&&this.draw===ft.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n<o;++n){const o=e[n];o[i]!==this.id||t&&o.type!==t||s.push(o)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return(0,s.a0)(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class pt{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const n=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,function(t,e,i){const n=(0,s.a4)(Object.create(null),[i?s.d.get(i):{},s.d.get(e),t.defaults]);s.d.set(e,n),t.defaultRoutes&&function(t,e){Object.keys(e).forEach(i=>{const n=i.split("."),o=n.pop(),a=[t].concat(n).join("."),r=e[i].split("."),l=r.pop(),h=r.join(".");s.d.route(a,o,h,l)})}(e,t.defaultRoutes),t.descriptors&&s.d.describe(e,t.descriptors)}(t,a,i),this.override&&s.d.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in s.d[n]&&(delete s.d[n][i],this.override&&delete s.a3[i])}}class gt{constructor(){this.controllers=new pt(v,"datasets",!0),this.elements=new pt(nt,"elements"),this.plugins=new pt(Object,"plugins"),this.scales=new pt(ft,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):(0,s.F)(e,e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)})})}_exec(t,e,i){const n=(0,s.a5)(t);(0,s.Q)(i["before"+n],[],i),e[t](i),(0,s.Q)(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var mt=new gt;class xt{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const n=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(n,t,e,i);return"afterDestroy"===e&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,n){n=n||{};for(const o of t){const t=o.plugin,a=t[i],r=[e,n,o.options];if(!1===(0,s.Q)(a,r,t)&&n.cancelable)return!1}return!0}invalidate(){(0,s.k)(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,n=(0,s.v)(i.options&&i.options.plugins,{}),o=function(t){const e={},i=[],s=Object.keys(mt.plugins.items);for(let t=0;t<s.length;t++)i.push(mt.getPlugin(s[t]));const n=t.plugins||[];for(let t=0;t<n.length;t++){const s=n[t];-1===i.indexOf(s)&&(i.push(s),e[s.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==n||e?function(t,{plugins:e,localIds:i},s,n){const o=[],a=t.getContext();for(const r of e){const e=r.id,l=bt(s[e],n);null!==l&&o.push({plugin:r,options:_t(t.config,{plugin:r,local:i[e]},l,a)})}return o}(t,o,n,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function bt(t,e){return e||!1!==t?!0===t?{}:t:null}function _t(t,{plugin:e,local:i},s,n){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(s,o);return i&&e.defaults&&a.push(e.defaults),t.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function yt(t,e){const i=s.d.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function vt(t){if("x"===t||"y"===t||"r"===t)return t}function kt(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function wt(t,...e){if(vt(t))return t;for(const i of e){const e=i.axis||kt(i.position)||t.length>1&&vt(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Mt(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function Ct(t){const e=t.options||(t.options={});e.plugins=(0,s.v)(e.plugins,{}),e.scales=function(t,e){const i=s.a3[t.type]||{scales:{}},n=e.scales||{},o=yt(t.type,e),a=Object.create(null);return Object.keys(n).forEach(e=>{const r=n[e];if(!(0,s.i)(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const l=wt(e,r,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return Mt(t,"x",i[0])||Mt(t,"y",i[0])}return{}}(e,t),s.d.scales[r.type]),h=function(t,e){return t===e?"_index_":"_value_"}(l,o),c=i.scales||{};a[e]=(0,s.ab)(Object.create(null),[{axis:l},r,c[l],c[h]])}),t.data.datasets.forEach(i=>{const o=i.type||t.type,r=i.indexAxis||yt(o,e),l=(s.a3[o]||{}).scales||{};Object.keys(l).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),o=i[e+"AxisID"]||e;a[o]=a[o]||Object.create(null),(0,s.ab)(a[o],[{axis:e},n[o],l[t]])})}),Object.keys(a).forEach(t=>{const e=a[t];(0,s.ab)(e,[s.d.scales[e.type],s.d.scale])}),a}(t,e)}function St(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Et=new Map,At=new Set;function Ot(t,e){let i=Et.get(t);return i||(i=e(),Et.set(t,i),At.add(i)),i}const Dt=(t,e,i)=>{const n=(0,s.f)(e,i);void 0!==n&&t.add(n)};class Pt{constructor(t){this._config=function(t){return(t=t||{}).data=St(t.data),Ct(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=St(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Ct(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ot(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ot(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ot(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return Ot(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:n,type:o}=this,a=this._cachedScopes(t,i),r=a.get(e);if(r)return r;const l=new Set;e.forEach(e=>{t&&(l.add(t),e.forEach(e=>Dt(l,t,e))),e.forEach(t=>Dt(l,n,t)),e.forEach(t=>Dt(l,s.a3[o]||{},t)),e.forEach(t=>Dt(l,s.d,t)),e.forEach(t=>Dt(l,s.a6,t))});const h=Array.from(l);return 0===h.length&&h.push(Object.create(null)),At.has(e)&&a.set(e,h),h}chartOptionScopes(){const{options:t,type:e}=this;return[t,s.a3[e]||{},s.d.datasets[e]||{},{type:e},s.d,s.a6]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Tt(this._resolverCache,t,n);let l=a;if(function(t,e){const{isScriptable:i,isIndexable:n}=(0,s.aa)(t);for(const o of e){const e=i(o),a=n(o),r=(a||e)&&t[o];if(e&&((0,s.a7)(r)||Ft(r))||a&&(0,s.b)(r))return!0}return!1}(a,e)){o.$shared=!1,i=(0,s.a7)(i)?i():i;const e=this.createResolver(t,i,r);l=(0,s.a8)(a,i,e)}for(const t of e)o[t]=l[t];return o}createResolver(t,e,i=[""],n){const{resolver:o}=Tt(this._resolverCache,t,i);return(0,s.i)(e)?(0,s.a8)(o,e,void 0,n):o}}function Tt(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const o=i.join();let a=n.get(o);return a||(a={resolver:(0,s.a9)(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(o,a)),a}const Ft=t=>(0,s.i)(t)&&Object.getOwnPropertyNames(t).some(e=>(0,s.a7)(t[e])),It=["top","bottom","left","right","chartArea"];function Lt(t,e){return"top"===t||"bottom"===t||-1===It.indexOf(t)&&"x"===e}function Bt(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function Rt(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),(0,s.Q)(i&&i.onComplete,[t],e)}function zt(t){const e=t.chart,i=e.options.animation;(0,s.Q)(i&&i.onProgress,[t],e)}function Ht(t){return(0,s.M)()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Nt={},Wt=t=>{const e=Ht(t);return Object.values(Nt).filter(t=>t.canvas===e).pop()};function Vt(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}class jt{static defaults=s.d;static instances=Nt;static overrides=s.a3;static registry=mt;static version="4.5.0";static getChart=Wt;static register(...t){mt.add(...t),$t()}static unregister(...t){mt.remove(...t),$t()}constructor(t,e){const i=this.config=new Pt(e),n=Ht(t),a=Wt(n);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!(0,s.M)()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?V:st}(n)),this.platform.updateConfig(i);const l=this.platform.acquireContext(n,r.aspectRatio),h=l&&l.canvas,c=h&&h.height,d=h&&h.width;this.id=(0,s.ac)(),this.ctx=l,this.canvas=h,this.width=d,this.height=c,this._options=r,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 xt,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(0,s.ad)(t=>this.update(t),r.resizeDelay||0),this._dataChanges=[],Nt[this.id]=this,l&&h?(o.listen(this,"complete",Rt),o.listen(this,"progress",zt),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return(0,s.k)(t)?e&&o?o:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return mt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():(0,s.ae)(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return(0,s.af)(this.canvas,this.ctx),this}stop(){return o.stop(this),this}resize(t,e){o.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,t,e,o),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,(0,s.ae)(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),(0,s.Q)(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};(0,s.F)(t,(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let o=[];e&&(o=o.concat(Object.keys(e).map(t=>{const i=e[t],s=wt(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}}))),(0,s.F)(o,e=>{const o=e.options,a=o.id,r=wt(a,o),l=(0,s.v)(o.type,e.dtype);void 0!==o.position&&Lt(o.position,r)===Lt(e.dposition)||(o.position=e.dposition),n[a]=!0;let h=null;a in i&&i[a].type===l?h=i[a]:(h=new(mt.getScale(l))({id:a,type:l,ctx:this.ctx,chart:this}),i[h.id]=h),h.init(o,t)}),(0,s.F)(n,(t,e)=>{t||delete i[e]}),(0,s.F)(i,t=>{N.configure(this,t,t.options),N.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Bt("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i<n;i++){const n=e[i];let o=this.getDatasetMeta(i);const a=n.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=a,o.indexAxis=n.indexAxis||yt(a,this.options),o.order=n.order||0,o.index=i,o.label=""+n.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const e=mt.getController(a),{datasetElementType:n,dataElementType:r}=s.d.datasets[a];Object.assign(e,{dataElementType:mt.getElement(r),datasetElementType:n&&mt.getElement(n)}),o.controller=new e(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){(0,s.F)(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!n&&-1===o.indexOf(e);e.buildOrUpdateElements(i),a=Math.max(+e.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),n||(0,s.F)(o,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Bt("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){(0,s.F)(this.scales,t=>{N.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(0,s.ag)(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e)Vt(t,s,"_removeElements"===i?-n:n)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;t<e;t++)if(!(0,s.ag)(n,i(t)))return;return Array.from(n).map(t=>t.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;N.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],(0,s.F)(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,(0,s.a7)(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(o.has(this)?this.attached&&!o.running(this)&&o.start(this):(this.draw(),Rt({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,n;for(s=0,n=e.length;s<n;++s){const n=e[s];t&&!n.visible||i.push(n)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},n=(0,s.ah)(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(n&&(0,s.Y)(e,n),t.controller.draw(),n&&(0,s.$)(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return(0,s.C)(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=A.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(t=>t&&t._dataset===e).pop();return s||(s={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(s)),s}getContext(){return this.$context||(this.$context=(0,s.j)(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,n);(0,s.h)(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(o,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),o.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),(0,s.af)(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Nt[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};(0,s.F)(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){(0,s.F)(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},(0,s.F)(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=t.length;a<r;++a){o=t[a];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!(0,s.ai)(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:o}=this,a=e,r=this._getActiveElements(t,n,i,a),l=(0,s.aj)(t),h=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,l);i&&(this._lastEvent=null,(0,s.Q)(o.onHover,[t,r,this],this),l&&(0,s.Q)(o.onClick,[t,r,this],this));const c=!(0,s.ai)(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=h,c}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function $t(){return(0,s.F)(jt.instances,t=>t._plugins.invalidate())}function Ut(t,e,i=e){t.lineCap=(0,s.v)(i.borderCapStyle,e.borderCapStyle),t.setLineDash((0,s.v)(i.borderDash,e.borderDash)),t.lineDashOffset=(0,s.v)(i.borderDashOffset,e.borderDashOffset),t.lineJoin=(0,s.v)(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=(0,s.v)(i.borderWidth,e.borderWidth),t.strokeStyle=(0,s.v)(i.borderColor,e.borderColor)}function Gt(t,e,i){t.lineTo(i.x,i.y)}function Yt(t,e,i={}){const s=t.length,{start:n=0,end:o=s-1}=i,{start:a,end:r}=e,l=Math.max(n,a),h=Math.min(o,r),c=n<a&&o<a||n>r&&o>r;return{count:s,start:l,loop:e.loop,ilen:h<l&&!c?s+h-l:h-l}}function Xt(t,e,i,n){const{points:o,options:a}=e,{count:r,start:l,loop:h,ilen:c}=Yt(o,i,n),d=function(t){return t.stepped?s.at:t.tension||"monotone"===t.cubicInterpolationMode?s.au:Gt}(a);let u,f,p,{move:g=!0,reverse:m}=n||{};for(u=0;u<=c;++u)f=o[(l+(m?c-u:u))%r],f.skip||(g?(t.moveTo(f.x,f.y),g=!1):d(t,p,f,m,a.stepped),p=f);return h&&(f=o[(l+(m?c:0))%r],d(t,p,f,m,a.stepped)),!!h}function Qt(t,e,i,s){const n=e.points,{count:o,start:a,ilen:r}=Yt(n,i,s),{move:l=!0,reverse:h}=s||{};let c,d,u,f,p,g,m=0,x=0;const b=t=>(a+(h?r-t:t))%o,_=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=n[b(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[b(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(i<f?f=i:i>p&&(p=i),m=(x*m+e)/++x):(_(),t.lineTo(e,i),u=s,x=0,f=p=i),g=i}_()}function Zt(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?Xt:Qt}const qt="function"==typeof Path2D;class Kt extends nt{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;(0,s.an)(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=(0,s.ao)(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],o=this.points,a=(0,s.ap)(this,{property:e,start:n,end:n});if(!a.length)return;const r=[],l=function(t){return t.stepped?s.aq:t.tension||"monotone"===t.cubicInterpolationMode?s.ar:s.as}(i);let h,c;for(h=0,c=a.length;h<c;++h){const{start:s,end:c}=a[h],d=o[s],u=o[c];if(d===u){r.push(d);continue}const f=l(d,u,Math.abs((n-d[e])/(u[e]-d[e])),i.stepped);f[e]=t[e],r.push(f)}return 1===r.length?r[0]:r}pathSegment(t,e,i){return Zt(this)(t,this,e,i)}path(t,e,i){const s=this.segments,n=Zt(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=n(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const n=this.options||{};(this.points||[]).length&&n.borderWidth&&(t.save(),function(t,e,i,s){qt&&!e.options.segment?function(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),Ut(t,e.options),t.stroke(n)}(t,e,i,s):function(t,e,i,s){const{segments:n,options:o}=e,a=Zt(e);for(const r of n)Ut(t,o,r.style),t.beginPath(),a(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Jt(t,e,i,s){const n=t.options,{[i]:o}=t.getProps([i],s);return Math.abs(e-o)<n.radius+n.hitRadius}class te extends nt{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return Jt(this,t,"x",e)}inYRange(t,e){return Jt(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!(0,s.C)(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,(0,s.av)(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function ee(t,e,i,n){if(n)return;let o=e[t],a=i[t];return"angle"===t&&(o=(0,s.al)(o),a=(0,s.al)(a)),{property:t,start:o,end:a}}function ie(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function se(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function ne(t,e){let i=[],n=!1;return(0,s.b)(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:s=null}=t||{},n=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=ie(t,e,n);const a=n[t],r=n[e];null!==s?(o.push({x:a.x,y:s}),o.push({x:r.x,y:s})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:r.y}))}),o}(t,e),i.length?new Kt({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function oe(t){return t&&!1!==t.fill}function ae(t,e,i){let n=t[e].fill;const o=[e];let a;if(!i)return n;for(;!1!==n&&-1===o.indexOf(n);){if(!(0,s.g)(n))return n;if(a=t[n],!a)return!1;if(a.visible)return n;o.push(n),n=a.fill}return!1}function re(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=(0,s.v)(i&&i.target,i);return void 0===n&&(n=!!e.backgroundColor),!1!==n&&null!==n&&(!0===n?"origin":n)}(t);if((0,s.i)(n))return!isNaN(n.value)&&n;let o=parseFloat(n);return(0,s.g)(o)&&Math.floor(o)===o?function(t,e,i,s){return"-"!==t&&"+"!==t||(i=e+i),!(i===e||i<0||i>=s)&&i}(n[0],e,o,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function le(t,e,i){const s=[];for(let n=0;n<i.length;n++){const o=i[n],{first:a,last:r,point:l}=he(o,e,"x");if(!(!l||a&&r))if(a)s.unshift(l);else if(t.push(l),!r)break}t.push(...s)}function he(t,e,i){const n=t.interpolate(e,i);if(!n)return{};const o=n[i],a=t.segments,r=t.points;let l=!1,h=!1;for(let t=0;t<a.length;t++){const e=a[t],n=r[e.start][i],c=r[e.end][i];if((0,s.ak)(o,n,c)){l=o===n,h=o===c;break}}return{first:l,last:h,point:n}}class ce{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:o,radius:a}=this;return e=e||{start:0,end:s.T},t.arc(n,o,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,n=t.angle;return{x:e+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function de(t,e,i){const n=function(t){const{chart:e,fill:i,line:n}=t;if((0,s.g)(i))return function(t,e){const i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:s}=t,n=[],o=s.segments,a=s.points,r=function(t,e){const i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){const n=s[t];if(n.index===e)break;n.hidden||i.unshift(n.dataset)}return i}(e,i);r.push(ne({x:null,y:e.bottom},s));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)le(n,a[t],r)}return new Kt({points:n,options:{}})}(t);if("shape"===i)return!0;const o=function(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:i}=t,n=e.options,o=e.getLabels().length,a=n.reverse?e.max:e.min,r=function(t,e,i){let n;return n="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:(0,s.i)(t)?t.value:e.getBaseValue(),n}(i,e,a),l=[];if(n.grid.circular){const t=e.getPointPositionForValue(0,a);return new ce({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(r)})}for(let t=0;t<o;++t)l.push(e.getPointPositionForValue(t,r));return l}(t):function(t){const{scale:e={},fill:i}=t,n=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:(0,s.i)(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if((0,s.g)(n)){const t=e.isHorizontal();return{x:t?n:null,y:t?null:n}}return null}(t)}(t);return o instanceof ce?o:ne(o,n)}(e),{chart:o,index:a,line:r,scale:l,axis:h}=e,c=r.options,d=c.fill,u=c.backgroundColor,{above:f=u,below:p=u}=d||{},g=o.getDatasetMeta(a),m=(0,s.ah)(o,g);n&&r.points.length&&((0,s.Y)(t,i),function(t,e){const{line:i,target:s,above:n,below:o,area:a,scale:r,clip:l}=e,h=i._loop?"angle":e.axis;t.save();let c=o;o!==n&&("x"===h?(ue(t,s,a.top),pe(t,{line:i,target:s,color:n,scale:r,property:h,clip:l}),t.restore(),t.save(),ue(t,s,a.bottom)):"y"===h&&(fe(t,s,a.left),pe(t,{line:i,target:s,color:o,scale:r,property:h,clip:l}),t.restore(),t.save(),fe(t,s,a.right),c=n)),pe(t,{line:i,target:s,color:c,scale:r,property:h,clip:l}),t.restore()}(t,{line:r,target:n,above:f,below:p,area:i,scale:l,axis:h,clip:m}),(0,s.$)(t))}function ue(t,e,i){const{segments:s,points:n}=e;let o=!0,a=!1;t.beginPath();for(const r of s){const{start:s,end:l}=r,h=n[s],c=n[ie(s,l,n)];o?(t.moveTo(h.x,h.y),o=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),a=!!e.pathSegment(t,r,{move:a}),a?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function fe(t,e,i){const{segments:s,points:n}=e;let o=!0,a=!1;t.beginPath();for(const r of s){const{start:s,end:l}=r,h=n[s],c=n[ie(s,l,n)];o?(t.moveTo(h.x,h.y),o=!1):(t.lineTo(i,h.y),t.lineTo(h.x,h.y)),a=!!e.pathSegment(t,r,{move:a}),a?t.closePath():t.lineTo(i,c.y)}t.lineTo(i,e.first().y),t.closePath(),t.clip()}function pe(t,e){const{line:i,target:n,property:o,color:a,scale:r,clip:l}=e,h=function(t,e,i){const n=t.segments,o=t.points,a=e.points,r=[];for(const t of n){let{start:n,end:l}=t;l=ie(n,l,o);const h=ee(i,o[n],o[l],t.loop);if(!e.segments){r.push({source:t,target:h,start:o[n],end:o[l]});continue}const c=(0,s.ap)(e,h);for(const e of c){const n=ee(i,a[e.start],a[e.end],e.loop),l=(0,s.az)(t,o,n);for(const t of l)r.push({source:t,target:e,start:{[i]:se(h,n,"start",Math.max)},end:{[i]:se(h,n,"end",Math.min)}})}}return r}(i,n,o);for(const{source:e,target:s,start:c,end:d}of h){const{style:{backgroundColor:h=a}={}}=e,u=!0!==n;t.save(),t.fillStyle=h,ge(t,r,l,u&&ee(o,c,d)),t.beginPath();const f=!!i.pathSegment(t,e);let p;if(u){f?t.closePath():me(t,n,d,o);const e=!!n.pathSegment(t,s,{move:f,reverse:!0});p=f&&e,p||me(t,n,c,o)}t.closePath(),t.fill(p?"evenodd":"nonzero"),t.restore()}}function ge(t,e,i,s){const n=e.chart.chartArea,{property:o,start:a,end:r}=s||{};if("x"===o||"y"===o){let e,s,l,h;"x"===o?(e=a,s=n.top,l=r,h=n.bottom):(e=n.left,s=a,l=n.right,h=r),t.beginPath(),i&&(e=Math.max(e,i.left),l=Math.min(l,i.right),s=Math.max(s,i.top),h=Math.min(h,i.bottom)),t.rect(e,s,l-e,h-s),t.clip()}}function me(t,e,i,s){const n=e.interpolate(i,s);n&&t.lineTo(n.x,n.y)}var xe={id:"filler",afterDatasetsUpdate(t,e,i){const s=(t.data.datasets||[]).length,n=[];let o,a,r,l;for(a=0;a<s;++a)o=t.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof Kt&&(l={visible:t.isDatasetVisible(a),index:a,fill:re(r,a,s),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,n.push(l);for(a=0;a<s;++a)l=n[a],l&&!1!==l.fill&&(l.fill=ae(n,a,i.propagate))},beforeDraw(t,e,i){const s="beforeDraw"===i.drawTime,n=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),s&&i.fill&&de(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;oe(i)&&de(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;oe(s)&&"beforeDatasetDraw"===i.drawTime&&de(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const be=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class _e extends nt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){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)}buildLabels(){const t=this.options.labels||{};let e=(0,s.Q)(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,n=(0,s.a0)(i.font),o=n.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=be(i,o);let h,c;e.font=n.string,this.isHorizontal()?(h=this.maxWidth,c=this._fitRows(a,o,r,l)+10):(c=this.maxHeight,h=this._fitCols(a,n,r,l)+10),this.width=Math.min(h,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:n,maxWidth:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.lineWidths=[0],h=s+a;let c=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach((t,f)=>{const p=i+e/2+n.measureText(t.text).width;(0===f||l[l.length-1]+p+2*a>o)&&(c+=h,l[l.length-(f>0?0:1)]=0,u+=h,d++),r[f]={left:0,top:u,row:d,width:p,height:s},l[l.length-1]+=p+a}),c}_fitCols(t,e,i,s){const{ctx:n,maxHeight:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.columnSizes=[],h=o-t;let c=a,d=0,u=0,f=0,p=0;return this.legendItems.forEach((t,o)=>{const{itemWidth:g,itemHeight:m}=function(t,e,i,s,n){const o=function(t,e,i,s){let n=t.text;return n&&"string"!=typeof n&&(n=n.reduce((t,e)=>t.length>e.length?t:e)),e+i.size/2+s.measureText(n).width}(s,t,e,i),a=function(t,e,i){let s=t;return"string"!=typeof e.text&&(s=ye(e,i)),s}(n,s,e.lineHeight);return{itemWidth:o,itemHeight:a}}(i,e,n,t,s);o>0&&u+m+2*a>h&&(c+=d+a,l.push({width:d,height:u}),f+=d+a,p++,d=u=0),r[o]={left:f,top:u,col:p,width:g,height:m},d=Math.max(d,g),u+=m+a}),c+=d,l.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:o}}=this,a=(0,s.aA)(o,this.left,this.width);if(this.isHorizontal()){let o=0,r=(0,s.a2)(i,this.left+n,this.right-this.lineWidths[o]);for(const l of e)o!==l.row&&(o=l.row,r=(0,s.a2)(i,this.left+n,this.right-this.lineWidths[o])),l.top+=this.top+t+n,l.left=a.leftForLtr(a.x(r),l.width),r+=l.width+n}else{let o=0,r=(0,s.a2)(i,this.top+t+n,this.bottom-this.columnSizes[o].height);for(const l of e)l.col!==o&&(o=l.col,r=(0,s.a2)(i,this.top+t+n,this.bottom-this.columnSizes[o].height)),l.top=r,l.left+=this.left+n,l.left=a.leftForLtr(a.x(l.left),l.width),r+=l.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;(0,s.Y)(t,this),this._draw(),(0,s.$)(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:o,labels:a}=t,r=s.d.color,l=(0,s.aA)(t.rtl,this.left,this.width),h=(0,s.a0)(a.font),{padding:c}=a,d=h.size,u=d/2;let f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=h.string;const{boxWidth:p,boxHeight:g,itemHeight:m}=be(a,d),x=this.isHorizontal(),b=this._computeTitleHeight();f=x?{x:(0,s.a2)(o,this.left+c,this.right-i[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:(0,s.a2)(o,this.top+b+c,this.bottom-e[0].height),line:0},(0,s.aB)(this.ctx,t.textDirection);const _=m+c;this.legendItems.forEach((y,v)=>{n.strokeStyle=y.fontColor,n.fillStyle=y.fontColor;const k=n.measureText(y.text).width,w=l.textAlign(y.textAlign||(y.textAlign=a.textAlign)),M=p+u+k;let C=f.x,S=f.y;if(l.setWidth(this.width),x?v>0&&C+M+c>this.right&&(S=f.y+=_,f.line++,C=f.x=(0,s.a2)(o,this.left+c,this.right-i[f.line])):v>0&&S+_>this.bottom&&(C=f.x=C+e[f.line].width+c,f.line++,S=f.y=(0,s.a2)(o,this.top+b+c,this.bottom-e[f.line].height)),function(t,e,i){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;n.save();const o=(0,s.v)(i.lineWidth,1);if(n.fillStyle=(0,s.v)(i.fillStyle,r),n.lineCap=(0,s.v)(i.lineCap,"butt"),n.lineDashOffset=(0,s.v)(i.lineDashOffset,0),n.lineJoin=(0,s.v)(i.lineJoin,"miter"),n.lineWidth=o,n.strokeStyle=(0,s.v)(i.strokeStyle,r),n.setLineDash((0,s.v)(i.lineDash,[])),a.usePointStyle){const r={radius:g*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:o},h=l.xPlus(t,p/2),c=e+u;(0,s.aE)(n,r,h,c,a.pointStyleWidth&&p)}else{const a=e+Math.max((d-g)/2,0),r=l.leftForLtr(t,p),h=(0,s.ay)(i.borderRadius);n.beginPath(),Object.values(h).some(t=>0!==t)?(0,s.aw)(n,{x:r,y:a,w:p,h:g,radius:h}):n.rect(r,a,p,g),n.fill(),0!==o&&n.stroke()}n.restore()}(l.x(C),S,y),C=(0,s.aC)(w,C+p+u,x?C+M:this.right,t.rtl),function(t,e,i){(0,s.Z)(n,i.text,t,e+m/2,h,{strikethrough:i.hidden,textAlign:l.textAlign(i.textAlign)})}(l.x(C),S,y),x)f.x+=M+c;else if("string"!=typeof y.text){const t=h.lineHeight;f.y+=ye(y,t)+c}else f.y+=_}),(0,s.aD)(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=(0,s.a0)(e.font),n=(0,s.E)(e.padding);if(!e.display)return;const o=(0,s.aA)(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=i.size/2,h=n.top+l;let c,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),c=this.top+h,d=(0,s.a2)(t.align,d,this.right-u);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);c=h+(0,s.a2)(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const f=(0,s.a2)(r,d,d+u);a.textAlign=o.textAlign((0,s.a1)(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,(0,s.Z)(a,e.text,f,c,i)}_computeTitleHeight(){const t=this.options.title,e=(0,s.a0)(t.font),i=(0,s.E)(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,o;if((0,s.ak)(t,this.left,this.right)&&(0,s.ak)(e,this.top,this.bottom))for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(n=o[i],(0,s.ak)(t,n.left,n.left+n.width)&&(0,s.ak)(e,n.top,n.top+n.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){return!("mousemove"!==t&&"mouseout"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const a=this._hoveredItem,r=(o=i,null!==(n=a)&&null!==o&&n.datasetIndex===o.datasetIndex&&n.index===o.index);a&&!r&&(0,s.Q)(e.onLeave,[t,a,this],this),this._hoveredItem=i,i&&!r&&(0,s.Q)(e.onHover,[t,i,this],this)}else i&&(0,s.Q)(e.onClick,[t,i,this],this);var n,o}}function ye(t,e){return e*(t.text?t.text.length:0)}var ve={id:"legend",_element:_e,start(t,e,i){const s=t.legend=new _e({ctx:t.ctx,options:i,chart:t});N.configure(t,s,i),N.addBox(t,s)},stop(t){N.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const s=t.legend;N.configure(t,s,i),s.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const s=e.datasetIndex,n=i.chart;n.isDatasetVisible(s)?(n.hide(s),e.hidden=!0):(n.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:o,color:a,useBorderRadius:r,borderRadius:l}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const h=t.controller.getStyle(i?0:void 0),c=(0,s.E)(h.borderWidth);return{text:e[t.index].label,fillStyle:h.backgroundColor,fontColor:a,hidden:!t.visible,lineCap:h.borderCapStyle,lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:h.borderColor,pointStyle:n||h.pointStyle,rotation:h.rotation,textAlign:o||h.textAlign,borderRadius:r&&(l||h.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class ke extends nt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const n=(0,s.b)(i.text)?i.text.length:1;this._padding=(0,s.E)(i.padding);const o=n*(0,s.a0)(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:o,options:a}=this,r=a.align;let l,h,c,d=0;return this.isHorizontal()?(h=(0,s.a2)(r,i,o),c=e+t,l=o-i):("left"===a.position?(h=i+t,c=(0,s.a2)(r,n,e),d=-.5*s.P):(h=o-t,c=(0,s.a2)(r,e,n),d=.5*s.P),l=n-e),{titleX:h,titleY:c,maxWidth:l,rotation:d}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=(0,s.a0)(e.font),n=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:r,rotation:l}=this._drawArgs(n);(0,s.Z)(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:l,textAlign:(0,s.a1)(e.align),textBaseline:"middle",translation:[o,a]})}}var we={id:"title",_element:ke,start(t,e,i){!function(t,e){const i=new ke({ctx:t.ctx,options:e,chart:t});N.configure(t,i,e),N.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;N.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;N.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};new WeakMap;const Me={average(t){if(!t.length)return!1;let e,i,s=new Set,n=0,o=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();s.add(t.x),n+=t.y,++o}}return 0!==o&&0!==s.size&&{x:[...s].reduce((t,e)=>t+e)/s.size,y:n/o}},nearest(t,e){if(!t.length)return!1;let i,n,o,a=e.x,r=e.y,l=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){const n=t[i].element;if(n&&n.hasValue()){const t=n.getCenterPoint(),i=(0,s.aF)(e,t);i<l&&(l=i,o=n)}}if(o){const t=o.tooltipPosition();a=t.x,r=t.y}return{x:a,y:r}}};function Ce(t,e){return e&&((0,s.b)(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Se(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Ee(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:t,label:a,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function Ae(t,e){const i=t.chart.ctx,{body:n,footer:o,title:a}=t,{boxWidth:r,boxHeight:l}=e,h=(0,s.a0)(e.bodyFont),c=(0,s.a0)(e.titleFont),d=(0,s.a0)(e.footerFont),u=a.length,f=o.length,p=n.length,g=(0,s.E)(e.padding);let m=g.height,x=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);b+=t.beforeBody.length+t.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),b&&(m+=p*(e.displayColors?Math.max(l,h.lineHeight):h.lineHeight)+(b-p)*h.lineHeight+(b-1)*e.bodySpacing),f&&(m+=e.footerMarginTop+f*d.lineHeight+(f-1)*e.footerSpacing);let _=0;const y=function(t){x=Math.max(x,i.measureText(t).width+_)};return i.save(),i.font=c.string,(0,s.F)(t.title,y),i.font=h.string,(0,s.F)(t.beforeBody.concat(t.afterBody),y),_=e.displayColors?r+2+e.boxPadding:0,(0,s.F)(n,t=>{(0,s.F)(t.before,y),(0,s.F)(t.lines,y),(0,s.F)(t.after,y)}),_=0,i.font=d.string,(0,s.F)(t.footer,y),i.restore(),x+=g.width,{width:x,height:m}}function Oe(t,e,i,s){const{x:n,width:o}=i,{width:a,chartArea:{left:r,right:l}}=t;let h="center";return"center"===s?h=n<=(r+l)/2?"left":"right":n<=o/2?h="left":n>=a-o/2&&(h="right"),function(t,e,i,s){const{x:n,width:o}=s,a=i.caretSize+i.caretPadding;return"left"===t&&n+o+a>e.width||"right"===t&&n-o-a<0||void 0}(h,t,e,i)&&(h="center"),h}function De(t,e,i){const s=i.yAlign||e.yAlign||function(t,e){const{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Oe(t,e,i,s),yAlign:s}}function Pe(t,e,i,n){const{caretSize:o,caretPadding:a,cornerRadius:r}=t,{xAlign:l,yAlign:h}=i,c=o+a,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:p}=(0,s.ay)(r);let g=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,l);const m=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(e,h,c);return"center"===h?"left"===l?g+=c:"right"===l&&(g-=c):"left"===l?g-=Math.max(d,f)+o:"right"===l&&(g+=Math.max(u,p)+o),{x:(0,s.S)(g,0,n.width-e.width),y:(0,s.S)(m,0,n.height-e.height)}}function Te(t,e,i){const n=(0,s.E)(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function Fe(t){return Ce([],Se(t))}function Ie(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const Le={beforeTitle:s.aG,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return""},afterTitle:s.aG,beforeBody:s.aG,beforeLabel:s.aG,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return(0,s.k)(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:s.aG,afterBody:s.aG,beforeFooter:s.aG,footer:s.aG,afterFooter:s.aG};function Be(t,e,i,s){const n=t[e].call(i,s);return void 0===n?Le[e].call(i,s):n}class Re extends nt{static positioners=Me;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,n=new h(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this._tooltipItems,(0,s.j)(t,{tooltip:this,tooltipItems:e,type:"tooltip"})));var t,e}getTitle(t,e){const{callbacks:i}=e,s=Be(i,"beforeTitle",this,t),n=Be(i,"title",this,t),o=Be(i,"afterTitle",this,t);let a=[];return a=Ce(a,Se(s)),a=Ce(a,Se(n)),a=Ce(a,Se(o)),a}getBeforeBody(t,e){return Fe(Be(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return(0,s.F)(t,t=>{const e={before:[],lines:[],after:[]},s=Ie(i,t);Ce(e.before,Se(Be(s,"beforeLabel",this,t))),Ce(e.lines,Be(s,"label",this,t)),Ce(e.after,Se(Be(s,"afterLabel",this,t))),n.push(e)}),n}getAfterBody(t,e){return Fe(Be(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=Be(i,"beforeFooter",this,t),n=Be(i,"footer",this,t),o=Be(i,"afterFooter",this,t);let a=[];return a=Ce(a,Se(s)),a=Ce(a,Se(n)),a=Ce(a,Se(o)),a}_createItems(t){const e=this._active,i=this.chart.data,n=[],o=[],a=[];let r,l,h=[];for(r=0,l=e.length;r<l;++r)h.push(Ee(this.chart,e[r]));return t.filter&&(h=h.filter((e,s,n)=>t.filter(e,s,n,i))),t.itemSort&&(h=h.sort((e,s)=>t.itemSort(e,s,i))),(0,s.F)(h,e=>{const i=Ie(t.callbacks,e);n.push(Be(i,"labelColor",this,e)),o.push(Be(i,"labelPointStyle",this,e)),a.push(Be(i,"labelTextColor",this,e))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=h,h}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=Me[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Ae(this,i),a=Object.assign({},t,e),r=De(this.chart,i,a),l=Pe(i,a,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:o}=this,{caretSize:a,cornerRadius:r}=i,{topLeft:l,topRight:h,bottomLeft:c,bottomRight:d}=(0,s.ay)(r),{x:u,y:f}=t,{width:p,height:g}=e;let m,x,b,_,y,v;return"center"===o?(y=f+g/2,"left"===n?(m=u,x=m-a,_=y+a,v=y-a):(m=u+p,x=m+a,_=y-a,v=y+a),b=m):(x="left"===n?u+Math.max(l,c)+a:"right"===n?u+p-Math.max(h,d)-a:this.caretX,"top"===o?(_=f,y=_-a,m=x-a,b=x+a):(_=f+g,y=_+a,m=x+a,b=x-a),v=_),{x1:m,x2:x,x3:b,y1:_,y2:y,y3:v}}drawTitle(t,e,i){const n=this.title,o=n.length;let a,r,l;if(o){const h=(0,s.aA)(i.rtl,this.x,this.width);for(t.x=Te(this,i.titleAlign,i),e.textAlign=h.textAlign(i.titleAlign),e.textBaseline="middle",a=(0,s.a0)(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(n[l],h.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,n,o){const a=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:l,boxWidth:h}=o,c=(0,s.a0)(o.bodyFont),d=Te(this,"left",o),u=n.x(d),f=l<c.lineHeight?(c.lineHeight-l)/2:0,p=e.y+f;if(o.usePointStyle){const e={radius:Math.min(h,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},i=n.leftForLtr(u,h)+h/2,c=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,(0,s.av)(t,e,i,c),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,(0,s.av)(t,e,i,c)}else{t.lineWidth=(0,s.i)(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const e=n.leftForLtr(u,h),i=n.leftForLtr(n.xPlus(u,1),h-2),r=(0,s.ay)(a.borderRadius);Object.values(r).some(t=>0!==t)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,(0,s.aw)(t,{x:e,y:p,w:h,h:l,radius:r}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),(0,s.aw)(t,{x:i,y:p+1,w:h-2,h:l-2,radius:r}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(e,p,h,l),t.strokeRect(e,p,h,l),t.fillStyle=a.backgroundColor,t.fillRect(i,p+1,h-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:h,boxPadding:c}=i,d=(0,s.a0)(i.bodyFont);let u=d.lineHeight,f=0;const p=(0,s.aA)(i.rtl,this.x,this.width),g=function(i){e.fillText(i,p.x(t.x+f),t.y+u/2),t.y+=u+o},m=p.textAlign(a);let x,b,_,y,v,k,w;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,t.x=Te(this,m,i),e.fillStyle=i.bodyColor,(0,s.F)(this.beforeBody,g),f=r&&"right"!==m?"center"===a?h/2+c:h+2+c:0,y=0,k=n.length;y<k;++y){for(x=n[y],b=this.labelTextColors[y],e.fillStyle=b,(0,s.F)(x.before,g),_=x.lines,r&&_.length&&(this._drawColorBox(e,t,y,p,i),u=Math.max(d.lineHeight,l)),v=0,w=_.length;v<w;++v)g(_[v]),u=d.lineHeight;(0,s.F)(x.after,g)}f=0,u=d.lineHeight,(0,s.F)(this.afterBody,g),t.y-=o}drawFooter(t,e,i){const n=this.footer,o=n.length;let a,r;if(o){const l=(0,s.aA)(i.rtl,this.x,this.width);for(t.x=Te(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=(0,s.a0)(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(n[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:h,height:c}=i,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:p}=(0,s.ay)(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(r+d,l),"top"===a&&this.drawCaret(t,e,i,n),e.lineTo(r+h-u,l),e.quadraticCurveTo(r+h,l,r+h,l+u),"center"===a&&"right"===o&&this.drawCaret(t,e,i,n),e.lineTo(r+h,l+c-p),e.quadraticCurveTo(r+h,l+c,r+h-p,l+c),"bottom"===a&&this.drawCaret(t,e,i,n),e.lineTo(r+f,l+c),e.quadraticCurveTo(r,l+c,r,l+c-f),"center"===a&&"left"===o&&this.drawCaret(t,e,i,n),e.lineTo(r,l+d),e.quadraticCurveTo(r,l,r+d,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=Me[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Ae(this,t),a=Object.assign({},i,this._size),r=De(e,t,a),l=Pe(t,a,r,e);s._to===l.x&&n._to===l.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=(0,s.E)(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,n,e),(0,s.aB)(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),(0,s.aD)(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),o=!(0,s.ai)(i,n),a=this._positionChanged(n,e);(o||a)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,i),r=this._positionChanged(a,t),l=e||!(0,s.ai)(a,o)||r;return l&&(this._active=a,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));const o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=Me[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}var ze={id:"tooltip",_element:Re,positioners:Me,afterInit(t,e,i){i&&(t.tooltip=new Re({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const 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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>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:Le},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function He(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class Ne extends ft{static id="category";static defaults={ticks:{callback:He}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if((0,s.k)(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:(0,s.S)(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,s){const n=t.indexOf(e);return-1===n?((t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s):n!==t.lastIndexOf(e)?i:n}(i,t,(0,s.v)(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){return He.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function We(t,e,{horizontal:i,minRotation:n}){const o=(0,s.t)(n),a=(i?Math.sin(o):Math.cos(o))||.001,r=.75*e*(""+t).length;return Math.min(e/a,r)}class Ve extends ft{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return(0,s.k)(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:o}=this;const a=t=>n=e?n:t,r=t=>o=i?o:t;if(t){const t=(0,s.s)(n),e=(0,s.s)(o);t<0&&e<0?r(0):t>0&&e>0&&a(0)}if(n===o){let e=0===o?1:Math.abs(.05*o);r(o+e),t||a(n-e)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:o,min:a,max:r,precision:l,count:h,maxTicks:c,maxDigits:d,includeBounds:u}=t,f=o||1,p=c-1,{min:g,max:m}=e,x=!(0,s.k)(a),b=!(0,s.k)(r),_=!(0,s.k)(h),y=(m-g)/(d+1);let v,k,w,M,C=(0,s.aI)((m-g)/p/f)*f;if(C<1e-14&&!x&&!b)return[{value:g},{value:m}];M=Math.ceil(m/C)-Math.floor(g/C),M>p&&(C=(0,s.aI)(M*C/p/f)*f),(0,s.k)(l)||(v=Math.pow(10,l),C=Math.ceil(C*v)/v),"ticks"===n?(k=Math.floor(g/C)*C,w=Math.ceil(m/C)*C):(k=g,w=m),x&&b&&o&&(0,s.aJ)((r-a)/o,C/1e3)?(M=Math.round(Math.min((r-a)/C,c)),C=(r-a)/M,k=a,w=r):_?(k=x?a:k,w=b?r:w,M=h-1,C=(w-k)/M):(M=(w-k)/C,M=(0,s.aK)(M,Math.round(M),C/1e3)?Math.round(M):Math.ceil(M));const S=Math.max((0,s.aL)(C),(0,s.aL)(k));v=Math.pow(10,(0,s.k)(l)?S:l),k=Math.round(k*v)/v,w=Math.round(w*v)/v;let E=0;for(x&&(u&&k!==a?(i.push({value:a}),k<a&&E++,(0,s.aK)(Math.round((k+E*C)*v)/v,a,We(a,y,t))&&E++):k<a&&E++);E<M;++E){const t=Math.round((k+E*C)*v)/v;if(b&&t>r)break;i.push({value:t})}return b&&u&&w!==r?i.length&&(0,s.aK)(i[i.length-1].value,r,We(r,y,t))?i[i.length-1].value=r:i.push({value:r}):b&&w!==r||i.push({value:w}),i}({maxTicks: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&&(0,s.aH)(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return(0,s.o)(t,this.chart.options.locale,this.options.ticks.format)}}class je extends Ve{static id="linear";static defaults={ticks:{callback:s.aM.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=(0,s.g)(t)?t:0,this.max=(0,s.g)(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=(0,s.t)(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}s.aM.formatters.logarithmic,s.aM.formatters.numeric},49757:(t,e,i)=>{i.d(e,{A:()=>o,H:()=>n});var s=i(51609);function n(){return(0,s.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)("path",{d:"M9 2.5C9 1.948 9.448 1.5 10 1.5C10.552 1.5 11 1.948 11 2.5V9",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),(0,s.createElement)("path",{d:"M11 8V6C11 5.448 11.448 5 12 5C12.552 5 13 5.448 13 6V9",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),(0,s.createElement)("path",{d:"M13 8V6.5C13 5.948 13.448 5.5 14 5.5C14.552 5.5 15 5.948 15 6.5V10.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),(0,s.createElement)("path",{d:"M7 5C7 4.448 7.448 4 8 4C8.552 4 9 4.448 9 5V9",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),(0,s.createElement)("path",{d:"M7 9.5C7 9.5 5.5 9.5 5.5 11.5C5.5 12.828 6 14 7 15C7.833 15.833 9 16.5 10.5 16.5H12C13.657 16.5 15 15.157 15 13.5V10.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}function o(){return(0,s.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)("path",{d:"M2.5 2.5V17.5H17.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.createElement)("path",{d:"M6.5 14V15.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),(0,s.createElement)("path",{d:"M9.5 12V15.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),(0,s.createElement)("path",{d:"M12.5 9.5V15.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),(0,s.createElement)("path",{d:"M15.5 6.5V15.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),(0,s.createElement)("path",{d:"M2.5 10.5C6.5 10.5 6 6.5 9.5 6.5C13 6.5 12.5 10.5 17.5 8",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:"0.55"}))}},51529:(t,e,i)=>{i.d(e,{N1:()=>f});var s=i(51609),n=i(44656);const o="label";function a(t,e){"function"==typeof t?t(e):t&&(t.current=e)}function r(t,e){t.labels=e}function l(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o;const s=[];t.datasets=e.map(e=>{const n=t.datasets.find(t=>t[i]===e[i]);return n&&e.data&&!s.includes(n)?(s.push(n),Object.assign(n,e),n):{...e}})}function h(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;const i={labels:[],datasets:[]};return r(i,t.labels),l(i,t.datasets,e),i}function c(t,e){const{height:i=150,width:o=300,redraw:c=!1,datasetIdKey:d,type:u,data:f,options:p,plugins:g=[],fallbackContent:m,updateMode:x,...b}=t,_=(0,s.useRef)(null),y=(0,s.useRef)(null),v=()=>{_.current&&(y.current=new n.t1(_.current,{type:u,data:h(f,d),options:p&&{...p},plugins:g}),a(e,y.current))},k=()=>{a(e,null),y.current&&(y.current.destroy(),y.current=null)};return(0,s.useEffect)(()=>{!c&&y.current&&p&&function(t,e){const i=t.options;i&&e&&Object.assign(i,e)}(y.current,p)},[c,p]),(0,s.useEffect)(()=>{!c&&y.current&&r(y.current.config.data,f.labels)},[c,f.labels]),(0,s.useEffect)(()=>{!c&&y.current&&f.datasets&&l(y.current.config.data,f.datasets,d)},[c,f.datasets]),(0,s.useEffect)(()=>{y.current&&(c?(k(),setTimeout(v)):y.current.update(x))},[c,p,f.labels,f.datasets,x]),(0,s.useEffect)(()=>{y.current&&(k(),setTimeout(v))},[u]),(0,s.useEffect)(()=>(v(),()=>k()),[]),s.createElement("canvas",{ref:_,role:"img",height:i,width:o,...b},m)}const d=(0,s.forwardRef)(c);function u(t,e){return n.t1.register(e),(0,s.forwardRef)((e,i)=>s.createElement(d,{...e,ref:i,type:t}))}const f=u("line",n.ZT)},51609:t=>{t.exports=window.React},56859:(t,e,i)=>{i.d(e,{A:()=>d});var s=i(51609),n=i(27723),o=i(25689),a=i(49757),r=i(39682),l=i(87941);const h="#4794ff",c="#6f52ff";function d({config:t,data:e,loading:i,error:d,onRetry:u}){const f=Array.isArray(e?.rows)?e.rows:[],p=f.reduce((t,e)=>(t.clicks+=Number(e.clicks)||0,t.impressions+=Number(e.impressions)||0,t),{clicks:0,impressions:0}),g=p.clicks>0||p.impressions>0,m=[{key:"clicks",label:(0,n.__)("Total Clicks","thinkrank"),value:p.clicks,color:h,icon:(0,s.createElement)(a.H,null)},{key:"impressions",label:(0,n.__)("Total Impressions","thinkrank"),value:p.impressions,color:c,icon:(0,s.createElement)(a.A,null)}];return(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__panel"},(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__toolbar"},(0,s.createElement)("span",{className:"thinkrank-dashboard-widget__toolbar-label"},(0,n.__)("Traffic from last few days","thinkrank")),(0,s.createElement)("a",{className:"thinkrank-dashboard-widget__view-more",href:t.settingsUrl},(0,n.__)("View More","thinkrank"),(0,s.createElement)("span",{"aria-hidden":"true"},"↗"))),i&&(0,s.createElement)("p",{className:"thinkrank-dashboard-widget__note"},(0,n.__)("Loading Search Console data…","thinkrank")),!i&&d&&(0,s.createElement)(l.A,{error:d,config:t,onRetry:u}),!i&&!d&&!g&&(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__empty-data"},(0,s.createElement)("p",{className:"thinkrank-dashboard-widget__empty-data-title"},(0,n.__)("No data available","thinkrank")),(0,s.createElement)("p",{className:"thinkrank-dashboard-widget__note"},(0,n.__)("Search Console data might take up to 30 days to appear for newly added sites. Please check back later.","thinkrank"))),!i&&!d&&g&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(o.A,{rows:f}),(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__stats"},m.map(t=>{return(0,s.createElement)("div",{key:t.key,className:"thinkrank-dashboard-widget__stat"},(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__stat-top"},(0,s.createElement)("span",{className:"thinkrank-dashboard-widget__stat-icon",style:{backgroundColor:t.color}},t.icon),(0,s.createElement)("span",{className:"thinkrank-dashboard-widget__stat-label"},t.label)),(0,s.createElement)("span",{className:"thinkrank-dashboard-widget__stat-value"},(e=t.value,(Number(e)||0).toLocaleString())));var e}))),(0,s.createElement)(r.A,{config:t}))}},60775:(t,e,i)=>{i.d(e,{A:()=>n});const s=()=>!0===window.thinkrankDebug||!0===window.thinkrankAdmin?.debug,n={error:(...t)=>{s()&&console.error("[ThinkRank]",...t)},warn:(...t)=>{s()&&console.warn("[ThinkRank]",...t)},info:(...t)=>{s()&&console.info("[ThinkRank]",...t)}}},62538:(t,e,i)=>{i.d(e,{R:()=>s});const s="30d"},69966:(t,e,i)=>{i.d(e,{A:()=>a});var s=i(51609),n=i(86087);let o=0;const a=({size:t=28,className:e=""})=>{const[i]=(0,n.useState)(()=>`tr${o+=1}`),a='<svg width="__SIZE__" height="__SIZE__" viewBox="0 0 29 29" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true"><g filter="url(#filter0_ii_1426_17776)"><g clip-path="url(#clip0_1426_17776)"><g filter="url(#filter1_i_1426_17776)"><path d="M0.436523 6.61665C0.436523 3.15762 3.24063 0.353516 6.69966 0.353516H22.1734C25.6324 0.353516 28.4365 3.15762 28.4365 6.61665V22.0904C28.4365 25.5494 25.6324 28.3535 22.1734 28.3535H6.69966C3.24063 28.3535 0.436523 25.5494 0.436523 22.0904V6.61665Z" fill="url(#paint0_linear_1426_17776)"></path></g><g filter="url(#filter2_f_1426_17776)"><path d="M7.5174 21.5838C3.89577 20.9253 2.76064 20.6108 -0.0576172 22.8811V30.3506H29.5615L29.1584 8.37305C28.9585 8.37314 22.824 10.9411 19.833 13.9C16.0579 18.7189 13.4633 22.6649 7.5174 21.5838Z" fill="url(#paint1_linear_1426_17776)"></path></g><g filter="url(#filter3_dii_1426_17776)"><path d="M29.1618 8.11914C29.1618 8.11914 29.1622 8.11903 29.3906 8.71865C29.6058 9.28347 29.6182 9.31627 29.6189 9.31817C29.6189 9.31817 29.6185 9.3185 29.6182 9.31862C29.6176 9.31886 29.6166 9.31924 29.6153 9.31976C29.6124 9.32086 29.6078 9.32246 29.6018 9.32477C29.5898 9.32942 29.5714 9.33652 29.5471 9.34596C29.4986 9.36487 29.4265 9.39344 29.3332 9.43073C29.1465 9.50532 28.8754 9.61538 28.5404 9.75703C27.8699 10.0405 26.9452 10.449 25.9291 10.9483C23.8797 11.9554 21.5331 13.2968 20.1165 14.6951C19.2976 15.5641 18.5831 16.4248 17.898 17.2522C17.2153 18.0766 16.555 18.8765 15.8671 19.588C14.477 21.0257 12.9316 22.1479 10.6959 22.53C9.60585 22.7163 8.53683 22.6112 7.52835 22.4516C6.48364 22.2863 5.5662 22.0772 4.59619 21.989C3.82718 21.9191 3.16045 21.9788 2.48024 22.211C1.79208 22.4458 1.05578 22.8689 0.16582 23.5725L-0.629883 22.5658C0.329559 21.8073 1.19422 21.2939 2.06576 20.9965C2.94522 20.6963 3.79701 20.6277 4.7124 20.7109C5.73306 20.8037 6.79732 21.0365 7.7291 21.184C8.69711 21.3372 9.59965 21.4156 10.4799 21.2651C12.3522 20.9451 13.6648 20.0196 14.9444 18.6962C15.5914 18.027 16.2189 17.2678 16.9095 16.4337C17.5953 15.6055 18.3371 14.7115 19.1918 13.8053L19.1994 13.7973L19.2073 13.7893C20.7824 12.2312 23.2976 10.8117 25.3631 9.79668C26.4061 9.28415 27.3538 8.86556 28.0407 8.5751C28.3843 8.4298 28.6633 8.31639 28.8569 8.239C28.9537 8.20031 29.0292 8.17052 29.0809 8.15036C29.1068 8.14028 29.1268 8.13259 29.1404 8.12734C29.1472 8.12472 29.1525 8.12281 29.1561 8.12142C29.1579 8.12073 29.1592 8.11998 29.1602 8.1196C29.1607 8.11941 29.1613 8.11925 29.1616 8.11914H29.1618Z" fill="url(#paint2_linear_1426_17776)"></path></g><g filter="url(#filter4_dii_1426_17776)"><path d="M22.3437 13.4975C22.3437 14.5285 21.508 15.3642 20.477 15.3642C19.4461 15.3642 18.6104 14.5285 18.6104 13.4975C18.6104 12.4666 19.4461 11.6309 20.477 11.6309C21.508 11.6309 22.3437 12.4666 22.3437 13.4975Z" fill="url(#paint3_radial_1426_17776)"></path><path d="M20.4766 11.2734C21.7049 11.2734 22.7009 12.2688 22.7012 13.4971C22.7012 14.7256 21.7051 15.7217 20.4766 15.7217C19.2482 15.7214 18.2529 14.7254 18.2529 13.4971C18.2532 12.2689 19.2484 11.2737 20.4766 11.2734Z" fill="none" stroke="white" stroke-width="0.715555"></path></g><g filter="url(#filter5_d_1426_17776)"><path d="M15.6201 6.78776C15.9391 6.88104 15.9391 7.33291 15.6201 7.42619L13.5873 8.02069C13.4784 8.05254 13.3933 8.13768 13.3614 8.24656L12.7669 10.2794C12.6736 10.5984 12.2218 10.5984 12.1285 10.2794L11.534 8.24656C11.5022 8.13768 11.417 8.05254 11.3081 8.02069L9.27529 7.42619C8.95631 7.33291 8.9563 6.88104 9.27528 6.78776L11.3081 6.19326C11.417 6.16141 11.5022 6.07627 11.534 5.96739L12.1285 3.93455C12.2218 3.61557 12.6736 3.61557 12.7669 3.93455L13.3614 5.96739C13.3933 6.07627 13.4784 6.16141 13.5873 6.19326L15.6201 6.78776Z" fill="url(#paint4_linear_1426_17776)"></path></g><g filter="url(#filter6_d_1426_17776)"><path d="M11.6747 13.8907C11.8298 13.9361 11.8298 14.1557 11.6747 14.201L10.4245 14.5667C10.3716 14.5822 10.3302 14.6235 10.3147 14.6765L9.94909 15.9267C9.90375 16.0817 9.68413 16.0817 9.63879 15.9267L9.27317 14.6765C9.25769 14.6235 9.21631 14.5822 9.16339 14.5667L7.91315 14.201C7.75811 14.1557 7.75811 13.9361 7.91315 13.8907L9.16339 13.5251C9.21631 13.5096 9.25769 13.4683 9.27317 13.4153L9.63879 12.1651C9.68413 12.0101 9.90375 12.0101 9.94909 12.1651L10.3147 13.4153C10.3302 13.4683 10.3716 13.5096 10.4245 13.5251L11.6747 13.8907Z" fill="url(#paint5_linear_1426_17776)"></path></g></g><rect x="0.353516" y="0.353516" width="28" height="28" rx="7.76216" fill="none" stroke="#B6CBFF" stroke-width="0.707321"></rect></g><defs><filter id="filter0_ii_1426_17776" x="0" y="0" width="29.3727" height="29.3727" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dx="0.665934"></feOffset><feGaussianBlur stdDeviation="0.332839"></feGaussianBlur><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.4 0"></feColorMatrix><feBlend mode="normal" in2="shape" result="effect1_innerShadow_1426_17776"></feBlend><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="0.666153"></feOffset><feGaussianBlur stdDeviation="0.332839"></feGaussianBlur><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.4 0"></feColorMatrix><feBlend mode="normal" in2="effect1_innerShadow_1426_17776" result="effect2_innerShadow_1426_17776"></feBlend></filter><filter id="filter1_i_1426_17776" x="0.436523" y="0.353516" width="28" height="28.6657" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="0.666153"></feOffset><feGaussianBlur stdDeviation="0.332839"></feGaussianBlur><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.4 0"></feColorMatrix><feBlend mode="normal" in2="shape" result="effect1_innerShadow_1426_17776"></feBlend></filter><filter id="filter2_f_1426_17776" x="-0.810117" y="7.62055" width="31.1241" height="23.4835" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur stdDeviation="0.37625" result="effect1_foregroundBlur_1426_17776"></feGaussianBlur></filter><filter id="filter3_dii_1426_17776" x="-3.13822" y="6.23789" width="35.2657" height="20.4698" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="0.627083"></feOffset><feGaussianBlur stdDeviation="1.25417"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0.315797 0 0 0 0 0 0 0 0 0 0.371526 0 0 0 0.25 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1426_17776"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1426_17776" result="shape"></feBlend><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="0.125417"></feOffset><feGaussianBlur stdDeviation="0.0627083"></feGaussianBlur><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0"></feColorMatrix><feBlend mode="normal" in2="shape" result="effect2_innerShadow_1426_17776"></feBlend><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="-0.125417"></feOffset><feGaussianBlur stdDeviation="0.37625"></feGaussianBlur><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0"></feColorMatrix><feBlend mode="normal" in2="effect2_innerShadow_1426_17776" result="effect3_innerShadow_1426_17776"></feBlend></filter><filter id="filter4_dii_1426_17776" x="13.9265" y="8.93202" width="13.101" height="13.1001" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="1.984"></feOffset><feGaussianBlur stdDeviation="1.984"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0.0528337 0 0 0 0 0.619328 0 0 0 0.3 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1426_17776"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1426_17776" result="shape"></feBlend><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="0.238518"></feOffset><feGaussianBlur stdDeviation="0.238518"></feGaussianBlur><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.4 0"></feColorMatrix><feBlend mode="normal" in2="shape" result="effect2_innerShadow_1426_17776"></feBlend><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="0.238518"></feOffset><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0"></feColorMatrix><feBlend mode="normal" in2="effect2_innerShadow_1426_17776" result="effect3_innerShadow_1426_17776"></feBlend></filter><filter id="filter5_d_1426_17776" x="6.94974" y="2.65211" width="10.996" height="10.997" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="1.0432"></feOffset><feGaussianBlur stdDeviation="1.0432"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1426_17776"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1426_17776" result="shape"></feBlend></filter><filter id="filter6_d_1426_17776" x="5.71048" y="11.0056" width="8.16694" height="8.16694" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="1.0432"></feOffset><feGaussianBlur stdDeviation="1.0432"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1426_17776"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1426_17776" result="shape"></feBlend></filter><linearGradient id="paint0_linear_1426_17776" x1="14.4365" y1="0.353516" x2="14.4365" y2="28.3535" gradientUnits="userSpaceOnUse"><stop stop-color="#5A57FF"></stop><stop offset="1" stop-color="#5B98FF"></stop></linearGradient><linearGradient id="paint1_linear_1426_17776" x1="18.3943" y1="15.3016" x2="18.3943" y2="40.2595" gradientUnits="userSpaceOnUse"><stop offset="0.0831429" stop-color="#4B73FF"></stop><stop offset="0.359704" stop-color="#4B73FF" stop-opacity="0"></stop><stop offset="0.7" stop-color="#4B73FF" stop-opacity="0"></stop></linearGradient><linearGradient id="paint2_linear_1426_17776" x1="29.2845" y1="8.77232" x2="0.650625" y2="22.9504" gradientUnits="userSpaceOnUse"><stop stop-color="#BDC1FF"></stop><stop offset="0.420828" stop-color="#D6E8FF"></stop><stop offset="1" stop-color="#7391FE"></stop></linearGradient><radialGradient id="paint3_radial_1426_17776" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(22.1572 11.6007) rotate(134.421) scale(4.39003)"><stop offset="0.321315" stop-color="#BAFEFF"></stop><stop offset="1" stop-color="#011FFF"></stop></radialGradient><linearGradient id="paint4_linear_1426_17776" x1="9.87102" y1="1.28287" x2="14.9766" y2="13.0695" gradientUnits="userSpaceOnUse"><stop stop-color="#FFE6FC"></stop><stop offset="0.350962" stop-color="#FFE6FC"></stop><stop offset="1" stop-color="#AA00F2"></stop></linearGradient><linearGradient id="paint5_linear_1426_17776" x1="8.28563" y1="10.6367" x2="11.2743" y2="17.5362" gradientUnits="userSpaceOnUse"><stop stop-color="#FFE6FC"></stop><stop offset="0.350962" stop-color="#FFE6FC"></stop><stop offset="1" stop-color="#AA00F2"></stop></linearGradient><clipPath id="clip0_1426_17776"><rect x="0.353516" y="0.353516" width="28" height="28" rx="7.76216" fill="white"></rect></clipPath></defs></svg>'.replace(/__SIZE__/g,String(t)).replace(/_1426_17776/g,`_${i}`);return(0,s.createElement)("span",{className:e,style:{display:"inline-flex",lineHeight:0},dangerouslySetInnerHTML:{__html:a}})}},79347:()=>{},81921:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(51609);function n(){return(0,s.createElement)("svg",{className:"thinkrank-dashboard-widget__illustration-svg",viewBox:"0 0 320 180",role:"img","aria-hidden":"true",focusable:"false",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)("rect",{x:"86",y:"34",width:"148",height:"104",rx:"8",fill:"#ffffff",stroke:"#C7CBE6",strokeWidth:"2"}),(0,s.createElement)("rect",{x:"104",y:"96",width:"12",height:"26",rx:"2",fill:"#D5D9F5"}),(0,s.createElement)("rect",{x:"122",y:"82",width:"12",height:"40",rx:"2",fill:"#B9BFF0"}),(0,s.createElement)("rect",{x:"140",y:"70",width:"12",height:"52",rx:"2",fill:"#4451FF"}),(0,s.createElement)("rect",{x:"104",y:"50",width:"52",height:"6",rx:"3",fill:"#E3E6F7"}),(0,s.createElement)("rect",{x:"104",y:"62",width:"34",height:"6",rx:"3",fill:"#EDEFFb"}),(0,s.createElement)("circle",{cx:"196",cy:"74",r:"20",fill:"none",stroke:"#E3E6F7",strokeWidth:"8"}),(0,s.createElement)("path",{d:"M196 54 a20 20 0 0 1 17.3 30",fill:"none",stroke:"#4451FF",strokeWidth:"8",strokeLinecap:"round"}),(0,s.createElement)("rect",{x:"176",y:"104",width:"40",height:"6",rx:"3",fill:"#E3E6F7"}),(0,s.createElement)("rect",{x:"176",y:"116",width:"28",height:"6",rx:"3",fill:"#EDEFFb"}),(0,s.createElement)("circle",{cx:"150",cy:"78",r:"30",fill:"#4451FF",fillOpacity:"0.08",stroke:"#4451FF",strokeWidth:"4"}),(0,s.createElement)("line",{x1:"171",y1:"99",x2:"188",y2:"116",stroke:"#4451FF",strokeWidth:"6",strokeLinecap:"round"}),(0,s.createElement)("rect",{x:"46",y:"52",width:"34",height:"24",rx:"4",fill:"#ffffff",stroke:"#C7CBE6",strokeWidth:"2"}),(0,s.createElement)("rect",{x:"52",y:"59",width:"22",height:"4",rx:"2",fill:"#E3E6F7"}),(0,s.createElement)("rect",{x:"52",y:"66",width:"14",height:"4",rx:"2",fill:"#EDEFFb"}),(0,s.createElement)("rect",{x:"240",y:"60",width:"34",height:"24",rx:"4",fill:"#ffffff",stroke:"#C7CBE6",strokeWidth:"2"}),(0,s.createElement)("rect",{x:"246",y:"67",width:"22",height:"4",rx:"2",fill:"#E3E6F7"}),(0,s.createElement)("rect",{x:"246",y:"74",width:"14",height:"4",rx:"2",fill:"#EDEFFb"}))}},85499:(t,e,i)=>{i.d(e,{A:()=>u});var s=i(51609),n=i(86087),o=i(1455),a=i.n(o),r=i(27723),l=i(11344),h=i(56859),c=i(62538),d=i(60775);function u({config:t}){const[e]=(0,n.useState)(Boolean(t.connected)),[i,o]=(0,n.useState)(null),[u,f]=(0,n.useState)(Boolean(t.connected)),[p,g]=(0,n.useState)(null),m=(0,n.useCallback)(()=>{f(!0),g(null),a()({path:`/thinkrank/v1/seo-analytics/search-daily?date_range=${c.R}`}).then(t=>{if(!1===t?.success)return g({reason:t?.data?.reason||"",message:t.message||(0,r.__)("Unable to load Search Console data.","thinkrank"),details:t?.data?.details||""}),void o(null);o(t?.data||{})}).catch(t=>{d.A.error("ThinkRank: dashboard widget fetch failed",t),g({reason:t?.data?.reason||"",message:t?.message||(0,r.__)("Unable to load Search Console data.","thinkrank"),details:t?.data?.details||""}),o(null)}).finally(()=>f(!1))},[]);return(0,n.useEffect)(()=>{e&&m()},[e,m]),e?(0,s.createElement)(h.A,{config:t,data:i,loading:u,error:p,onRetry:m}):(0,s.createElement)(l.A,{config:t})}},86087:t=>{t.exports=window.wp.element},87941:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(51609),n=i(27723);function o(){return(0,s.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 24 24","aria-hidden":"true"},(0,s.createElement)("path",{d:"M4 7h10M18 7h2M4 17h2M10 17h10M16 4v6M8 14v6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}))}function a(){return(0,s.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 24 24","aria-hidden":"true"},(0,s.createElement)("path",{d:"M12 4.5 21 20H3L12 4.5Z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),(0,s.createElement)("path",{d:"M12 10v4.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,s.createElement)("circle",{cx:"12",cy:"17.5",r:"1.1",fill:"currentColor"}))}function r({error:t,config:e,onRetry:i}){const{title:r,tone:l,action:h}=function(t,e){switch(t){case"not_connected":return{title:(0,n.__)("Google account not connected","thinkrank"),tone:"setup",action:{label:(0,n.__)("Connect Google Search Console","thinkrank"),url:e.connectUrl||e.settingsUrl}};case"no_property":return{title:(0,n.__)("No Search Console property selected","thinkrank"),tone:"setup",action:{label:(0,n.__)("Select your property","thinkrank"),url:e.propertyUrl||e.settingsUrl}};case"reconnect":return{title:(0,n.__)("Google connection expired","thinkrank"),tone:"setup",action:{label:(0,n.__)("Reconnect Google","thinkrank"),url:e.connectUrl||e.settingsUrl}};case"permission":return{title:(0,n.__)("No access to this property","thinkrank"),tone:"setup",action:{label:(0,n.__)("Choose another property","thinkrank"),url:e.propertyUrl||e.settingsUrl}};case"quota":return{title:(0,n.__)("Google rate limit reached","thinkrank"),tone:"warning",action:null};case"google_down":return{title:(0,n.__)("Search Console is unavailable","thinkrank"),tone:"warning",action:null};default:return{title:(0,n.__)("Search data could not be loaded","thinkrank"),tone:"warning",action:null}}}(t?.reason,e),c=t?.message||(0,n.__)("Search data could not be loaded right now.","thinkrank");return(0,s.createElement)("div",{className:`thinkrank-dashboard-widget__error thinkrank-dashboard-widget__error--${l}`,role:"alert"},(0,s.createElement)("span",{className:"thinkrank-dashboard-widget__error-icon"},"setup"===l?(0,s.createElement)(o,null):(0,s.createElement)(a,null)),(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__error-body"},(0,s.createElement)("p",{className:"thinkrank-dashboard-widget__error-title"},r),(0,s.createElement)("p",{className:"thinkrank-dashboard-widget__error-message"},c),(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__error-actions"},h?.url?(0,s.createElement)("a",{className:"thinkrank-dashboard-widget__error-cta",href:h.url},h.label):(0,s.createElement)("button",{type:"button",className:"thinkrank-dashboard-widget__error-cta",onClick:i},(0,n.__)("Try again","thinkrank"))),t?.details&&(0,s.createElement)("details",{className:"thinkrank-dashboard-widget__error-details"},(0,s.createElement)("summary",null,(0,n.__)("Technical details","thinkrank")),(0,s.createElement)("code",null,t.details))))}},99284:(t,e,i)=>{i.d(e,{$:()=>Gt,A:()=>ot,B:()=>nt,C:()=>$t,D:()=>Q,E:()=>ae,F:()=>g,G:()=>Ne,H:()=>L,I:()=>Te,J:()=>je,K:()=>Ve,L:()=>ut,M:()=>Pe,N:()=>V,O:()=>c,P:()=>D,Q:()=>p,R:()=>he,S:()=>tt,T:()=>P,U:()=>Y,V:()=>zt,W:()=>et,X:()=>Nt,Y:()=>Ut,Z:()=>qt,_:()=>ct,a:()=>le,a0:()=>re,a1:()=>pt,a2:()=>gt,a3:()=>Tt,a4:()=>y,a5:()=>C,a6:()=>Ft,a7:()=>E,a8:()=>ue,a9:()=>de,aA:()=>Qe,aB:()=>Ze,aC:()=>mt,aD:()=>qe,aE:()=>jt,aF:()=>Z,aG:()=>n,aH:()=>U,aI:()=>W,aJ:()=>$,aK:()=>N,aL:()=>X,aM:()=>Pt,aN:()=>z,aO:()=>Ht,aP:()=>at,aQ:()=>st,aa:()=>fe,ab:()=>v,ac:()=>o,ad:()=>ft,ae:()=>We,af:()=>Wt,ag:()=>A,ah:()=>ri,ai:()=>m,aj:()=>O,ak:()=>it,al:()=>K,am:()=>se,an:()=>De,ao:()=>ii,ap:()=>ei,aq:()=>Ue,ar:()=>Ge,as:()=>$e,at:()=>Yt,au:()=>Xt,av:()=>Vt,aw:()=>Kt,ax:()=>ne,ay:()=>oe,az:()=>ti,b:()=>r,c:()=>Mt,d:()=>Rt,e:()=>kt,f:()=>M,g:()=>h,h:()=>S,i:()=>l,j:()=>ce,k:()=>a,l:()=>lt,m:()=>u,n:()=>f,o:()=>Ot,p:()=>J,q:()=>xt,r:()=>dt,s:()=>H,t:()=>G,u:()=>ht,v:()=>d,w:()=>bt,x:()=>j,y:()=>Me,z:()=>ze});var s=i(44594);function n(){}const o=(()=>{let t=0;return()=>t++})();function a(t){return null==t}function r(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function l(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function h(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function c(t,e){return h(t)?t:e}function d(t,e){return void 0===t?e:t}const u=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:+t/e,f=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function p(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function g(t,e,i,s){let n,o,a;if(r(t))if(o=t.length,s)for(n=o-1;n>=0;n--)e.call(i,t[n],n);else for(n=0;n<o;n++)e.call(i,t[n],n);else if(l(t))for(a=Object.keys(t),o=a.length,n=0;n<o;n++)e.call(i,t[a[n]],a[n])}function m(t,e){let i,s,n,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,s=t.length;i<s;++i)if(n=t[i],o=e[i],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function x(t){if(r(t))return t.map(x);if(l(t)){const e=Object.create(null),i=Object.keys(t),s=i.length;let n=0;for(;n<s;++n)e[i[n]]=x(t[i[n]]);return e}return t}function b(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function _(t,e,i,s){if(!b(t))return;const n=e[t],o=i[t];l(n)&&l(o)?y(n,o,s):e[t]=x(o)}function y(t,e,i){const s=r(e)?e:[e],n=s.length;if(!l(t))return t;const o=(i=i||{}).merger||_;let a;for(let e=0;e<n;++e){if(a=s[e],!l(a))continue;const n=Object.keys(a);for(let e=0,s=n.length;e<s;++e)o(n[e],t,a,i)}return t}function v(t,e){return y(t,e,{merger:k})}function k(t,e,i){if(!b(t))return;const s=e[t],n=i[t];l(s)&&l(n)?v(s,n):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=x(n))}const w={"":t=>t,x:t=>t.x,y:t=>t.y};function M(t,e){const i=w[e]||(w[e]=function(t){const e=function(t){const e=t.split("."),i=[];let s="";for(const t of e)s+=t,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function C(t){return t.charAt(0).toUpperCase()+t.slice(1)}const S=t=>void 0!==t,E=t=>"function"==typeof t,A=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function O(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const D=Math.PI,P=2*D,T=P+D,F=Number.POSITIVE_INFINITY,I=D/180,L=D/2,B=D/4,R=2*D/3,z=Math.log10,H=Math.sign;function N(t,e,i){return Math.abs(t-e)<i}function W(t){const e=Math.round(t);t=N(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(z(t))),s=t/i;return(s<=1?1:s<=2?2:s<=5?5:10)*i}function V(t){const e=[],i=Math.sqrt(t);let s;for(s=1;s<i;s++)t%s===0&&(e.push(s),e.push(t/s));return i===(0|i)&&e.push(i),e.sort((t,e)=>t-e).pop(),e}function j(t){return!function(t){return"symbol"==typeof t||"object"==typeof t&&null!==t&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function $(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}function U(t,e,i){let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function G(t){return t*(D/180)}function Y(t){return t*(180/D)}function X(t){if(!h(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function Q(t,e){const i=e.x-t.x,s=e.y-t.y,n=Math.sqrt(i*i+s*s);let o=Math.atan2(s,i);return o<-.5*D&&(o+=P),{angle:o,distance:n}}function Z(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function q(t,e){return(t-e+T)%P-D}function K(t){return(t%P+P)%P}function J(t,e,i,s){const n=K(t),o=K(e),a=K(i),r=K(o-n),l=K(a-n),h=K(n-o),c=K(n-a);return n===o||n===a||s&&o===a||r>l&&h<c}function tt(t,e,i){return Math.max(e,Math.min(i,t))}function et(t){return tt(t,-32768,32767)}function it(t,e,i,s=1e-6){return t>=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function st(t,e,i){i=i||(i=>t[i]<e);let s,n=t.length-1,o=0;for(;n-o>1;)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const nt=(t,e,i,s)=>st(t,i,s?s=>{const n=t[s][e];return n<i||n===i&&t[s+1][e]===i}:s=>t[s][e]<i),ot=(t,e,i)=>st(t,i,s=>t[s][e]>=i);function at(t,e,i){let s=0,n=t.length;for(;s<n&&t[s]<e;)s++;for(;n>s&&t[n-1]>i;)n--;return s>0||n<t.length?t.slice(s,n):t}const rt=["push","pop","shift","splice","unshift"];function lt(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),rt.forEach(e=>{const i="_onData"+C(e),s=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const n=s.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"==typeof t[i]&&t[i](...e)}),n}})}))}function ht(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(rt.forEach(e=>{delete t[e]}),delete t._chartjs)}function ct(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const dt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function ut(t,e){let i=[],s=!1;return function(...n){i=n,s||(s=!0,dt.call(window,()=>{s=!1,t.apply(e,i)}))}}function ft(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}const pt=t=>"start"===t?"left":"end"===t?"right":"center",gt=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,mt=(t,e,i,s)=>t===(s?"left":"right")?i:"center"===t?(e+i)/2:e;function xt(t,e,i){const s=e.length;let n=0,o=s;if(t._sorted){const{iScale:r,vScale:l,_parsed:h}=t,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,d=r.axis,{min:u,max:f,minDefined:p,maxDefined:g}=r.getUserBounds();if(p){if(n=Math.min(nt(h,d,u).lo,i?s:nt(e,d,r.getPixelForValue(u)).lo),c){const t=h.slice(0,n+1).reverse().findIndex(t=>!a(t[l.axis]));n-=Math.max(0,t)}n=tt(n,0,s-1)}if(g){let t=Math.max(nt(h,r.axis,f,!0).hi+1,i?0:nt(e,d,r.getPixelForValue(f),!0).hi+1);if(c){const e=h.slice(t-1).findIndex(t=>!a(t[l.axis]));t+=Math.max(0,e)}o=tt(t,n,s)-n}else o=s-n}return{start:n,count:o}}function bt(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const o=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),o}const _t=t=>0===t||1===t,yt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*P/i),vt=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*P/i)+1,kt={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*L),easeOutSine:t=>Math.sin(t*L),easeInOutSine:t=>-.5*(Math.cos(D*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>_t(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>_t(t)?t:yt(t,.075,.3),easeOutElastic:t=>_t(t)?t:vt(t,.075,.3),easeInOutElastic(t){const e=.1125;return _t(t)?t:t<.5?.5*yt(2*t,e,.45):.5+.5*vt(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let 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:t=>1-kt.easeOutBounce(1-t),easeOutBounce(t){const 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:t=>t<.5?.5*kt.easeInBounce(2*t):.5*kt.easeOutBounce(2*t-1)+.5};function wt(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Mt(t){return wt(t)?t:new s.Q1(t)}function Ct(t){return wt(t)?t:new s.Q1(t).saturate(.5).darken(.1).hexString()}const St=["x","y","borderWidth","radius","tension"],Et=["color","borderColor","backgroundColor"],At=new Map;function Ot(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let s=At.get(i);return s||(s=new Intl.NumberFormat(t,e),At.set(i,s)),s}(e,i).format(t)}const Dt={values:t=>r(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const a=z(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),Ot(t,s,l)},logarithmic(t,e,i){if(0===t)return"0";const s=i[e].significand||t/Math.pow(10,Math.floor(z(t)));return[1,2,3,5,10,15].includes(s)||e>.8*i.length?Dt.numeric.call(this,t,e,i):""}};var Pt={formatters:Dt};const Tt=Object.create(null),Ft=Object.create(null);function It(t,e){if(!e)return t;const i=e.split(".");for(let e=0,s=i.length;e<s;++e){const s=i[e];t=t[s]||(t[s]=Object.create(null))}return t}function Lt(t,e,i){return"string"==typeof e?y(It(t,e),i):y(It(t,""),e)}class Bt{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Ct(e.backgroundColor),this.hoverBorderColor=(t,e)=>Ct(e.borderColor),this.hoverColor=(t,e)=>Ct(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Lt(this,t,e)}get(t){return It(this,t)}describe(t,e){return Lt(Ft,t,e)}override(t,e){return Lt(Tt,t,e)}route(t,e,i,s){const n=It(this,t),o=It(this,i),a="_"+e;Object.defineProperties(n,{[a]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=o[s];return l(t)?Object.assign({},e,t):d(t,e)},set(t){this[a]=t}}})}apply(t){t.forEach(t=>t(this))}}var Rt=new Bt({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Et},numbers:{type:"number",properties:St}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Pt.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function zt(t,e,i,s,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>s&&(s=o),s}function Ht(t,e,i,s){let n=(s=s||{}).data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==e&&(n=s.data={},o=s.garbageCollect=[],s.font=e),t.save(),t.font=e;let a=0;const l=i.length;let h,c,d,u,f;for(h=0;h<l;h++)if(u=i[h],null==u||r(u)){if(r(u))for(c=0,d=u.length;c<d;c++)f=u[c],null==f||r(f)||(a=zt(t,n,o,a,f))}else a=zt(t,n,o,a,u);t.restore();const p=o.length/2;if(p>i.length){for(h=0;h<p;h++)delete n[o[h]];o.splice(0,p)}return a}function Nt(t,e,i){const s=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*s)/s+n}function Wt(t,e){(e||t)&&((e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function Vt(t,e,i,s){jt(t,e,i,s,null)}function jt(t,e,i,s,n){let o,a,r,l,h,c,d,u;const f=e.pointStyle,p=e.rotation,g=e.radius;let m=(p||0)*I;if(f&&"object"==typeof f&&(o=f.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,s),t.rotate(m),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(g)||g<=0)){switch(t.beginPath(),f){default:n?t.ellipse(i,s,n/2,g,0,0,P):t.arc(i,s,g,0,P),t.closePath();break;case"triangle":c=n?n/2:g,t.moveTo(i+Math.sin(m)*c,s-Math.cos(m)*g),m+=R,t.lineTo(i+Math.sin(m)*c,s-Math.cos(m)*g),m+=R,t.lineTo(i+Math.sin(m)*c,s-Math.cos(m)*g),t.closePath();break;case"rectRounded":h=.516*g,l=g-h,a=Math.cos(m+B)*l,d=Math.cos(m+B)*(n?n/2-h:l),r=Math.sin(m+B)*l,u=Math.sin(m+B)*(n?n/2-h:l),t.arc(i-d,s-r,h,m-D,m-L),t.arc(i+u,s-a,h,m-L,m),t.arc(i+d,s+r,h,m,m+L),t.arc(i-u,s+a,h,m+L,m+D),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,c=n?n/2:l,t.rect(i-c,s-l,2*c,2*l);break}m+=B;case"rectRot":d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-r),t.lineTo(i+u,s-a),t.lineTo(i+d,s+r),t.lineTo(i-u,s+a),t.closePath();break;case"crossRot":m+=B;case"cross":d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a);break;case"star":d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a),m+=B,d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a);break;case"line":a=n?n/2:Math.cos(m)*g,r=Math.sin(m)*g,t.moveTo(i-a,s-r),t.lineTo(i+a,s+r);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(m)*(n?n/2:g),s+Math.sin(m)*g);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function $t(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function Ut(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Gt(t){t.restore()}function Yt(t,e,i,s,n){if(!e)return t.lineTo(i.x,i.y);if("middle"===n){const s=(e.x+i.x)/2;t.lineTo(s,e.y),t.lineTo(s,i.y)}else"after"===n!=!!s?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Xt(t,e,i,s){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(s?e.cp1x:e.cp2x,s?e.cp1y:e.cp2y,s?i.cp2x:i.cp1x,s?i.cp2y:i.cp1y,i.x,i.y)}function Qt(t,e,i,s,n){if(n.strikethrough||n.underline){const o=t.measureText(s),a=e-o.actualBoundingBoxLeft,r=e+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,h=i+o.actualBoundingBoxDescent,c=n.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=n.decorationWidth||2,t.moveTo(a,c),t.lineTo(r,c),t.stroke()}}function Zt(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function qt(t,e,i,s,n,o={}){const l=r(e)?e:[e],h=o.strokeWidth>0&&""!==o.strokeColor;let c,d;for(t.save(),t.font=n.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),a(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,o),c=0;c<l.length;++c)d=l[c],o.backdrop&&Zt(t,o.backdrop),h&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),a(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(d,i,s,o.maxWidth)),t.fillText(d,i,s,o.maxWidth),Qt(t,i,s,d,o),s+=Number(n.lineHeight);t.restore()}function Kt(t,e){const{x:i,y:s,w:n,h:o,radius:a}=e;t.arc(i+a.topLeft,s+a.topLeft,a.topLeft,1.5*D,D,!0),t.lineTo(i,s+o-a.bottomLeft),t.arc(i+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,D,L,!0),t.lineTo(i+n-a.bottomRight,s+o),t.arc(i+n-a.bottomRight,s+o-a.bottomRight,a.bottomRight,L,0,!0),t.lineTo(i+n,s+a.topRight),t.arc(i+n-a.topRight,s+a.topRight,a.topRight,0,-L,!0),t.lineTo(i+a.topLeft,s)}const Jt=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,te=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ee(t,e){const i=(""+t).match(Jt);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}const ie=t=>+t||0;function se(t,e){const i={},s=l(e),n=s?Object.keys(e):e,o=l(t)?s?i=>d(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of n)i[t]=ie(o(t));return i}function ne(t){return se(t,{top:"y",right:"x",bottom:"y",left:"x"})}function oe(t){return se(t,["topLeft","topRight","bottomLeft","bottomRight"])}function ae(t){const e=ne(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function re(t,e){t=t||{},e=e||Rt.font;let i=d(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=d(t.style,e.style);s&&!(""+s).match(te)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:d(t.family,e.family),lineHeight:ee(d(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:d(t.weight,e.weight),string:""};return n.string=function(t){return!t||a(t.size)||a(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(n),n}function le(t,e,i,s){let n,o,a,l=!0;for(n=0,o=t.length;n<o;++n)if(a=t[n],void 0!==a&&(void 0!==e&&"function"==typeof a&&(a=a(e),l=!1),void 0!==i&&r(a)&&(a=a[i%a.length],l=!1),void 0!==a))return s&&!l&&(s.cacheable=!1),a}function he(t,e,i){const{min:s,max:n}=t,o=f(e,(n-s)/2),a=(t,e)=>i&&0===t?0:t+e;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function ce(t,e){return Object.assign(Object.create(t),e)}function de(t,e=[""],i,s,n=()=>t[0]){const o=i||t;void 0===s&&(s=ke("_fallback",t));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:s,_getTarget:n,override:i=>de([i,...t],e,o,s)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>me(i,s,()=>function(t,e,i,s){let n;for(const o of e)if(n=ke(pe(o,t),i),void 0!==n)return ge(t,n)?ye(i,s,t,n):n}(s,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>we(t).includes(e),ownKeys:t=>we(t),set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function ue(t,e,i,s){const n={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:fe(t,s),setContext:e=>ue(t,e,i,s),override:n=>ue(t.override(n),e,i,s)};return new Proxy(n,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>me(t,e,()=>function(t,e,i){const{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=t;let h=s[e];return E(h)&&a.isScriptable(e)&&(h=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t);let l=e(o,a||s);return r.delete(t),ge(t,l)&&(l=ye(n._scopes,n,t,l)),l}(e,h,t,i)),r(h)&&h.length&&(h=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=i;if(void 0!==o.index&&s(t))return e[o.index%e.length];if(l(e[0])){const i=e,s=n._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=ye(s,n,t,l);e.push(ue(i,o,a&&a[t],r))}}return e}(e,h,t,a.isIndexable)),ge(e,h)&&(h=ue(h,n,o&&o[e],a)),h}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function fe(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:E(i)?i:()=>i,isIndexable:E(s)?s:()=>s}}const pe=(t,e)=>t?t+C(e):e,ge=(t,e)=>l(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function me(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const s=i();return t[e]=s,s}function xe(t,e,i){return E(t)?t(e,i):t}const be=(t,e)=>!0===t?e:"string"==typeof t?M(e,t):void 0;function _e(t,e,i,s,n){for(const o of e){const e=be(i,o);if(e){t.add(e);const o=xe(e._fallback,i,n);if(void 0!==o&&o!==i&&o!==s)return o}else if(!1===e&&void 0!==s&&i!==s)return null}return!1}function ye(t,e,i,s){const n=e._rootScopes,o=xe(e._fallback,i,s),a=[...t,...n],h=new Set;h.add(s);let c=ve(h,a,i,o||i,s);return null!==c&&(void 0===o||o===i||(c=ve(h,a,o,c,s),null!==c))&&de(Array.from(h),[""],n,o,()=>function(t,e,i){const s=t._getTarget();e in s||(s[e]={});const n=s[e];return r(n)&&l(i)?i:n||{}}(e,i,s))}function ve(t,e,i,s,n){for(;i;)i=_e(t,e,i,s,n);return i}function ke(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function we(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function Me(t,e,i,s){const{iScale:n}=t,{key:o="r"}=this._parsing,a=new Array(s);let r,l,h,c;for(r=0,l=s;r<l;++r)h=r+i,c=e[h],a[r]={r:n.parse(M(c,o),h)};return a}const Ce=Number.EPSILON||1e-14,Se=(t,e)=>e<t.length&&!t[e].skip&&t[e],Ee=t=>"x"===t?"y":"x";function Ae(t,e,i,s){const n=t.skip?e:t,o=e,a=i.skip?e:i,r=Z(o,n),l=Z(a,o);let h=r/(r+l),c=l/(r+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const d=s*h,u=s*c;return{previous:{x:o.x-d*(a.x-n.x),y:o.y-d*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function Oe(t,e,i){return Math.max(Math.min(t,i),e)}function De(t,e,i,s,n){let o,a,r,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Ee(e),s=t.length,n=Array(s).fill(0),o=Array(s);let a,r,l,h=Se(t,0);for(a=0;a<s;++a)if(r=l,l=h,h=Se(t,a+1),l){if(h){const t=h[e]-l[e];n[a]=0!==t?(h[i]-l[i])/t:0}o[a]=r?h?H(n[a-1])!==H(n[a])?0:(n[a-1]+n[a])/2:n[a-1]:n[a]}!function(t,e,i){const s=t.length;let n,o,a,r,l,h=Se(t,0);for(let c=0;c<s-1;++c)l=h,h=Se(t,c+1),l&&h&&(N(e[c],0,Ce)?i[c]=i[c+1]=0:(n=i[c]/e[c],o=i[c+1]/e[c],r=Math.pow(n,2)+Math.pow(o,2),r<=9||(a=3/Math.sqrt(r),i[c]=n*a*e[c],i[c+1]=o*a*e[c])))}(t,n,o),function(t,e,i="x"){const s=Ee(i),n=t.length;let o,a,r,l=Se(t,0);for(let h=0;h<n;++h){if(a=r,r=l,l=Se(t,h+1),!r)continue;const n=r[i],c=r[s];a&&(o=(n-a[i])/3,r[`cp1${i}`]=n-o,r[`cp1${s}`]=c-o*e[h]),l&&(o=(l[i]-n)/3,r[`cp2${i}`]=n+o,r[`cp2${s}`]=c+o*e[h])}}(t,o,e)}(t,n);else{let i=s?t[t.length-1]:t[0];for(o=0,a=t.length;o<a;++o)r=t[o],l=Ae(i,r,t[Math.min(o+1,a-(s?0:1))%a],e.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,i=r}e.capBezierPoints&&function(t,e){let i,s,n,o,a,r=$t(t[0],e);for(i=0,s=t.length;i<s;++i)a=o,o=r,r=i<s-1&&$t(t[i+1],e),o&&(n=t[i],a&&(n.cp1x=Oe(n.cp1x,e.left,e.right),n.cp1y=Oe(n.cp1y,e.top,e.bottom)),r&&(n.cp2x=Oe(n.cp2x,e.left,e.right),n.cp2y=Oe(n.cp2y,e.top,e.bottom)))}(t,i)}function Pe(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Te(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function Fe(t,e,i){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}const Ie=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),Le=["top","right","bottom","left"];function Be(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=Le[n];s[o]=parseFloat(t[e+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const Re=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function ze(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,n=Ie(i),o="border-box"===n.boxSizing,a=Be(n,"padding"),r=Be(n,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:n,offsetY:o}=s;let a,r,l=!1;if(Re(n,o,t.target))a=n,r=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,r=s.clientY-t.top,l=!0}return{x:a,y:r,box:l}}(t,i),d=a.left+(c&&r.left),u=a.top+(c&&r.top);let{width:f,height:p}=e;return o&&(f-=a.width+r.width,p-=a.height+r.height),{x:Math.round((l-d)/f*i.width/s),y:Math.round((h-u)/p*i.height/s)}}const He=t=>Math.round(10*t)/10;function Ne(t,e,i,s){const n=Ie(t),o=Be(n,"margin"),a=Fe(n.maxWidth,t,"clientWidth")||F,r=Fe(n.maxHeight,t,"clientHeight")||F,l=function(t,e,i){let s,n;if(void 0===e||void 0===i){const o=t&&Te(t);if(o){const t=o.getBoundingClientRect(),a=Ie(o),r=Be(a,"border","width"),l=Be(a,"padding");e=t.width-l.width-r.width,i=t.height-l.height-r.height,s=Fe(a.maxWidth,o,"clientWidth"),n=Fe(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||F,maxHeight:n||F}}(t,e,i);let{width:h,height:c}=l;if("content-box"===n.boxSizing){const t=Be(n,"border","width"),e=Be(n,"padding");h-=e.width+t.width,c-=e.height+t.height}return h=Math.max(0,h-o.width),c=Math.max(0,s?h/s:c-o.height),h=He(Math.min(h,a,l.maxWidth)),c=He(Math.min(c,r,l.maxHeight)),h&&!c&&(c=He(h/2)),(void 0!==e||void 0!==i)&&s&&l.height&&c>l.height&&(c=l.height,h=He(Math.floor(c*s))),{width:h,height:c}}function We(t,e,i){const s=e||1,n=Math.floor(t.height*s),o=Math.floor(t.width*s);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||a.height!==n||a.width!==o)&&(t.currentDevicePixelRatio=s,a.height=n,a.width=o,t.ctx.setTransform(s,0,0,s,0,0),!0)}const Ve=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Pe()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function je(t,e){const i=function(t,e){return Ie(t).getPropertyValue(e)}(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function $e(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Ue(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function Ge(t,e,i,s){const n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=$e(t,n,i),r=$e(n,o,i),l=$e(o,e,i),h=$e(a,r,i),c=$e(r,l,i);return $e(h,c,i)}const Ye=function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}},Xe=function(){return{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}};function Qe(t,e,i){return t?Ye(e,i):Xe()}function Ze(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function qe(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ke(t){return"angle"===t?{between:J,compare:q,normalize:K}:{between:it,compare:(t,e)=>t-e,normalize:t=>t}}function Je({start:t,end:e,count:i,loop:s,style:n}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:n}}function ti(t,e,i){if(!i)return[t];const{property:s,start:n,end:o}=i,a=e.length,{compare:r,between:l,normalize:h}=Ke(s),{start:c,end:d,loop:u,style:f}=function(t,e,i){const{property:s,start:n,end:o}=i,{between:a,normalize:r}=Ke(s),l=e.length;let h,c,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,h=0,c=l;h<c&&a(r(e[d%l][s]),n,o);++h)d--,u--;d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:f,style:t.style}}(t,e,i),p=[];let g,m,x,b=!1,_=null;const y=()=>b||l(n,x,g)&&0!==r(n,x),v=()=>!b||0===r(o,g)||l(o,x,g);for(let t=c,i=c;t<=d;++t)m=e[t%a],m.skip||(g=h(m[s]),g!==x&&(b=l(g,n,o),null===_&&y()&&(_=0===r(g,n)?t:i),null!==_&&v()&&(p.push(Je({start:_,end:t,loop:u,count:a,style:f})),_=null),i=t,x=g));return null!==_&&p.push(Je({start:_,end:d,loop:u,count:a,style:f})),p}function ei(t,e){const i=[],s=t.segments;for(let n=0;n<s.length;n++){const o=ti(s[n],t.points,e);o.length&&i.push(...o)}return i}function ii(t,e){const i=t.points,s=t.options.spanGaps,n=i.length;if(!n)return[];const o=!!t._loop,{start:a,end:r}=function(t,e,i,s){let n=0,o=e-1;if(i&&!s)for(;n<e&&!t[n].skip;)n++;for(;n<e&&t[n].skip;)n++;for(n%=e,i&&(o+=n);o>n&&t[o%e].skip;)o--;return o%=e,{start:n,end:o}}(i,n,o,s);return si(t,!0===s?[{start:a,end:r,loop:o}]:function(t,e,i,s){const n=t.length,o=[];let a,r=e,l=t[e];for(a=e+1;a<=i;++a){const i=t[a%n];i.skip||i.stop?l.skip||(s=!1,o.push({start:e%n,end:(a-1)%n,loop:s}),e=r=i.stop?a:null):(r=a,l.skip&&(e=a)),l=i}return null!==r&&o.push({start:e%n,end:r%n,loop:s}),o}(i,a,r<a?r+n:r,!!t._fullLoop&&0===a&&r===n-1),i,e)}function si(t,e,i,s){return s&&s.setContext&&i?function(t,e,i,s){const n=t._chart.getContext(),o=ni(t.options),{_datasetIndex:a,options:{spanGaps:r}}=t,l=i.length,h=[];let c=o,d=e[0].start,u=d;function f(t,e,s,n){const o=r?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=o;for(;i[e%l].skip;)e+=o;t%l!==e%l&&(h.push({start:t%l,end:e%l,loop:s,style:n}),c=n,d=e%l)}}for(const t of e){d=r?d:t.start;let e,o=i[d%l];for(u=d+1;u<=t.end;u++){const r=i[u%l];e=ni(s.setContext(ce(n,{type:"segment",p0:o,p1:r,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),oi(e,c)&&f(d,u-1,t.loop,c),o=r,c=e}d<u-1&&f(d,u-1,t.loop,c)}return h}(t,e,i,s):e}function ni(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function oi(t,e){if(!e)return!1;const i=[],s=function(t,e){return wt(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,s)!==JSON.stringify(e,s)}function ai(t,e,i){return t.options.clip?t[i]:e[i]}function ri(t,e){const i=e._clip;if(i.disabled)return!1;const s=function(t,e){const{xScale:i,yScale:s}=t;return i&&s?{left:ai(i,e,"left"),right:ai(i,e,"right"),top:ai(s,e,"top"),bottom:ai(s,e,"bottom")}:e}(e,t.chartArea);return{left:!1===i.left?0:s.left-(!0===i.left?0:i.left),right:!1===i.right?t.width:s.right+(!0===i.right?0:i.right),top:!1===i.top?0:s.top-(!0===i.top?0:i.top),bottom:!1===i.bottom?t.height:s.bottom+(!0===i.bottom?0:i.bottom)}}}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var o=e[s]={exports:{}};return t[s](o,o.exports,i),o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var s=i(51609),n=i(1455),o=i.n(n),a=i(86087),r=i(85499),l=(i(79347),i(60775));const h=window.thinkrankDashboardWidget||{};h.restNonce&&o().use(o().createNonceMiddleware(h.restNonce)),document.addEventListener("DOMContentLoaded",()=>{const t=document.getElementById("thinkrank-dashboard-widget");if(t)try{t.innerHTML="",(0,a.createRoot)(t).render((0,s.createElement)(r.A,{config:h}))}catch(t){l.A.error("ThinkRank: Failed to mount Dashboard Widget",t)}})})(); |
|
1
|
+(()=>{"use strict";var t={1455:t=>{t.exports=window.wp.apiFetch},11344:(t,e,i)=>{i.d(e,{A:()=>a});var s=i(51609),n=i(27723),o=i(81921);function a({config:t}){const e=t.connectUrl||t.settingsUrl||"";return(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__empty"},(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__illustration"},(0,s.createElement)(o.A,null)),(0,s.createElement)("h3",{className:"thinkrank-dashboard-widget__title"},(0,n.__)("Unlock SEO Insights Using Google Search Console","thinkrank")),(0,s.createElement)("p",{className:"thinkrank-dashboard-widget__subtext"},(0,n.__)("Connect Google Search Console to gain search insights and monitor your growth.","thinkrank")),(0,s.createElement)("a",{className:"thinkrank-dashboard-widget__cta",href:e},(0,n.__)("Connect to Google Search Console","thinkrank")))}},25689:(t,e,i)=>{i.d(e,{A:()=>d});var s=i(51609),n=i(27723),o=i(51529),a=i(44656);a.t1.register(a.PP,a.kc,a.FN,a.No,a.hE,a.m_,a.s$,a.dN);const r={clicks:"#4794ff",impressions:"#6f52ff",ctr:"#bd52ff",position:"#ff8026"},l="#e9ebf1",h="#7c828d";function c(t,e,i,s){return{label:t,data:e,borderColor:i,backgroundColor:"transparent",borderWidth:2,tension:.4,fill:!1,pointRadius:0,pointHoverRadius:5,pointHoverBackgroundColor:i,pointHoverBorderColor:"#ffffff",pointHoverBorderWidth:2,yAxisID:s}}function d({rows:t}){if(!Array.isArray(t)||0===t.length)return null;const e={labels:t.map(t=>{const e=new Date(`${t.date}T00:00:00`);return Number.isNaN(e.getTime())?t.date:e.toLocaleDateString("en-US",{month:"short",day:"numeric"})}),datasets:[c((0,n.__)("Clicks","thinkrank"),t.map(t=>t.clicks),r.clicks,"yLeft"),c((0,n.__)("Impressions","thinkrank"),t.map(t=>t.impressions),r.impressions,"yLeft"),c((0,n.__)("Avg. CTR (%)","thinkrank"),t.map(t=>t.ctr),r.ctr,"yRight"),c((0,n.__)("Avg. Position","thinkrank"),t.map(t=>t.position),r.position,"yRight")]},i={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!0,position:"bottom",labels:{usePointStyle:!0,pointStyle:"circle",padding:14,font:{size:12},color:h}},tooltip:{enabled:!0}},scales:{x:{grid:{color:l,drawBorder:!1},ticks:{color:h,font:{size:11},maxTicksLimit:7,maxRotation:0},border:{display:!1}},yLeft:{position:"left",grid:{color:l,drawBorder:!1},ticks:{color:h,font:{size:11},callback:t=>t>=1e3?`${(t/1e3).toFixed(0)}k`:t},border:{display:!1}},yRight:{position:"right",grid:{display:!1},ticks:{color:h,font:{size:11},callback:t=>`${t}`},border:{display:!1}}}};return(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__chart"},(0,s.createElement)(o.N1,{data:e,options:i}))}},27723:t=>{t.exports=window.wp.i18n},39682:(t,e,i)=>{i.d(e,{A:()=>a});var s=i(51609),n=i(27723),o=i(69966);function a({config:t}){if(t.isPro)return null;if(t.isProInstalled)return(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__teaser"},(0,s.createElement)(o.A,{size:24,className:"thinkrank-dashboard-widget__teaser-mark"}),(0,s.createElement)("span",{className:"thinkrank-dashboard-widget__teaser-text"},(0,n.__)("Your ThinkRank Pro licence is not active yet","thinkrank")),(0,s.createElement)("a",{className:"thinkrank-dashboard-widget__teaser-cta",href:t.licenseUrl||"#"},(0,n.__)("Activate license","thinkrank")));const e=t.upgradeUrl||"https://thinkrank.ai/#pricing";return(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__teaser"},(0,s.createElement)(o.A,{size:24,className:"thinkrank-dashboard-widget__teaser-mark"}),(0,s.createElement)("span",{className:"thinkrank-dashboard-widget__teaser-text"},(0,n.__)("Turn these numbers into action with AI insights and ranking alerts","thinkrank")),(0,s.createElement)("a",{className:"thinkrank-dashboard-widget__teaser-cta",href:e,target:"_blank",rel:"noopener noreferrer"},(0,n.__)("Upgrade","thinkrank")))}},44594:(t,e,i)=>{function s(t){return t+.5|0}i.d(e,{Q1:()=>T});const n=(t,e,i)=>Math.max(Math.min(t,i),e);function o(t){return n(s(2.55*t),0,255)}function a(t){return n(s(255*t),0,255)}function r(t){return n(s(t/2.55)/100,0,1)}function l(t){return n(s(100*t),0,100)}const h={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},c=[..."0123456789ABCDEF"],d=t=>c[15&t],u=t=>c[(240&t)>>4]+c[15&t],f=t=>(240&t)>>4==(15&t);const p=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function g(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function m(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function x(t,e,i){const s=g(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function b(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),o=Math.min(e,i,s),a=(n+o)/2;let r,l,h;return n!==o&&(h=n-o,l=a>.5?h/(2-n-o):h/(n+o),r=function(t,e,i,s,n){return t===n?(e-i)/s+(e<i?6:0):e===n?(i-t)/s+2:(t-e)/s+4}(e,i,s,h,n),r=60*r+.5),[0|r,l||0,a]}function _(t,e,i,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,s)).map(a)}function y(t,e,i){return _(g,t,e,i)}function v(t){return(t%360+360)%360}const k={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},w={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let M;const C=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,S=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,E=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function A(t,e,i){if(t){let s=b(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=y(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function O(t,e){return t?Object.assign(e||{},t):t}function D(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=a(t[3]))):(e=O(t,{r:0,g:0,b:0,a:1})).a=a(e.a),e}function P(t){return"r"===t.charAt(0)?function(t){const e=C.exec(t);let i,s,a,r=255;if(e){if(e[7]!==i){const t=+e[7];r=e[8]?o(t):n(255*t,0,255)}return i=+e[1],s=+e[3],a=+e[5],i=255&(e[2]?o(i):n(i,0,255)),s=255&(e[4]?o(s):n(s,0,255)),a=255&(e[6]?o(a):n(a,0,255)),{r:i,g:s,b:a,a:r}}}(t):function(t){const e=p.exec(t);let i,s=255;if(!e)return;e[5]!==i&&(s=e[6]?o(+e[5]):a(+e[5]));const n=v(+e[2]),r=+e[3]/100,l=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return _(x,t,e,i)}(n,r,l):"hsv"===e[1]?function(t,e,i){return _(m,t,e,i)}(n,r,l):y(n,r,l),{r:i[0],g:i[1],b:i[2],a:s}}(t)}class T{constructor(t){if(t instanceof T)return t;const e=typeof t;let i;var s,n,o;"object"===e?i=D(t):"string"===e&&(o=(s=t).length,"#"===s[0]&&(4===o||5===o?n={r:255&17*h[s[1]],g:255&17*h[s[2]],b:255&17*h[s[3]],a:5===o?17*h[s[4]]:255}:7!==o&&9!==o||(n={r:h[s[1]]<<4|h[s[2]],g:h[s[3]]<<4|h[s[4]],b:h[s[5]]<<4|h[s[6]],a:9===o?h[s[7]]<<4|h[s[8]]:255})),i=n||function(t){M||(M=function(){const t={},e=Object.keys(w),i=Object.keys(k);let s,n,o,a,r;for(s=0;s<e.length;s++){for(a=r=e[s],n=0;n<i.length;n++)o=i[n],r=r.replace(o,k[o]);o=parseInt(w[a],16),t[r]=[o>>16&255,o>>8&255,255&o]}return t}(),M.transparent=[0,0,0,0]);const e=M[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||P(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=O(this._rgb);return t&&(t.a=r(t.a)),t}set rgb(t){this._rgb=D(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${r(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?(t=this._rgb,e=(t=>f(t.r)&&f(t.g)&&f(t.b)&&f(t.a))(t)?d:u,t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0):void 0;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=b(t),i=e[0],s=l(e[1]),n=l(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${n}%, ${r(t.a)})`:`hsl(${i}, ${s}%, ${n}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let n;const o=e===n?.5:e,a=2*o-1,r=i.a-s.a,l=((a*r===-1?a:(a+r)/(1+a*r))+1)/2;n=1-l,i.r=255&l*i.r+n*s.r+.5,i.g=255&l*i.g+n*s.g+.5,i.b=255&l*i.b+n*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const s=E(r(t.r)),n=E(r(t.g)),o=E(r(t.b));return{r:a(S(s+i*(E(r(e.r))-s))),g:a(S(n+i*(E(r(e.g))-n))),b:a(S(o+i*(E(r(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new T(this.rgb)}alpha(t){return this._rgb.a=a(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=s(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return A(this._rgb,2,t),this}darken(t){return A(this._rgb,2,-t),this}saturate(t){return A(this._rgb,1,t),this}desaturate(t){return A(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=b(t);i[0]=v(i[0]+e),i=y(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}},44656:(t,e,i)=>{i.d(e,{FN:()=>te,No:()=>Kt,PP:()=>Ne,ZT:()=>k,dN:()=>xe,hE:()=>we,kc:()=>je,m_:()=>ze,s$:()=>ve,t1:()=>jt});var s=i(99284);i(44594);class n{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],o=e.duration;n.forEach(s=>s({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=s.r.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var o=new n;const a="transparent",r={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=(0,s.c)(t||a),o=n.valid&&(0,s.c)(e||a);return o&&o.valid?o.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class l{constructor(t,e,i,n){const o=e[i];n=(0,s.a)([t.to,n,o,t.from]);const a=(0,s.a)([t.from,o,n]);this._active=!0,this._fn=t.fn||r[t.type||typeof a],this._easing=s.e[t.easing]||s.e.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=(0,s.a)([t.to,e,n,t.from]),this._from=(0,s.a)([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||e<i),!this._active)return this._target[s]=a,void this._notify(!0);e<0?this._target[s]=n:(r=e/i%2,r=o&&r>1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class h{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!(0,s.i)(t))return;const e=Object.keys(s.d.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!(0,s.i)(o))return;const a={};for(const t of e)a[t]=o[t];((0,s.b)(o.properties)&&o.properties||[n]).forEach(t=>{t!==n&&i.has(t)||i.set(t,a)})})}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){const n=t[s[e]];n&&n.active()&&i.push(n.wait())}return Promise.all(i)}(t.options.$animations,i).then(()=>{t.options=i},()=>{}),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let r;for(r=o.length-1;r>=0;--r){const h=o[r];if("$"===h.charAt(0))continue;if("options"===h){s.push(...this._animateOptions(t,e));continue}const c=e[h];let d=n[h];const u=i.get(h);if(d){if(u&&d.active()){d.update(u,c,a);continue}d.cancel()}u&&u.duration?(n[h]=d=new l(u,t,h,c),s.push(d)):t[h]=c}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(o.add(this._chart,i),!0):void 0}}function c(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function d(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n<o;++n)i.push(s[n].index);return i}function u(t,e,i,n={}){const o=t.keys,a="single"===n.mode;let r,l,h,c;if(null===e)return;let d=!1;for(r=0,l=o.length;r<l;++r){if(h=+o[r],h===i){if(d=!0,n.all)continue;break}c=t.values[h],(0,s.g)(c)&&(a||0===e||(0,s.s)(e)===(0,s.s)(c))&&(e+=c)}return d||n.all?e:0}function f(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function p(t,e,i){const s=t[e]||(t[e]={});return s[i]||(s[i]={})}function g(t,e,i,s){for(const n of e.getMatchingVisibleMetas(s).reverse()){const e=t[n.index];if(i&&e>0||!i&&e<0)return n.index}return null}function m(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,h=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,a,s),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[l]:o,[h]:d}=i;u=(i._stacks||(i._stacks={}))[h]=p(n,c,o),u[r]=d,u._top=g(u,a,!0,s.type),u._bottom=g(u,a,!1,s.type),(u._visualValues||(u._visualValues={}))[r]=d}}function x(t,e){const i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function b(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i],void 0!==e[s]._visualValues&&void 0!==e[s]._visualValues[i]&&delete e[s]._visualValues[i]}}}const _=t=>"reset"===t||"none"===t,y=(t,e)=>e?t:Object.assign({},t);class v{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=f(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&b(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,o=e.xAxisID=(0,s.v)(i.xAxisID,x(t,"x")),a=e.yAxisID=(0,s.v)(i.yAxisID,x(t,"y")),r=e.rAxisID=(0,s.v)(i.rAxisID,x(t,"r")),l=e.indexAxis,h=e.iAxisID=n(l,o,a,r),c=e.vAxisID=n(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&(0,s.u)(this._data,this),t._stacked&&b(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if((0,s.i)(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:s}=e,n="x"===i.axis?"x":"y",o="x"===s.axis?"x":"y",a=Object.keys(t),r=new Array(a.length);let l,h,c;for(l=0,h=a.length;l<h;++l)c=a[l],r[l]={[n]:c,[o]:t[c]};return r}(e,t)}else if(i!==e){if(i){(0,s.u)(i,this);const t=this._cachedMeta;b(t),t._parsed=[]}e&&Object.isExtensible(e)&&(0,s.l)(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=f(e.vScale,e),e.stack!==i.stack&&(s=!0,b(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&(m(this,e._parsed),e._stacked=f(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:o,_stacked:a}=i,r=o.axis;let l,h,c,d=0===t&&e===n.length||i._sorted,u=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=(0,s.b)(n[t])?this.parseArrayData(i,n,t,e):(0,s.i)(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const o=()=>null===h[r]||u&&h[r]<u[r];for(l=0;l<e;++l)i._parsed[l+t]=h=c[l],d&&(o()&&(d=!1),u=h);i._sorted=d}a&&m(this,c)}parsePrimitiveData(t,e,i,s){const{iScale:n,vScale:o}=t,a=n.axis,r=o.axis,l=n.getLabels(),h=n===o,c=new Array(s);let d,u,f;for(d=0,u=s;d<u;++d)f=d+i,c[d]={[a]:h||n.parse(l[f],f),[r]:o.parse(e[f],f)};return c}parseArrayData(t,e,i,s){const{xScale:n,yScale:o}=t,a=new Array(s);let r,l,h,c;for(r=0,l=s;r<l;++r)h=r+i,c=e[h],a[r]={x:n.parse(c[0],h),y:o.parse(c[1],h)};return a}parseObjectData(t,e,i,n){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,h=new Array(n);let c,d,u,f;for(c=0,d=n;c<d;++c)u=c+i,f=e[u],h[c]={x:o.parse((0,s.f)(f,r),u),y:a.parse((0,s.f)(f,l),u)};return h}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,n=this._cachedMeta,o=e[t.axis];return u({keys:d(s,!0),values:e._stacks[t.axis]._visualValues},o,n.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const n=i[e.axis];let o=null===n?NaN:n;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=u(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,n=i._parsed,o=i._sorted&&t===i.iScale,a=n.length,r=this._getOtherScale(t),l=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:d(i,!0),values:null})(e,i,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(r);let f,p;function g(){p=n[f];const e=p[r.axis];return!(0,s.g)(p[t.axis])||c>e||u<e}for(f=0;f<a&&(g()||(this.updateRangeFromParsed(h,t,p,l),!o));++f);if(o)for(f=a-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(h,t,p,l);break}return h}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,o,a;for(n=0,o=e.length;n<o;++n)a=e[n][t.axis],(0,s.g)(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,n=this.getParsed(t);return{label:i?""+i.getLabelForValue(n[i.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,n,o;return(0,s.i)(t)?(e=t.top,i=t.right,n=t.bottom,o=t.left):e=i=n=o=t,{top:e,right:i,bottom:n,left:o,disabled:!1===t}}((0,s.v)(this.options.clip,function(t,e,i){if(!1===i)return!1;const s=c(t,i),n=c(e,i);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],n=e.chartArea,o=[],a=this._drawStart||0,r=this._drawCount||s.length-a,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,n,a,r),h=a;h<a+r;++h){const e=s[h];e.hidden||(e.active&&l?o.push(e):e.draw(t,n))}for(h=0;h<o.length;++h)o[h].draw(t,n)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];o=e.$context||(e.$context=function(t,e,i){return(0,s.j)(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=function(t,e){return(0,s.j)(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const n="active"===e,o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&(0,s.h)(i);if(r)return y(r,l);const h=this.chart.config,c=h.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],u=h.getOptionScopes(this.getDataset(),c),f=Object.keys(s.d.elements[t]),p=h.resolveNamedOptions(u,f,()=>this.getContext(i,n,e),d);return p.$shared&&(p.$shared=l,o[a]=Object.freeze(y(p,l))),p}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,a=n[o];if(a)return a;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(o,this.getContext(t,i,e))}const l=new h(s,r&&r.animations);return r&&r._cacheable&&(n[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||_(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,s){_(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!_(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,e,i=!0){const s=this._cachedMeta,n=s.data,o=t+e;let a;const r=t=>{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(n),a=t;a<o;++a)n[a]=new this.dataElementType;this._parsing&&r(s._parsed),this.parse(t,e),i&&this.updateElements(n,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&b(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}class k extends v{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:l}=(0,s.q)(e,n,a);this._drawStart=r,this._drawCount=l,(0,s.w)(e)&&(r=0,l=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=n;const h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:h},t),this.updateElements(n,r,l,t)}updateElements(t,e,i,n){const o="reset"===n,{iScale:a,vScale:r,_stacked:l,_dataset:h}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(e,n),u=a.axis,f=r.axis,{spanGaps:p,segment:g}=this.options,m=(0,s.x)(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||"none"===n,b=e+i,_=t.length;let y=e>0&&this.getParsed(e-1);for(let i=0;i<_;++i){const p=t[i],_=x?p:{};if(i<e||i>=b){_.skip=!0;continue}const v=this.getParsed(i),k=(0,s.k)(v[f]),w=_[u]=a.getPixelForValue(v[u],i),M=_[f]=o||k?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,v,l):v[f],i);_.skip=isNaN(w)||isNaN(M)||k,_.stop=i>0&&Math.abs(v[u]-y[u])>m,g&&(_.parsed=v,_.raw=h.data[i]),d&&(_.options=c||this.resolveDataElementOptions(i,p.active?"active":n)),x||this.updateElement(p,i,_,n),y=v}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function w(t,e,i,n){const{controller:o,data:a,_sorted:r}=t,l=o._cachedMeta.iScale,h=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(l&&e===l.axis&&"r"!==e&&r&&a.length){const r=l._reversePixels?s.A:s.B;if(!n){const n=r(a,e,i);if(h){const{vScale:e}=o._cachedMeta,{_parsed:i}=t,a=i.slice(0,n.lo+1).reverse().findIndex(t=>!(0,s.k)(t[e.axis]));n.lo-=Math.max(0,a);const r=i.slice(n.hi).findIndex(t=>!(0,s.k)(t[e.axis]));n.hi+=Math.max(0,r)}return n}if(o._sharedOptions){const t=a[0],s="function"==typeof t.getRange&&t.getRange(e);if(s){const t=r(a,e,i-s),n=r(a,e,i+s);return{lo:t.lo,hi:n.hi}}}}return{lo:0,hi:a.length-1}}function M(t,e,i,s,n){const o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=o.length;t<i;++t){const{index:i,data:r}=o[t],{lo:l,hi:h}=w(o[t],e,a,n);for(let t=l;t<=h;++t){const e=r[t];e.skip||s(e,i,t)}}}function C(t,e,i,n,o){const a=[];return o||t.isPointInArea(e)?(M(t,i,e,function(i,r,l){(o||(0,s.C)(i,t.chartArea,0))&&i.inRange(e.x,e.y,n)&&a.push({element:i,datasetIndex:r,index:l})},!0),a):a}function S(t,e,i,n,o,a){return a||t.isPointInArea(e)?"r"!==i||n?function(t,e,i,s,n,o){let a=[];const r=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,s){const n=e?Math.abs(t.x-s.x):0,o=i?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2))}}(i);let l=Number.POSITIVE_INFINITY;return M(t,i,e,function(i,h,c){const d=i.inRange(e.x,e.y,n);if(s&&!d)return;const u=i.getCenterPoint(n);if(!o&&!t.isPointInArea(u)&&!d)return;const f=r(e,u);f<l?(a=[{element:i,datasetIndex:h,index:c}],l=f):f===l&&a.push({element:i,datasetIndex:h,index:c})}),a}(t,e,i,n,o,a):function(t,e,i,n){let o=[];return M(t,i,e,function(t,i,a){const{startAngle:r,endAngle:l}=t.getProps(["startAngle","endAngle"],n),{angle:h}=(0,s.D)(t,{x:e.x,y:e.y});(0,s.p)(h,r,l)&&o.push({element:t,datasetIndex:i,index:a})}),o}(t,e,i,o):[]}function E(t,e,i,s,n){const o=[],a="x"===i?"inXRange":"inYRange";let r=!1;return M(t,i,e,(t,s,l)=>{t[a]&&t[a](e[i],n)&&(o.push({element:t,datasetIndex:s,index:l}),r=r||t.inRange(e.x,e.y,n))}),s&&!r?[]:o}var A={evaluateInteractionItems:M,modes:{index(t,e,i,n){const o=(0,s.z)(e,t),a=i.axis||"x",r=i.includeInvisible||!1,l=i.intersect?C(t,o,a,n,r):S(t,o,a,!1,n,r),h=[];return l.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=l[0].index,i=t.data[e];i&&!i.skip&&h.push({element:i,datasetIndex:t.index,index:e})}),h):[]},dataset(t,e,i,n){const o=(0,s.z)(e,t),a=i.axis||"xy",r=i.includeInvisible||!1;let l=i.intersect?C(t,o,a,n,r):S(t,o,a,!1,n,r);if(l.length>0){const e=l[0].datasetIndex,i=t.getDatasetMeta(e).data;l=[];for(let t=0;t<i.length;++t)l.push({element:i[t],datasetIndex:e,index:t})}return l},point:(t,e,i,n)=>C(t,(0,s.z)(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){const o=(0,s.z)(e,t),a=i.axis||"xy",r=i.includeInvisible||!1;return S(t,o,a,i.intersect,n,r)},x:(t,e,i,n)=>E(t,(0,s.z)(e,t),"x",i.intersect,n),y:(t,e,i,n)=>E(t,(0,s.z)(e,t),"y",i.intersect,n)}};const O=["left","top","right","bottom"];function D(t,e){return t.filter(t=>t.pos===e)}function P(t,e){return t.filter(t=>-1===O.indexOf(t.pos)&&t.box.axis===e)}function T(t,e){return t.sort((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight})}function F(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function I(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function L(t,e,i,n){const{pos:o,box:a}=i,r=t.maxPadding;if(!(0,s.i)(o)){i.size&&(t[o]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?a.height:a.width),i.size=e.size/e.count,t[o]+=i.size}a.getPadding&&I(r,a.getPadding());const l=Math.max(0,e.outerWidth-F(r,t,"left","right")),h=Math.max(0,e.outerHeight-F(r,t,"top","bottom")),c=l!==t.w,d=h!==t.h;return t.w=l,t.h=h,i.horizontal?{same:c,other:d}:{same:d,other:c}}function B(t,e){const i=e.maxPadding;return function(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{s[t]=Math.max(e[t],i[t])}),s}(t?["left","right"]:["top","bottom"])}function R(t,e,i,s){const n=[];let o,a,r,l,h,c;for(o=0,a=t.length,h=0;o<a;++o){r=t[o],l=r.box,l.update(r.width||e.w,r.height||e.h,B(r.horizontal,e));const{same:a,other:d}=L(e,i,r,s);h|=a&&n.length,c=c||d,l.fullSize||n.push(r)}return h&&R(n,e,i,s)||c}function z(t,e,i,s,n){t.top=i,t.left=e,t.right=e+s,t.bottom=i+n,t.width=s,t.height=n}function H(t,e,i,n){const o=i.padding;let{x:a,y:r}=e;for(const l of t){const t=l.box,h=n[l.stack]||{count:1,placed:0,weight:1},c=l.stackWeight/h.weight||1;if(l.horizontal){const n=e.w*c,a=h.size||t.height;(0,s.h)(h.start)&&(r=h.start),t.fullSize?z(t,o.left,r,i.outerWidth-o.right-o.left,a):z(t,e.left+h.placed,r,n,a),h.start=r,h.placed+=n,r=t.bottom}else{const n=e.h*c,r=h.size||t.width;(0,s.h)(h.start)&&(a=h.start),t.fullSize?z(t,a,o.top,r,i.outerHeight-o.bottom-o.top):z(t,a,e.top+h.placed,r,n),h.start=a,h.placed+=n,a=t.right}}e.x=a,e.y=r}var N={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,n){if(!t)return;const o=(0,s.E)(t.options.layout.padding),a=Math.max(e-o.width,0),r=Math.max(i-o.height,0),l=function(t){const e=function(t){const e=[];let i,s,n,o,a,r;for(i=0,s=(t||[]).length;i<s;++i)n=t[i],({position:o,options:{stack:a,stackWeight:r=1}}=n),e.push({index:i,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return e}(t),i=T(e.filter(t=>t.box.fullSize),!0),s=T(D(e,"left"),!0),n=T(D(e,"right")),o=T(D(e,"top"),!0),a=T(D(e,"bottom")),r=P(e,"x"),l=P(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:D(e,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}(t.boxes),h=l.vertical,c=l.horizontal;(0,s.F)(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const d=h.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:o,availableWidth:a,availableHeight:r,vBoxMaxWidth:a/2/d,hBoxMaxHeight:r/2}),f=Object.assign({},o);I(f,(0,s.E)(n));const p=Object.assign({maxPadding:f,w:a,h:r,x:o.left,y:o.top},o),g=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!O.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let o,a,r;for(o=0,a=t.length;o<a;++o){r=t[o];const{fullSize:a}=r.box,l=i[r.stack],h=l&&r.stackWeight/l.weight;r.horizontal?(r.width=h?h*s:a&&e.availableWidth,r.height=n):(r.width=s,r.height=h?h*n:a&&e.availableHeight)}return i}(h.concat(c),u);R(l.fullSize,p,u,g),R(h,p,u,g),R(c,p,u,g)&&R(h,p,u,g),function(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(p),H(l.leftAndTop,p,u,g),p.x+=p.w,p.y+=p.h,H(l.rightAndBottom,p,u,g),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},(0,s.F)(l.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class W{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class V extends W{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const j="$chartjs",$={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},U=t=>null===t||""===t,G=!!s.K&&{passive:!0};function Y(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,G)}function X(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Q(t,e,i){const s=t.canvas,n=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||X(i.addedNodes,s),e=e&&!X(i.removedNodes,s);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}function Z(t,e,i){const s=t.canvas,n=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||X(i.removedNodes,s),e=e&&!X(i.addedNodes,s);e&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}const q=new Map;let K=0;function J(){const t=window.devicePixelRatio;t!==K&&(K=t,q.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function tt(t,e,i){const n=t.canvas,o=n&&(0,s.I)(n);if(!o)return;const a=(0,s.L)((t,e)=>{const s=o.clientWidth;i(t,e),s<o.clientWidth&&i()},window),r=new ResizeObserver(t=>{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||a(i,s)});return r.observe(o),function(t,e){q.size||window.addEventListener("resize",J),q.set(t,e)}(t,a),r}function et(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){q.delete(t),q.size||window.removeEventListener("resize",J)}(t)}function it(t,e,i){const n=t.canvas,o=(0,s.L)(e=>{null!==t.ctx&&i(function(t,e){const i=$[t.type]||t.type,{x:n,y:o}=(0,s.z)(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==o?o:null}}(e,t))},t);return function(t,e,i){t&&t.addEventListener(e,i,G)}(n,e,o),o}class st extends W{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),o=t.getAttribute("width");if(t[j]={initial:{height:n,width:o,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",U(o)){const e=(0,s.J)(t,"width");void 0!==e&&(t.width=e)}if(U(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=(0,s.J)(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[j])return!1;const i=e[j].initial;["height","width"].forEach(t=>{const n=i[t];(0,s.k)(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e[j],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:Q,detach:Z,resize:tt}[e]||it;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];s&&(({attach:et,detach:et,resize:et}[e]||Y)(t,e,s),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return(0,s.G)(t,e,i,n)}isAttached(t){const e=t&&(0,s.I)(t);return!(!e||!e.isConnected)}}class nt{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return(0,s.x)(this.x)&&(0,s.x)(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),s}}function ot(t,e,i,n,o){const a=(0,s.v)(n,0),r=Math.min((0,s.v)(o,t.length),t.length);let l,h,c,d=0;for(i=Math.ceil(i),o&&(l=o-n,i=l/Math.floor(l/i)),c=a;c<0;)d++,c=Math.round(a+d*i);for(h=Math.max(a,0);h<r;h++)h===c&&(e.push(t[h]),d++,c=Math.round(a+d*i))}const at=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,rt=(t,e)=>Math.min(e||t,t);function lt(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;o<n;o+=s)i.push(t[Math.floor(o)]);return i}function ht(t,e,i){const s=t.ticks.length,n=Math.min(e,s-1),o=t._startPixel,a=t._endPixel,r=1e-6;let l,h=t.getPixelForTick(n);if(!(i&&(l=1===s?Math.max(h-o,a-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(n-1))/2,h+=n<e?l:-l,h<o-r||h>a+r)))return h}function ct(t){return t.drawTicks?t.tickLength:0}function dt(t,e){if(!t.display)return 0;const i=(0,s.a0)(t.font,e),n=(0,s.E)(t.padding);return((0,s.b)(t.text)?t.text.length:1)*i.lineHeight+n.height}function ut(t,e,i){let n=(0,s.a1)(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class ft extends nt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(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)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=(0,s.O)(t,Number.POSITIVE_INFINITY),e=(0,s.O)(e,Number.NEGATIVE_INFINITY),i=(0,s.O)(i,Number.POSITIVE_INFINITY),n=(0,s.O)(n,Number.NEGATIVE_INFINITY),{min:(0,s.O)(t,i),max:(0,s.O)(e,n),minDefined:(0,s.g)(t),maxDefined:(0,s.g)(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:o,maxDefined:a}=this.getUserBounds();if(o&&a)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let s=0,l=r.length;s<l;++s)e=r[s].controller.getMinMax(this,t),o||(i=Math.min(i,e.min)),a||(n=Math.max(n,e.max));return i=a&&i>n?n:i,n=o&&i>n?i:n,{min:(0,s.O)(i,(0,s.O)(n,i)),max:(0,s.O)(n,(0,s.O)(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){(0,s.Q)(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:o,ticks:a}=this.options,r=a.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=(0,s.R)(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?lt(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||"auto"===a.source)&&(this.ticks=function(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}(t),o=Math.min(i.maxTicksLimit||n,n),a=i.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;i<s;i++)t[i].major&&e.push(i);return e}(e):[],r=a.length,l=a[0],h=a[r-1],c=[];if(r>o)return function(t,e,i,s){let n,o=0,a=i[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===a&&(e.push(t[n]),o++,a=i[o*s])}(e,c,a,r/o),c;const d=function(t,e,i){const n=function(t){const e=t.length;let i,s;if(e<2)return!1;for(s=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==s)return!1;return s}(t),o=e.length/i;if(!n)return Math.max(o,1);const a=(0,s.N)(n);for(let t=0,e=a.length-1;t<e;t++){const e=a[t];if(e>o)return e}return Math.max(o,1)}(a,e,o);if(r>0){let t,i;const n=r>1?Math.round((h-l)/(r-1)):null;for(ot(e,c,d,(0,s.k)(n)?0:l-n,l),t=0,i=r-1;t<i;t++)ot(e,c,d,a[t],a[t+1]);return ot(e,c,d,h,(0,s.k)(n)?e.length:h+n),c}return ot(e,c,d),c}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){(0,s.Q)(this.options.afterUpdate,[this])}beforeSetDimensions(){(0,s.Q)(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){(0,s.Q)(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),(0,s.Q)(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){(0,s.Q)(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,n,o;for(i=0,n=t.length;i<n;i++)o=t[i],o.label=(0,s.Q)(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){(0,s.Q)(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){(0,s.Q)(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=rt(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let a,r,l,h=n;if(!this._isVisible()||!e.display||n>=o||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),d=c.widest.width,u=c.highest.height,f=(0,s.S)(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),r=this.maxHeight-ct(t.grid)-e.padding-dt(t.title,this.chart.options.font),l=Math.sqrt(d*d+u*u),h=(0,s.U)(Math.min(Math.asin((0,s.S)((c.highest.height+6)/a,-1,1)),Math.asin((0,s.S)(r/l,-1,1))-Math.asin((0,s.S)(u/l,-1,1)))),h=Math.max(n,Math.min(o,h))),this.labelRotation=h}afterCalculateLabelRotation(){(0,s.Q)(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){(0,s.Q)(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const a=dt(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=ct(o)+a):(t.height=this.maxHeight,t.width=ct(o)+a),i.display&&this.ticks.length){const{first:e,last:n,widest:o,highest:a}=this._getLabelSizes(),l=2*i.padding,h=(0,s.t)(this.labelRotation),c=Math.cos(h),d=Math.sin(h);if(r){const e=i.mirror?0:d*o.width+c*a.height;t.height=Math.min(this.maxHeight,t.height+e+l)}else{const e=i.mirror?0:c*o.width+d*a.height;t.width=Math.min(this.maxWidth,t.width+e+l)}this._calculatePadding(e,n,d,c)}}this._handleMargins(),r?(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)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?l?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-h+o)*this.width/(this.width-h),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){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))}afterFit(){(0,s.Q)(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)(0,s.k)(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=lt(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:n,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/rt(e,i));let h,c,d,u,f,p,g,m,x,b,_,y=0,v=0;for(h=0;h<e;h+=l){if(u=t[h].label,f=this._resolveTickFontOptions(h),n.font=p=f.string,g=o[p]=o[p]||{data:{},gc:[]},m=f.lineHeight,x=b=0,(0,s.k)(u)||(0,s.b)(u)){if((0,s.b)(u))for(c=0,d=u.length;c<d;++c)_=u[c],(0,s.k)(_)||(0,s.b)(_)||(x=(0,s.V)(n,g.data,g.gc,x,_),b+=m)}else x=(0,s.V)(n,g.data,g.gc,x,u),b=m;a.push(x),r.push(b),y=Math.max(x,y),v=Math.max(b,v)}!function(t,e){(0,s.F)(t,t=>{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n<s;++n)delete t.data[i[n]];i.splice(0,s)}})}(o,e);const k=a.indexOf(y),w=r.indexOf(v),M=t=>({width:a[t]||0,height:r[t]||0});return{first:M(0),last:M(e-1),widest:M(k),highest:M(w),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return(0,s.W)(this._alignToPixels?(0,s.X)(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return(0,s.j)(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=(i=this.chart.getContext(),(0,s.j)(i,{scale:this,type:"scale"})));var i}_tickSize(){const t=this.options.ticks,e=(0,s.t)(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*i>r*n?r/i:l/n:l*n<r*i?l/i:r/n}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:o,position:a,border:r}=n,l=o.offset,h=this.isHorizontal(),c=this.ticks.length+(l?1:0),d=ct(o),u=[],f=r.setContext(this.getContext()),p=f.display?f.width:0,g=p/2,m=function(t){return(0,s.X)(i,t,p)};let x,b,_,y,v,k,w,M,C,S,E,A;if("top"===a)x=m(this.bottom),k=this.bottom-d,M=x-g,S=m(t.top)+g,A=t.bottom;else if("bottom"===a)x=m(this.top),S=t.top,A=m(t.bottom)-g,k=x+g,M=this.top+d;else if("left"===a)x=m(this.right),v=this.right-d,w=x-g,C=m(t.left)+g,E=t.right;else if("right"===a)x=m(this.left),C=t.left,E=m(t.right)-g,v=x+g,w=this.left+d;else if("x"===e){if("center"===a)x=m((t.top+t.bottom)/2+.5);else if((0,s.i)(a)){const t=Object.keys(a)[0],e=a[t];x=m(this.chart.scales[t].getPixelForValue(e))}S=t.top,A=t.bottom,k=x+g,M=k+d}else if("y"===e){if("center"===a)x=m((t.left+t.right)/2);else if((0,s.i)(a)){const t=Object.keys(a)[0],e=a[t];x=m(this.chart.scales[t].getPixelForValue(e))}v=x-g,w=v-d,C=t.left,E=t.right}const O=(0,s.v)(n.ticks.maxTicksLimit,c),D=Math.max(1,Math.ceil(c/O));for(b=0;b<c;b+=D){const t=this.getContext(b),e=o.setContext(t),n=r.setContext(t),a=e.lineWidth,c=e.color,d=n.dash||[],f=n.dashOffset,p=e.tickWidth,g=e.tickColor,m=e.tickBorderDash||[],x=e.tickBorderDashOffset;_=ht(this,b,l),void 0!==_&&(y=(0,s.X)(i,_,a),h?v=w=C=E=y:k=M=S=A=y,u.push({tx1:v,ty1:k,tx2:w,ty2:M,x1:C,y1:S,x2:E,y2:A,width:a,color:c,borderDash:d,borderDashOffset:f,tickWidth:p,tickColor:g,tickBorderDash:m,tickBorderDashOffset:x}))}return this._ticksLength=c,this._borderValue=x,u}_computeLabelItems(t){const e=this.axis,i=this.options,{position:n,ticks:o}=i,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:h,padding:c,mirror:d}=o,u=ct(i.grid),f=u+c,p=d?-c:f,g=-(0,s.t)(this.labelRotation),m=[];let x,b,_,y,v,k,w,M,C,S,E,A,O="middle";if("top"===n)k=this.bottom-p,w=this._getXAxisLabelAlignment();else if("bottom"===n)k=this.top+p,w=this._getXAxisLabelAlignment();else if("left"===n){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,v=t.x}else if("right"===n){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,v=t.x}else if("x"===e){if("center"===n)k=(t.top+t.bottom)/2+f;else if((0,s.i)(n)){const t=Object.keys(n)[0],e=n[t];k=this.chart.scales[t].getPixelForValue(e)+f}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===n)v=(t.left+t.right)/2-f;else if((0,s.i)(n)){const t=Object.keys(n)[0],e=n[t];v=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(u).textAlign}"y"===e&&("start"===l?O="top":"end"===l&&(O="bottom"));const D=this._getLabelSizes();for(x=0,b=r.length;x<b;++x){_=r[x],y=_.label;const t=o.setContext(this.getContext(x));M=this.getPixelForTick(x)+o.labelOffset,C=this._resolveTickFontOptions(x),S=C.lineHeight,E=(0,s.b)(y)?y.length:1;const e=E/2,i=t.color,l=t.textStrokeColor,c=t.textStrokeWidth;let u,f=w;if(a?(v=M,"inner"===w&&(f=x===b-1?this.options.reverse?"left":"right":0===x?this.options.reverse?"right":"left":"center"),A="top"===n?"near"===h||0!==g?-E*S+S/2:"center"===h?-D.highest.height/2-e*S+S:-D.highest.height+S/2:"near"===h||0!==g?S/2:"center"===h?D.highest.height/2-e*S:D.highest.height-E*S,d&&(A*=-1),0===g||t.showLabelBackdrop||(v+=S/2*Math.sin(g))):(k=M,A=(1-E)*S/2),t.showLabelBackdrop){const e=(0,s.E)(t.backdropPadding),i=D.heights[x],n=D.widths[x];let o=A-e.top,a=0-e.left;switch(O){case"middle":o-=i/2;break;case"bottom":o-=i}switch(w){case"center":a-=n/2;break;case"right":a-=n;break;case"inner":x===b-1?a-=n:x>0&&(a-=n/2)}u={left:a,top:o,width:n+e.width,height:i+e.height,color:t.backdropColor}}m.push({label:y,font:C,textOffset:A,options:{rotation:g,color:i,strokeColor:l,strokeWidth:c,textAlign:f,textBaseline:O,translation:[v,k],backdrop:u}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-(0,s.t)(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,o=t+n,a=this._getLabelSizes().widest.width;let r,l;return"left"===e?s?(l=this.right+n,"near"===i?r="left":"center"===i?(r="center",l+=a/2):(r="right",l+=a)):(l=this.right-o,"near"===i?r="right":"center"===i?(r="center",l-=a/2):(r="left",l=this.left)):"right"===e?s?(l=this.left+n,"near"===i?r="right":"center"===i?(r="center",l-=a/2):(r="left",l-=a)):(l=this.left+o,"near"===i?r="left":"center"===i?(r="center",l+=a/2):(r="right",l=this.right)):r="right",{textAlign:r,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(e=>e.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const a=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n<o;++n){const t=s[n];e.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&a({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:n}}=this,o=i.setContext(this.getContext()),a=i.display?o.width:0;if(!a)return;const r=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let h,c,d,u;this.isHorizontal()?(h=(0,s.X)(t,this.left,a)-a/2,c=(0,s.X)(t,this.right,r)+r/2,d=u=l):(d=(0,s.X)(t,this.top,a)-a/2,u=(0,s.X)(t,this.bottom,r)+r/2,h=c=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(h,d),e.lineTo(c,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&(0,s.Y)(e,i);const n=this.getLabelItems(t);for(const t of n){const i=t.options,n=t.font,o=t.label,a=t.textOffset;(0,s.Z)(e,o,0,a,n,i)}i&&(0,s.$)(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const o=(0,s.a0)(i.font),a=(0,s.E)(i.padding),r=i.align;let l=o.lineHeight/2;"bottom"===e||"center"===e||(0,s.i)(e)?(l+=a.bottom,(0,s.b)(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:h,titleY:c,maxWidth:d,rotation:u}=function(t,e,i,n){const{top:o,left:a,bottom:r,right:l,chart:h}=t,{chartArea:c,scales:d}=h;let u,f,p,g=0;const m=r-o,x=l-a;if(t.isHorizontal()){if(f=(0,s.a2)(n,a,l),(0,s.i)(i)){const t=Object.keys(i)[0],s=i[t];p=d[t].getPixelForValue(s)+m-e}else p="center"===i?(c.bottom+c.top)/2+m-e:at(t,i,e);u=l-a}else{if((0,s.i)(i)){const t=Object.keys(i)[0],s=i[t];f=d[t].getPixelForValue(s)-x+e}else f="center"===i?(c.left+c.right)/2-x+e:at(t,i,e);p=(0,s.a2)(n,r,o),g="left"===i?-s.H:s.H}return{titleX:f,titleY:p,maxWidth:u,rotation:g}}(this,l,e,r);(0,s.Z)(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:u,textAlign:ut(r,e,n),textBaseline:"middle",translation:[h,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=(0,s.v)(t.grid&&t.grid.z,-1),n=(0,s.v)(t.border&&t.border.z,0);return this._isVisible()&&this.draw===ft.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n<o;++n){const o=e[n];o[i]!==this.id||t&&o.type!==t||s.push(o)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return(0,s.a0)(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class pt{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const n=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,function(t,e,i){const n=(0,s.a4)(Object.create(null),[i?s.d.get(i):{},s.d.get(e),t.defaults]);s.d.set(e,n),t.defaultRoutes&&function(t,e){Object.keys(e).forEach(i=>{const n=i.split("."),o=n.pop(),a=[t].concat(n).join("."),r=e[i].split("."),l=r.pop(),h=r.join(".");s.d.route(a,o,h,l)})}(e,t.defaultRoutes),t.descriptors&&s.d.describe(e,t.descriptors)}(t,a,i),this.override&&s.d.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in s.d[n]&&(delete s.d[n][i],this.override&&delete s.a3[i])}}class gt{constructor(){this.controllers=new pt(v,"datasets",!0),this.elements=new pt(nt,"elements"),this.plugins=new pt(Object,"plugins"),this.scales=new pt(ft,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):(0,s.F)(e,e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)})})}_exec(t,e,i){const n=(0,s.a5)(t);(0,s.Q)(i["before"+n],[],i),e[t](i),(0,s.Q)(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var mt=new gt;class xt{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const n=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(n,t,e,i);return"afterDestroy"===e&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,n){n=n||{};for(const o of t){const t=o.plugin,a=t[i],r=[e,n,o.options];if(!1===(0,s.Q)(a,r,t)&&n.cancelable)return!1}return!0}invalidate(){(0,s.k)(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,n=(0,s.v)(i.options&&i.options.plugins,{}),o=function(t){const e={},i=[],s=Object.keys(mt.plugins.items);for(let t=0;t<s.length;t++)i.push(mt.getPlugin(s[t]));const n=t.plugins||[];for(let t=0;t<n.length;t++){const s=n[t];-1===i.indexOf(s)&&(i.push(s),e[s.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==n||e?function(t,{plugins:e,localIds:i},s,n){const o=[],a=t.getContext();for(const r of e){const e=r.id,l=bt(s[e],n);null!==l&&o.push({plugin:r,options:_t(t.config,{plugin:r,local:i[e]},l,a)})}return o}(t,o,n,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function bt(t,e){return e||!1!==t?!0===t?{}:t:null}function _t(t,{plugin:e,local:i},s,n){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(s,o);return i&&e.defaults&&a.push(e.defaults),t.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function yt(t,e){const i=s.d.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function vt(t){if("x"===t||"y"===t||"r"===t)return t}function kt(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function wt(t,...e){if(vt(t))return t;for(const i of e){const e=i.axis||kt(i.position)||t.length>1&&vt(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Mt(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function Ct(t){const e=t.options||(t.options={});e.plugins=(0,s.v)(e.plugins,{}),e.scales=function(t,e){const i=s.a3[t.type]||{scales:{}},n=e.scales||{},o=yt(t.type,e),a=Object.create(null);return Object.keys(n).forEach(e=>{const r=n[e];if(!(0,s.i)(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const l=wt(e,r,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return Mt(t,"x",i[0])||Mt(t,"y",i[0])}return{}}(e,t),s.d.scales[r.type]),h=function(t,e){return t===e?"_index_":"_value_"}(l,o),c=i.scales||{};a[e]=(0,s.ab)(Object.create(null),[{axis:l},r,c[l],c[h]])}),t.data.datasets.forEach(i=>{const o=i.type||t.type,r=i.indexAxis||yt(o,e),l=(s.a3[o]||{}).scales||{};Object.keys(l).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),o=i[e+"AxisID"]||e;a[o]=a[o]||Object.create(null),(0,s.ab)(a[o],[{axis:e},n[o],l[t]])})}),Object.keys(a).forEach(t=>{const e=a[t];(0,s.ab)(e,[s.d.scales[e.type],s.d.scale])}),a}(t,e)}function St(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Et=new Map,At=new Set;function Ot(t,e){let i=Et.get(t);return i||(i=e(),Et.set(t,i),At.add(i)),i}const Dt=(t,e,i)=>{const n=(0,s.f)(e,i);void 0!==n&&t.add(n)};class Pt{constructor(t){this._config=function(t){return(t=t||{}).data=St(t.data),Ct(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=St(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Ct(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ot(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ot(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ot(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return Ot(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:n,type:o}=this,a=this._cachedScopes(t,i),r=a.get(e);if(r)return r;const l=new Set;e.forEach(e=>{t&&(l.add(t),e.forEach(e=>Dt(l,t,e))),e.forEach(t=>Dt(l,n,t)),e.forEach(t=>Dt(l,s.a3[o]||{},t)),e.forEach(t=>Dt(l,s.d,t)),e.forEach(t=>Dt(l,s.a6,t))});const h=Array.from(l);return 0===h.length&&h.push(Object.create(null)),At.has(e)&&a.set(e,h),h}chartOptionScopes(){const{options:t,type:e}=this;return[t,s.a3[e]||{},s.d.datasets[e]||{},{type:e},s.d,s.a6]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Tt(this._resolverCache,t,n);let l=a;if(function(t,e){const{isScriptable:i,isIndexable:n}=(0,s.aa)(t);for(const o of e){const e=i(o),a=n(o),r=(a||e)&&t[o];if(e&&((0,s.a7)(r)||Ft(r))||a&&(0,s.b)(r))return!0}return!1}(a,e)){o.$shared=!1,i=(0,s.a7)(i)?i():i;const e=this.createResolver(t,i,r);l=(0,s.a8)(a,i,e)}for(const t of e)o[t]=l[t];return o}createResolver(t,e,i=[""],n){const{resolver:o}=Tt(this._resolverCache,t,i);return(0,s.i)(e)?(0,s.a8)(o,e,void 0,n):o}}function Tt(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const o=i.join();let a=n.get(o);return a||(a={resolver:(0,s.a9)(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(o,a)),a}const Ft=t=>(0,s.i)(t)&&Object.getOwnPropertyNames(t).some(e=>(0,s.a7)(t[e])),It=["top","bottom","left","right","chartArea"];function Lt(t,e){return"top"===t||"bottom"===t||-1===It.indexOf(t)&&"x"===e}function Bt(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function Rt(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),(0,s.Q)(i&&i.onComplete,[t],e)}function zt(t){const e=t.chart,i=e.options.animation;(0,s.Q)(i&&i.onProgress,[t],e)}function Ht(t){return(0,s.M)()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Nt={},Wt=t=>{const e=Ht(t);return Object.values(Nt).filter(t=>t.canvas===e).pop()};function Vt(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}class jt{static defaults=s.d;static instances=Nt;static overrides=s.a3;static registry=mt;static version="4.5.0";static getChart=Wt;static register(...t){mt.add(...t),$t()}static unregister(...t){mt.remove(...t),$t()}constructor(t,e){const i=this.config=new Pt(e),n=Ht(t),a=Wt(n);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!(0,s.M)()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?V:st}(n)),this.platform.updateConfig(i);const l=this.platform.acquireContext(n,r.aspectRatio),h=l&&l.canvas,c=h&&h.height,d=h&&h.width;this.id=(0,s.ac)(),this.ctx=l,this.canvas=h,this.width=d,this.height=c,this._options=r,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 xt,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(0,s.ad)(t=>this.update(t),r.resizeDelay||0),this._dataChanges=[],Nt[this.id]=this,l&&h?(o.listen(this,"complete",Rt),o.listen(this,"progress",zt),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return(0,s.k)(t)?e&&o?o:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return mt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():(0,s.ae)(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return(0,s.af)(this.canvas,this.ctx),this}stop(){return o.stop(this),this}resize(t,e){o.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,t,e,o),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,(0,s.ae)(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),(0,s.Q)(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};(0,s.F)(t,(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let o=[];e&&(o=o.concat(Object.keys(e).map(t=>{const i=e[t],s=wt(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}}))),(0,s.F)(o,e=>{const o=e.options,a=o.id,r=wt(a,o),l=(0,s.v)(o.type,e.dtype);void 0!==o.position&&Lt(o.position,r)===Lt(e.dposition)||(o.position=e.dposition),n[a]=!0;let h=null;a in i&&i[a].type===l?h=i[a]:(h=new(mt.getScale(l))({id:a,type:l,ctx:this.ctx,chart:this}),i[h.id]=h),h.init(o,t)}),(0,s.F)(n,(t,e)=>{t||delete i[e]}),(0,s.F)(i,t=>{N.configure(this,t,t.options),N.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Bt("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i<n;i++){const n=e[i];let o=this.getDatasetMeta(i);const a=n.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=a,o.indexAxis=n.indexAxis||yt(a,this.options),o.order=n.order||0,o.index=i,o.label=""+n.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const e=mt.getController(a),{datasetElementType:n,dataElementType:r}=s.d.datasets[a];Object.assign(e,{dataElementType:mt.getElement(r),datasetElementType:n&&mt.getElement(n)}),o.controller=new e(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){(0,s.F)(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!n&&-1===o.indexOf(e);e.buildOrUpdateElements(i),a=Math.max(+e.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),n||(0,s.F)(o,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Bt("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){(0,s.F)(this.scales,t=>{N.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(0,s.ag)(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e)Vt(t,s,"_removeElements"===i?-n:n)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;t<e;t++)if(!(0,s.ag)(n,i(t)))return;return Array.from(n).map(t=>t.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;N.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],(0,s.F)(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,(0,s.a7)(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(o.has(this)?this.attached&&!o.running(this)&&o.start(this):(this.draw(),Rt({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,n;for(s=0,n=e.length;s<n;++s){const n=e[s];t&&!n.visible||i.push(n)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},n=(0,s.ah)(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(n&&(0,s.Y)(e,n),t.controller.draw(),n&&(0,s.$)(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return(0,s.C)(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=A.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(t=>t&&t._dataset===e).pop();return s||(s={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(s)),s}getContext(){return this.$context||(this.$context=(0,s.j)(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,n);(0,s.h)(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(o,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),o.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),(0,s.af)(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Nt[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};(0,s.F)(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){(0,s.F)(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},(0,s.F)(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=t.length;a<r;++a){o=t[a];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!(0,s.ai)(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:o}=this,a=e,r=this._getActiveElements(t,n,i,a),l=(0,s.aj)(t),h=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,l);i&&(this._lastEvent=null,(0,s.Q)(o.onHover,[t,r,this],this),l&&(0,s.Q)(o.onClick,[t,r,this],this));const c=!(0,s.ai)(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=h,c}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function $t(){return(0,s.F)(jt.instances,t=>t._plugins.invalidate())}function Ut(t,e,i=e){t.lineCap=(0,s.v)(i.borderCapStyle,e.borderCapStyle),t.setLineDash((0,s.v)(i.borderDash,e.borderDash)),t.lineDashOffset=(0,s.v)(i.borderDashOffset,e.borderDashOffset),t.lineJoin=(0,s.v)(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=(0,s.v)(i.borderWidth,e.borderWidth),t.strokeStyle=(0,s.v)(i.borderColor,e.borderColor)}function Gt(t,e,i){t.lineTo(i.x,i.y)}function Yt(t,e,i={}){const s=t.length,{start:n=0,end:o=s-1}=i,{start:a,end:r}=e,l=Math.max(n,a),h=Math.min(o,r),c=n<a&&o<a||n>r&&o>r;return{count:s,start:l,loop:e.loop,ilen:h<l&&!c?s+h-l:h-l}}function Xt(t,e,i,n){const{points:o,options:a}=e,{count:r,start:l,loop:h,ilen:c}=Yt(o,i,n),d=function(t){return t.stepped?s.at:t.tension||"monotone"===t.cubicInterpolationMode?s.au:Gt}(a);let u,f,p,{move:g=!0,reverse:m}=n||{};for(u=0;u<=c;++u)f=o[(l+(m?c-u:u))%r],f.skip||(g?(t.moveTo(f.x,f.y),g=!1):d(t,p,f,m,a.stepped),p=f);return h&&(f=o[(l+(m?c:0))%r],d(t,p,f,m,a.stepped)),!!h}function Qt(t,e,i,s){const n=e.points,{count:o,start:a,ilen:r}=Yt(n,i,s),{move:l=!0,reverse:h}=s||{};let c,d,u,f,p,g,m=0,x=0;const b=t=>(a+(h?r-t:t))%o,_=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=n[b(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[b(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(i<f?f=i:i>p&&(p=i),m=(x*m+e)/++x):(_(),t.lineTo(e,i),u=s,x=0,f=p=i),g=i}_()}function Zt(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?Xt:Qt}const qt="function"==typeof Path2D;class Kt extends nt{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;(0,s.an)(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=(0,s.ao)(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],o=this.points,a=(0,s.ap)(this,{property:e,start:n,end:n});if(!a.length)return;const r=[],l=function(t){return t.stepped?s.aq:t.tension||"monotone"===t.cubicInterpolationMode?s.ar:s.as}(i);let h,c;for(h=0,c=a.length;h<c;++h){const{start:s,end:c}=a[h],d=o[s],u=o[c];if(d===u){r.push(d);continue}const f=l(d,u,Math.abs((n-d[e])/(u[e]-d[e])),i.stepped);f[e]=t[e],r.push(f)}return 1===r.length?r[0]:r}pathSegment(t,e,i){return Zt(this)(t,this,e,i)}path(t,e,i){const s=this.segments,n=Zt(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=n(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const n=this.options||{};(this.points||[]).length&&n.borderWidth&&(t.save(),function(t,e,i,s){qt&&!e.options.segment?function(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),Ut(t,e.options),t.stroke(n)}(t,e,i,s):function(t,e,i,s){const{segments:n,options:o}=e,a=Zt(e);for(const r of n)Ut(t,o,r.style),t.beginPath(),a(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Jt(t,e,i,s){const n=t.options,{[i]:o}=t.getProps([i],s);return Math.abs(e-o)<n.radius+n.hitRadius}class te extends nt{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return Jt(this,t,"x",e)}inYRange(t,e){return Jt(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!(0,s.C)(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,(0,s.av)(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function ee(t,e,i,n){if(n)return;let o=e[t],a=i[t];return"angle"===t&&(o=(0,s.al)(o),a=(0,s.al)(a)),{property:t,start:o,end:a}}function ie(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function se(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function ne(t,e){let i=[],n=!1;return(0,s.b)(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:s=null}=t||{},n=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=ie(t,e,n);const a=n[t],r=n[e];null!==s?(o.push({x:a.x,y:s}),o.push({x:r.x,y:s})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:r.y}))}),o}(t,e),i.length?new Kt({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function oe(t){return t&&!1!==t.fill}function ae(t,e,i){let n=t[e].fill;const o=[e];let a;if(!i)return n;for(;!1!==n&&-1===o.indexOf(n);){if(!(0,s.g)(n))return n;if(a=t[n],!a)return!1;if(a.visible)return n;o.push(n),n=a.fill}return!1}function re(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=(0,s.v)(i&&i.target,i);return void 0===n&&(n=!!e.backgroundColor),!1!==n&&null!==n&&(!0===n?"origin":n)}(t);if((0,s.i)(n))return!isNaN(n.value)&&n;let o=parseFloat(n);return(0,s.g)(o)&&Math.floor(o)===o?function(t,e,i,s){return"-"!==t&&"+"!==t||(i=e+i),!(i===e||i<0||i>=s)&&i}(n[0],e,o,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function le(t,e,i){const s=[];for(let n=0;n<i.length;n++){const o=i[n],{first:a,last:r,point:l}=he(o,e,"x");if(!(!l||a&&r))if(a)s.unshift(l);else if(t.push(l),!r)break}t.push(...s)}function he(t,e,i){const n=t.interpolate(e,i);if(!n)return{};const o=n[i],a=t.segments,r=t.points;let l=!1,h=!1;for(let t=0;t<a.length;t++){const e=a[t],n=r[e.start][i],c=r[e.end][i];if((0,s.ak)(o,n,c)){l=o===n,h=o===c;break}}return{first:l,last:h,point:n}}class ce{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:o,radius:a}=this;return e=e||{start:0,end:s.T},t.arc(n,o,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,n=t.angle;return{x:e+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function de(t,e,i){const n=function(t){const{chart:e,fill:i,line:n}=t;if((0,s.g)(i))return function(t,e){const i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:s}=t,n=[],o=s.segments,a=s.points,r=function(t,e){const i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){const n=s[t];if(n.index===e)break;n.hidden||i.unshift(n.dataset)}return i}(e,i);r.push(ne({x:null,y:e.bottom},s));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)le(n,a[t],r)}return new Kt({points:n,options:{}})}(t);if("shape"===i)return!0;const o=function(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:i}=t,n=e.options,o=e.getLabels().length,a=n.reverse?e.max:e.min,r=function(t,e,i){let n;return n="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:(0,s.i)(t)?t.value:e.getBaseValue(),n}(i,e,a),l=[];if(n.grid.circular){const t=e.getPointPositionForValue(0,a);return new ce({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(r)})}for(let t=0;t<o;++t)l.push(e.getPointPositionForValue(t,r));return l}(t):function(t){const{scale:e={},fill:i}=t,n=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:(0,s.i)(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if((0,s.g)(n)){const t=e.isHorizontal();return{x:t?n:null,y:t?null:n}}return null}(t)}(t);return o instanceof ce?o:ne(o,n)}(e),{chart:o,index:a,line:r,scale:l,axis:h}=e,c=r.options,d=c.fill,u=c.backgroundColor,{above:f=u,below:p=u}=d||{},g=o.getDatasetMeta(a),m=(0,s.ah)(o,g);n&&r.points.length&&((0,s.Y)(t,i),function(t,e){const{line:i,target:s,above:n,below:o,area:a,scale:r,clip:l}=e,h=i._loop?"angle":e.axis;t.save();let c=o;o!==n&&("x"===h?(ue(t,s,a.top),pe(t,{line:i,target:s,color:n,scale:r,property:h,clip:l}),t.restore(),t.save(),ue(t,s,a.bottom)):"y"===h&&(fe(t,s,a.left),pe(t,{line:i,target:s,color:o,scale:r,property:h,clip:l}),t.restore(),t.save(),fe(t,s,a.right),c=n)),pe(t,{line:i,target:s,color:c,scale:r,property:h,clip:l}),t.restore()}(t,{line:r,target:n,above:f,below:p,area:i,scale:l,axis:h,clip:m}),(0,s.$)(t))}function ue(t,e,i){const{segments:s,points:n}=e;let o=!0,a=!1;t.beginPath();for(const r of s){const{start:s,end:l}=r,h=n[s],c=n[ie(s,l,n)];o?(t.moveTo(h.x,h.y),o=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),a=!!e.pathSegment(t,r,{move:a}),a?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function fe(t,e,i){const{segments:s,points:n}=e;let o=!0,a=!1;t.beginPath();for(const r of s){const{start:s,end:l}=r,h=n[s],c=n[ie(s,l,n)];o?(t.moveTo(h.x,h.y),o=!1):(t.lineTo(i,h.y),t.lineTo(h.x,h.y)),a=!!e.pathSegment(t,r,{move:a}),a?t.closePath():t.lineTo(i,c.y)}t.lineTo(i,e.first().y),t.closePath(),t.clip()}function pe(t,e){const{line:i,target:n,property:o,color:a,scale:r,clip:l}=e,h=function(t,e,i){const n=t.segments,o=t.points,a=e.points,r=[];for(const t of n){let{start:n,end:l}=t;l=ie(n,l,o);const h=ee(i,o[n],o[l],t.loop);if(!e.segments){r.push({source:t,target:h,start:o[n],end:o[l]});continue}const c=(0,s.ap)(e,h);for(const e of c){const n=ee(i,a[e.start],a[e.end],e.loop),l=(0,s.az)(t,o,n);for(const t of l)r.push({source:t,target:e,start:{[i]:se(h,n,"start",Math.max)},end:{[i]:se(h,n,"end",Math.min)}})}}return r}(i,n,o);for(const{source:e,target:s,start:c,end:d}of h){const{style:{backgroundColor:h=a}={}}=e,u=!0!==n;t.save(),t.fillStyle=h,ge(t,r,l,u&&ee(o,c,d)),t.beginPath();const f=!!i.pathSegment(t,e);let p;if(u){f?t.closePath():me(t,n,d,o);const e=!!n.pathSegment(t,s,{move:f,reverse:!0});p=f&&e,p||me(t,n,c,o)}t.closePath(),t.fill(p?"evenodd":"nonzero"),t.restore()}}function ge(t,e,i,s){const n=e.chart.chartArea,{property:o,start:a,end:r}=s||{};if("x"===o||"y"===o){let e,s,l,h;"x"===o?(e=a,s=n.top,l=r,h=n.bottom):(e=n.left,s=a,l=n.right,h=r),t.beginPath(),i&&(e=Math.max(e,i.left),l=Math.min(l,i.right),s=Math.max(s,i.top),h=Math.min(h,i.bottom)),t.rect(e,s,l-e,h-s),t.clip()}}function me(t,e,i,s){const n=e.interpolate(i,s);n&&t.lineTo(n.x,n.y)}var xe={id:"filler",afterDatasetsUpdate(t,e,i){const s=(t.data.datasets||[]).length,n=[];let o,a,r,l;for(a=0;a<s;++a)o=t.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof Kt&&(l={visible:t.isDatasetVisible(a),index:a,fill:re(r,a,s),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,n.push(l);for(a=0;a<s;++a)l=n[a],l&&!1!==l.fill&&(l.fill=ae(n,a,i.propagate))},beforeDraw(t,e,i){const s="beforeDraw"===i.drawTime,n=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),s&&i.fill&&de(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;oe(i)&&de(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;oe(s)&&"beforeDatasetDraw"===i.drawTime&&de(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const be=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class _e extends nt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){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)}buildLabels(){const t=this.options.labels||{};let e=(0,s.Q)(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,n=(0,s.a0)(i.font),o=n.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=be(i,o);let h,c;e.font=n.string,this.isHorizontal()?(h=this.maxWidth,c=this._fitRows(a,o,r,l)+10):(c=this.maxHeight,h=this._fitCols(a,n,r,l)+10),this.width=Math.min(h,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:n,maxWidth:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.lineWidths=[0],h=s+a;let c=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach((t,f)=>{const p=i+e/2+n.measureText(t.text).width;(0===f||l[l.length-1]+p+2*a>o)&&(c+=h,l[l.length-(f>0?0:1)]=0,u+=h,d++),r[f]={left:0,top:u,row:d,width:p,height:s},l[l.length-1]+=p+a}),c}_fitCols(t,e,i,s){const{ctx:n,maxHeight:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.columnSizes=[],h=o-t;let c=a,d=0,u=0,f=0,p=0;return this.legendItems.forEach((t,o)=>{const{itemWidth:g,itemHeight:m}=function(t,e,i,s,n){const o=function(t,e,i,s){let n=t.text;return n&&"string"!=typeof n&&(n=n.reduce((t,e)=>t.length>e.length?t:e)),e+i.size/2+s.measureText(n).width}(s,t,e,i),a=function(t,e,i){let s=t;return"string"!=typeof e.text&&(s=ye(e,i)),s}(n,s,e.lineHeight);return{itemWidth:o,itemHeight:a}}(i,e,n,t,s);o>0&&u+m+2*a>h&&(c+=d+a,l.push({width:d,height:u}),f+=d+a,p++,d=u=0),r[o]={left:f,top:u,col:p,width:g,height:m},d=Math.max(d,g),u+=m+a}),c+=d,l.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:o}}=this,a=(0,s.aA)(o,this.left,this.width);if(this.isHorizontal()){let o=0,r=(0,s.a2)(i,this.left+n,this.right-this.lineWidths[o]);for(const l of e)o!==l.row&&(o=l.row,r=(0,s.a2)(i,this.left+n,this.right-this.lineWidths[o])),l.top+=this.top+t+n,l.left=a.leftForLtr(a.x(r),l.width),r+=l.width+n}else{let o=0,r=(0,s.a2)(i,this.top+t+n,this.bottom-this.columnSizes[o].height);for(const l of e)l.col!==o&&(o=l.col,r=(0,s.a2)(i,this.top+t+n,this.bottom-this.columnSizes[o].height)),l.top=r,l.left+=this.left+n,l.left=a.leftForLtr(a.x(l.left),l.width),r+=l.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;(0,s.Y)(t,this),this._draw(),(0,s.$)(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:o,labels:a}=t,r=s.d.color,l=(0,s.aA)(t.rtl,this.left,this.width),h=(0,s.a0)(a.font),{padding:c}=a,d=h.size,u=d/2;let f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=h.string;const{boxWidth:p,boxHeight:g,itemHeight:m}=be(a,d),x=this.isHorizontal(),b=this._computeTitleHeight();f=x?{x:(0,s.a2)(o,this.left+c,this.right-i[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:(0,s.a2)(o,this.top+b+c,this.bottom-e[0].height),line:0},(0,s.aB)(this.ctx,t.textDirection);const _=m+c;this.legendItems.forEach((y,v)=>{n.strokeStyle=y.fontColor,n.fillStyle=y.fontColor;const k=n.measureText(y.text).width,w=l.textAlign(y.textAlign||(y.textAlign=a.textAlign)),M=p+u+k;let C=f.x,S=f.y;if(l.setWidth(this.width),x?v>0&&C+M+c>this.right&&(S=f.y+=_,f.line++,C=f.x=(0,s.a2)(o,this.left+c,this.right-i[f.line])):v>0&&S+_>this.bottom&&(C=f.x=C+e[f.line].width+c,f.line++,S=f.y=(0,s.a2)(o,this.top+b+c,this.bottom-e[f.line].height)),function(t,e,i){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;n.save();const o=(0,s.v)(i.lineWidth,1);if(n.fillStyle=(0,s.v)(i.fillStyle,r),n.lineCap=(0,s.v)(i.lineCap,"butt"),n.lineDashOffset=(0,s.v)(i.lineDashOffset,0),n.lineJoin=(0,s.v)(i.lineJoin,"miter"),n.lineWidth=o,n.strokeStyle=(0,s.v)(i.strokeStyle,r),n.setLineDash((0,s.v)(i.lineDash,[])),a.usePointStyle){const r={radius:g*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:o},h=l.xPlus(t,p/2),c=e+u;(0,s.aE)(n,r,h,c,a.pointStyleWidth&&p)}else{const a=e+Math.max((d-g)/2,0),r=l.leftForLtr(t,p),h=(0,s.ay)(i.borderRadius);n.beginPath(),Object.values(h).some(t=>0!==t)?(0,s.aw)(n,{x:r,y:a,w:p,h:g,radius:h}):n.rect(r,a,p,g),n.fill(),0!==o&&n.stroke()}n.restore()}(l.x(C),S,y),C=(0,s.aC)(w,C+p+u,x?C+M:this.right,t.rtl),function(t,e,i){(0,s.Z)(n,i.text,t,e+m/2,h,{strikethrough:i.hidden,textAlign:l.textAlign(i.textAlign)})}(l.x(C),S,y),x)f.x+=M+c;else if("string"!=typeof y.text){const t=h.lineHeight;f.y+=ye(y,t)+c}else f.y+=_}),(0,s.aD)(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=(0,s.a0)(e.font),n=(0,s.E)(e.padding);if(!e.display)return;const o=(0,s.aA)(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=i.size/2,h=n.top+l;let c,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),c=this.top+h,d=(0,s.a2)(t.align,d,this.right-u);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);c=h+(0,s.a2)(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const f=(0,s.a2)(r,d,d+u);a.textAlign=o.textAlign((0,s.a1)(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,(0,s.Z)(a,e.text,f,c,i)}_computeTitleHeight(){const t=this.options.title,e=(0,s.a0)(t.font),i=(0,s.E)(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,o;if((0,s.ak)(t,this.left,this.right)&&(0,s.ak)(e,this.top,this.bottom))for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(n=o[i],(0,s.ak)(t,n.left,n.left+n.width)&&(0,s.ak)(e,n.top,n.top+n.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){return!("mousemove"!==t&&"mouseout"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const a=this._hoveredItem,r=(o=i,null!==(n=a)&&null!==o&&n.datasetIndex===o.datasetIndex&&n.index===o.index);a&&!r&&(0,s.Q)(e.onLeave,[t,a,this],this),this._hoveredItem=i,i&&!r&&(0,s.Q)(e.onHover,[t,i,this],this)}else i&&(0,s.Q)(e.onClick,[t,i,this],this);var n,o}}function ye(t,e){return e*(t.text?t.text.length:0)}var ve={id:"legend",_element:_e,start(t,e,i){const s=t.legend=new _e({ctx:t.ctx,options:i,chart:t});N.configure(t,s,i),N.addBox(t,s)},stop(t){N.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const s=t.legend;N.configure(t,s,i),s.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const s=e.datasetIndex,n=i.chart;n.isDatasetVisible(s)?(n.hide(s),e.hidden=!0):(n.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:o,color:a,useBorderRadius:r,borderRadius:l}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const h=t.controller.getStyle(i?0:void 0),c=(0,s.E)(h.borderWidth);return{text:e[t.index].label,fillStyle:h.backgroundColor,fontColor:a,hidden:!t.visible,lineCap:h.borderCapStyle,lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:h.borderColor,pointStyle:n||h.pointStyle,rotation:h.rotation,textAlign:o||h.textAlign,borderRadius:r&&(l||h.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class ke extends nt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const n=(0,s.b)(i.text)?i.text.length:1;this._padding=(0,s.E)(i.padding);const o=n*(0,s.a0)(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:o,options:a}=this,r=a.align;let l,h,c,d=0;return this.isHorizontal()?(h=(0,s.a2)(r,i,o),c=e+t,l=o-i):("left"===a.position?(h=i+t,c=(0,s.a2)(r,n,e),d=-.5*s.P):(h=o-t,c=(0,s.a2)(r,e,n),d=.5*s.P),l=n-e),{titleX:h,titleY:c,maxWidth:l,rotation:d}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=(0,s.a0)(e.font),n=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:r,rotation:l}=this._drawArgs(n);(0,s.Z)(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:l,textAlign:(0,s.a1)(e.align),textBaseline:"middle",translation:[o,a]})}}var we={id:"title",_element:ke,start(t,e,i){!function(t,e){const i=new ke({ctx:t.ctx,options:e,chart:t});N.configure(t,i,e),N.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;N.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;N.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};new WeakMap;const Me={average(t){if(!t.length)return!1;let e,i,s=new Set,n=0,o=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();s.add(t.x),n+=t.y,++o}}return 0!==o&&0!==s.size&&{x:[...s].reduce((t,e)=>t+e)/s.size,y:n/o}},nearest(t,e){if(!t.length)return!1;let i,n,o,a=e.x,r=e.y,l=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){const n=t[i].element;if(n&&n.hasValue()){const t=n.getCenterPoint(),i=(0,s.aF)(e,t);i<l&&(l=i,o=n)}}if(o){const t=o.tooltipPosition();a=t.x,r=t.y}return{x:a,y:r}}};function Ce(t,e){return e&&((0,s.b)(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Se(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Ee(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:t,label:a,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function Ae(t,e){const i=t.chart.ctx,{body:n,footer:o,title:a}=t,{boxWidth:r,boxHeight:l}=e,h=(0,s.a0)(e.bodyFont),c=(0,s.a0)(e.titleFont),d=(0,s.a0)(e.footerFont),u=a.length,f=o.length,p=n.length,g=(0,s.E)(e.padding);let m=g.height,x=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);b+=t.beforeBody.length+t.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),b&&(m+=p*(e.displayColors?Math.max(l,h.lineHeight):h.lineHeight)+(b-p)*h.lineHeight+(b-1)*e.bodySpacing),f&&(m+=e.footerMarginTop+f*d.lineHeight+(f-1)*e.footerSpacing);let _=0;const y=function(t){x=Math.max(x,i.measureText(t).width+_)};return i.save(),i.font=c.string,(0,s.F)(t.title,y),i.font=h.string,(0,s.F)(t.beforeBody.concat(t.afterBody),y),_=e.displayColors?r+2+e.boxPadding:0,(0,s.F)(n,t=>{(0,s.F)(t.before,y),(0,s.F)(t.lines,y),(0,s.F)(t.after,y)}),_=0,i.font=d.string,(0,s.F)(t.footer,y),i.restore(),x+=g.width,{width:x,height:m}}function Oe(t,e,i,s){const{x:n,width:o}=i,{width:a,chartArea:{left:r,right:l}}=t;let h="center";return"center"===s?h=n<=(r+l)/2?"left":"right":n<=o/2?h="left":n>=a-o/2&&(h="right"),function(t,e,i,s){const{x:n,width:o}=s,a=i.caretSize+i.caretPadding;return"left"===t&&n+o+a>e.width||"right"===t&&n-o-a<0||void 0}(h,t,e,i)&&(h="center"),h}function De(t,e,i){const s=i.yAlign||e.yAlign||function(t,e){const{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Oe(t,e,i,s),yAlign:s}}function Pe(t,e,i,n){const{caretSize:o,caretPadding:a,cornerRadius:r}=t,{xAlign:l,yAlign:h}=i,c=o+a,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:p}=(0,s.ay)(r);let g=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,l);const m=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(e,h,c);return"center"===h?"left"===l?g+=c:"right"===l&&(g-=c):"left"===l?g-=Math.max(d,f)+o:"right"===l&&(g+=Math.max(u,p)+o),{x:(0,s.S)(g,0,n.width-e.width),y:(0,s.S)(m,0,n.height-e.height)}}function Te(t,e,i){const n=(0,s.E)(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function Fe(t){return Ce([],Se(t))}function Ie(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const Le={beforeTitle:s.aG,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return""},afterTitle:s.aG,beforeBody:s.aG,beforeLabel:s.aG,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return(0,s.k)(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:s.aG,afterBody:s.aG,beforeFooter:s.aG,footer:s.aG,afterFooter:s.aG};function Be(t,e,i,s){const n=t[e].call(i,s);return void 0===n?Le[e].call(i,s):n}class Re extends nt{static positioners=Me;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,n=new h(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this._tooltipItems,(0,s.j)(t,{tooltip:this,tooltipItems:e,type:"tooltip"})));var t,e}getTitle(t,e){const{callbacks:i}=e,s=Be(i,"beforeTitle",this,t),n=Be(i,"title",this,t),o=Be(i,"afterTitle",this,t);let a=[];return a=Ce(a,Se(s)),a=Ce(a,Se(n)),a=Ce(a,Se(o)),a}getBeforeBody(t,e){return Fe(Be(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return(0,s.F)(t,t=>{const e={before:[],lines:[],after:[]},s=Ie(i,t);Ce(e.before,Se(Be(s,"beforeLabel",this,t))),Ce(e.lines,Be(s,"label",this,t)),Ce(e.after,Se(Be(s,"afterLabel",this,t))),n.push(e)}),n}getAfterBody(t,e){return Fe(Be(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=Be(i,"beforeFooter",this,t),n=Be(i,"footer",this,t),o=Be(i,"afterFooter",this,t);let a=[];return a=Ce(a,Se(s)),a=Ce(a,Se(n)),a=Ce(a,Se(o)),a}_createItems(t){const e=this._active,i=this.chart.data,n=[],o=[],a=[];let r,l,h=[];for(r=0,l=e.length;r<l;++r)h.push(Ee(this.chart,e[r]));return t.filter&&(h=h.filter((e,s,n)=>t.filter(e,s,n,i))),t.itemSort&&(h=h.sort((e,s)=>t.itemSort(e,s,i))),(0,s.F)(h,e=>{const i=Ie(t.callbacks,e);n.push(Be(i,"labelColor",this,e)),o.push(Be(i,"labelPointStyle",this,e)),a.push(Be(i,"labelTextColor",this,e))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=h,h}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=Me[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Ae(this,i),a=Object.assign({},t,e),r=De(this.chart,i,a),l=Pe(i,a,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:o}=this,{caretSize:a,cornerRadius:r}=i,{topLeft:l,topRight:h,bottomLeft:c,bottomRight:d}=(0,s.ay)(r),{x:u,y:f}=t,{width:p,height:g}=e;let m,x,b,_,y,v;return"center"===o?(y=f+g/2,"left"===n?(m=u,x=m-a,_=y+a,v=y-a):(m=u+p,x=m+a,_=y-a,v=y+a),b=m):(x="left"===n?u+Math.max(l,c)+a:"right"===n?u+p-Math.max(h,d)-a:this.caretX,"top"===o?(_=f,y=_-a,m=x-a,b=x+a):(_=f+g,y=_+a,m=x+a,b=x-a),v=_),{x1:m,x2:x,x3:b,y1:_,y2:y,y3:v}}drawTitle(t,e,i){const n=this.title,o=n.length;let a,r,l;if(o){const h=(0,s.aA)(i.rtl,this.x,this.width);for(t.x=Te(this,i.titleAlign,i),e.textAlign=h.textAlign(i.titleAlign),e.textBaseline="middle",a=(0,s.a0)(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(n[l],h.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,n,o){const a=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:l,boxWidth:h}=o,c=(0,s.a0)(o.bodyFont),d=Te(this,"left",o),u=n.x(d),f=l<c.lineHeight?(c.lineHeight-l)/2:0,p=e.y+f;if(o.usePointStyle){const e={radius:Math.min(h,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},i=n.leftForLtr(u,h)+h/2,c=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,(0,s.av)(t,e,i,c),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,(0,s.av)(t,e,i,c)}else{t.lineWidth=(0,s.i)(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const e=n.leftForLtr(u,h),i=n.leftForLtr(n.xPlus(u,1),h-2),r=(0,s.ay)(a.borderRadius);Object.values(r).some(t=>0!==t)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,(0,s.aw)(t,{x:e,y:p,w:h,h:l,radius:r}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),(0,s.aw)(t,{x:i,y:p+1,w:h-2,h:l-2,radius:r}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(e,p,h,l),t.strokeRect(e,p,h,l),t.fillStyle=a.backgroundColor,t.fillRect(i,p+1,h-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:h,boxPadding:c}=i,d=(0,s.a0)(i.bodyFont);let u=d.lineHeight,f=0;const p=(0,s.aA)(i.rtl,this.x,this.width),g=function(i){e.fillText(i,p.x(t.x+f),t.y+u/2),t.y+=u+o},m=p.textAlign(a);let x,b,_,y,v,k,w;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,t.x=Te(this,m,i),e.fillStyle=i.bodyColor,(0,s.F)(this.beforeBody,g),f=r&&"right"!==m?"center"===a?h/2+c:h+2+c:0,y=0,k=n.length;y<k;++y){for(x=n[y],b=this.labelTextColors[y],e.fillStyle=b,(0,s.F)(x.before,g),_=x.lines,r&&_.length&&(this._drawColorBox(e,t,y,p,i),u=Math.max(d.lineHeight,l)),v=0,w=_.length;v<w;++v)g(_[v]),u=d.lineHeight;(0,s.F)(x.after,g)}f=0,u=d.lineHeight,(0,s.F)(this.afterBody,g),t.y-=o}drawFooter(t,e,i){const n=this.footer,o=n.length;let a,r;if(o){const l=(0,s.aA)(i.rtl,this.x,this.width);for(t.x=Te(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=(0,s.a0)(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(n[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:h,height:c}=i,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:p}=(0,s.ay)(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(r+d,l),"top"===a&&this.drawCaret(t,e,i,n),e.lineTo(r+h-u,l),e.quadraticCurveTo(r+h,l,r+h,l+u),"center"===a&&"right"===o&&this.drawCaret(t,e,i,n),e.lineTo(r+h,l+c-p),e.quadraticCurveTo(r+h,l+c,r+h-p,l+c),"bottom"===a&&this.drawCaret(t,e,i,n),e.lineTo(r+f,l+c),e.quadraticCurveTo(r,l+c,r,l+c-f),"center"===a&&"left"===o&&this.drawCaret(t,e,i,n),e.lineTo(r,l+d),e.quadraticCurveTo(r,l,r+d,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=Me[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Ae(this,t),a=Object.assign({},i,this._size),r=De(e,t,a),l=Pe(t,a,r,e);s._to===l.x&&n._to===l.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=(0,s.E)(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,n,e),(0,s.aB)(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),(0,s.aD)(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),o=!(0,s.ai)(i,n),a=this._positionChanged(n,e);(o||a)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,i),r=this._positionChanged(a,t),l=e||!(0,s.ai)(a,o)||r;return l&&(this._active=a,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));const o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=Me[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}var ze={id:"tooltip",_element:Re,positioners:Me,afterInit(t,e,i){i&&(t.tooltip=new Re({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const 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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>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:Le},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function He(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class Ne extends ft{static id="category";static defaults={ticks:{callback:He}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if((0,s.k)(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:(0,s.S)(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,s){const n=t.indexOf(e);return-1===n?((t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s):n!==t.lastIndexOf(e)?i:n}(i,t,(0,s.v)(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){return He.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function We(t,e,{horizontal:i,minRotation:n}){const o=(0,s.t)(n),a=(i?Math.sin(o):Math.cos(o))||.001,r=.75*e*(""+t).length;return Math.min(e/a,r)}class Ve extends ft{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return(0,s.k)(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:o}=this;const a=t=>n=e?n:t,r=t=>o=i?o:t;if(t){const t=(0,s.s)(n),e=(0,s.s)(o);t<0&&e<0?r(0):t>0&&e>0&&a(0)}if(n===o){let e=0===o?1:Math.abs(.05*o);r(o+e),t||a(n-e)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:o,min:a,max:r,precision:l,count:h,maxTicks:c,maxDigits:d,includeBounds:u}=t,f=o||1,p=c-1,{min:g,max:m}=e,x=!(0,s.k)(a),b=!(0,s.k)(r),_=!(0,s.k)(h),y=(m-g)/(d+1);let v,k,w,M,C=(0,s.aI)((m-g)/p/f)*f;if(C<1e-14&&!x&&!b)return[{value:g},{value:m}];M=Math.ceil(m/C)-Math.floor(g/C),M>p&&(C=(0,s.aI)(M*C/p/f)*f),(0,s.k)(l)||(v=Math.pow(10,l),C=Math.ceil(C*v)/v),"ticks"===n?(k=Math.floor(g/C)*C,w=Math.ceil(m/C)*C):(k=g,w=m),x&&b&&o&&(0,s.aJ)((r-a)/o,C/1e3)?(M=Math.round(Math.min((r-a)/C,c)),C=(r-a)/M,k=a,w=r):_?(k=x?a:k,w=b?r:w,M=h-1,C=(w-k)/M):(M=(w-k)/C,M=(0,s.aK)(M,Math.round(M),C/1e3)?Math.round(M):Math.ceil(M));const S=Math.max((0,s.aL)(C),(0,s.aL)(k));v=Math.pow(10,(0,s.k)(l)?S:l),k=Math.round(k*v)/v,w=Math.round(w*v)/v;let E=0;for(x&&(u&&k!==a?(i.push({value:a}),k<a&&E++,(0,s.aK)(Math.round((k+E*C)*v)/v,a,We(a,y,t))&&E++):k<a&&E++);E<M;++E){const t=Math.round((k+E*C)*v)/v;if(b&&t>r)break;i.push({value:t})}return b&&u&&w!==r?i.length&&(0,s.aK)(i[i.length-1].value,r,We(r,y,t))?i[i.length-1].value=r:i.push({value:r}):b&&w!==r||i.push({value:w}),i}({maxTicks: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&&(0,s.aH)(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return(0,s.o)(t,this.chart.options.locale,this.options.ticks.format)}}class je extends Ve{static id="linear";static defaults={ticks:{callback:s.aM.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=(0,s.g)(t)?t:0,this.max=(0,s.g)(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=(0,s.t)(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}s.aM.formatters.logarithmic,s.aM.formatters.numeric},49757:(t,e,i)=>{i.d(e,{A:()=>o,H:()=>n});var s=i(51609);function n(){return(0,s.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)("path",{d:"M9 2.5C9 1.948 9.448 1.5 10 1.5C10.552 1.5 11 1.948 11 2.5V9",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),(0,s.createElement)("path",{d:"M11 8V6C11 5.448 11.448 5 12 5C12.552 5 13 5.448 13 6V9",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),(0,s.createElement)("path",{d:"M13 8V6.5C13 5.948 13.448 5.5 14 5.5C14.552 5.5 15 5.948 15 6.5V10.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),(0,s.createElement)("path",{d:"M7 5C7 4.448 7.448 4 8 4C8.552 4 9 4.448 9 5V9",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),(0,s.createElement)("path",{d:"M7 9.5C7 9.5 5.5 9.5 5.5 11.5C5.5 12.828 6 14 7 15C7.833 15.833 9 16.5 10.5 16.5H12C13.657 16.5 15 15.157 15 13.5V10.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}function o(){return(0,s.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)("path",{d:"M2.5 2.5V17.5H17.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.createElement)("path",{d:"M6.5 14V15.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),(0,s.createElement)("path",{d:"M9.5 12V15.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),(0,s.createElement)("path",{d:"M12.5 9.5V15.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),(0,s.createElement)("path",{d:"M15.5 6.5V15.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),(0,s.createElement)("path",{d:"M2.5 10.5C6.5 10.5 6 6.5 9.5 6.5C13 6.5 12.5 10.5 17.5 8",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:"0.55"}))}},51529:(t,e,i)=>{i.d(e,{N1:()=>f});var s=i(51609),n=i(44656);const o="label";function a(t,e){"function"==typeof t?t(e):t&&(t.current=e)}function r(t,e){t.labels=e}function l(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o;const s=[];t.datasets=e.map(e=>{const n=t.datasets.find(t=>t[i]===e[i]);return n&&e.data&&!s.includes(n)?(s.push(n),Object.assign(n,e),n):{...e}})}function h(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;const i={labels:[],datasets:[]};return r(i,t.labels),l(i,t.datasets,e),i}function c(t,e){const{height:i=150,width:o=300,redraw:c=!1,datasetIdKey:d,type:u,data:f,options:p,plugins:g=[],fallbackContent:m,updateMode:x,...b}=t,_=(0,s.useRef)(null),y=(0,s.useRef)(null),v=()=>{_.current&&(y.current=new n.t1(_.current,{type:u,data:h(f,d),options:p&&{...p},plugins:g}),a(e,y.current))},k=()=>{a(e,null),y.current&&(y.current.destroy(),y.current=null)};return(0,s.useEffect)(()=>{!c&&y.current&&p&&function(t,e){const i=t.options;i&&e&&Object.assign(i,e)}(y.current,p)},[c,p]),(0,s.useEffect)(()=>{!c&&y.current&&r(y.current.config.data,f.labels)},[c,f.labels]),(0,s.useEffect)(()=>{!c&&y.current&&f.datasets&&l(y.current.config.data,f.datasets,d)},[c,f.datasets]),(0,s.useEffect)(()=>{y.current&&(c?(k(),setTimeout(v)):y.current.update(x))},[c,p,f.labels,f.datasets,x]),(0,s.useEffect)(()=>{y.current&&(k(),setTimeout(v))},[u]),(0,s.useEffect)(()=>(v(),()=>k()),[]),s.createElement("canvas",{ref:_,role:"img",height:i,width:o,...b},m)}const d=(0,s.forwardRef)(c);function u(t,e){return n.t1.register(e),(0,s.forwardRef)((e,i)=>s.createElement(d,{...e,ref:i,type:t}))}const f=u("line",n.ZT)},51609:t=>{t.exports=window.React},56859:(t,e,i)=>{i.d(e,{A:()=>d});var s=i(51609),n=i(27723),o=i(25689),a=i(49757),r=i(39682),l=i(87941);const h="#4794ff",c="#6f52ff";function d({config:t,data:e,loading:i,error:d,onRetry:u}){const f=Array.isArray(e?.rows)?e.rows:[],p=f.reduce((t,e)=>(t.clicks+=Number(e.clicks)||0,t.impressions+=Number(e.impressions)||0,t),{clicks:0,impressions:0}),g=p.clicks>0||p.impressions>0,m=[{key:"clicks",label:(0,n.__)("Total Clicks","thinkrank"),value:p.clicks,color:h,icon:(0,s.createElement)(a.H,null)},{key:"impressions",label:(0,n.__)("Total Impressions","thinkrank"),value:p.impressions,color:c,icon:(0,s.createElement)(a.A,null)}];return(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__panel"},(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__toolbar"},(0,s.createElement)("span",{className:"thinkrank-dashboard-widget__toolbar-label"},(0,n.__)("Traffic from last few days","thinkrank")),(0,s.createElement)("a",{className:"thinkrank-dashboard-widget__view-more",href:t.settingsUrl},(0,n.__)("View More","thinkrank"),(0,s.createElement)("span",{"aria-hidden":"true"},"↗"))),i&&(0,s.createElement)("p",{className:"thinkrank-dashboard-widget__note"},(0,n.__)("Loading Search Console data…","thinkrank")),!i&&d&&(0,s.createElement)(l.A,{error:d,config:t,onRetry:u}),!i&&!d&&!g&&(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__empty-data"},(0,s.createElement)("p",{className:"thinkrank-dashboard-widget__empty-data-title"},(0,n.__)("No data available","thinkrank")),(0,s.createElement)("p",{className:"thinkrank-dashboard-widget__note"},(0,n.__)("Search Console data might take up to 30 days to appear for newly added sites. Please check back later.","thinkrank"))),!i&&!d&&g&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(o.A,{rows:f}),(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__stats"},m.map(t=>{return(0,s.createElement)("div",{key:t.key,className:"thinkrank-dashboard-widget__stat"},(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__stat-top"},(0,s.createElement)("span",{className:"thinkrank-dashboard-widget__stat-icon",style:{backgroundColor:t.color}},t.icon),(0,s.createElement)("span",{className:"thinkrank-dashboard-widget__stat-label"},t.label)),(0,s.createElement)("span",{className:"thinkrank-dashboard-widget__stat-value"},(e=t.value,(Number(e)||0).toLocaleString())));var e}))),(0,s.createElement)(r.A,{config:t}))}},60775:(t,e,i)=>{i.d(e,{A:()=>n});const s=()=>!0===window.thinkrankDebug||!0===window.thinkrankAdmin?.debug,n={error:(...t)=>{s()&&console.error("[ThinkRank]",...t)},warn:(...t)=>{s()&&console.warn("[ThinkRank]",...t)},info:(...t)=>{s()&&console.info("[ThinkRank]",...t)}}},62538:(t,e,i)=>{i.d(e,{R:()=>s});const s="30d"},69966:(t,e,i)=>{i.d(e,{A:()=>a});var s=i(51609),n=i(86087);let o=0;const a=({size:t=28,className:e=""})=>{const[i]=(0,n.useState)(()=>`tr${o+=1}`),a='<svg width="__SIZE__" height="__SIZE__" viewBox="0 0 29 29" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true"><g filter="url(#filter0_ii_1426_17776)"><g clip-path="url(#clip0_1426_17776)"><g filter="url(#filter1_i_1426_17776)"><path d="M0.436523 6.61665C0.436523 3.15762 3.24063 0.353516 6.69966 0.353516H22.1734C25.6324 0.353516 28.4365 3.15762 28.4365 6.61665V22.0904C28.4365 25.5494 25.6324 28.3535 22.1734 28.3535H6.69966C3.24063 28.3535 0.436523 25.5494 0.436523 22.0904V6.61665Z" fill="url(#paint0_linear_1426_17776)"></path></g><g filter="url(#filter2_f_1426_17776)"><path d="M7.5174 21.5838C3.89577 20.9253 2.76064 20.6108 -0.0576172 22.8811V30.3506H29.5615L29.1584 8.37305C28.9585 8.37314 22.824 10.9411 19.833 13.9C16.0579 18.7189 13.4633 22.6649 7.5174 21.5838Z" fill="url(#paint1_linear_1426_17776)"></path></g><g filter="url(#filter3_dii_1426_17776)"><path d="M29.1618 8.11914C29.1618 8.11914 29.1622 8.11903 29.3906 8.71865C29.6058 9.28347 29.6182 9.31627 29.6189 9.31817C29.6189 9.31817 29.6185 9.3185 29.6182 9.31862C29.6176 9.31886 29.6166 9.31924 29.6153 9.31976C29.6124 9.32086 29.6078 9.32246 29.6018 9.32477C29.5898 9.32942 29.5714 9.33652 29.5471 9.34596C29.4986 9.36487 29.4265 9.39344 29.3332 9.43073C29.1465 9.50532 28.8754 9.61538 28.5404 9.75703C27.8699 10.0405 26.9452 10.449 25.9291 10.9483C23.8797 11.9554 21.5331 13.2968 20.1165 14.6951C19.2976 15.5641 18.5831 16.4248 17.898 17.2522C17.2153 18.0766 16.555 18.8765 15.8671 19.588C14.477 21.0257 12.9316 22.1479 10.6959 22.53C9.60585 22.7163 8.53683 22.6112 7.52835 22.4516C6.48364 22.2863 5.5662 22.0772 4.59619 21.989C3.82718 21.9191 3.16045 21.9788 2.48024 22.211C1.79208 22.4458 1.05578 22.8689 0.16582 23.5725L-0.629883 22.5658C0.329559 21.8073 1.19422 21.2939 2.06576 20.9965C2.94522 20.6963 3.79701 20.6277 4.7124 20.7109C5.73306 20.8037 6.79732 21.0365 7.7291 21.184C8.69711 21.3372 9.59965 21.4156 10.4799 21.2651C12.3522 20.9451 13.6648 20.0196 14.9444 18.6962C15.5914 18.027 16.2189 17.2678 16.9095 16.4337C17.5953 15.6055 18.3371 14.7115 19.1918 13.8053L19.1994 13.7973L19.2073 13.7893C20.7824 12.2312 23.2976 10.8117 25.3631 9.79668C26.4061 9.28415 27.3538 8.86556 28.0407 8.5751C28.3843 8.4298 28.6633 8.31639 28.8569 8.239C28.9537 8.20031 29.0292 8.17052 29.0809 8.15036C29.1068 8.14028 29.1268 8.13259 29.1404 8.12734C29.1472 8.12472 29.1525 8.12281 29.1561 8.12142C29.1579 8.12073 29.1592 8.11998 29.1602 8.1196C29.1607 8.11941 29.1613 8.11925 29.1616 8.11914H29.1618Z" fill="url(#paint2_linear_1426_17776)"></path></g><g filter="url(#filter4_dii_1426_17776)"><path d="M22.3437 13.4975C22.3437 14.5285 21.508 15.3642 20.477 15.3642C19.4461 15.3642 18.6104 14.5285 18.6104 13.4975C18.6104 12.4666 19.4461 11.6309 20.477 11.6309C21.508 11.6309 22.3437 12.4666 22.3437 13.4975Z" fill="url(#paint3_radial_1426_17776)"></path><path d="M20.4766 11.2734C21.7049 11.2734 22.7009 12.2688 22.7012 13.4971C22.7012 14.7256 21.7051 15.7217 20.4766 15.7217C19.2482 15.7214 18.2529 14.7254 18.2529 13.4971C18.2532 12.2689 19.2484 11.2737 20.4766 11.2734Z" fill="none" stroke="white" stroke-width="0.715555"></path></g><g filter="url(#filter5_d_1426_17776)"><path d="M15.6201 6.78776C15.9391 6.88104 15.9391 7.33291 15.6201 7.42619L13.5873 8.02069C13.4784 8.05254 13.3933 8.13768 13.3614 8.24656L12.7669 10.2794C12.6736 10.5984 12.2218 10.5984 12.1285 10.2794L11.534 8.24656C11.5022 8.13768 11.417 8.05254 11.3081 8.02069L9.27529 7.42619C8.95631 7.33291 8.9563 6.88104 9.27528 6.78776L11.3081 6.19326C11.417 6.16141 11.5022 6.07627 11.534 5.96739L12.1285 3.93455C12.2218 3.61557 12.6736 3.61557 12.7669 3.93455L13.3614 5.96739C13.3933 6.07627 13.4784 6.16141 13.5873 6.19326L15.6201 6.78776Z" fill="url(#paint4_linear_1426_17776)"></path></g><g filter="url(#filter6_d_1426_17776)"><path d="M11.6747 13.8907C11.8298 13.9361 11.8298 14.1557 11.6747 14.201L10.4245 14.5667C10.3716 14.5822 10.3302 14.6235 10.3147 14.6765L9.94909 15.9267C9.90375 16.0817 9.68413 16.0817 9.63879 15.9267L9.27317 14.6765C9.25769 14.6235 9.21631 14.5822 9.16339 14.5667L7.91315 14.201C7.75811 14.1557 7.75811 13.9361 7.91315 13.8907L9.16339 13.5251C9.21631 13.5096 9.25769 13.4683 9.27317 13.4153L9.63879 12.1651C9.68413 12.0101 9.90375 12.0101 9.94909 12.1651L10.3147 13.4153C10.3302 13.4683 10.3716 13.5096 10.4245 13.5251L11.6747 13.8907Z" fill="url(#paint5_linear_1426_17776)"></path></g></g><rect x="0.353516" y="0.353516" width="28" height="28" rx="7.76216" fill="none" stroke="#B6CBFF" stroke-width="0.707321"></rect></g><defs><filter id="filter0_ii_1426_17776" x="0" y="0" width="29.3727" height="29.3727" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dx="0.665934"></feOffset><feGaussianBlur stdDeviation="0.332839"></feGaussianBlur><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.4 0"></feColorMatrix><feBlend mode="normal" in2="shape" result="effect1_innerShadow_1426_17776"></feBlend><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="0.666153"></feOffset><feGaussianBlur stdDeviation="0.332839"></feGaussianBlur><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.4 0"></feColorMatrix><feBlend mode="normal" in2="effect1_innerShadow_1426_17776" result="effect2_innerShadow_1426_17776"></feBlend></filter><filter id="filter1_i_1426_17776" x="0.436523" y="0.353516" width="28" height="28.6657" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="0.666153"></feOffset><feGaussianBlur stdDeviation="0.332839"></feGaussianBlur><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.4 0"></feColorMatrix><feBlend mode="normal" in2="shape" result="effect1_innerShadow_1426_17776"></feBlend></filter><filter id="filter2_f_1426_17776" x="-0.810117" y="7.62055" width="31.1241" height="23.4835" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur stdDeviation="0.37625" result="effect1_foregroundBlur_1426_17776"></feGaussianBlur></filter><filter id="filter3_dii_1426_17776" x="-3.13822" y="6.23789" width="35.2657" height="20.4698" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="0.627083"></feOffset><feGaussianBlur stdDeviation="1.25417"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0.315797 0 0 0 0 0 0 0 0 0 0.371526 0 0 0 0.25 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1426_17776"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1426_17776" result="shape"></feBlend><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="0.125417"></feOffset><feGaussianBlur stdDeviation="0.0627083"></feGaussianBlur><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0"></feColorMatrix><feBlend mode="normal" in2="shape" result="effect2_innerShadow_1426_17776"></feBlend><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="-0.125417"></feOffset><feGaussianBlur stdDeviation="0.37625"></feGaussianBlur><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0"></feColorMatrix><feBlend mode="normal" in2="effect2_innerShadow_1426_17776" result="effect3_innerShadow_1426_17776"></feBlend></filter><filter id="filter4_dii_1426_17776" x="13.9265" y="8.93202" width="13.101" height="13.1001" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="1.984"></feOffset><feGaussianBlur stdDeviation="1.984"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0.0528337 0 0 0 0 0.619328 0 0 0 0.3 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1426_17776"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1426_17776" result="shape"></feBlend><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="0.238518"></feOffset><feGaussianBlur stdDeviation="0.238518"></feGaussianBlur><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.4 0"></feColorMatrix><feBlend mode="normal" in2="shape" result="effect2_innerShadow_1426_17776"></feBlend><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="0.238518"></feOffset><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0"></feColorMatrix><feBlend mode="normal" in2="effect2_innerShadow_1426_17776" result="effect3_innerShadow_1426_17776"></feBlend></filter><filter id="filter5_d_1426_17776" x="6.94974" y="2.65211" width="10.996" height="10.997" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="1.0432"></feOffset><feGaussianBlur stdDeviation="1.0432"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1426_17776"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1426_17776" result="shape"></feBlend></filter><filter id="filter6_d_1426_17776" x="5.71048" y="11.0056" width="8.16694" height="8.16694" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="1.0432"></feOffset><feGaussianBlur stdDeviation="1.0432"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1426_17776"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1426_17776" result="shape"></feBlend></filter><linearGradient id="paint0_linear_1426_17776" x1="14.4365" y1="0.353516" x2="14.4365" y2="28.3535" gradientUnits="userSpaceOnUse"><stop stop-color="#5A57FF"></stop><stop offset="1" stop-color="#5B98FF"></stop></linearGradient><linearGradient id="paint1_linear_1426_17776" x1="18.3943" y1="15.3016" x2="18.3943" y2="40.2595" gradientUnits="userSpaceOnUse"><stop offset="0.0831429" stop-color="#4B73FF"></stop><stop offset="0.359704" stop-color="#4B73FF" stop-opacity="0"></stop><stop offset="0.7" stop-color="#4B73FF" stop-opacity="0"></stop></linearGradient><linearGradient id="paint2_linear_1426_17776" x1="29.2845" y1="8.77232" x2="0.650625" y2="22.9504" gradientUnits="userSpaceOnUse"><stop stop-color="#BDC1FF"></stop><stop offset="0.420828" stop-color="#D6E8FF"></stop><stop offset="1" stop-color="#7391FE"></stop></linearGradient><radialGradient id="paint3_radial_1426_17776" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(22.1572 11.6007) rotate(134.421) scale(4.39003)"><stop offset="0.321315" stop-color="#BAFEFF"></stop><stop offset="1" stop-color="#011FFF"></stop></radialGradient><linearGradient id="paint4_linear_1426_17776" x1="9.87102" y1="1.28287" x2="14.9766" y2="13.0695" gradientUnits="userSpaceOnUse"><stop stop-color="#FFE6FC"></stop><stop offset="0.350962" stop-color="#FFE6FC"></stop><stop offset="1" stop-color="#AA00F2"></stop></linearGradient><linearGradient id="paint5_linear_1426_17776" x1="8.28563" y1="10.6367" x2="11.2743" y2="17.5362" gradientUnits="userSpaceOnUse"><stop stop-color="#FFE6FC"></stop><stop offset="0.350962" stop-color="#FFE6FC"></stop><stop offset="1" stop-color="#AA00F2"></stop></linearGradient><clipPath id="clip0_1426_17776"><rect x="0.353516" y="0.353516" width="28" height="28" rx="7.76216" fill="white"></rect></clipPath></defs></svg>'.replace(/__SIZE__/g,String(t)).replace(/_1426_17776/g,`_${i}`);return(0,s.createElement)("span",{className:e,style:{display:"inline-flex",lineHeight:0},dangerouslySetInnerHTML:{__html:a}})}},79347:()=>{},81921:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(51609);function n(){return(0,s.createElement)("svg",{className:"thinkrank-dashboard-widget__illustration-svg",viewBox:"0 0 320 180",role:"img","aria-hidden":"true",focusable:"false",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)("rect",{x:"86",y:"34",width:"148",height:"104",rx:"8",fill:"#ffffff",stroke:"#C7CBE6",strokeWidth:"2"}),(0,s.createElement)("rect",{x:"104",y:"96",width:"12",height:"26",rx:"2",fill:"#D5D9F5"}),(0,s.createElement)("rect",{x:"122",y:"82",width:"12",height:"40",rx:"2",fill:"#B9BFF0"}),(0,s.createElement)("rect",{x:"140",y:"70",width:"12",height:"52",rx:"2",fill:"#4451FF"}),(0,s.createElement)("rect",{x:"104",y:"50",width:"52",height:"6",rx:"3",fill:"#E3E6F7"}),(0,s.createElement)("rect",{x:"104",y:"62",width:"34",height:"6",rx:"3",fill:"#EDEFFb"}),(0,s.createElement)("circle",{cx:"196",cy:"74",r:"20",fill:"none",stroke:"#E3E6F7",strokeWidth:"8"}),(0,s.createElement)("path",{d:"M196 54 a20 20 0 0 1 17.3 30",fill:"none",stroke:"#4451FF",strokeWidth:"8",strokeLinecap:"round"}),(0,s.createElement)("rect",{x:"176",y:"104",width:"40",height:"6",rx:"3",fill:"#E3E6F7"}),(0,s.createElement)("rect",{x:"176",y:"116",width:"28",height:"6",rx:"3",fill:"#EDEFFb"}),(0,s.createElement)("circle",{cx:"150",cy:"78",r:"30",fill:"#4451FF",fillOpacity:"0.08",stroke:"#4451FF",strokeWidth:"4"}),(0,s.createElement)("line",{x1:"171",y1:"99",x2:"188",y2:"116",stroke:"#4451FF",strokeWidth:"6",strokeLinecap:"round"}),(0,s.createElement)("rect",{x:"46",y:"52",width:"34",height:"24",rx:"4",fill:"#ffffff",stroke:"#C7CBE6",strokeWidth:"2"}),(0,s.createElement)("rect",{x:"52",y:"59",width:"22",height:"4",rx:"2",fill:"#E3E6F7"}),(0,s.createElement)("rect",{x:"52",y:"66",width:"14",height:"4",rx:"2",fill:"#EDEFFb"}),(0,s.createElement)("rect",{x:"240",y:"60",width:"34",height:"24",rx:"4",fill:"#ffffff",stroke:"#C7CBE6",strokeWidth:"2"}),(0,s.createElement)("rect",{x:"246",y:"67",width:"22",height:"4",rx:"2",fill:"#E3E6F7"}),(0,s.createElement)("rect",{x:"246",y:"74",width:"14",height:"4",rx:"2",fill:"#EDEFFb"}))}},85499:(t,e,i)=>{i.d(e,{A:()=>u});var s=i(51609),n=i(86087),o=i(1455),a=i.n(o),r=i(27723),l=i(11344),h=i(56859),c=i(62538),d=i(60775);function u({config:t}){const[e]=(0,n.useState)(Boolean(t.connected)),[i,o]=(0,n.useState)(null),[u,f]=(0,n.useState)(Boolean(t.connected)),[p,g]=(0,n.useState)(null),m=(0,n.useCallback)(()=>{f(!0),g(null),a()({path:`/thinkrank/v1/seo-analytics/search-daily?date_range=${c.R}`}).then(t=>{if(!1===t?.success)return g({reason:t?.data?.reason||"",message:t.message||(0,r.__)("Unable to load Search Console data.","thinkrank"),details:t?.data?.details||""}),void o(null);o(t?.data||{})}).catch(t=>{d.A.error("ThinkRank: dashboard widget fetch failed",t),g({reason:t?.data?.reason||"",message:t?.message||(0,r.__)("Unable to load Search Console data.","thinkrank"),details:t?.data?.details||""}),o(null)}).finally(()=>f(!1))},[]);return(0,n.useEffect)(()=>{e&&m()},[e,m]),e?(0,s.createElement)(h.A,{config:t,data:i,loading:u,error:p,onRetry:m}):(0,s.createElement)(l.A,{config:t})}},86087:t=>{t.exports=window.wp.element},87941:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(51609),n=i(27723);function o(){return(0,s.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 24 24","aria-hidden":"true"},(0,s.createElement)("path",{d:"M4 7h10M18 7h2M4 17h2M10 17h10M16 4v6M8 14v6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}))}function a(){return(0,s.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 24 24","aria-hidden":"true"},(0,s.createElement)("path",{d:"M12 4.5 21 20H3L12 4.5Z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),(0,s.createElement)("path",{d:"M12 10v4.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,s.createElement)("circle",{cx:"12",cy:"17.5",r:"1.1",fill:"currentColor"}))}function r({error:t,config:e,onRetry:i}){const{title:r,tone:l,action:h}=function(t,e){switch(t){case"not_connected":return{title:(0,n.__)("Google account not connected","thinkrank"),tone:"setup",action:{label:(0,n.__)("Connect Google Search Console","thinkrank"),url:e.connectUrl||e.settingsUrl}};case"no_property":return{title:(0,n.__)("No Search Console property selected","thinkrank"),tone:"setup",action:{label:(0,n.__)("Select your property","thinkrank"),url:e.propertyUrl||e.settingsUrl}};case"reconnect":return{title:(0,n.__)("Google connection expired","thinkrank"),tone:"setup",action:{label:(0,n.__)("Reconnect Google","thinkrank"),url:e.connectUrl||e.settingsUrl}};case"permission":return{title:(0,n.__)("No access to this property","thinkrank"),tone:"setup",action:{label:(0,n.__)("Choose another property","thinkrank"),url:e.propertyUrl||e.settingsUrl}};case"quota":return{title:(0,n.__)("Google rate limit reached","thinkrank"),tone:"warning",action:null};case"google_down":return{title:(0,n.__)("Search Console is unavailable","thinkrank"),tone:"warning",action:null};default:return{title:(0,n.__)("Search data could not be loaded","thinkrank"),tone:"warning",action:null}}}(t?.reason,e),c=t?.message||(0,n.__)("Search data could not be loaded right now.","thinkrank");return(0,s.createElement)("div",{className:`thinkrank-dashboard-widget__error thinkrank-dashboard-widget__error--${l}`,role:"alert"},(0,s.createElement)("span",{className:"thinkrank-dashboard-widget__error-icon"},"setup"===l?(0,s.createElement)(o,null):(0,s.createElement)(a,null)),(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__error-body"},(0,s.createElement)("p",{className:"thinkrank-dashboard-widget__error-title"},r),(0,s.createElement)("p",{className:"thinkrank-dashboard-widget__error-message"},c),(0,s.createElement)("div",{className:"thinkrank-dashboard-widget__error-actions"},h?.url?(0,s.createElement)("a",{className:"thinkrank-dashboard-widget__error-cta",href:h.url},h.label):(0,s.createElement)("button",{type:"button",className:"thinkrank-dashboard-widget__error-cta",onClick:i},(0,n.__)("Try again","thinkrank"))),t?.details&&(0,s.createElement)("details",{className:"thinkrank-dashboard-widget__error-details"},(0,s.createElement)("summary",null,(0,n.__)("Technical details","thinkrank")),(0,s.createElement)("code",null,t.details))))}},99284:(t,e,i)=>{i.d(e,{$:()=>Gt,A:()=>ot,B:()=>nt,C:()=>$t,D:()=>Q,E:()=>ae,F:()=>g,G:()=>Ne,H:()=>L,I:()=>Te,J:()=>je,K:()=>Ve,L:()=>ut,M:()=>Pe,N:()=>V,O:()=>c,P:()=>D,Q:()=>p,R:()=>he,S:()=>tt,T:()=>P,U:()=>Y,V:()=>zt,W:()=>et,X:()=>Nt,Y:()=>Ut,Z:()=>qt,_:()=>ct,a:()=>le,a0:()=>re,a1:()=>pt,a2:()=>gt,a3:()=>Tt,a4:()=>y,a5:()=>C,a6:()=>Ft,a7:()=>E,a8:()=>ue,a9:()=>de,aA:()=>Qe,aB:()=>Ze,aC:()=>mt,aD:()=>qe,aE:()=>jt,aF:()=>Z,aG:()=>n,aH:()=>U,aI:()=>W,aJ:()=>$,aK:()=>N,aL:()=>X,aM:()=>Pt,aN:()=>z,aO:()=>Ht,aP:()=>at,aQ:()=>st,aa:()=>fe,ab:()=>v,ac:()=>o,ad:()=>ft,ae:()=>We,af:()=>Wt,ag:()=>A,ah:()=>ri,ai:()=>m,aj:()=>O,ak:()=>it,al:()=>K,am:()=>se,an:()=>De,ao:()=>ii,ap:()=>ei,aq:()=>Ue,ar:()=>Ge,as:()=>$e,at:()=>Yt,au:()=>Xt,av:()=>Vt,aw:()=>Kt,ax:()=>ne,ay:()=>oe,az:()=>ti,b:()=>r,c:()=>Mt,d:()=>Rt,e:()=>kt,f:()=>M,g:()=>h,h:()=>S,i:()=>l,j:()=>ce,k:()=>a,l:()=>lt,m:()=>u,n:()=>f,o:()=>Ot,p:()=>J,q:()=>xt,r:()=>dt,s:()=>H,t:()=>G,u:()=>ht,v:()=>d,w:()=>bt,x:()=>j,y:()=>Me,z:()=>ze});var s=i(44594);function n(){}const o=(()=>{let t=0;return()=>t++})();function a(t){return null==t}function r(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function l(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function h(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function c(t,e){return h(t)?t:e}function d(t,e){return void 0===t?e:t}const u=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:+t/e,f=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function p(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function g(t,e,i,s){let n,o,a;if(r(t))if(o=t.length,s)for(n=o-1;n>=0;n--)e.call(i,t[n],n);else for(n=0;n<o;n++)e.call(i,t[n],n);else if(l(t))for(a=Object.keys(t),o=a.length,n=0;n<o;n++)e.call(i,t[a[n]],a[n])}function m(t,e){let i,s,n,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,s=t.length;i<s;++i)if(n=t[i],o=e[i],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function x(t){if(r(t))return t.map(x);if(l(t)){const e=Object.create(null),i=Object.keys(t),s=i.length;let n=0;for(;n<s;++n)e[i[n]]=x(t[i[n]]);return e}return t}function b(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function _(t,e,i,s){if(!b(t))return;const n=e[t],o=i[t];l(n)&&l(o)?y(n,o,s):e[t]=x(o)}function y(t,e,i){const s=r(e)?e:[e],n=s.length;if(!l(t))return t;const o=(i=i||{}).merger||_;let a;for(let e=0;e<n;++e){if(a=s[e],!l(a))continue;const n=Object.keys(a);for(let e=0,s=n.length;e<s;++e)o(n[e],t,a,i)}return t}function v(t,e){return y(t,e,{merger:k})}function k(t,e,i){if(!b(t))return;const s=e[t],n=i[t];l(s)&&l(n)?v(s,n):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=x(n))}const w={"":t=>t,x:t=>t.x,y:t=>t.y};function M(t,e){const i=w[e]||(w[e]=function(t){const e=function(t){const e=t.split("."),i=[];let s="";for(const t of e)s+=t,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function C(t){return t.charAt(0).toUpperCase()+t.slice(1)}const S=t=>void 0!==t,E=t=>"function"==typeof t,A=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function O(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const D=Math.PI,P=2*D,T=P+D,F=Number.POSITIVE_INFINITY,I=D/180,L=D/2,B=D/4,R=2*D/3,z=Math.log10,H=Math.sign;function N(t,e,i){return Math.abs(t-e)<i}function W(t){const e=Math.round(t);t=N(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(z(t))),s=t/i;return(s<=1?1:s<=2?2:s<=5?5:10)*i}function V(t){const e=[],i=Math.sqrt(t);let s;for(s=1;s<i;s++)t%s===0&&(e.push(s),e.push(t/s));return i===(0|i)&&e.push(i),e.sort((t,e)=>t-e).pop(),e}function j(t){return!function(t){return"symbol"==typeof t||"object"==typeof t&&null!==t&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function $(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}function U(t,e,i){let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function G(t){return t*(D/180)}function Y(t){return t*(180/D)}function X(t){if(!h(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function Q(t,e){const i=e.x-t.x,s=e.y-t.y,n=Math.sqrt(i*i+s*s);let o=Math.atan2(s,i);return o<-.5*D&&(o+=P),{angle:o,distance:n}}function Z(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function q(t,e){return(t-e+T)%P-D}function K(t){return(t%P+P)%P}function J(t,e,i,s){const n=K(t),o=K(e),a=K(i),r=K(o-n),l=K(a-n),h=K(n-o),c=K(n-a);return n===o||n===a||s&&o===a||r>l&&h<c}function tt(t,e,i){return Math.max(e,Math.min(i,t))}function et(t){return tt(t,-32768,32767)}function it(t,e,i,s=1e-6){return t>=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function st(t,e,i){i=i||(i=>t[i]<e);let s,n=t.length-1,o=0;for(;n-o>1;)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const nt=(t,e,i,s)=>st(t,i,s?s=>{const n=t[s][e];return n<i||n===i&&t[s+1][e]===i}:s=>t[s][e]<i),ot=(t,e,i)=>st(t,i,s=>t[s][e]>=i);function at(t,e,i){let s=0,n=t.length;for(;s<n&&t[s]<e;)s++;for(;n>s&&t[n-1]>i;)n--;return s>0||n<t.length?t.slice(s,n):t}const rt=["push","pop","shift","splice","unshift"];function lt(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),rt.forEach(e=>{const i="_onData"+C(e),s=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const n=s.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"==typeof t[i]&&t[i](...e)}),n}})}))}function ht(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(rt.forEach(e=>{delete t[e]}),delete t._chartjs)}function ct(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const dt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function ut(t,e){let i=[],s=!1;return function(...n){i=n,s||(s=!0,dt.call(window,()=>{s=!1,t.apply(e,i)}))}}function ft(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}const pt=t=>"start"===t?"left":"end"===t?"right":"center",gt=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,mt=(t,e,i,s)=>t===(s?"left":"right")?i:"center"===t?(e+i)/2:e;function xt(t,e,i){const s=e.length;let n=0,o=s;if(t._sorted){const{iScale:r,vScale:l,_parsed:h}=t,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,d=r.axis,{min:u,max:f,minDefined:p,maxDefined:g}=r.getUserBounds();if(p){if(n=Math.min(nt(h,d,u).lo,i?s:nt(e,d,r.getPixelForValue(u)).lo),c){const t=h.slice(0,n+1).reverse().findIndex(t=>!a(t[l.axis]));n-=Math.max(0,t)}n=tt(n,0,s-1)}if(g){let t=Math.max(nt(h,r.axis,f,!0).hi+1,i?0:nt(e,d,r.getPixelForValue(f),!0).hi+1);if(c){const e=h.slice(t-1).findIndex(t=>!a(t[l.axis]));t+=Math.max(0,e)}o=tt(t,n,s)-n}else o=s-n}return{start:n,count:o}}function bt(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const o=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),o}const _t=t=>0===t||1===t,yt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*P/i),vt=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*P/i)+1,kt={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*L),easeOutSine:t=>Math.sin(t*L),easeInOutSine:t=>-.5*(Math.cos(D*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>_t(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>_t(t)?t:yt(t,.075,.3),easeOutElastic:t=>_t(t)?t:vt(t,.075,.3),easeInOutElastic(t){const e=.1125;return _t(t)?t:t<.5?.5*yt(2*t,e,.45):.5+.5*vt(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let 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:t=>1-kt.easeOutBounce(1-t),easeOutBounce(t){const 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:t=>t<.5?.5*kt.easeInBounce(2*t):.5*kt.easeOutBounce(2*t-1)+.5};function wt(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Mt(t){return wt(t)?t:new s.Q1(t)}function Ct(t){return wt(t)?t:new s.Q1(t).saturate(.5).darken(.1).hexString()}const St=["x","y","borderWidth","radius","tension"],Et=["color","borderColor","backgroundColor"],At=new Map;function Ot(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let s=At.get(i);return s||(s=new Intl.NumberFormat(t,e),At.set(i,s)),s}(e,i).format(t)}const Dt={values:t=>r(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const a=z(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),Ot(t,s,l)},logarithmic(t,e,i){if(0===t)return"0";const s=i[e].significand||t/Math.pow(10,Math.floor(z(t)));return[1,2,3,5,10,15].includes(s)||e>.8*i.length?Dt.numeric.call(this,t,e,i):""}};var Pt={formatters:Dt};const Tt=Object.create(null),Ft=Object.create(null);function It(t,e){if(!e)return t;const i=e.split(".");for(let e=0,s=i.length;e<s;++e){const s=i[e];t=t[s]||(t[s]=Object.create(null))}return t}function Lt(t,e,i){return"string"==typeof e?y(It(t,e),i):y(It(t,""),e)}class Bt{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Ct(e.backgroundColor),this.hoverBorderColor=(t,e)=>Ct(e.borderColor),this.hoverColor=(t,e)=>Ct(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Lt(this,t,e)}get(t){return It(this,t)}describe(t,e){return Lt(Ft,t,e)}override(t,e){return Lt(Tt,t,e)}route(t,e,i,s){const n=It(this,t),o=It(this,i),a="_"+e;Object.defineProperties(n,{[a]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=o[s];return l(t)?Object.assign({},e,t):d(t,e)},set(t){this[a]=t}}})}apply(t){t.forEach(t=>t(this))}}var Rt=new Bt({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Et},numbers:{type:"number",properties:St}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Pt.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function zt(t,e,i,s,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>s&&(s=o),s}function Ht(t,e,i,s){let n=(s=s||{}).data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==e&&(n=s.data={},o=s.garbageCollect=[],s.font=e),t.save(),t.font=e;let a=0;const l=i.length;let h,c,d,u,f;for(h=0;h<l;h++)if(u=i[h],null==u||r(u)){if(r(u))for(c=0,d=u.length;c<d;c++)f=u[c],null==f||r(f)||(a=zt(t,n,o,a,f))}else a=zt(t,n,o,a,u);t.restore();const p=o.length/2;if(p>i.length){for(h=0;h<p;h++)delete n[o[h]];o.splice(0,p)}return a}function Nt(t,e,i){const s=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*s)/s+n}function Wt(t,e){(e||t)&&((e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function Vt(t,e,i,s){jt(t,e,i,s,null)}function jt(t,e,i,s,n){let o,a,r,l,h,c,d,u;const f=e.pointStyle,p=e.rotation,g=e.radius;let m=(p||0)*I;if(f&&"object"==typeof f&&(o=f.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,s),t.rotate(m),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(g)||g<=0)){switch(t.beginPath(),f){default:n?t.ellipse(i,s,n/2,g,0,0,P):t.arc(i,s,g,0,P),t.closePath();break;case"triangle":c=n?n/2:g,t.moveTo(i+Math.sin(m)*c,s-Math.cos(m)*g),m+=R,t.lineTo(i+Math.sin(m)*c,s-Math.cos(m)*g),m+=R,t.lineTo(i+Math.sin(m)*c,s-Math.cos(m)*g),t.closePath();break;case"rectRounded":h=.516*g,l=g-h,a=Math.cos(m+B)*l,d=Math.cos(m+B)*(n?n/2-h:l),r=Math.sin(m+B)*l,u=Math.sin(m+B)*(n?n/2-h:l),t.arc(i-d,s-r,h,m-D,m-L),t.arc(i+u,s-a,h,m-L,m),t.arc(i+d,s+r,h,m,m+L),t.arc(i-u,s+a,h,m+L,m+D),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,c=n?n/2:l,t.rect(i-c,s-l,2*c,2*l);break}m+=B;case"rectRot":d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-r),t.lineTo(i+u,s-a),t.lineTo(i+d,s+r),t.lineTo(i-u,s+a),t.closePath();break;case"crossRot":m+=B;case"cross":d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a);break;case"star":d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a),m+=B,d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a);break;case"line":a=n?n/2:Math.cos(m)*g,r=Math.sin(m)*g,t.moveTo(i-a,s-r),t.lineTo(i+a,s+r);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(m)*(n?n/2:g),s+Math.sin(m)*g);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function $t(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function Ut(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Gt(t){t.restore()}function Yt(t,e,i,s,n){if(!e)return t.lineTo(i.x,i.y);if("middle"===n){const s=(e.x+i.x)/2;t.lineTo(s,e.y),t.lineTo(s,i.y)}else"after"===n!=!!s?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Xt(t,e,i,s){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(s?e.cp1x:e.cp2x,s?e.cp1y:e.cp2y,s?i.cp2x:i.cp1x,s?i.cp2y:i.cp1y,i.x,i.y)}function Qt(t,e,i,s,n){if(n.strikethrough||n.underline){const o=t.measureText(s),a=e-o.actualBoundingBoxLeft,r=e+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,h=i+o.actualBoundingBoxDescent,c=n.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=n.decorationWidth||2,t.moveTo(a,c),t.lineTo(r,c),t.stroke()}}function Zt(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function qt(t,e,i,s,n,o={}){const l=r(e)?e:[e],h=o.strokeWidth>0&&""!==o.strokeColor;let c,d;for(t.save(),t.font=n.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),a(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,o),c=0;c<l.length;++c)d=l[c],o.backdrop&&Zt(t,o.backdrop),h&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),a(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(d,i,s,o.maxWidth)),t.fillText(d,i,s,o.maxWidth),Qt(t,i,s,d,o),s+=Number(n.lineHeight);t.restore()}function Kt(t,e){const{x:i,y:s,w:n,h:o,radius:a}=e;t.arc(i+a.topLeft,s+a.topLeft,a.topLeft,1.5*D,D,!0),t.lineTo(i,s+o-a.bottomLeft),t.arc(i+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,D,L,!0),t.lineTo(i+n-a.bottomRight,s+o),t.arc(i+n-a.bottomRight,s+o-a.bottomRight,a.bottomRight,L,0,!0),t.lineTo(i+n,s+a.topRight),t.arc(i+n-a.topRight,s+a.topRight,a.topRight,0,-L,!0),t.lineTo(i+a.topLeft,s)}const Jt=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,te=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ee(t,e){const i=(""+t).match(Jt);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}const ie=t=>+t||0;function se(t,e){const i={},s=l(e),n=s?Object.keys(e):e,o=l(t)?s?i=>d(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of n)i[t]=ie(o(t));return i}function ne(t){return se(t,{top:"y",right:"x",bottom:"y",left:"x"})}function oe(t){return se(t,["topLeft","topRight","bottomLeft","bottomRight"])}function ae(t){const e=ne(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function re(t,e){t=t||{},e=e||Rt.font;let i=d(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=d(t.style,e.style);s&&!(""+s).match(te)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:d(t.family,e.family),lineHeight:ee(d(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:d(t.weight,e.weight),string:""};return n.string=function(t){return!t||a(t.size)||a(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(n),n}function le(t,e,i,s){let n,o,a,l=!0;for(n=0,o=t.length;n<o;++n)if(a=t[n],void 0!==a&&(void 0!==e&&"function"==typeof a&&(a=a(e),l=!1),void 0!==i&&r(a)&&(a=a[i%a.length],l=!1),void 0!==a))return s&&!l&&(s.cacheable=!1),a}function he(t,e,i){const{min:s,max:n}=t,o=f(e,(n-s)/2),a=(t,e)=>i&&0===t?0:t+e;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function ce(t,e){return Object.assign(Object.create(t),e)}function de(t,e=[""],i,s,n=()=>t[0]){const o=i||t;void 0===s&&(s=ke("_fallback",t));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:s,_getTarget:n,override:i=>de([i,...t],e,o,s)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>me(i,s,()=>function(t,e,i,s){let n;for(const o of e)if(n=ke(pe(o,t),i),void 0!==n)return ge(t,n)?ye(i,s,t,n):n}(s,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>we(t).includes(e),ownKeys:t=>we(t),set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function ue(t,e,i,s){const n={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:fe(t,s),setContext:e=>ue(t,e,i,s),override:n=>ue(t.override(n),e,i,s)};return new Proxy(n,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>me(t,e,()=>function(t,e,i){const{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=t;let h=s[e];return E(h)&&a.isScriptable(e)&&(h=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t);let l=e(o,a||s);return r.delete(t),ge(t,l)&&(l=ye(n._scopes,n,t,l)),l}(e,h,t,i)),r(h)&&h.length&&(h=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=i;if(void 0!==o.index&&s(t))return e[o.index%e.length];if(l(e[0])){const i=e,s=n._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=ye(s,n,t,l);e.push(ue(i,o,a&&a[t],r))}}return e}(e,h,t,a.isIndexable)),ge(e,h)&&(h=ue(h,n,o&&o[e],a)),h}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function fe(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:E(i)?i:()=>i,isIndexable:E(s)?s:()=>s}}const pe=(t,e)=>t?t+C(e):e,ge=(t,e)=>l(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function me(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const s=i();return t[e]=s,s}function xe(t,e,i){return E(t)?t(e,i):t}const be=(t,e)=>!0===t?e:"string"==typeof t?M(e,t):void 0;function _e(t,e,i,s,n){for(const o of e){const e=be(i,o);if(e){t.add(e);const o=xe(e._fallback,i,n);if(void 0!==o&&o!==i&&o!==s)return o}else if(!1===e&&void 0!==s&&i!==s)return null}return!1}function ye(t,e,i,s){const n=e._rootScopes,o=xe(e._fallback,i,s),a=[...t,...n],h=new Set;h.add(s);let c=ve(h,a,i,o||i,s);return null!==c&&(void 0===o||o===i||(c=ve(h,a,o,c,s),null!==c))&&de(Array.from(h),[""],n,o,()=>function(t,e,i){const s=t._getTarget();e in s||(s[e]={});const n=s[e];return r(n)&&l(i)?i:n||{}}(e,i,s))}function ve(t,e,i,s,n){for(;i;)i=_e(t,e,i,s,n);return i}function ke(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function we(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function Me(t,e,i,s){const{iScale:n}=t,{key:o="r"}=this._parsing,a=new Array(s);let r,l,h,c;for(r=0,l=s;r<l;++r)h=r+i,c=e[h],a[r]={r:n.parse(M(c,o),h)};return a}const Ce=Number.EPSILON||1e-14,Se=(t,e)=>e<t.length&&!t[e].skip&&t[e],Ee=t=>"x"===t?"y":"x";function Ae(t,e,i,s){const n=t.skip?e:t,o=e,a=i.skip?e:i,r=Z(o,n),l=Z(a,o);let h=r/(r+l),c=l/(r+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const d=s*h,u=s*c;return{previous:{x:o.x-d*(a.x-n.x),y:o.y-d*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function Oe(t,e,i){return Math.max(Math.min(t,i),e)}function De(t,e,i,s,n){let o,a,r,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Ee(e),s=t.length,n=Array(s).fill(0),o=Array(s);let a,r,l,h=Se(t,0);for(a=0;a<s;++a)if(r=l,l=h,h=Se(t,a+1),l){if(h){const t=h[e]-l[e];n[a]=0!==t?(h[i]-l[i])/t:0}o[a]=r?h?H(n[a-1])!==H(n[a])?0:(n[a-1]+n[a])/2:n[a-1]:n[a]}!function(t,e,i){const s=t.length;let n,o,a,r,l,h=Se(t,0);for(let c=0;c<s-1;++c)l=h,h=Se(t,c+1),l&&h&&(N(e[c],0,Ce)?i[c]=i[c+1]=0:(n=i[c]/e[c],o=i[c+1]/e[c],r=Math.pow(n,2)+Math.pow(o,2),r<=9||(a=3/Math.sqrt(r),i[c]=n*a*e[c],i[c+1]=o*a*e[c])))}(t,n,o),function(t,e,i="x"){const s=Ee(i),n=t.length;let o,a,r,l=Se(t,0);for(let h=0;h<n;++h){if(a=r,r=l,l=Se(t,h+1),!r)continue;const n=r[i],c=r[s];a&&(o=(n-a[i])/3,r[`cp1${i}`]=n-o,r[`cp1${s}`]=c-o*e[h]),l&&(o=(l[i]-n)/3,r[`cp2${i}`]=n+o,r[`cp2${s}`]=c+o*e[h])}}(t,o,e)}(t,n);else{let i=s?t[t.length-1]:t[0];for(o=0,a=t.length;o<a;++o)r=t[o],l=Ae(i,r,t[Math.min(o+1,a-(s?0:1))%a],e.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,i=r}e.capBezierPoints&&function(t,e){let i,s,n,o,a,r=$t(t[0],e);for(i=0,s=t.length;i<s;++i)a=o,o=r,r=i<s-1&&$t(t[i+1],e),o&&(n=t[i],a&&(n.cp1x=Oe(n.cp1x,e.left,e.right),n.cp1y=Oe(n.cp1y,e.top,e.bottom)),r&&(n.cp2x=Oe(n.cp2x,e.left,e.right),n.cp2y=Oe(n.cp2y,e.top,e.bottom)))}(t,i)}function Pe(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Te(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function Fe(t,e,i){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}const Ie=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),Le=["top","right","bottom","left"];function Be(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=Le[n];s[o]=parseFloat(t[e+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const Re=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function ze(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,n=Ie(i),o="border-box"===n.boxSizing,a=Be(n,"padding"),r=Be(n,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:n,offsetY:o}=s;let a,r,l=!1;if(Re(n,o,t.target))a=n,r=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,r=s.clientY-t.top,l=!0}return{x:a,y:r,box:l}}(t,i),d=a.left+(c&&r.left),u=a.top+(c&&r.top);let{width:f,height:p}=e;return o&&(f-=a.width+r.width,p-=a.height+r.height),{x:Math.round((l-d)/f*i.width/s),y:Math.round((h-u)/p*i.height/s)}}const He=t=>Math.round(10*t)/10;function Ne(t,e,i,s){const n=Ie(t),o=Be(n,"margin"),a=Fe(n.maxWidth,t,"clientWidth")||F,r=Fe(n.maxHeight,t,"clientHeight")||F,l=function(t,e,i){let s,n;if(void 0===e||void 0===i){const o=t&&Te(t);if(o){const t=o.getBoundingClientRect(),a=Ie(o),r=Be(a,"border","width"),l=Be(a,"padding");e=t.width-l.width-r.width,i=t.height-l.height-r.height,s=Fe(a.maxWidth,o,"clientWidth"),n=Fe(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||F,maxHeight:n||F}}(t,e,i);let{width:h,height:c}=l;if("content-box"===n.boxSizing){const t=Be(n,"border","width"),e=Be(n,"padding");h-=e.width+t.width,c-=e.height+t.height}return h=Math.max(0,h-o.width),c=Math.max(0,s?h/s:c-o.height),h=He(Math.min(h,a,l.maxWidth)),c=He(Math.min(c,r,l.maxHeight)),h&&!c&&(c=He(h/2)),(void 0!==e||void 0!==i)&&s&&l.height&&c>l.height&&(c=l.height,h=He(Math.floor(c*s))),{width:h,height:c}}function We(t,e,i){const s=e||1,n=Math.floor(t.height*s),o=Math.floor(t.width*s);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||a.height!==n||a.width!==o)&&(t.currentDevicePixelRatio=s,a.height=n,a.width=o,t.ctx.setTransform(s,0,0,s,0,0),!0)}const Ve=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Pe()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function je(t,e){const i=function(t,e){return Ie(t).getPropertyValue(e)}(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function $e(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Ue(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function Ge(t,e,i,s){const n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=$e(t,n,i),r=$e(n,o,i),l=$e(o,e,i),h=$e(a,r,i),c=$e(r,l,i);return $e(h,c,i)}const Ye=function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}},Xe=function(){return{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}};function Qe(t,e,i){return t?Ye(e,i):Xe()}function Ze(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function qe(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ke(t){return"angle"===t?{between:J,compare:q,normalize:K}:{between:it,compare:(t,e)=>t-e,normalize:t=>t}}function Je({start:t,end:e,count:i,loop:s,style:n}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:n}}function ti(t,e,i){if(!i)return[t];const{property:s,start:n,end:o}=i,a=e.length,{compare:r,between:l,normalize:h}=Ke(s),{start:c,end:d,loop:u,style:f}=function(t,e,i){const{property:s,start:n,end:o}=i,{between:a,normalize:r}=Ke(s),l=e.length;let h,c,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,h=0,c=l;h<c&&a(r(e[d%l][s]),n,o);++h)d--,u--;d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:f,style:t.style}}(t,e,i),p=[];let g,m,x,b=!1,_=null;const y=()=>b||l(n,x,g)&&0!==r(n,x),v=()=>!b||0===r(o,g)||l(o,x,g);for(let t=c,i=c;t<=d;++t)m=e[t%a],m.skip||(g=h(m[s]),g!==x&&(b=l(g,n,o),null===_&&y()&&(_=0===r(g,n)?t:i),null!==_&&v()&&(p.push(Je({start:_,end:t,loop:u,count:a,style:f})),_=null),i=t,x=g));return null!==_&&p.push(Je({start:_,end:d,loop:u,count:a,style:f})),p}function ei(t,e){const i=[],s=t.segments;for(let n=0;n<s.length;n++){const o=ti(s[n],t.points,e);o.length&&i.push(...o)}return i}function ii(t,e){const i=t.points,s=t.options.spanGaps,n=i.length;if(!n)return[];const o=!!t._loop,{start:a,end:r}=function(t,e,i,s){let n=0,o=e-1;if(i&&!s)for(;n<e&&!t[n].skip;)n++;for(;n<e&&t[n].skip;)n++;for(n%=e,i&&(o+=n);o>n&&t[o%e].skip;)o--;return o%=e,{start:n,end:o}}(i,n,o,s);return si(t,!0===s?[{start:a,end:r,loop:o}]:function(t,e,i,s){const n=t.length,o=[];let a,r=e,l=t[e];for(a=e+1;a<=i;++a){const i=t[a%n];i.skip||i.stop?l.skip||(s=!1,o.push({start:e%n,end:(a-1)%n,loop:s}),e=r=i.stop?a:null):(r=a,l.skip&&(e=a)),l=i}return null!==r&&o.push({start:e%n,end:r%n,loop:s}),o}(i,a,r<a?r+n:r,!!t._fullLoop&&0===a&&r===n-1),i,e)}function si(t,e,i,s){return s&&s.setContext&&i?function(t,e,i,s){const n=t._chart.getContext(),o=ni(t.options),{_datasetIndex:a,options:{spanGaps:r}}=t,l=i.length,h=[];let c=o,d=e[0].start,u=d;function f(t,e,s,n){const o=r?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=o;for(;i[e%l].skip;)e+=o;t%l!==e%l&&(h.push({start:t%l,end:e%l,loop:s,style:n}),c=n,d=e%l)}}for(const t of e){d=r?d:t.start;let e,o=i[d%l];for(u=d+1;u<=t.end;u++){const r=i[u%l];e=ni(s.setContext(ce(n,{type:"segment",p0:o,p1:r,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),oi(e,c)&&f(d,u-1,t.loop,c),o=r,c=e}d<u-1&&f(d,u-1,t.loop,c)}return h}(t,e,i,s):e}function ni(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function oi(t,e){if(!e)return!1;const i=[],s=function(t,e){return wt(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,s)!==JSON.stringify(e,s)}function ai(t,e,i){return t.options.clip?t[i]:e[i]}function ri(t,e){const i=e._clip;if(i.disabled)return!1;const s=function(t,e){const{xScale:i,yScale:s}=t;return i&&s?{left:ai(i,e,"left"),right:ai(i,e,"right"),top:ai(s,e,"top"),bottom:ai(s,e,"bottom")}:e}(e,t.chartArea);return{left:!1===i.left?0:s.left-(!0===i.left?0:i.left),right:!1===i.right?t.width:s.right+(!0===i.right?0:i.right),top:!1===i.top?0:s.top-(!0===i.top?0:i.top),bottom:!1===i.bottom?t.height:s.bottom+(!0===i.bottom?0:i.bottom)}}}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var o=e[s]={exports:{}};return t[s](o,o.exports,i),o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var s=i(51609),n=i(1455),o=i.n(n),a=i(86087),r=i(85499),l=(i(79347),i(60775));const h=window.thinkrankDashboardWidget||{};h.restNonce&&o().use(o().createNonceMiddleware(h.restNonce));const c=()=>{const t=document.getElementById("thinkrank-dashboard-widget");if(t)try{t.innerHTML="",(0,a.createRoot)(t).render((0,s.createElement)(r.A,{config:h}))}catch(t){l.A.error("ThinkRank: Failed to mount Dashboard Widget",t)}};"loading"!==document.readyState?c():document.addEventListener("DOMContentLoaded",c)})(); |