/*! For license information please see main.a804595cd65cbc4683f9.bundle.js.LICENSE.txt */ (self.webpackChunkwebpack_boilerplate=self.webpackChunkwebpack_boilerplate||[]).push([[179],{355:t=>{var e;window,e=function(){return function(t){var e={};function i(s){if(e[s])return e[s].exports;var r=e[s]={i:s,l:!1,exports:{}};return t[s].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(s,r,function(e){return t[e]}.bind(null,r));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=2)}([function(t,e){t.exports=function t(e,i){return null==e||null==i||Object.keys(i).forEach((function(s){"[object Object]"==Object.prototype.toString.call(i[s])?"[object Object]"!=Object.prototype.toString.call(e[s])?e[s]=i[s]:e[s]=t(e[s],i[s]):e[s]=i[s]})),e}},function(t,e){Array.prototype.each=function(t){for(var e=this.length,i=0;ie.w-s.x&&(n=!1),t.top-r.y<-(t.height-s.y)&&(n=!1),t.top+r.y>e.h-s.y&&(n=!1),n}},{key:"_toggleClass",value:function(){var t=this;if(this.visible)return Array.isArray(this.toggle.class.in)?this.toggle.class.in.each((function(e){t.element.classList.add(e)})):this.element.classList.add(this.toggle.class.in),void(Array.isArray(this.toggle.class.out)?this.toggle.class.out.each((function(e){t.element.classList.remove(e)})):this.element.classList.remove(this.toggle.class.out));Array.isArray(this.toggle.class.in)?this.toggle.class.in.each((function(e){t.element.classList.remove(e)})):this.element.classList.remove(this.toggle.class.in),Array.isArray(this.toggle.class.out)?this.toggle.class.out.each((function(e){t.element.classList.add(e)})):this.element.classList.add(this.toggle.class.out)}},{key:"_toggleCallback",value:function(){if(this.visible){if("function"==typeof this.toggle.callback.in)return this.toggle.callback.in.call(this.element,this)}else if("function"==typeof this.toggle.callback.out)return this.toggle.callback.out.call(this.element,this)}}])&&a(e.prototype,i),t}();function c(t,e){for(var i=0;i-1}))}},{key:"search",value:function(t){var e=this.triggers.filter((function(e){if(t instanceof NodeList||Array.isArray(t)){var i=!1;return t.each((function(t){e.element==t&&(i=!0)})),i}return e.element==t}));return 0==e.length?null:e.length>1?e:e[0]}},{key:"call",value:function(t){this.triggers.each(t)}}])&&c(e.prototype,i),t}();function d(t,e){for(var i=0;ithis.position.x?"right":"left":t.y!==this.position.y?t.y>this.position.y?"bottom":"top":"none")!==this.direction&&(this.direction=e,"function"==typeof this.directionChange&&this.directionChange(this.direction)),this.position=t,this.lastAction=this._getTimestamp()}else this.direction="none";this.running||this._startRun()}},{key:"_startRun",value:function(){this.running=!0,"function"==typeof this.startCallback&&this.startCallback(),this._loop()}},{key:"_stopRun",value:function(){this.running=!1,"function"==typeof this.stopCallback&&this.stopCallback()}},{key:"getPosition",value:function(){return{x:this.element.pageXOffset||this.element.scrollLeft||document.documentElement.scrollLeft||0,y:this.element.pageYOffset||this.element.scrollTop||document.documentElement.scrollTop||0}}},{key:"_getTimestamp",value:function(){return Number(Date.now())}},{key:"_tick",value:function(){this.callback(this.position,this.direction),this._getTimestamp()-this.lastAction>this.sustain&&this._stopRun(),this.running&&this._loop()}},{key:"_loop",value:function(){(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(t){setTimeout(t,1e3/60)})(this._tick.bind(this))}},{key:"kill",value:function(){this.running=!1,this.element.removeEventListener("scroll",this._boundListener)}}])&&d(e.prototype,i),t}();function u(t,e){for(var i=0;i0&&(e=this.createTriggers(t)),this.collection=new g(e)}},{key:"_initLoop",value:function(){var t=this;this.loop=new y({sustain:this.scrollOptions.sustain,element:this.scrollOptions.element,callback:function(e,i){t._scrollCallback(e,i)},start:function(){t._scrollStart()},stop:function(){t._scrollStop()},directionChange:function(e){t._scrollDirectionChange(e)}})}},{key:"_scrollCallback",value:function(t,e){var i=this;this.collection.call((function(t){t.checkVisibility(i.scrollOptions.element,e)})),this.scrollOptions.callback(t,e)}},{key:"_scrollStart",value:function(){this.scrollOptions.start()}},{key:"_scrollStop",value:function(){this.scrollOptions.stop()}},{key:"_scrollDirectionChange",value:function(t){this.scrollOptions.directionChange(t)}},{key:"createTrigger",value:function(t,e){return new m(t,n()(this.defaultTrigger,e))}},{key:"createTriggers",value:function(t,e){var i=this,s=[];return t.each((function(t){s.push(i.createTrigger(t,e))})),s}},{key:"add",value:function(t,e){return t instanceof HTMLElement?(this.collection.add(this.createTrigger(t,e)),this):t instanceof m?(this.collection.add(t),this):t instanceof NodeList?(this.collection.add(this.createTriggers(t,e)),this):Array.isArray(t)&&t.length&&t[0]instanceof m?(this.collection.add(t),this):Array.isArray(t)&&t.length&&t[0]instanceof HTMLElement?(this.collection.add(this.createTriggers(t,e)),this):(this.collection.add(this.createTriggers(document.querySelectorAll(t),e)),this)}},{key:"remove",value:function(t){return t instanceof m||Array.isArray(t)&&t.length&&t[0]instanceof m?(this.collection.remove(t),this):t instanceof HTMLElement||Array.isArray(t)&&t.length&&t[0]instanceof HTMLElement||t instanceof NodeList?(this.collection.remove(this.search(t)),this):Array.isArray(t)&&t.length&&t[0]instanceof m?(this.collection.remove(t),this):(this.collection.remove(this.query(t.toString())),this)}},{key:"query",value:function(t){return this.collection.query(t)}},{key:"search",value:function(t){return this.collection.search(t)}},{key:"listen",value:function(){this.loop||this._initLoop()}},{key:"kill",value:function(){this.loop.kill(),this.loop=null}}])&&u(e.prototype,i),t}()}])},t.exports=e()},421:(module,exports,__webpack_require__)=>{var __WEBPACK_AMD_DEFINE_RESULT__,root,factory;"undefined"!=typeof navigator&&(root=window||{},factory=function(window){"use strict";var svgNS="http://www.w3.org/2000/svg",locationHref="",initialDefaultFrame=-999999,subframeEnabled=!0,idPrefix="",expressionsPlugin,isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),cachedColors={},bmRnd,bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};function ProjectInterface(){return{}}!function(){var t,e=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],i=e.length;for(t=0;t1?i[1]=1:i[1]<=0&&(i[1]=0),HSVtoRGB(i[0],i[1],i[2])}function addBrightnessToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[2]+=e,i[2]>1?i[2]=1:i[2]<0&&(i[2]=0),HSVtoRGB(i[0],i[1],i[2])}function addHueToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[0]+=e/360,i[0]>1?i[0]-=1:i[0]<0&&(i[0]+=1),HSVtoRGB(i[0],i[1],i[2])}var rgbToHex=function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1===e.length?"0"+e:e;return function(t,e,s){return t<0&&(t=0),e<0&&(e=0),s<0&&(s=0),"#"+i[t]+i[e]+i[s]}}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var i=this._cbs[t],s=0;s0||t>-1e-6&&t<0?s(1e4*t)/1e4:t}function I(){var t=this.props;return"matrix("+D(t[0])+","+D(t[1])+","+D(t[4])+","+D(t[5])+","+D(t[12])+","+D(t[13])+")"}return function(){this.reset=r,this.rotate=n,this.rotateX=a,this.rotateY=o,this.rotateZ=h,this.skew=c,this.skewFromAxis=p,this.shear=l,this.scale=d,this.setTransform=f,this.translate=u,this.transform=m,this.applyToPoint=x,this.applyToX=_,this.applyToY=E,this.applyToZ=S,this.applyToPointArray=M,this.applyToTriplePoints=C,this.applyToPointStringified=A,this.toCSS=T,this.to2dCSS=I,this.clone=v,this.cloneFromProps=b,this.equals=y,this.inversePoints=w,this.inversePoint=k,this.getInverseMatrix=P,this._t=this.transform,this.isIdentity=g,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();!function(t,e){var i=this,s=256,r=e.pow(s,6),n=e.pow(2,52),a=2*n,o=255;function h(t){var e,i=t.length,r=this,n=0,a=r.i=r.j=0,h=r.S=[];for(i||(t=[i++]);n=a;)t/=2,e/=2,i>>>=1;return(t+i)/e};return v.int32=function(){return 0|y.g(4)},v.quick=function(){return y.g(4)/4294967296},v.double=v,p(d(y.S),t),(f.pass||u||function(t,i,s,r){return r&&(r.S&&l(r,y),t.state=function(){return l(y,{})}),s?(e.random=t,i):t})(v,g,"global"in f?f.global:this==e,f.state)},p(e.random(),t)}([],BMMath);var BezierFactory=function(){var t={getBezierEasing:function(t,i,s,r,n){var a=n||("bez_"+t+"_"+i+"_"+s+"_"+r).replace(/\./g,"p");if(e[a])return e[a];var o=new l([t,i,s,r]);return e[a]=o,o}},e={},i=.1,s="function"==typeof Float32Array;function r(t,e){return 1-3*e+3*t}function n(t,e){return 3*e-6*t}function a(t){return 3*t}function o(t,e,i){return((r(e,i)*t+n(e,i))*t+a(e))*t}function h(t,e,i){return 3*r(e,i)*t*t+2*n(e,i)*t+a(e)}function l(t){this._p=t,this._mSampleValues=s?new Float32Array(11):new Array(11),this._precomputed=!1,this.get=this.get.bind(this)}return l.prototype={get:function(t){var e=this._p[0],i=this._p[1],s=this._p[2],r=this._p[3];return this._precomputed||this._precompute(),e===i&&s===r?t:0===t?0:1===t?1:o(this._getTForX(t),i,r)},_precompute:function(){var t=this._p[0],e=this._p[1],i=this._p[2],s=this._p[3];this._precomputed=!0,t===e&&i===s||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],s=0;s<11;++s)this._mSampleValues[s]=o(s*i,t,e)},_getTForX:function(t){for(var e=this._p[0],s=this._p[2],r=this._mSampleValues,n=0,a=1;10!==a&&r[a]<=t;++a)n+=i;var l=n+(t-r[--a])/(r[a+1]-r[a])*i,c=h(l,e,s);return c>=.001?function(t,e,i,s){for(var r=0;r<4;++r){var n=h(e,i,s);if(0===n)return e;e-=(o(e,i,s)-t)/n}return e}(t,l,e,s):0===c?l:function(t,e,i,s,r){var n,a,h=0;do{(n=o(a=e+(i-e)/2,s,r)-t)>0?i=a:e=a}while(Math.abs(n)>1e-7&&++h<10);return a}(t,n,n+i,e,s)}},t}();function extendPrototype(t,e){var i,s,r=t.length;for(i=0;i-.001&&a<.001}var i=function(t,e,i,s){var r,n,a,o,h,l,c=defaultCurveSegments,p=0,d=[],f=[],u=bezierLengthPool.newElement();for(a=i.length,r=0;ra?-1:1,l=!0;l;)if(s[n]<=a&&s[n+1]>a?(o=(a-s[n])/(s[n+1]-s[n]),l=!1):n+=h,n<0||n>=r-1){if(n===r-1)return i[n];l=!1}return i[n]+(i[n+1]-i[n])*o}var h=createTypedArray("float32",8);return{getSegmentsLength:function(t){var e,s=segmentsLengthPool.newElement(),r=t.c,n=t.v,a=t.o,o=t.i,h=t._length,l=s.lengths,c=0;for(e=0;e1&&(n=1);var c,p=o(n,l),d=o(a=a>1?1:a,l),f=e.length,u=1-p,m=1-d,g=u*u*u,y=p*u*u*3,v=p*p*u*3,b=p*p*p,x=u*u*m,_=p*u*m+u*p*m+u*u*d,E=p*p*m+u*p*d+p*u*d,S=p*p*d,P=u*m*m,k=p*m*m+u*d*m+u*m*d,w=p*d*m+u*d*d+p*m*d,C=p*d*d,M=m*m*m,A=d*m*m+m*d*m+m*m*d,T=d*d*m+m*d*d+d*m*d,D=d*d*d;for(c=0;cf?d>u?d-f-u:u-f-d:u>f?u-f-d:f-d-u)>-1e-4&&p<1e-4}}}!function(){for(var t=0,e=["ms","moz","webkit","o"],i=0;i=0;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)s(t[e].ks.k);else for(n=t[e].ks.k.length,r=0;ri[0]||!(i[0]>t[0])&&(t[1]>i[1]||!(i[1]>t[1])&&(t[2]>i[2]||!(i[2]>t[2])&&null))}var n,a=function(){var t=[4,4,14];function e(t){var e,i,s,r=t.length;for(e=0;e=0;i-=1)if("sh"===t[i].ty)if(t[i].ks.k.i)t[i].ks.k.c=t[i].closed;else for(r=t[i].ks.k.length,s=0;s0&&(c=!1),c){var p=createTag("style");p.setAttribute("f-forigin",s[i].fOrigin),p.setAttribute("f-origin",s[i].origin),p.setAttribute("f-family",s[i].fFamily),p.type="text/css",p.innerText="@font-face {font-family: "+s[i].fFamily+"; font-style: normal; src: url('"+s[i].fPath+"');}",e.appendChild(p)}}else if("g"===s[i].fOrigin||1===s[i].origin){for(h=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),l=0;l=a.t-r){n.h&&(n=a),f=0;break}if(a.t-r>t){f=u;break}u=C||t=C?A.points.length-1:0;for(h=A.points[T].point.length,o=0;o=F&&I=C)i[0]=y[0],i[1]=y[1],i[2]=y[2];else if(t<=M)i[0]=n.s[0],i[1]=n.s[1],i[2]=n.s[2];else{v=i,x=(b=function(t,e,i){var s,r,n,a,o,h=[],l=t[0],c=t[1],p=t[2],d=t[3],f=e[0],u=e[1],m=e[2],g=e[3];return(r=l*f+c*u+p*m+d*g)<0&&(r=-r,f=-f,u=-u,m=-m,g=-g),1-r>1e-6?(s=Math.acos(r),n=Math.sin(s),a=Math.sin((1-i)*s)/n,o=Math.sin(i*s)/n):(a=1-i,o=i),h[0]=a*l+o*f,h[1]=a*c+o*u,h[2]=a*p+o*m,h[3]=a*d+o*g,h}(s(n.s),s(y),(t-M)/(C-M)))[0],_=b[1],E=b[2],S=b[3],P=Math.atan2(2*_*S-2*x*E,1-2*_*_-2*E*E),k=Math.asin(2*x*_+2*E*S),w=Math.atan2(2*x*S-2*_*E,1-2*x*x-2*E*E),v[0]=P/degToRads,v[1]=k/degToRads,v[2]=w/degToRads}else for(u=0;u=C?l=1:t=s&&e>=s||this._caching.lastFrame=e&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var r=this.interpolateValue(e,this._caching);this.pv=r}return this._caching.lastFrame=e,this.pv}function n(t){var i;if("unidimensional"===this.propType)i=t*this.mult,e(this.v-i)>1e-5&&(this.v=i,this._mdf=!0);else for(var s=0,r=this.v.length;s1e-5&&(this.v[s]=i,this._mdf=!0),s+=1}function a(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t;this.lock=!0,this._mdf=this._isFirstFrame;var e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t=this.p.keyframes[this.p.keyframes.length-1].t?(s=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/i,0),r=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/i,0)):(s=this.p.pv,r=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/i,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){s=[],r=[];var n=this.px,a=this.py;n._caching.lastFrame+n.offsetTime<=n.keyframes[0].t?(s[0]=n.getValueAtTime((n.keyframes[0].t+.01)/i,0),s[1]=a.getValueAtTime((a.keyframes[0].t+.01)/i,0),r[0]=n.getValueAtTime(n.keyframes[0].t/i,0),r[1]=a.getValueAtTime(a.keyframes[0].t/i,0)):n._caching.lastFrame+n.offsetTime>=n.keyframes[n.keyframes.length-1].t?(s[0]=n.getValueAtTime(n.keyframes[n.keyframes.length-1].t/i,0),s[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/i,0),r[0]=n.getValueAtTime((n.keyframes[n.keyframes.length-1].t-.01)/i,0),r[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/i,0)):(s=[n.pv,a.pv],r[0]=n.getValueAtTime((n._caching.lastFrame+n.offsetTime-.01)/i,n.offsetTime),r[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/i,a.offsetTime))}else s=r=t;this.v.rotate(-Math.atan2(s[1]-r[1],s[0]-r[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],e),e.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},e.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(t,i,s){return new e(t,i,s)}}}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var i=0;i=this._maxLength&&this.doubleArrayLength(),i){case"v":n=this.v;break;case"i":n=this.i;break;case"o":n=this.o;break;default:n=[]}(!n[s]||n[s]&&!r)&&(n[s]=pointPool.newElement()),n[s][0]=t,n[s][1]=e},ShapePath.prototype.setTripleAt=function(t,e,i,s,r,n,a,o){this.setXYAt(t,e,"v",a,o),this.setXYAt(i,s,"o",a,o),this.setXYAt(r,n,"i",a,o)},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,i=this.o,s=this.i,r=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],s[0][0],s[0][1],i[0][0],i[0][1],0,!1),r=1);var n,a=this._length-1,o=this._length;for(n=r;n=f[f.length-1].t-this.offsetTime)s=f[f.length-1].s?f[f.length-1].s[0]:f[f.length-2].e[0],n=!0;else{for(var u,m,g=d,y=f.length-1,v=!0;v&&(u=f[g],!((m=f[g+1]).t-this.offsetTime>t));)g=m.t-this.offsetTime)c=1;else if(ts&&e>s)||(this._caching.lastIndex=r=1?n.push({s:t-1,e:e-1}):(n.push({s:t,e:1}),n.push({s:0,e:e-1}));var a,o,h=[],l=n.length;for(a=0;as+i||(c=o.s*r<=s?0:(o.s*r-s)/i,p=o.e*r>=s+i?1:(o.e*r-s)/i,h.push([c,p]))}return h.length||h.push([0,0]),h},TrimModifier.prototype.releasePathsData=function(t){var e,i=t.length;for(e=0;e1?1+n:this.s.v<0?0+n:this.s.v+n)>(i=this.e.v>1?1+n:this.e.v<0?0+n:this.e.v+n)){var a=e;e=i,i=a}e=1e-4*Math.round(1e4*e),i=1e-4*Math.round(1e4*i),this.sValue=e,this.eValue=i}else e=this.sValue,i=this.eValue;var o,h,l,c,p,d=this.shapes.length,f=0;if(i===e)for(r=0;r=0;r-=1)if((u=this.shapes[r]).shape._mdf){for((m=u.localShapeCollection).releaseShapes(),2===this.m&&d>1?(y=this.calculateShapeEdges(e,i,u.totalShapeLength,x,f),x+=u.totalShapeLength):y=[[v,b]],h=y.length,o=0;o=1?g.push({s:u.totalShapeLength*(v-1),e:u.totalShapeLength*(b-1)}):(g.push({s:u.totalShapeLength*v,e:u.totalShapeLength}),g.push({s:0,e:u.totalShapeLength*(b-1)}));var _=this.addShapes(u,g[0]);if(g[0].s!==g[0].e){if(g.length>1)if(u.shape.paths.shapes[u.shape.paths._length-1].c){var E=_.pop();this.addPaths(_,m),_=this.addShapes(u,g[1],E)}else this.addPaths(_,m),_=this.addShapes(u,g[1]);this.addPaths(_,m)}}u.shape.paths=m}}},TrimModifier.prototype.addPaths=function(t,e){var i,s=t.length;for(i=0;ie.e){i.c=!1;break}e.s<=u&&e.e>=u+a.addedLength?(this.addSegment(d[s].v[r-1],d[s].o[r-1],d[s].i[r],d[s].v[r],i,o,g),g=!1):(l=bez.getNewSegment(d[s].v[r-1],d[s].v[r],d[s].o[r-1],d[s].i[r],(e.s-u)/a.addedLength,(e.e-u)/a.addedLength,h[r-1]),this.addSegmentFromArray(l,i,o,g),g=!1,i.c=!1),u+=a.addedLength,o+=1}if(d[s].c&&h.length){if(a=h[r-1],u<=e.e){var y=h[r-1].addedLength;e.s<=u&&e.e>=u+y?(this.addSegment(d[s].v[r-1],d[s].o[r-1],d[s].i[0],d[s].v[0],i,o,g),g=!1):(l=bez.getNewSegment(d[s].v[r-1],d[s].v[0],d[s].o[r-1],d[s].i[0],(e.s-u)/y,(e.e-u)/y,h[r-1]),this.addSegmentFromArray(l,i,o,g),g=!1,i.c=!1)}else i.c=!1;u+=a.addedLength,o+=1}if(i._length&&(i.setXYAt(i.v[c][0],i.v[c][1],"i",c),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),u>e.e)break;s0;)i-=1,this._elements.unshift(e[i]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(t){var e,i=t.length;for(e=0;e0?Math.floor(d):Math.ceil(d),m=this.pMatrix.props,g=this.rMatrix.props,y=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var v,b,x=0;if(d>0){for(;xu;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),x-=1;f&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-f,!0),x-=f)}for(s=1===this.data.m?0:this._currentCopies-1,r=1===this.data.m?1:-1,n=this._currentCopies;n;){if(b=(i=(e=this.elemsData[s].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=1===this._currentCopies?this.so.v:this.so.v+(this.eo.v-this.so.v)*(s/(this._currentCopies-1)),0!==x){for((0!==s&&1===r||s!==this._currentCopies-1&&-1===r)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),this.matrix.transform(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),v=0;v.01)return!1;i+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t500)&&(this._imageLoaded(),clearInterval(i)),e+=1}.bind(this),50)}function n(t){var e={assetData:t},i=s(t,this.assetsPath,this.path);return assetLoader.load(i,function(t){e.img=t,this._footageLoaded()}.bind(this),function(){e.img={},this._footageLoaded()}.bind(this)),e}function a(){this._imageLoaded=e.bind(this),this._footageLoaded=i.bind(this),this.testImageLoaded=r.bind(this),this.createFootageData=n.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return a.prototype={loadAssets:function(t,e){var i;this.imagesLoadedCb=e;var s=t.length;for(i=0;i=o+ot||!u?(v=(o+ot-l)/h.partialLength,V=f.point[0]+(h.point[0]-f.point[0])*v,z=f.point[1]+(h.point[1]-f.point[1])*v,P.translate(-_[0]*C[r].an*.005,-_[1]*R*.01),c=!1):u&&(l+=h.partialLength,(p+=1)>=u.length&&(p=0,m[d+=1]?u=m[d].points:x.v.c?(p=0,u=m[d=0].points):(l-=h.partialLength,u=null)),u&&(f=h,g=(h=u[p]).partialLength));B=C[r].an/2-C[r].add,P.translate(-B,0,0)}else B=C[r].an/2-C[r].add,P.translate(-B,0,0),P.translate(-_[0]*C[r].an*.005,-_[1]*R*.01,0);for(D=0;D1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,i=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var s;this.lock=!0,this._mdf=!1;var r=this.effectsSequence.length,n=t||this.data.d.k[this.keysIndex].s;for(s=0;se);)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e,i,s=[],r=0,n=t.length,a=!1;r=55296&&e<=56319?(i=t.charCodeAt(r+1))>=56320&&i<=57343?(a||FontManager.isModifier(e,i)?(s[s.length-1]+=t.substr(r,2),a=!1):s.push(t.substr(r,2)),r+=1):s.push(t.charAt(r)):e>56319?(i=t.charCodeAt(r+1),FontManager.isZeroWidthJoiner(e,i)?(a=!0,s[s.length-1]+=t.substr(r,2),r+=1):s.push(t.charAt(r))):FontManager.isZeroWidthJoiner(e)?(s[s.length-1]+=t.charAt(r),a=!0):s.push(t.charAt(r)),r+=1;return s},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e,i,s,r,n,a,o,h=this.elem.globalData.fontManager,l=this.data,c=[],p=0,d=l.m.g,f=0,u=0,m=0,g=[],y=0,v=0,b=h.getFontByName(t.f),x=0,_=getFontProperties(b);t.fWeight=_.weight,t.fStyle=_.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),i=t.finalText.length,t.finalLineHeight=t.lh;var E,S=t.tr/1e3*t.finalSize;if(t.sz)for(var P,k,w=!0,C=t.sz[0],M=t.sz[1];w;){P=0,y=0,i=(k=this.buildFinalText(t.t)).length,S=t.tr/1e3*t.finalSize;var A=-1;for(e=0;eC&&" "!==k[e]?(-1===A?i+=1:e=A,P+=t.finalLineHeight||1.2*t.finalSize,k.splice(e,A===e?1:0,"\r"),A=-1,y=0):(y+=x,y+=S);P+=b.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&Mv?y:v,y=-2*S,r="",s=!0,m+=1):r=T,h.chars?(o=h.getCharData(T,b.fStyle,h.getFontByName(t.f).fFamily),x=s?0:o.w*t.finalSize/100):x=h.measureText(r,t.f,t.finalSize)," "===T?D+=x+S:(y+=x+S+D,D=0),c.push({l:x,an:x,add:f,n:s,anIndexes:[],val:r,line:m,animatorJustifyOffset:0}),2==d){if(f+=x,""===r||" "===r||e===i-1){for(""!==r&&" "!==r||(f-=x);u<=e;)c[u].an=f,c[u].ind=p,c[u].extra=x,u+=1;p+=1,f=0}}else if(3==d){if(f+=x,""===r||e===i-1){for(""===r&&(f-=x);u<=e;)c[u].an=f,c[u].ind=p,c[u].extra=x,u+=1;f=0,p+=1}}else c[p].ind=p,c[p].extra=0,p+=1;if(t.l=c,v=y>v?y:v,g.push(y),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=g;var I,F,L,R,O=l.a;a=O.length;var B=[];for(n=0;n0?r=this.ne.v/100:n=-this.ne.v/100,this.xe.v>0?a=1-this.xe.v/100:o=1+this.xe.v/100;var h=BezierFactory.getBezierEasing(r,n,a,o).get,l=0,c=this.finalS,p=this.finalE,d=this.data.sh;if(2===d)l=h(l=p===c?s>=p?1:0:t(0,e(.5/(p-c)+(s-c)/(p-c),1)));else if(3===d)l=h(l=p===c?s>=p?0:1:1-t(0,e(.5/(p-c)+(s-c)/(p-c),1)));else if(4===d)p===c?l=0:(l=t(0,e(.5/(p-c)+(s-c)/(p-c),1)))<.5?l*=2:l=1-2*(l-.5),l=h(l);else if(5===d){if(p===c)l=0;else{var f=p-c,u=-f/2+(s=e(t(0,s+.5-c),p-c)),m=f/2;l=Math.sqrt(1-u*u/(m*m))}l=h(l)}else 6===d?(p===c?l=0:(s=e(t(0,s+.5-c),p-c),l=(1+Math.cos(Math.PI+2*Math.PI*s/(p-c)))/2),l=h(l)):(s>=i(c)&&(l=t(0,e(s-c<0?e(p,1)-(c-s):p-s,1))),l=h(l));return l*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,i=this.o.v/e,s=this.s.v/e+i,r=this.e.v/e+i;if(s>r){var n=s;s=r,r=n}this.finalS=s,this.finalE=r}},extendPrototype([DynamicPropertyContainer],s),{getTextSelectorProp:function(t,e,i){return new s(t,e,i)}}}(),poolFactory=function(t,e,i){var s=0,r=t,n=createSizedArray(r);return{newElement:function(){return s?n[s-=1]:e()},release:function(t){s===r&&(n=pooling.double(n),r*=2),i&&i(t),n[s]=t,s+=1}}},pooling={double:function(t){return t.concat(createSizedArray(t.length))}},pointPool=poolFactory(8,(function(){return createTypedArray("float32",2)})),shapePool=(factory=poolFactory(4,(function(){return new ShapePath}),(function(t){var e,i=t._length;for(e=0;e0&&(this.maskElement.setAttribute("id",g),this.element.maskedElement.setAttribute(v,"url("+locationHref+"#"+g+")"),n.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}function HierarchyElement(){}function FrameElement(){}function TransformElement(){}function RenderableElement(){}function RenderableDOMElement(){}function ProcessedElement(t,e){this.elem=t,this.pos=e}function SVGStyleData(t,e){this.data=t,this.type=t.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=!0===t.hd,this.pElem=createNS("path"),this.msElem=null}function SVGShapeData(t,e,i){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=i,this.lvl=e,this._isAnimated=!!i.k;for(var s=0,r=t.length;s=0;e-=1)this.elements[e]||(i=this.layers[e]).ip-i.st<=t-this.layers[e].st&&i.op-i.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);case 15:return this.createFootage(t);default:return this.createNull(t)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.createFootage=function(t){return new FootageElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;ei&&"meet"===n||si&&"slice"===n)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===o&&(si&&"slice"===n)?(t-this.transformCanvas.w*(e/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===h&&(s>i&&"meet"===n||si&&"meet"===n||s=0;t-=1)this.elements[t]&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRenderer.prototype.renderFrame=function(t,e){if((this.renderedFrame!==t||!0!==this.renderConfig.clearCanvas||e)&&!this.destroyed&&-1!==t){var i;this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var s=this.layers.length;for(this.completeLayers||this.checkLayers(t),i=0;i=0;i-=1)(this.completeLayers||this.elements[i])&&this.elements[i].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRenderer.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){var i=this.createItem(this.layers[t],this,this.globalData);e[t]=i,i.initExpressions()}},CanvasRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},CanvasRenderer.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRenderer.prototype.show=function(){this.animationItem.container.style.display="block"},extendPrototype([BaseRenderer],HybridRenderer),HybridRenderer.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRenderer.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},HybridRenderer.prototype.appendElementInPos=function(t,e){var i=t.getBaseElement();if(i){var s=this.layers[e];if(s.ddd&&this.supports3d)this.addTo3dContainer(i,e);else if(this.threeDElements)this.addTo3dContainer(i,e);else{for(var r,n,a=0;a=t)return this.threeDElements[e].perspectiveElem;e+=1}return null},HybridRenderer.prototype.createThreeDContainer=function(t,e){var i,s,r=createTag("div");styleDiv(r);var n=createTag("div");if(styleDiv(n),"3d"===e){(i=r.style).width=this.globalData.compSize.w+"px",i.height=this.globalData.compSize.h+"px";var a="50% 50%";i.webkitTransformOrigin=a,i.mozTransformOrigin=a,i.transformOrigin=a;var o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";(s=n.style).transform=o,s.webkitTransform=o}r.appendChild(n);var h={container:n,perspectiveElem:r,startPos:t,endPos:t,type:e};return this.threeDElements.push(h),h},HybridRenderer.prototype.build3dContainers=function(){var t,e,i=this.layers.length,s="";for(t=0;t=0;t-=1)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem)},HybridRenderer.prototype.addTo3dContainer=function(t,e){for(var i=0,s=this.threeDElements.length;ia?(t=r/this.globalData.compSize.w,e=r/this.globalData.compSize.w,i=0,s=(n-this.globalData.compSize.h*(r/this.globalData.compSize.w))/2):(t=n/this.globalData.compSize.h,e=n/this.globalData.compSize.h,i=(r-this.globalData.compSize.w*(n/this.globalData.compSize.h))/2,s=0);var o=this.resizerElem.style;o.webkitTransform="matrix3d("+t+",0,0,0,0,"+e+",0,0,0,0,1,0,"+i+","+s+",0,1)",o.transform=o.webkitTransform},HybridRenderer.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRenderer.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRenderer.prototype.show=function(){this.resizerElem.style.display="block"},HybridRenderer.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var t,e=this.globalData.compSize.w,i=this.globalData.compSize.h,s=this.threeDElements.length;for(t=0;t1&&(n+=" C"+e.o[s-1][0]+","+e.o[s-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),i.lastPath!==n){var a="";i.elem&&(e.c&&(a=t.inv?this.solidPath+n:n),i.elem.setAttribute("d",a)),i.lastPath=n}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var i,s=this.dynamicProperties.length;for(i=0;it?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t0;)h=s.transformers[m].mProps._mdf||h,u-=1,m-=1;if(h)for(u=y-s.styles[c].lvl,m=s.transformers.length-1;u>0;)f=s.transformers[m].mProps.v.props,d.transform(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15]),u-=1,m-=1}else d=t;if(a=(p=s.sh.paths)._length,h){for(o="",n=0;n=1?v=.99:v<=-1&&(v=-.99);var b=o*v,x=Math.cos(y+e.a.v)*b+c[0],_=Math.sin(y+e.a.v)*b+c[1];h.setAttribute("fx",x),h.setAttribute("fy",_),l&&!e.g._collapsable&&(e.of.setAttribute("fx",x),e.of.setAttribute("fy",_))}}function o(t,e,i){var s=e.style,r=e.d;r&&(r._mdf||i)&&r.dashStr&&(s.pElem.setAttribute("stroke-dasharray",r.dashStr),s.pElem.setAttribute("stroke-dashoffset",r.dashoffset[0])),e.c&&(e.c._mdf||i)&&s.pElem.setAttribute("stroke","rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||i)&&s.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||i)&&(s.pElem.setAttribute("stroke-width",e.w.v),s.msElem&&s.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:function(t){switch(t.ty){case"fl":return r;case"gf":return a;case"gs":return n;case"st":return o;case"sh":case"el":case"rc":case"sr":return s;case"tr":return i;default:return null}}}}();function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}function CVShapeData(t,e,i,s){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var r,n=4;"rc"===e.ty?n=5:"el"===e.ty?n=6:"sr"===e.ty&&(n=7),this.sh=ShapePropertyFactory.getShapeProp(t,e,n,t);var a,o=i.length;for(r=0;r=0;s-=1)i=t.transforms[s].transform.mProps.v.props,t.finalTransform.transform(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],i[9],i[10],i[11],i[12],i[13],i[14],i[15]);t._mdf=n},processSequences:function(t){var e,i=this.sequenceList.length;for(e=0;e=0&&!this.shapeModifiers[t].processShapes(this._isFirstFrame);t-=1);}},searchProcessedElement:function(t){for(var e=this.processedElements,i=0,s=e.length;i=0;i-=1)(this.completeLayers||this.elements[i])&&(this.elements[i].prepareFrame(this.renderedFrame-this.layers[i].st),this.elements[i]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(t){this.audio.rate(t)},AudioElement.prototype.volume=function(t){this.audio.volume(t)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},FootageElement.prototype.prepareFrame=function(){},extendPrototype([RenderableElement,BaseElement,FrameElement],FootageElement),FootageElement.prototype.getBaseElement=function(){return null},FootageElement.prototype.renderFrame=function(){},FootageElement.prototype.destroy=function(){},FootageElement.prototype.initExpressions=function(){this.layerInterface=FootageInterface(this)},FootageElement.prototype.getFootageData=function(){return this.footageData},extendPrototype([SVGRenderer,ICompElement,SVGBaseElement],SVGCompElement),extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextLottieElement),SVGTextLottieElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextLottieElement.prototype.buildTextContents=function(t){for(var e=0,i=t.length,s=[],r="";et?this.textSpans[t]:createNS(h?"path":"text"),b<=t&&(a.setAttribute("stroke-linecap","butt"),a.setAttribute("stroke-linejoin","round"),a.setAttribute("stroke-miterlimit","4"),this.textSpans[t]=a,this.layerElement.appendChild(a)),a.style.display="inherit"),c.reset(),c.scale(i.finalSize/100,i.finalSize/100),d&&(o[t].n&&(f=-g,u+=i.yOffset,u+=m?1:0,m=!1),this.applyTextPropertiesToMatrix(i,c,o[t].line,f,u),f+=o[t].l||0,f+=g),h?(l=(y=(v=this.globalData.fontManager.getCharData(i.finalText[t],s.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily))&&v.data||{}).shapes?y.shapes[0].it:[],d?p+=this.createPathShape(c,l):a.setAttribute("d",this.createPathShape(c,l))):(d&&a.setAttribute("transform","translate("+c.props[12]+","+c.props[13]+")"),a.textContent=o[t].val,a.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"));d&&a&&a.setAttribute("d",p)}else{var x=this.textContainer,_="start";switch(i.j){case 1:_="end";break;case 2:_="middle";break;default:_="start"}x.setAttribute("text-anchor",_),x.setAttribute("letter-spacing",g);var E=this.buildTextContents(i.finalText);for(e=E.length,u=i.ps?i.ps[1]+i.ascent:0,t=0;t1&&o&&this.setShapesAsAnimated(a)}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,i=t.length;for(e=0;e=0;o-=1){if((d=this.searchProcessedElement(t[o]))?e[o]=i[d-1]:t[o]._render=a,"fl"===t[o].ty||"st"===t[o].ty||"gf"===t[o].ty||"gs"===t[o].ty)d?e[o].style.closed=!1:e[o]=this.createStyleElement(t[o],r),t[o]._render&&s.appendChild(e[o].style.pElem),m.push(e[o].style);else if("gr"===t[o].ty){if(d)for(l=e[o].it.length,h=0;h=l?f<0?s:r:s+d*Math.pow((n-t)/f,1/i),c[p]=a,p+=1,o+=256/255;return c.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,i=this.filterManager.effectElements;this.feFuncRComposed&&(t||i[3].p._mdf||i[4].p._mdf||i[5].p._mdf||i[6].p._mdf||i[7].p._mdf)&&(e=this.getTableValue(i[3].p.v,i[4].p.v,i[5].p.v,i[6].p.v,i[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||i[10].p._mdf||i[11].p._mdf||i[12].p._mdf||i[13].p._mdf||i[14].p._mdf)&&(e=this.getTableValue(i[10].p.v,i[11].p.v,i[12].p.v,i[13].p.v,i[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||i[17].p._mdf||i[18].p._mdf||i[19].p._mdf||i[20].p._mdf||i[21].p._mdf)&&(e=this.getTableValue(i[17].p.v,i[18].p.v,i[19].p.v,i[20].p.v,i[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||i[24].p._mdf||i[25].p._mdf||i[26].p._mdf||i[27].p._mdf||i[28].p._mdf)&&(e=this.getTableValue(i[24].p.v,i[25].p.v,i[26].p.v,i[27].p.v,i[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||i[31].p._mdf||i[32].p._mdf||i[33].p._mdf||i[34].p._mdf||i[35].p._mdf)&&(e=this.getTableValue(i[31].p.v,i[32].p.v,i[33].p.v,i[34].p.v,i[35].p.v),this.feFuncA.setAttribute("tableValues",e))}},SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*e[0]),Math.round(255*e[1]),Math.round(255*e[2])))}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var i=this.filterManager.effectElements[3].p.v,s=(this.filterManager.effectElements[2].p.v-90)*degToRads,r=i*Math.cos(s),n=i*Math.sin(s);this.feOffset.setAttribute("dx",r),this.feOffset.setAttribute("dy",n)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,i){this.initialized=!1,this.filterManager=e,this.filterElem=t,this.elem=i,i.matteElement=createNS("g"),i.matteElement.appendChild(i.layerElement),i.matteElement.appendChild(i.transformedElement),i.baseElement=i.matteElement}function SVGEffects(t){var e,i,s=t.data.ef?t.data.ef.length:0,r=createElementID(),n=filtersFactory.createFilter(r,!0),a=0;for(this.filters=[],e=0;eo&&"xMidYMid slice"===h||a=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},CVCompElement.prototype.destroy=function(){var t;for(t=this.layers.length-1;t>=0;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var t,e,i,s,r=this.element.finalTransform.mat,n=this.element.canvasContext,a=this.masksProperties.length;for(n.beginPath(),t=0;t=0;n-=1){if((h=this.searchProcessedElement(t[n]))?e[n]=i[h-1]:t[n]._shouldRender=s,"fl"===t[n].ty||"st"===t[n].ty||"gf"===t[n].ty||"gs"===t[n].ty)h?e[n].style.closed=!1:e[n]=this.createStyleElement(t[n],u),d.push(e[n].style);else if("gr"===t[n].ty){if(h)for(o=e[n].it.length,a=0;a=0;r-=1)"tr"===e[r].ty?(n=i[r].transform,this.renderShapeTransform(t,n)):"sh"===e[r].ty||"el"===e[r].ty||"rc"===e[r].ty||"sr"===e[r].ty?this.renderPath(e[r],i[r]):"fl"===e[r].ty?this.renderFill(e[r],i[r],n):"st"===e[r].ty?this.renderStroke(e[r],i[r],n):"gf"===e[r].ty||"gs"===e[r].ty?this.renderGradientFill(e[r],i[r],n):"gr"===e[r].ty?this.renderShape(n,e[r].it,i[r].it):e[r].ty;s&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var i,s,r,n=t.trNodes,a=e.paths,o=a._length;n.length=0;var h=t.transforms.finalTransform;for(r=0;r=1?p=.99:p<=-1&&(p=-.99);var d=l*p,f=Math.cos(c+e.a.v)*d+o[0],u=Math.sin(c+e.a.v)*d+o[1];s=a.createRadialGradient(f,u,0,o[0],o[1],l)}var m=t.g.p,g=e.g.c,y=1;for(n=0;n0&&o<1&&p[d].push(this.calculateF(o,t,e,i,s,d)):(h=n*n-4*a*r)>=0&&((l=(-n+bmSqrt(h))/(2*r))>0&&l<1&&p[d].push(this.calculateF(l,t,e,i,s,d)),(c=(-n-bmSqrt(h))/(2*r))>0&&c<1&&p[d].push(this.calculateF(c,t,e,i,s,d))));this.shapeBoundingBox.left=bmMin.apply(null,p[0]),this.shapeBoundingBox.top=bmMin.apply(null,p[1]),this.shapeBoundingBox.right=bmMax.apply(null,p[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,p[1])},HShapeElement.prototype.calculateF=function(t,e,i,s,r,n){return bmPow(1-t,3)*e[n]+3*bmPow(1-t,2)*t*i[n]+3*(1-t)*bmPow(t,2)*s[n]+bmPow(t,3)*r[n]},HShapeElement.prototype.calculateBoundingBox=function(t,e){var i,s=t.length;for(i=0;i=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax=0;t-=1){var s=this.hierarchy[t].finalTransform.mProp;this.mat.translate(-s.p.v[0],-s.p.v[1],s.p.v[2]),this.mat.rotateX(-s.or.v[0]).rotateY(-s.or.v[1]).rotateZ(s.or.v[2]),this.mat.rotateX(-s.rx.v).rotateY(-s.ry.v).rotateZ(s.rz.v),this.mat.scale(1/s.s.v[0],1/s.s.v[1],1/s.s.v[2]),this.mat.translate(s.a.v[0],s.a.v[1],s.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var r;r=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var n=Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2)+Math.pow(r[2],2)),a=[r[0]/n,r[1]/n,r[2]/n],o=Math.sqrt(a[2]*a[2]+a[0]*a[0]),h=Math.atan2(a[1],o),l=Math.atan2(a[0],-a[2]);this.mat.rotateY(l).rotateX(-h)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var c=!this._prevMat.equals(this.mat);if((c||this.pe._mdf)&&this.comp.threeDElements){var p,d,f;for(e=this.comp.threeDElements.length,t=0;t=0;i-=1)e[i].animation.destroy(t)},t.freeze=function(){a=!0},t.unfreeze=function(){a=!1,u()},t.setVolume=function(t,i){var r;for(r=0;rthis.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,i,s=this.animationData.layers,r=s.length,n=t.layers,a=n.length;for(i=0;ithis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded&&this.renderer)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(t){t&&this.name!==t||!0===this.isPaused&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!==t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(t){for(var e,i=0;i=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(i=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFramee&&(i=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,-1!==i&&this.goToAndStop(i,!0)},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"==typeof t[0]){var i,s=t.length;for(i=0;ii){var s=i;i=e,e=s}return Math.min(Math.max(t,e),i)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if("number"==typeof t||t instanceof Number)return e=e||0,Math.abs(t-e);var i;e||(e=helperLengthArray);var s=Math.min(t.length,e.length),r=0;for(i=0;i.5?l/(2-a-o):l/(a+o),a){case s:e=(r-n)/l+(r1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function hslToRgb(t){var e,i,s,r=t[0],n=t[1],a=t[2];if(0===n)e=a,s=a,i=a;else{var o=a<.5?a*(1+n):a+n-a*n,h=2*a-o;e=hue2rgb(h,o,r+1/3),i=hue2rgb(h,o,r),s=hue2rgb(h,o,r-1/3)}return[e,i,s,t[3]]}function linear(t,e,i,s,r){if(void 0!==s&&void 0!==r||(s=e,r=i,e=0,i=1),i=i)return r;var a,o=i===e?0:(t-e)/(i-e);if(!s.length)return s+(r-s)*o;var h=s.length,l=createTypedArray("float32",h);for(a=0;a1){for(s=0;s1?e=1:e<0&&(e=0);var a=t(e);if($bm_isInstanceOfArray(r)){var o,h=r.length,l=createTypedArray("float32",h);for(o=0;odata.k[e].t&&tdata.k[e+1].t-t?(i=e+2,s=data.k[e+1].t):(i=e+1,s=data.k[e].t);break}}-1===i&&(i=e+1,s=data.k[e].t)}else i=0,s=0;var n={};return n.index=i,n.time=s/elem.comp.globalData.frameRate,n}function key(t){var e,i,s;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var r=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(s=r.length,i=0;il.length-1)&&(e=l.length-1),s=c-(r=l[l.length-1-e].t)),"pingpong"===t){if(Math.floor((h-r)/s)%2!=0)return this.getValueAtTime((s-(h-r)%s+r)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var p=this.getValueAtTime(r/this.comp.globalData.frameRate,0),d=this.getValueAtTime(c/this.comp.globalData.frameRate,0),f=this.getValueAtTime(((h-r)%s+r)/this.comp.globalData.frameRate,0),u=Math.floor((h-r)/s);if(this.pv.length){for(a=(o=new Array(p.length)).length,n=0;n=c)return this.pv;if(i?r=c+(s=e?Math.abs(this.elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-c)):((!e||e>l.length-1)&&(e=l.length-1),s=(r=l[e].t)-c),"pingpong"===t){if(Math.floor((c-h)/s)%2==0)return this.getValueAtTime(((c-h)%s+c)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var p=this.getValueAtTime(c/this.comp.globalData.frameRate,0),d=this.getValueAtTime(r/this.comp.globalData.frameRate,0),f=this.getValueAtTime((s-(c-h)%s+c)/this.comp.globalData.frameRate,0),u=Math.floor((c-h)/s)+1;if(this.pv.length){for(a=(o=new Array(p.length)).length,n=0;n1?(r+t-n)/(e-1):1,o=0,h=0;for(i=this.pv.length?createTypedArray("float32",this.pv.length):0;oa){var c=o,p=i.c&&o===h-1?0:o+1,d=(a-l)/n[o].addedLength;s=bez.getPointInSegment(i.v[c],i.v[p],i.o[c],i.i[p],d,n[o]);break}l+=n[o].addedLength,o+=1}return s||(s=i.c?[i.v[0][0],i.v[0][1]]:[i.v[i._length-1][0],i.v[i._length-1][1]]),s},vectorOnPath:function(t,e,i){1==t?t=this.v.c:0==t&&(t=.999);var s=this.pointOnPath(t,e),r=this.pointOnPath(t+.001,e),n=r[0]-s[0],a=r[1]-s[1],o=Math.sqrt(Math.pow(n,2)+Math.pow(a,2));return 0===o?[0,0]:"tangent"===i?[n/o,a/o]:[-a/o,n/o]},tangentOnPath:function(t,e){return this.vectorOnPath(t,e,"tangent")},normalOnPath:function(t,e){return this.vectorOnPath(t,e,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([l],o),extendPrototype([l],h),h.prototype.getValueAtTime=function(t){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime1&&(defaultCurveSegments=t);roundValues(!(defaultCurveSegments>=50))}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(t,e){"expressions"===t&&(expressionsPlugin=e)}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(t){for(var e=queryString.split("&"),i=0;i{"use strict";function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:window.getComputedStyle(t,null),s=m(i[e]);return E()||"width"!==e?E()||"height"!==e||(s+=m(i.paddingTop)+m(i.paddingBottom)+m(i.borderTopWidth)+m(i.borderBottomWidth)):s+=m(i.paddingLeft)+m(i.paddingRight)+m(i.borderLeftWidth)+m(i.borderRightWidth),s}var P={reverse:!1,by:null,compare:null,randomize:!1,key:"element"};function k(t,e){var i=Object.assign({},P,e),s=Array.from(t),r=!1;return t.length?i.randomize?function(t){for(var e=t.length;e;){e-=1;var i=Math.floor(Math.random()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}(t):("function"==typeof i.by?t.sort((function(t,e){if(r)return 0;var s=i.by(t[i.key]),n=i.by(e[i.key]);return void 0===s&&void 0===n?(r=!0,0):sn||"sortLast"===s||"sortFirst"===n?1:0})):"function"==typeof i.compare&&t.sort(i.compare),r?s:(i.reverse&&t.reverse(),t)):[]}var w={},C="transitionend",M=0;function A(t){return!!w[t]&&(w[t].element.removeEventListener(C,w[t].listener),w[t]=null,!0)}function T(t){return Math.max.apply(Math,t)}function D(t,e,i,s){var r=t/e;return Math.abs(Math.round(r)-r)=s-e&&t[r]<=s+e)return r;return 0}function L(t,e){var i={};t.forEach((function(t){i[t.top]?i[t.top].push(t):i[t.top]=[t]}));var s=[],r=[],n=[];return Object.keys(i).forEach((function(t){var a=i[t];r.push(a);var o,h=a[a.length-1],l=h.left+h.width,c=Math.round((e-l)/2),p=a,d=!1;if(c>0){var f=[];(d=a.every((function(t){var e=new y(t.left+c,t.top,t.width,t.height,t.id),i=!s.some((function(t){return y.intersects(e,t)}));return f.push(e),i})))&&(p=f)}if(!d&&a.some((function(t){return s.some((function(e){var i=y.intersects(t,e);return i&&(o=e),i}))}))){var u=n.findIndex((function(t){return t.includes(o)}));n.splice(u,1,r[u])}s=s.concat(p),n.push(p)})),[].concat.apply([],n).sort((function(t,e){return t.id-e.id})).map((function(t){return new g(t.left,t.top)}))}function R(t){return Array.from(new Set(t))}var O=0,B=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e)}(l,t);var e,i,r=(e=l,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,s=a(e);if(i){var r=a(this).constructor;t=Reflect.construct(s,arguments,r)}else t=s.apply(this,arguments);return h(this,t)});function l(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,l),(e=r.call(this)).options=Object.assign({},l.options,i),e.options.delimeter&&(e.options.delimiter=e.options.delimeter),e.lastSort={},e.group=l.ALL_ITEMS,e.lastFilter=l.ALL_ITEMS,e.isEnabled=!0,e.isDestroyed=!1,e.isInitialized=!1,e._transitions=[],e.isTransitioning=!1,e._queue=[];var n=e._getElementOption(t);if(!n)throw new TypeError("Shuffle needs to be initialized with an element.");return e.element=n,e.id="shuffle_"+O,O+=1,e._init(),e.isInitialized=!0,e}return n(l,[{key:"_init",value:function(){if(this.items=this._getItems(),this.sortedItems=this.items,this.options.sizer=this._getElementOption(this.options.sizer),this.element.classList.add(l.Classes.BASE),this._initItems(this.items),this._onResize=this._getResizeFunction(),window.addEventListener("resize",this._onResize),"complete"!==document.readyState){var t=this.layout.bind(this);window.addEventListener("load",(function e(){window.removeEventListener("load",e),t()}))}var e=window.getComputedStyle(this.element,null),i=l.getSize(this.element).width;this._validateStyles(e),this._setColumns(i),this.filter(this.options.group,this.options.initialSort),this.element.offsetWidth,this.setItemTransitions(this.items),this.element.style.transition="height ".concat(this.options.speed,"ms ").concat(this.options.easing)}},{key:"_getResizeFunction",value:function(){var t=this._handleResize.bind(this);return this.options.throttle?this.options.throttle(t,this.options.throttleTime):t}},{key:"_getElementOption",value:function(t){return"string"==typeof t?this.element.querySelector(t):t&&t.nodeType&&1===t.nodeType?t:t&&t.jquery?t[0]:null}},{key:"_validateStyles",value:function(t){"static"===t.position&&(this.element.style.position="relative"),"hidden"!==t.overflow&&(this.element.style.overflow="hidden")}},{key:"_filter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.lastFilter,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.items,i=this._getFilteredSets(t,e);return this._toggleFilterClasses(i),this.lastFilter=t,"string"==typeof t&&(this.group=t),i}},{key:"_getFilteredSets",value:function(t,e){var i=this,s=[],r=[];return t===l.ALL_ITEMS?s=e:e.forEach((function(e){i._doesPassFilter(t,e.element)?s.push(e):r.push(e)})),{visible:s,hidden:r}}},{key:"_doesPassFilter",value:function(t,e){if("function"==typeof t)return t.call(e,e,this);var i=e.getAttribute("data-"+l.FILTER_ATTRIBUTE_KEY),s=this.options.delimiter?i.split(this.options.delimiter):JSON.parse(i);function r(t){return s.includes(t)}return Array.isArray(t)?this.options.filterMode===l.FilterMode.ANY?t.some(r):t.every(r):s.includes(t)}},{key:"_toggleFilterClasses",value:function(t){var e=t.visible,i=t.hidden;e.forEach((function(t){t.show()})),i.forEach((function(t){t.hide()}))}},{key:"_initItems",value:function(t){t.forEach((function(t){t.init()}))}},{key:"_disposeItems",value:function(t){t.forEach((function(t){t.dispose()}))}},{key:"_updateItemCount",value:function(){this.visibleItems=this._getFilteredItems().length}},{key:"setItemTransitions",value:function(t){var e=this.options,i=e.speed,s=e.easing,r=this.options.useTransforms?["transform"]:["top","left"],n=Object.keys(x.Css.HIDDEN.before).map((function(t){return t.replace(/([A-Z])/g,(function(t,e){return"-".concat(e.toLowerCase())}))})),a=r.concat(n).join();t.forEach((function(t){t.element.style.transitionDuration=i+"ms",t.element.style.transitionTimingFunction=s,t.element.style.transitionProperty=a}))}},{key:"_getItems",value:function(){var t=this;return Array.from(this.element.children).filter((function(e){return function(t,e){if(!t||1!==t.nodeType)return!1;if(f)return f.call(t,e);for(var i=t.parentNode.querySelectorAll(e),s=0;s0?l.getSize(this.items[0].element,!0).width:t)&&(i=t),i+e}},{key:"_getGutterSize",value:function(t){return"function"==typeof this.options.gutterWidth?this.options.gutterWidth(t):this.options.sizer?S(this.options.sizer,"marginLeft"):this.options.gutterWidth}},{key:"_setColumns",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.getSize(this.element).width,e=this._getGutterSize(t),i=this._getColumnSize(t,e),s=(t+e)/i;Math.abs(Math.round(s)-s)1&&void 0!==arguments[1]?arguments[1]:{};this.isDestroyed||(e.shuffle=this,this.emit(t,e))}},{key:"_resetCols",value:function(){var t=this.cols;for(this.positions=[];t;)t-=1,this.positions.push(0)}},{key:"_layout",value:function(t){var e=this,i=this._getNextPositions(t),s=0;t.forEach((function(t,r){function n(){t.applyCss(x.Css.VISIBLE.after)}if(g.equals(t.point,i[r])&&!t.isHidden)return t.applyCss(x.Css.VISIBLE.before),void n();t.point=i[r],t.scale=x.Scale.VISIBLE,t.isHidden=!1;var a=e.getStylesForTransition(t,x.Css.VISIBLE.before);a.transitionDelay=e._getStaggerAmount(s)+"ms",e._queue.push({item:t,styles:a,callback:n}),s+=1}))}},{key:"_getNextPositions",value:function(t){var e=this;if(this.options.isCentered){var i=t.map((function(t,i){var s=l.getSize(t.element,!0),r=e._getItemPosition(s);return new y(r.x,r.y,s.width,s.height,i)}));return this.getTransformedPositions(i,this.containerWidth)}return t.map((function(t){return e._getItemPosition(l.getSize(t.element,!0))}))}},{key:"_getItemPosition",value:function(t){return function(t){for(var e=t.itemSize,i=t.positions,s=t.gridSize,r=t.total,n=t.threshold,a=t.buffer,o=D(e.width,s,r,n),h=I(i,o,r),l=F(h,a),c=new g(s*l,h[l]),p=h[l]+e.height,d=0;d0&&void 0!==arguments[0]?arguments[0]:this._getConcealedItems(),i=0;e.forEach((function(e){function s(){e.applyCss(x.Css.HIDDEN.after)}if(e.isHidden)return e.applyCss(x.Css.HIDDEN.before),void s();e.scale=x.Scale.HIDDEN,e.isHidden=!0;var r=t.getStylesForTransition(e,x.Css.HIDDEN.before);r.transitionDelay=t._getStaggerAmount(i)+"ms",t._queue.push({item:e,styles:r,callback:s}),i+=1}))}},{key:"_handleResize",value:function(){this.isEnabled&&!this.isDestroyed&&this.update()}},{key:"getStylesForTransition",value:function(t,e){var i=Object.assign({},e);if(this.options.useTransforms){var s=this.options.isRTL?"-":"",r=this.options.roundTransforms?Math.round(t.point.x):t.point.x,n=this.options.roundTransforms?Math.round(t.point.y):t.point.y;i.transform="translate(".concat(s).concat(r,"px, ").concat(n,"px) scale(").concat(t.scale,")")}else this.options.isRTL?i.right=t.point.x+"px":i.left=t.point.x+"px",i.top=t.point.y+"px";return i}},{key:"_whenTransitionDone",value:function(t,e,i){var s=function(t,e){var i=C+(M+=1),s=function(t){t.currentTarget===t.target&&(A(i),e(t))};return t.addEventListener(C,s),w[i]={element:t,listener:s},i}(t,(function(t){e(),i(null,t)}));this._transitions.push(s)}},{key:"_getTransitionFunction",value:function(t){var e=this;return function(i){t.item.applyCss(t.styles),e._whenTransitionDone(t.item.element,t.callback,i)}}},{key:"_processQueue",value:function(){this.isTransitioning&&this._cancelMovement();var t=this.options.speed>0,e=this._queue.length>0;e&&t&&this.isInitialized?this._startTransitions(this._queue):e?(this._styleImmediately(this._queue),this._dispatch(l.EventType.LAYOUT)):this._dispatch(l.EventType.LAYOUT),this._queue.length=0}},{key:"_startTransitions",value:function(t){var e=this;this.isTransitioning=!0,function(t,e,i){i||("function"==typeof e?(i=e,e=null):i=u);var s=t&&t.length;if(!s)return i(null,[]);var r=!1,n=new Array(s);function a(t){return function(e,a){if(!r){if(e)return i(e,n),void(r=!0);n[t]=a,--s||i(null,n)}}}t.forEach(e?function(t,i){t.call(e,a(i))}:function(t,e){t(a(e))})}(t.map((function(t){return e._getTransitionFunction(t)})),this._movementFinished.bind(this))}},{key:"_cancelMovement",value:function(){this._transitions.forEach(A),this._transitions.length=0,this.isTransitioning=!1}},{key:"_styleImmediately",value:function(t){if(t.length){var e=t.map((function(t){return t.item.element}));l._skipTransitions(e,(function(){t.forEach((function(t){t.item.applyCss(t.styles),t.callback()}))}))}}},{key:"_movementFinished",value:function(){this._transitions.length=0,this.isTransitioning=!1,this._dispatch(l.EventType.LAYOUT)}},{key:"filter",value:function(t,e){this.isEnabled&&((!t||t&&0===t.length)&&(t=l.ALL_ITEMS),this._filter(t),this._shrink(),this._updateItemCount(),this.sort(e))}},{key:"sort",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.lastSort;if(this.isEnabled){this._resetCols();var e=k(this._getFilteredItems(),t);this.sortedItems=e,this._layout(e),this._processQueue(),this._setContainerSize(),this.lastSort=t}}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isEnabled&&(t||this._setColumns(),this.sort())}},{key:"layout",value:function(){this.update(!0)}},{key:"add",value:function(t){var e=this,i=R(t).map((function(t){return new x(t,e.options.isRTL)}));this._initItems(i),this._resetCols();var s=k(this._mergeNewItems(i),this.lastSort),r=this._filter(this.lastFilter,s),n=function(t){return i.includes(t)},a=function(t){t.scale=x.Scale.HIDDEN,t.isHidden=!0,t.applyCss(x.Css.HIDDEN.before),t.applyCss(x.Css.HIDDEN.after)},o=this._getNextPositions(r.visible);r.visible.forEach((function(t,i){n(t)&&(t.point=o[i],a(t),t.applyCss(e.getStylesForTransition(t,{})))})),r.hidden.forEach((function(t){n(t)&&a(t)})),this.element.offsetWidth,this.setItemTransitions(i),this.items=this._mergeNewItems(i),this.filter(this.lastFilter)}},{key:"disable",value:function(){this.isEnabled=!1}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.isEnabled=!0,t&&this.update()}},{key:"remove",value:function(t){var e=this;if(t.length){var i=R(t),s=i.map((function(t){return e.getItemByElement(t)})).filter((function(t){return!!t}));this._toggleFilterClasses({visible:[],hidden:s}),this._shrink(s),this.sort(),this.items=this.items.filter((function(t){return!s.includes(t)})),this._updateItemCount(),this.once(l.EventType.LAYOUT,(function(){e._disposeItems(s),i.forEach((function(t){t.parentNode.removeChild(t)})),e._dispatch(l.EventType.REMOVED,{collection:i})}))}}},{key:"getItemByElement",value:function(t){return this.items.find((function(e){return e.element===t}))}},{key:"resetItems",value:function(){var t=this;this._disposeItems(this.items),this.isInitialized=!1,this.items=this._getItems(),this._initItems(this.items),this.once(l.EventType.LAYOUT,(function(){t.setItemTransitions(t.items),t.isInitialized=!0})),this.filter(this.lastFilter)}},{key:"destroy",value:function(){this._cancelMovement(),window.removeEventListener("resize",this._onResize),this.element.classList.remove("shuffle"),this.element.removeAttribute("style"),this._disposeItems(this.items),this.items.length=0,this._transitions.length=0,this.options.sizer=null,this.element=null,this.isDestroyed=!0,this.isEnabled=!1}}],[{key:"getSize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=window.getComputedStyle(t,null),s=S(t,"width",i),r=S(t,"height",i);if(e){var n=S(t,"marginLeft",i),a=S(t,"marginRight",i),o=S(t,"marginTop",i),h=S(t,"marginBottom",i);s+=n+a,r+=o+h}return{width:s,height:r}}},{key:"_skipTransitions",value:function(t,e){var i=t.map((function(t){var e=t.style,i=e.transitionDuration,s=e.transitionDelay;return e.transitionDuration="0ms",e.transitionDelay="0ms",{duration:i,delay:s}}));e(),t[0].offsetWidth,t.forEach((function(t,e){t.style.transitionDuration=i[e].duration,t.style.transitionDelay=i[e].delay}))}}]),l}(p);B.ShuffleItem=x,B.ALL_ITEMS="all",B.FILTER_ATTRIBUTE_KEY="groups",B.EventType={LAYOUT:"shuffle:layout",REMOVED:"shuffle:removed"},B.Classes=v,B.FilterMode={ANY:"any",ALL:"all"},B.options={group:B.ALL_ITEMS,speed:250,easing:"cubic-bezier(0.4, 0.0, 0.2, 1)",itemSelector:"*",sizer:null,gutterWidth:0,columnWidth:0,delimiter:null,buffer:0,columnThreshold:.01,initialSort:null,throttle:function(t,e){var i,s,r,n,a=0;return function(){i=this,s=arguments;var t=new Date-a;return n||(t>=e?o():n=setTimeout(o,e-t)),r};function o(){n=0,a=+new Date,r=t.apply(i,s),i=null,s=null}},throttleTime:300,staggerAmount:15,staggerAmountMax:150,useTransforms:!0,filterMode:B.FilterMode.ANY,isCentered:!1,isRTL:!1,roundTransforms:!0},B.Point=g,B.Rect=y,B.__sorter=k,B.__getColumnSpan=D,B.__getAvailablePositions=I,B.__getShortColumn=F,B.__getCenteredPositions=L;const V=B,z=(t,e)=>{let i="overall",s="overall",r="all";const n=document.getElementById("mobile-filters-categories"),a=document.getElementById("mobile-filters-indicators");for(let t of n.children)t.addEventListener("click",(function(){this.parentElement.classList.toggle("open"),h(),this.classList.add("selected"),"overall"!=this.children[0].value?(n.parentElement.classList.add("show-indicators"),s!=this.children[0].value&&(s=this.children[0].value,i=this.children[0].value,o())):(n.parentElement.classList.remove("show-indicators"),s=this.children[0].value,i=this.children[0].value),l()}));for(let t of a.children){const e=t.children[0].children;for(let t of e)t.addEventListener("click",(function(){for(let t of e)t.classList.remove("selected");this.classList.add("selected"),r=this.children[0].value,i=this.children[0].value,this.parentElement.parentElement.parentElement.classList.toggle("open"),l()}))}function o(){for(let t of a.children){for(let e of t.children[0].children)e.classList.remove("selected");t.className==s?(t.classList.add("selected"),t.children[0].children[0].classList.add("selected")):t.classList.remove("selected")}}function h(){for(let t of n.children)t.classList.remove("selected")}function l(){t(i),e()}},N=(t,e)=>{const i=document.getElementById("ba-filters").querySelector(".overall"),s=document.getElementById("breakdown"),r=document.getElementsByClassName("circ-cat"),n=document.getElementsByClassName("indicator");i.addEventListener("click",(function(){a(n),a(r),this.parentElement.classList.add("active"),t(this.value),s.classList.add("show"),e()}));for(let o of r)o.addEventListener("click",(function(){a(r),this.parentElement.classList.add("active"),a(n),this.parentElement.children[1].children[1].classList.add("active"),i.parentElement.classList.remove("active"),t(this.value),e(),s.classList.remove("show")}));for(let r of n)r.addEventListener("click",(function(){a(n),this.parentElement.classList.add("active"),this.classList.contains("overall")||i.classList.remove(),t(this.value),e(),s.classList.remove("show")}));function a(t){for(let e of t)e.parentElement.classList.contains("active")&&e.parentElement.classList.remove("active")}},H=(t,e)=>{if(history.pushState){let s="";e&&(s=`?${t}=${e}`);var i=window.location.protocol+"//"+window.location.host+window.location.pathname+s;window.history.pushState({path:i},"",i)}};function G(){}const j=function(){let t=0;return function(){return t++}}();function W(t){return null==t}function q(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 $(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const Y=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function U(t,e){return Y(t)?t:e}function X(t,e){return void 0===t?e:t}const K=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function J(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function Z(t,e,i,s){let r,n,a;if(q(t))if(n=t.length,s)for(r=n-1;r>=0;r--)e.call(i,t[r],r);else for(r=0;rt,x:t=>t.x,y:t=>t.y};function ot(t,e){return(at[e]||(at[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)))(t)}function ht(t){return t.charAt(0).toUpperCase()+t.slice(1)}const lt=t=>void 0!==t,ct=t=>"function"==typeof t,pt=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},dt=Math.PI,ft=2*dt,ut=ft+dt,mt=Number.POSITIVE_INFINITY,gt=dt/180,yt=dt/2,vt=dt/4,bt=2*dt/3,xt=Math.log10,_t=Math.sign;function Et(t){const e=Math.round(t);t=Pt(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(xt(t))),s=t/i;return(s<=1?1:s<=2?2:s<=5?5:10)*i}function St(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Pt(t,e,i){return Math.abs(t-e)h&&l=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function Ot(t,e,i){i=i||(i=>t[i]1;)s=n+r>>1,i(s)?n=s:r=s;return{lo:n,hi:r}}const Bt=(t,e,i,s)=>Ot(t,i,s?s=>t[s][e]<=i:s=>t[s][e]Ot(t,i,(s=>t[s][e]>=i)),zt=["push","pop","shift","splice","unshift"];function Nt(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,r=s.indexOf(e);-1!==r&&s.splice(r,1),s.length>0||(zt.forEach((e=>{delete t[e]})),delete t._chartjs)}function Ht(t){const e=new Set;let i,s;for(i=0,s=t.length;iArray.prototype.slice.call(t));let r=!1,n=[];return function(...i){n=s(i),r||(r=!0,Gt.call(window,(()=>{r=!1,t.apply(e,n)})))}}const Wt=t=>"start"===t?"left":"end"===t?"right":"center",qt=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function $t(t,e,i){const s=e.length;let r=0,n=s;if(t._sorted){const{iScale:a,_parsed:o}=t,h=a.axis,{min:l,max:c,minDefined:p,maxDefined:d}=a.getUserBounds();p&&(r=Lt(Math.min(Bt(o,a.axis,l).lo,i?s:Bt(e,h,a.getPixelForValue(l)).lo),0,s-1)),n=d?Lt(Math.max(Bt(o,a.axis,c,!0).hi+1,i?0:Bt(e,h,a.getPixelForValue(c),!0).hi+1),r,s)-r:s-r}return{start:r,count:n}}function Yt(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,r={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=r,!0;const n=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,r),n}const Ut=t=>0===t||1===t,Xt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*ft/i),Kt=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*ft/i)+1,Jt={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*yt),easeOutSine:t=>Math.sin(t*yt),easeInOutSine:t=>-.5*(Math.cos(dt*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=>Ut(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=>Ut(t)?t:Xt(t,.075,.3),easeOutElastic:t=>Ut(t)?t:Kt(t,.075,.3),easeInOutElastic(t){const e=.1125;return Ut(t)?t:t<.5?.5*Xt(2*t,e,.45):.5+.5*Kt(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-Jt.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*Jt.easeInBounce(2*t):.5*Jt.easeOutBounce(2*t-1)+.5};function Zt(t){return t+.5|0}const Qt=(t,e,i)=>Math.max(Math.min(t,i),e);function te(t){return Qt(Zt(2.55*t),0,255)}function ee(t){return Qt(Zt(255*t),0,255)}function ie(t){return Qt(Zt(t/2.55)/100,0,1)}function se(t){return Qt(Zt(100*t),0,100)}const re={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},ne=[..."0123456789ABCDEF"],ae=t=>ne[15&t],oe=t=>ne[(240&t)>>4]+ne[15&t],he=t=>(240&t)>>4==(15&t);const le=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ce(t,e,i){const s=e*Math.min(i,1-i),r=(e,r=(e+t/30)%12)=>i-s*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function pe(t,e,i){const s=(s,r=(s+t/60)%6)=>i-i*e*Math.max(Math.min(r,4-r,1),0);return[s(5),s(3),s(1)]}function de(t,e,i){const s=ce(t,1,.5);let r;for(e+i>1&&(r=1/(e+i),e*=r,i*=r),r=0;r<3;r++)s[r]*=1-e-i,s[r]+=e;return s}function fe(t){const e=t.r/255,i=t.g/255,s=t.b/255,r=Math.max(e,i,s),n=Math.min(e,i,s),a=(r+n)/2;let o,h,l;return r!==n&&(l=r-n,h=a>.5?l/(2-r-n):l/(r+n),o=function(t,e,i,s,r){return t===r?(e-i)/s+(et<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,Ee=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Se(t,e,i){if(t){let s=fe(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=me(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function Pe(t,e){return t?Object.assign(e||{},t):t}function ke(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=ee(t[3]))):(e=Pe(t,{r:0,g:0,b:0,a:1})).a=ee(e.a),e}function we(t){return"r"===t.charAt(0)?function(t){const e=xe.exec(t);let i,s,r,n=255;if(e){if(e[7]!==i){const t=+e[7];n=e[8]?te(t):Qt(255*t,0,255)}return i=+e[1],s=+e[3],r=+e[5],i=255&(e[2]?te(i):Qt(i,0,255)),s=255&(e[4]?te(s):Qt(s,0,255)),r=255&(e[6]?te(r):Qt(r,0,255)),{r:i,g:s,b:r,a:n}}}(t):function(t){const e=le.exec(t);let i,s=255;if(!e)return;e[5]!==i&&(s=e[6]?te(+e[5]):ee(+e[5]));const r=ge(+e[2]),n=+e[3]/100,a=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return ue(de,t,e,i)}(r,n,a):"hsv"===e[1]?function(t,e,i){return ue(pe,t,e,i)}(r,n,a):me(r,n,a),{r:i[0],g:i[1],b:i[2],a:s}}(t)}class Ce{constructor(t){if(t instanceof Ce)return t;const e=typeof t;let i;var s,r,n;"object"===e?i=ke(t):"string"===e&&(n=(s=t).length,"#"===s[0]&&(4===n||5===n?r={r:255&17*re[s[1]],g:255&17*re[s[2]],b:255&17*re[s[3]],a:5===n?17*re[s[4]]:255}:7!==n&&9!==n||(r={r:re[s[1]]<<4|re[s[2]],g:re[s[3]]<<4|re[s[4]],b:re[s[5]]<<4|re[s[6]],a:9===n?re[s[7]]<<4|re[s[8]]:255})),i=r||function(t){be||(be=function(){const t={},e=Object.keys(ve),i=Object.keys(ye);let s,r,n,a,o;for(s=0;s>16&255,n>>8&255,255&n]}return t}(),be.transparent=[0,0,0,0]);const e=be[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||we(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Pe(this._rgb);return t&&(t.a=ie(t.a)),t}set rgb(t){this._rgb=ke(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${ie(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?(t=this._rgb,e=(t=>he(t.r)&&he(t.g)&&he(t.b)&&he(t.a))(t)?ae:oe,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=fe(t),i=e[0],s=se(e[1]),r=se(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${r}%, ${ie(t.a)})`:`hsl(${i}, ${s}%, ${r}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let r;const n=e===r?.5:e,a=2*n-1,o=i.a-s.a,h=((a*o==-1?a:(a+o)/(1+a*o))+1)/2;r=1-h,i.r=255&h*i.r+r*s.r+.5,i.g=255&h*i.g+r*s.g+.5,i.b=255&h*i.b+r*s.b+.5,i.a=n*i.a+(1-n)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const s=Ee(ie(t.r)),r=Ee(ie(t.g)),n=Ee(ie(t.b));return{r:ee(_e(s+i*(Ee(ie(e.r))-s))),g:ee(_e(r+i*(Ee(ie(e.g))-r))),b:ee(_e(n+i*(Ee(ie(e.b))-n))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new Ce(this.rgb)}alpha(t){return this._rgb.a=ee(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=Zt(.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 Se(this._rgb,2,t),this}darken(t){return Se(this._rgb,2,-t),this}saturate(t){return Se(this._rgb,1,t),this}desaturate(t){return Se(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=fe(t);i[0]=ge(i[0]+e),i=me(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function Me(t){return new Ce(t)}function Ae(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Te(t){return Ae(t)?t:Me(t)}function De(t){return Ae(t)?t:Me(t).saturate(.5).darken(.1).hexString()}const Ie=Object.create(null),Fe=Object.create(null);function Le(t,e){if(!e)return t;const i=e.split(".");for(let e=0,s=i.length;et.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)=>De(e.backgroundColor),this.hoverBorderColor=(t,e)=>De(e.borderColor),this.hoverColor=(t,e)=>De(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)}set(t,e){return Re(this,t,e)}get(t){return Le(this,t)}describe(t,e){return Re(Fe,t,e)}override(t,e){return Re(Ie,t,e)}route(t,e,i,s){const r=Le(this,t),n=Le(this,i),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=n[s];return $(t)?Object.assign({},e,t):X(t,e)},set(t){this[a]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function Be(t,e,i,s,r){let n=e[r];return n||(n=e[r]=t.measureText(r).width,i.push(r)),n>s&&(s=n),s}function Ve(t,e,i,s){let r=(s=s||{}).data=s.data||{},n=s.garbageCollect=s.garbageCollect||[];s.font!==e&&(r=s.data={},n=s.garbageCollect=[],s.font=e),t.save(),t.font=e;let a=0;const o=i.length;let h,l,c,p,d;for(h=0;hi.length){for(h=0;h0&&t.stroke()}}function je(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==n.strokeColor;let h,l;for(t.save(),t.font=r.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),W(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,n),h=0;hX(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of r)i[t]=+n(t)||0;return i}function ei(t){return ti(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ii(t){return ti(t,["topLeft","topRight","bottomLeft","bottomRight"])}function si(t){const e=ei(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ri(t,e){t=t||{},e=e||Oe.font;let i=X(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=X(t.style,e.style);s&&!(""+s).match(Ze)&&(console.warn('Invalid font style specified: "'+s+'"'),s="");const r={family:X(t.family,e.family),lineHeight:Qe(X(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:X(t.weight,e.weight),string:""};return r.string=function(t){return!t||W(t.size)||W(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function ni(t,e,i,s){let r,n,a,o=!0;for(r=0,n=t.length;rt[0])){lt(s)||(s=vi("_fallback",t));const n={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:s,_getTarget:r,override:r=>oi([r,...t],e,i,s)};return new Proxy(n,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>di(i,s,(()=>function(t,e,i,s){let r;for(const n of e)if(r=vi(ci(n,t),i),lt(r))return pi(t,r)?gi(i,s,t,r):r}(s,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>bi(t).includes(e),ownKeys:t=>bi(t),set(t,e,i){const s=t._storage||(t._storage=r());return t[e]=s[e]=i,delete t._keys,!0}})}function hi(t,e,i,s){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:li(t,s),setContext:e=>hi(t,e,i,s),override:r=>hi(t.override(r),e,i,s)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>di(t,e,(()=>function(t,e,i){const{_proxy:s,_context:r,_subProxy:n,_descriptors:a}=t;let o=s[e];return ct(o)&&a.isScriptable(e)&&(o=function(t,e,i,s){const{_proxy:r,_context:n,_subProxy:a,_stack:o}=i;if(o.has(t))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+t);return o.add(t),e=e(n,a||s),o.delete(t),pi(t,e)&&(e=gi(r._scopes,r,t,e)),e}(e,o,t,i)),q(o)&&o.length&&(o=function(t,e,i,s){const{_proxy:r,_context:n,_subProxy:a,_descriptors:o}=i;if(lt(n.index)&&s(t))e=e[n.index%e.length];else if($(e[0])){const i=e,s=r._scopes.filter((t=>t!==i));e=[];for(const h of i){const i=gi(s,r,t,h);e.push(hi(i,n,a&&a[t],o))}}return e}(e,o,t,a.isIndexable)),pi(e,o)&&(o=hi(o,r,n&&n[e],a)),o}(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 li(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:i,indexable:s,isScriptable:ct(i)?i:()=>i,isIndexable:ct(s)?s:()=>s}}const ci=(t,e)=>t?t+ht(e):e,pi=(t,e)=>$(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function di(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const s=i();return t[e]=s,s}function fi(t,e,i){return ct(t)?t(e,i):t}const ui=(t,e)=>!0===t?e:"string"==typeof t?ot(e,t):void 0;function mi(t,e,i,s,r){for(const n of e){const e=ui(i,n);if(e){t.add(e);const n=fi(e._fallback,i,r);if(lt(n)&&n!==i&&n!==s)return n}else if(!1===e&<(s)&&i!==s)return null}return!1}function gi(t,e,i,s){const r=e._rootScopes,n=fi(e._fallback,i,s),a=[...t,...r],o=new Set;o.add(s);let h=yi(o,a,i,n||i,s);return null!==h&&(!lt(n)||n===i||(h=yi(o,a,n,h,s),null!==h))&&oi(Array.from(o),[""],r,n,(()=>function(t,e,i){const s=t._getTarget();e in s||(s[e]={});const r=s[e];return q(r)&&$(i)?i:r}(e,i,s)))}function yi(t,e,i,s,r){for(;i;)i=mi(t,e,i,s,r);return i}function vi(t,e){for(const i of e){if(!i)continue;const e=i[t];if(lt(e))return e}}function bi(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 xi(t,e,i,s){const{iScale:r}=t,{key:n="r"}=this._parsing,a=new Array(s);let o,h,l,c;for(o=0,h=s;oe"x"===t?"y":"x";function Pi(t,e,i,s){const r=t.skip?e:t,n=e,a=i.skip?e:i,o=Tt(n,r),h=Tt(a,n);let l=o/(o+h),c=h/(o+h);l=isNaN(l)?0:l,c=isNaN(c)?0:c;const p=s*l,d=s*c;return{previous:{x:n.x-p*(a.x-r.x),y:n.y-p*(a.y-r.y)},next:{x:n.x+d*(a.x-r.x),y:n.y+d*(a.y-r.y)}}}function ki(t,e,i){return Math.max(Math.min(t,i),e)}function wi(t,e,i,s,r){let n,a,o,h;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Si(e),s=t.length,r=Array(s).fill(0),n=Array(s);let a,o,h,l=Ei(t,0);for(a=0;awindow.getComputedStyle(t,null),Di=["top","right","bottom","left"];function Ii(t,e,i){const s={};i=i?"-"+i:"";for(let r=0;r<4;r++){const n=Di[r];s[n]=parseFloat(t[e+"-"+n+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}function Fi(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,r=Ti(i),n="border-box"===r.boxSizing,a=Ii(r,"padding"),o=Ii(r,"border","width"),{x:h,y:l,box:c}=function(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:r,offsetY:n}=s;let a,o,h=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(r,n,t.target))a=r,o=n;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,o=s.clientY-t.top,h=!0}return{x:a,y:o,box:h}}(t,i),p=a.left+(c&&o.left),d=a.top+(c&&o.top);let{width:f,height:u}=e;return n&&(f-=a.width+o.width,u-=a.height+o.height),{x:Math.round((h-p)/f*i.width/s),y:Math.round((l-d)/u*i.height/s)}}const Li=t=>Math.round(10*t)/10;function Ri(t,e,i){const s=e||1,r=Math.floor(t.height*s),n=Math.floor(t.width*s);t.height=r/s,t.width=n/s;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!==r||a.width!==n)&&(t.currentDevicePixelRatio=s,a.height=r,a.width=n,t.ctx.setTransform(s,0,0,s,0,0),!0)}const Oi=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Bi(t,e){const i=function(t,e){return Ti(t).getPropertyValue(e)}(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Vi(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function zi(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 Ni(t,e,i,s){const r={x:t.cp2x,y:t.cp2y},n={x:e.cp1x,y:e.cp1y},a=Vi(t,r,i),o=Vi(r,n,i),h=Vi(n,e,i),l=Vi(a,o,i),c=Vi(o,h,i);return Vi(l,c,i)}const Hi=new Map;function Gi(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let s=Hi.get(i);return s||(s=new Intl.NumberFormat(t,e),Hi.set(i,s)),s}(e,i).format(t)}function ji(t,e,i){return t?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}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Wi(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 qi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function $i(t){return"angle"===t?{between:Ft,compare:Dt,normalize:It}:{between:Rt,compare:(t,e)=>t-e,normalize:t=>t}}function Yi({start:t,end:e,count:i,loop:s,style:r}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:r}}function Ui(t,e,i){if(!i)return[t];const{property:s,start:r,end:n}=i,a=e.length,{compare:o,between:h,normalize:l}=$i(s),{start:c,end:p,loop:d,style:f}=function(t,e,i){const{property:s,start:r,end:n}=i,{between:a,normalize:o}=$i(s),h=e.length;let l,c,{start:p,end:d,loop:f}=t;if(f){for(p+=h,d+=h,l=0,c=h;ls({chart:t,initial:e.initial,numSteps:n,currentStep:Math.min(i-e.start,n)})))}_refresh(){this._request||(this._running=!0,this._request=Gt.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 r=i.items;let n,a=r.length-1,o=!1;for(;a>=0;--a)n=r[a],n._active?(n._total>i.duration&&(i.duration=n._total),n.tick(t),o=!0):(r[a]=r[r.length-1],r.pop());o&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=r.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)}};const Qi="transparent",ts={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const s=Te(t||Qi),r=s.valid&&Te(e||Qi);return r&&r.valid?r.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class es{constructor(t,e,i,s){const r=e[i];s=ni([t.to,s,r,t.from]);const n=ni([t.from,r,s]);this._active=!0,this._fn=t.fn||ts[t.type||typeof n],this._easing=Jt[t.easing]||Jt.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=n,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,n=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(n,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=ni([t.to,e,s,t.from]),this._from=ni([t.from,s,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,r=this._from,n=this._loop,a=this._to;let o;if(this._active=r!==a&&(n||e1?2-o:o,o=this._easing(Math.min(1,Math.max(0,o))),this._target[s]=this._fn(r,a,o))}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"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),Oe.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),Oe.describe("animations",{_fallback:"animation"}),Oe.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}}}});class ss{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!$(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach((i=>{const s=t[i];if(!$(s))return;const r={};for(const t of is)r[t]=s[t];(q(s.properties)&&s.properties||[i]).forEach((t=>{t!==i&&e.has(t)||e.set(t,r)}))}))}_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 r=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e{t.options=i}),(()=>{})),r}_createAnimations(t,e){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),n=Object.keys(e),a=Date.now();let o;for(o=n.length-1;o>=0;--o){const h=n[o];if("$"===h.charAt(0))continue;if("options"===h){s.push(...this._animateOptions(t,e));continue}const l=e[h];let c=r[h];const p=i.get(h);if(c){if(p&&c.active()){c.update(p,l,a);continue}c.cancel()}p&&p.duration?(r[h]=c=new es(p,t,h,l),s.push(c)):t[h]=l}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?(Zi.add(this._chart,i),!0):void 0}}function rs(t,e){const i=t&&t.options||{},s=i.reverse,r=void 0===i.min?e:0,n=void 0===i.max?e:0;return{start:s?n:r,end:s?r:n}}function ns(t,e){const i=[],s=t._getSortedDatasetMetas(e);let r,n;for(r=0,n=s.length;r0||!i&&e<0)return r.index}return null}function cs(t,e){const{chart:i,_cachedMeta:s}=t,r=i._stacks||(i._stacks={}),{iScale:n,vScale:a,index:o}=s,h=n.axis,l=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(n,a,s),p=e.length;let d;for(let t=0;ti[t].axis===e)).shift()}function ds(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]}}}const fs=t=>"reset"===t||"none"===t,us=(t,e)=>e?t:Object.assign({},t);class ms{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.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=os(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&ds(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,r=e.xAxisID=X(i.xAxisID,ps(t,"x")),n=e.yAxisID=X(i.yAxisID,ps(t,"y")),a=e.rAxisID=X(i.rAxisID,ps(t,"r")),o=e.indexAxis,h=e.iAxisID=s(o,r,n,a),l=e.vAxisID=s(o,n,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(n),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(l)}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&&Nt(this._data,this),t._stacked&&ds(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if($(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let s,r,n;for(s=0,r=e.length;s{const e="_onData"+ht(t),i=s[t];Object.defineProperty(s,t,{configurable:!0,enumerable:!1,value(...t){const r=i.apply(this,t);return s._chartjs.listeners.forEach((i=>{"function"==typeof i[e]&&i[e](...t)})),r}})})))),this._syncList=[],this._data=e}var s}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 r=e._stacked;e._stacked=os(e.vScale,e),e.stack!==i.stack&&(s=!0,ds(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&cs(this,e._parsed)}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:s}=this,{iScale:r,_stacked:n}=i,a=r.axis;let o,h,l,c=0===t&&e===s.length||i._sorted,p=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,l=s;else{l=q(s[t])?this.parseArrayData(i,s,t,e):$(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const r=()=>null===h[a]||p&&h[a]t&&!e.hidden&&e._stacked&&{keys:ns(i,!0),values:null})(e,i,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:l,max:c}=function(t){const{min:e,max:i,minDefined:s,maxDefined:r}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:r?i:Number.POSITIVE_INFINITY}}(a);let p,d;function f(){d=s[p];const e=d[a.axis];return!Y(d[t.axis])||l>e||c=0;--p)if(!f()){this.updateRangeFromParsed(h,t,d,o);break}return h}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,n;for(s=0,r=e.length;s=0&&tthis.getContext(i,s)),c);return f.$shared&&(f.$shared=o,r[n]=Object.freeze(us(f,o))),f}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,n=`animation-${e}`,a=r[n];if(a)return a;let o;if(!1!==s.options.animation){const s=this.chart.config,r=s.datasetAnimationScopeKeys(this._type,e),n=s.getOptionScopes(this.getDataset(),r);o=s.createResolver(n,this.getContext(t,i,e))}const h=new ss(s,o&&o.animations);return o&&o._cacheable&&(r[n]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||fs(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),n=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:n}}updateElement(t,e,i,s){fs(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!fs(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}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,r=e.length,n=Math.min(r,s);n&&this.parse(0,n),r>s?this._insertElements(s,r-s,t):r{for(t.length+=e,a=t.length-1;a>=n;a--)t[a]=t[a-e]};for(o(r),a=t;at-e)))}return t._cache.$bar}(e,t.type);let s,r,n,a,o=e._length;const h=()=>{32767!==n&&-32768!==n&&(lt(a)&&(o=Math.min(o,Math.abs(n-a)||o)),a=n)};for(s=0,r=i.length;sMath.abs(o)&&(h=o,l=a),e[i.axis]=l,e._custom={barStart:h,barEnd:l,start:r,end:n,min:a,max:o}}(t,e,i,s):e[i.axis]=i.parse(t,s),e}function vs(t,e,i,s){const r=t.iScale,n=t.vScale,a=r.getLabels(),o=r===n,h=[];let l,c,p,d;for(l=i,c=i+s;lt.x,i="left",s="right"):(e=t.baset.controller.options.grouped)),r=i.options.stacked,n=[],a=t=>{const i=t.controller.getParsed(e),s=i&&i[t.vScale.axis];if(W(s)||isNaN(s))return!0};for(const i of s)if((void 0===e||!a(i))&&((!1===r||-1===n.indexOf(i.stack)||void 0===r&&void 0===i.stack)&&n.push(i.stack),i.index===t))break;return n.length||n.push(void 0),n}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=void 0!==e?s.indexOf(e):-1;return-1===r?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,n;for(r=0,n=e.data.length;r=i?1:-1)}(c,e,n)*r,p===n&&(m-=c/2);const t=e.getPixelForDecimal(0),i=e.getPixelForDecimal(1),s=Math.min(t,i),a=Math.max(t,i);m=Math.max(Math.min(m,a),s),l=m+c}if(m===e.getPixelForValue(n)){const t=_t(c)*e.getLineWidthForValue(n)/2;m+=t,c-=t}return{size:c,base:m,head:l,center:l+c/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,n=X(s.maxBarThickness,1/0);let a,o;if(e.grouped){const i=r?this._getStackCount(t):e.stackCount,h="flex"===s.barThickness?function(t,e,i,s){const r=e.pixels,n=r[t];let a=t>0?r[t-1]:null,o=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:s}=e,r=this.getParsed(t),n=i.getLabelForValue(r.x),a=s.getLabelForValue(r.y),o=r._custom;return{label:e.label,value:"("+n+", "+a+(o?", "+o:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const r="reset"===s,{iScale:n,vScale:a}=this._cachedMeta,{sharedOptions:o,includeOptions:h}=this._getSharedOptions(e,s),l=n.axis,c=a.axis;for(let p=e;p""}}}};class ws extends ms{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let r,n,a=t=>+i[t];if($(i[t])){const{key:t="value"}=this._parsing;a=e=>+ot(i[e],t)}for(r=t,n=t+e;r"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e)(this.options.cutout,a),1),h=this._getRingWeight(this.index),{circumference:l,rotation:c}=this._getRotationExtents(),{ratioX:p,ratioY:d,offsetX:f,offsetY:u}=function(t,e,i){let s=1,r=1,n=0,a=0;if(eFt(t,o,h,!0)?1:Math.max(e,e*i,s,s*i),u=(t,e,s)=>Ft(t,o,h,!0)?-1:Math.min(e,e*i,s,s*i),m=f(0,l,p),g=f(yt,c,d),y=u(dt,l,p),v=u(dt+yt,c,d);s=(m-y)/2,r=(g-v)/2,n=-(m+y)/2,a=-(g+v)/2}return{ratioX:s,ratioY:r,offsetX:n,offsetY:a}}(c,l,o),m=(i.width-n)/p,g=(i.height-n)/d,y=Math.max(Math.min(m,g)/2,0),v=K(this.options.radius,y),b=(v-Math.max(v*o,0))/this._getVisibleDatasetWeightTotal();this.offsetX=f*v,this.offsetY=u*v,s.total=this.calculateTotal(),this.outerRadius=v-b*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-b*h,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/ft)}updateElements(t,e,i,s){const r="reset"===s,n=this.chart,a=n.chartArea,o=n.options.animation,h=(a.left+a.right)/2,l=(a.top+a.bottom)/2,c=r&&o.animateScale,p=c?0:this.innerRadius,d=c?0:this.outerRadius,{sharedOptions:f,includeOptions:u}=this._getSharedOptions(e,s);let m,g=this._getRotation();for(m=0;m0&&!isNaN(t)?ft*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Gi(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,n,a,o;if(!t)for(s=0,r=i.data.datasets.length;s"spacing"!==t,_indexable:t=>"spacing"!==t},ws.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,s)=>{const r=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return q(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class Cs extends ms{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,n=this.chart._animationsDisabled;let{start:a,count:o}=$t(e,s,n);this._drawStart=a,this._drawCount=o,Yt(e)&&(a=0,o=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(i,void 0,{animated:!n,options:h},t),this.updateElements(s,a,o,t)}updateElements(t,e,i,s){const r="reset"===s,{iScale:n,vScale:a,_stacked:o,_dataset:h}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),p=n.axis,d=a.axis,{spanGaps:f,segment:u}=this.options,m=St(f)?f:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||r||"none"===s;let y=e>0&&this.getParsed(e-1);for(let f=e;f0&&Math.abs(i[p]-y[p])>m,u&&(v.parsed=i,v.raw=h.data[f]),c&&(v.options=l||this.resolveDataElementOptions(f,e.active?"active":s)),g||this.updateElement(e,f,v,s),y=i}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),n=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,n)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Cs.id="line",Cs.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Cs.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Ms extends ms{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Gi(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return xi.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(se.max&&(e.max=s))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),n=(r-Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=r-n*this.index,this.innerRadius=this.outerRadius-n}updateElements(t,e,i,s){const r="reset"===s,n=this.chart,a=n.options.animation,o=this._cachedMeta.rScale,h=o.xCenter,l=o.yCenter,c=o.getIndexAngle(0)-.5*dt;let p,d=c;const f=360/this.countVisibleElements();for(p=0;p{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?wt(this.resolveDataElementOptions(t,e).angle||i):0}}Ms.id="polarArea",Ms.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Ms.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,s)=>{const r=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class As extends ws{}As.id="pie",As.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Ts extends ms{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return xi.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const n={_loop:!0,_fullLoop:r.length===s.length,options:e};this.updateElement(i,void 0,n,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,n="reset"===s;for(let a=e;a{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),s}}Ds.defaults={},Ds.defaultRoutes=void 0;const Is={values:t=>q(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let r,n=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)&&(r="scientific"),n=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=xt(Math.abs(n)),o=Math.max(Math.min(-1*Math.floor(a),20),0),h={notation:r,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(h,this.options.ticks.format),Gi(t,s,h)},logarithmic(t,e,i){if(0===t)return"0";const s=t/Math.pow(10,Math.floor(xt(t)));return 1===s||2===s||5===s?Is.numeric.call(this,t,e,i):""}};var Fs={formatters:Is};function Ls(t,e,i,s,r){const n=X(s,0),a=Math.min(X(r,t.length),t.length);let o,h,l,c=0;for(i=Math.ceil(i),r&&(o=r-s,i=o/Math.floor(o/i)),l=n;l<0;)c++,l=Math.round(n+c*i);for(h=Math.max(n,0);he.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:Fs.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Oe.route("scale.ticks","color","","color"),Oe.route("scale.grid","color","","borderColor"),Oe.route("scale.grid","borderColor","","borderColor"),Oe.route("scale.title","color","","color"),Oe.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),Oe.describe("scales",{_fallback:"scale"}),Oe.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Rs=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Os(t,e){const i=[],s=t.length/e,r=t.length;let n=0;for(;na+o)))return l}function Vs(t){return t.drawTicks?t.tickLength:0}function zs(t,e){if(!t.display)return 0;const i=ri(t.font,e),s=si(t.padding);return(q(t.text)?t.text.length:1)*i.lineHeight+s.height}function Ns(t,e,i){let s=Wt(t);return(i&&"right"!==e||!i&&"right"===e)&&(s=(t=>"left"===t?"right":"right"===t?"left":t)(s)),s}class Hs extends Ds{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:s}=this;return t=U(t,Number.POSITIVE_INFINITY),e=U(e,Number.NEGATIVE_INFINITY),i=U(i,Number.POSITIVE_INFINITY),s=U(s,Number.NEGATIVE_INFINITY),{min:U(t,i),max:U(e,s),minDefined:Y(t),maxDefined:Y(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:r,maxDefined:n}=this.getUserBounds();if(r&&n)return{min:i,max:s};const a=this.getMatchingVisibleMetas();for(let o=0,h=a.length;os?s:i,s=r&&i>s?i:s,{min:U(i,U(s,i)),max:U(s,U(i,s))}}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||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){J(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:r,ticks:n}=this.options,a=n.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:s,max:r}=t,n=K(e,(r-s)/2),a=(t,e)=>i&&0===t?0:t+e;return{min:a(s,-Math.abs(n)),max:a(r,n)}}(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const o=as)return function(t,e,i,s){let r,n=0,a=i[0];for(s=Math.ceil(s),r=0;rt-e)).pop(),e}(s);for(let t=0,e=n.length-1;tr)return e}return Math.max(r,1)}(r,e,s);if(n>0){let t,i;const s=n>1?Math.round((o-a)/(n-1)):null;for(Ls(e,h,l,W(s)?0:a-s,a),t=0,i=n-1;t=r||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const l=this._getLabelSizes(),c=l.widest.width,p=l.highest.height,d=Lt(this.chart.width-c,0,this.maxWidth);n=t.offset?this.maxWidth/i:d/(i-1),c+6>n&&(n=d/(i-(t.offset?.5:1)),a=this.maxHeight-Vs(t.grid)-e.padding-zs(t.title,this.chart.options.font),o=Math.sqrt(c*c+p*p),h=Ct(Math.min(Math.asin(Lt((l.highest.height+6)/n,-1,1)),Math.asin(Lt(a/o,-1,1))-Math.asin(Lt(p/o,-1,1)))),h=Math.max(s,Math.min(r,h))),this.labelRotation=h}afterCalculateLabelRotation(){J(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){J(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:r}}=this,n=this._isVisible(),a=this.isHorizontal();if(n){const n=zs(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Vs(r)+n):(t.height=this.maxHeight,t.width=Vs(r)+n),i.display&&this.ticks.length){const{first:e,last:s,widest:r,highest:n}=this._getLabelSizes(),o=2*i.padding,h=wt(this.labelRotation),l=Math.cos(h),c=Math.sin(h);if(a){const e=i.mirror?0:c*r.width+l*n.height;t.height=Math.min(this.maxHeight,t.height+e+o)}else{const e=i.mirror?0:l*r.width+c*n.height;t.width=Math.min(this.maxWidth,t.width+e+o)}this._calculatePadding(e,s,c,l)}}this._handleMargins(),a?(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:r,padding:n},position:a}=this.options,o=0!==this.labelRotation,h="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,p=0;o?h?(c=s*t.width,p=i*e.height):(c=i*t.height,p=s*e.width):"start"===r?p=e.width:"end"===r?c=t.width:"inner"!==r&&(c=t.width/2,p=e.width/2),this.paddingLeft=Math.max((c-a+n)*this.width/(this.width-a),0),this.paddingRight=Math.max((p-l+n)*this.width/(this.width-l),0)}else{let i=e.height/2,s=t.height/2;"start"===r?(i=0,s=t.height):"end"===r&&(i=e.height,s=0),this.paddingTop=i+n,this.paddingBottom=s+n}}_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(){J(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{const i=t.gc,s=i.length/2;let r;if(s>e){for(r=0;r({width:r[t]||0,height:n[t]||0});return{first:_(0),last:_(e-1),widest:_(b),highest:_(x),widths:r,heights:n}}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 function(t){return Lt(t,-32768,32767)}(this._alignToPixels?ze(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&&ta*s?a/i:o/s:o*s0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:r,position:n}=s,a=r.offset,o=this.isHorizontal(),h=this.ticks.length+(a?1:0),l=Vs(r),c=[],p=r.setContext(this.getContext()),d=p.drawBorder?p.borderWidth:0,f=d/2,u=function(t){return ze(i,t,d)};let m,g,y,v,b,x,_,E,S,P,k,w;if("top"===n)m=u(this.bottom),x=this.bottom-l,E=m-f,P=u(t.top)+f,w=t.bottom;else if("bottom"===n)m=u(this.top),P=t.top,w=u(t.bottom)-f,x=m+f,E=this.top+l;else if("left"===n)m=u(this.right),b=this.right-l,_=m-f,S=u(t.left)+f,k=t.right;else if("right"===n)m=u(this.left),S=t.left,k=u(t.right)-f,b=m+f,_=this.left+l;else if("x"===e){if("center"===n)m=u((t.top+t.bottom)/2+.5);else if($(n)){const t=Object.keys(n)[0],e=n[t];m=u(this.chart.scales[t].getPixelForValue(e))}P=t.top,w=t.bottom,x=m+f,E=x+l}else if("y"===e){if("center"===n)m=u((t.left+t.right)/2);else if($(n)){const t=Object.keys(n)[0],e=n[t];m=u(this.chart.scales[t].getPixelForValue(e))}b=m-f,_=b-l,S=t.left,k=t.right}const C=X(s.ticks.maxTicksLimit,h),M=Math.max(1,Math.ceil(h/C));for(g=0;ge.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 r,n;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(r=0,n=s.length;r{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,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 r,n;for(r=0,n=e.length;r{const s=i.split("."),r=s.pop(),n=[t].concat(s).join("."),a=e[i].split("."),o=a.pop(),h=a.join(".");Oe.route(n,r,h,o)}))}(e,t.defaultRoutes),t.descriptors&&Oe.describe(e,t.descriptors)}(t,n,i),this.override&&Oe.override(t.id,t.overrides)),n}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in Oe[s]&&(delete Oe[s][i],this.override&&delete Ie[i])}}var js=new class{constructor(){this.controllers=new Gs(ms,"datasets",!0),this.elements=new Gs(Ds,"elements"),this.plugins=new Gs(Object,"plugins"),this.scales=new Gs(Hs,"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 s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):Z(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)}))}))}_exec(t,e,i){const s=ht(t);J(i["before"+s],[],i),e[t](i),J(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e0&&this.getParsed(e-1);for(let l=e;l0&&Math.abs(i[d]-v[d])>g,m&&(u.parsed=i,u.raw=h.data[l]),p&&(u.options=c||this.resolveDataElementOptions(l,e.active?"active":s)),y||this.updateElement(e,l,u,s),v=i}this.updateSharedOptions(c,s,l)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),n=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,n)/2}}Ws.id="scatter",Ws.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1},Ws.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var qs=Object.freeze({__proto__:null,BarController:Ps,BubbleController:ks,DoughnutController:ws,LineController:Cs,PolarAreaController:Ms,PieController:As,RadarController:Ts,ScatterController:Ws});function $s(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ys{constructor(t){this.options=t||{}}init(t){}formats(){return $s()}parse(t,e){return $s()}format(t,e){return $s()}add(t,e,i){return $s()}diff(t,e,i){return $s()}startOf(t,e,i){return $s()}endOf(t,e){return $s()}}Ys.override=function(t){Object.assign(Ys.prototype,t)};var Us={_date:Ys};function Xs(t,e,i,s){const{controller:r,data:n,_sorted:a}=t,o=r._cachedMeta.iScale;if(o&&e===o.axis&&"r"!==e&&a&&n.length){const t=o._reversePixels?Vt:Bt;if(!s)return t(n,e,i);if(r._sharedOptions){const s=n[0],r="function"==typeof s.getRange&&s.getRange(e);if(r){const s=t(n,e,i-r),a=t(n,e,i+r);return{lo:s.lo,hi:a.hi}}}}return{lo:0,hi:n.length-1}}function Ks(t,e,i,s,r){const n=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=n.length;t{t[a](e[i],r)&&(n.push({element:t,datasetIndex:s,index:h}),o=o||t.inRange(e.x,e.y,r))})),s&&!o?[]:n}var tr={evaluateInteractionItems:Ks,modes:{index(t,e,i,s){const r=Fi(e,t),n=i.axis||"x",a=i.includeInvisible||!1,o=i.intersect?Js(t,r,n,s,a):Zs(t,r,n,!1,s,a),h=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=o[0].index,i=t.data[e];i&&!i.skip&&h.push({element:i,datasetIndex:t.index,index:e})})),h):[]},dataset(t,e,i,s){const r=Fi(e,t),n=i.axis||"xy",a=i.includeInvisible||!1;let o=i.intersect?Js(t,r,n,s,a):Zs(t,r,n,!1,s,a);if(o.length>0){const e=o[0].datasetIndex,i=t.getDatasetMeta(e).data;o=[];for(let t=0;tJs(t,Fi(e,t),i.axis||"xy",s,i.includeInvisible||!1),nearest(t,e,i,s){const r=Fi(e,t),n=i.axis||"xy",a=i.includeInvisible||!1;return Zs(t,r,n,i.intersect,s,a)},x:(t,e,i,s)=>Qs(t,Fi(e,t),"x",i.intersect,s),y:(t,e,i,s)=>Qs(t,Fi(e,t),"y",i.intersect,s)}};const er=["left","top","right","bottom"];function ir(t,e){return t.filter((t=>t.pos===e))}function sr(t,e){return t.filter((t=>-1===er.indexOf(t.pos)&&t.box.axis===e))}function rr(t,e){return t.sort(((t,i)=>{const s=e?i:t,r=e?t:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight}))}function nr(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function ar(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 or(t,e,i,s){const{pos:r,box:n}=i,a=t.maxPadding;if(!$(r)){i.size&&(t[r]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?n.height:n.width),i.size=e.size/e.count,t[r]+=i.size}n.getPadding&&ar(a,n.getPadding());const o=Math.max(0,e.outerWidth-nr(a,t,"left","right")),h=Math.max(0,e.outerHeight-nr(a,t,"top","bottom")),l=o!==t.w,c=h!==t.h;return t.w=o,t.h=h,i.horizontal?{same:l,other:c}:{same:c,other:l}}function hr(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 lr(t,e,i,s){const r=[];let n,a,o,h,l,c;for(n=0,a=t.length,l=0;nt.box.fullSize)),!0),s=rr(ir(e,"left"),!0),r=rr(ir(e,"right")),n=rr(ir(e,"top"),!0),a=rr(ir(e,"bottom")),o=sr(e,"x"),h=sr(e,"y");return{fullSize:i,leftAndTop:s.concat(n),rightAndBottom:r.concat(h).concat(a).concat(o),chartArea:ir(e,"chartArea"),vertical:s.concat(r).concat(h),horizontal:n.concat(a).concat(o)}}(t.boxes),h=o.vertical,l=o.horizontal;Z(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const c=h.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,p=Object.freeze({outerWidth:e,outerHeight:i,padding:r,availableWidth:n,availableHeight:a,vBoxMaxWidth:n/2/c,hBoxMaxHeight:a/2}),d=Object.assign({},r);ar(d,si(s));const f=Object.assign({maxPadding:d,w:n,h:a,x:r.left,y:r.top},r),u=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:r}=i;if(!t||!er.includes(s))continue;const n=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});n.count++,n.weight+=r}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:r}=e;let n,a,o;for(n=0,a=t.length;n{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})}))}};class fr{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 ur extends fr{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const mr={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},gr=t=>null===t||""===t,yr=!!Oi&&{passive:!0};function vr(t,e,i){t.canvas.removeEventListener(e,i,yr)}function br(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function xr(t,e,i){const s=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||br(i.addedNodes,s),e=e&&!br(i.removedNodes,s);e&&i()}));return r.observe(document,{childList:!0,subtree:!0}),r}function _r(t,e,i){const s=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||br(i.removedNodes,s),e=e&&!br(i.addedNodes,s);e&&i()}));return r.observe(document,{childList:!0,subtree:!0}),r}const Er=new Map;let Sr=0;function Pr(){const t=window.devicePixelRatio;t!==Sr&&(Sr=t,Er.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function kr(t,e,i){const s=t.canvas,r=s&&Mi(s);if(!r)return;const n=jt(((t,e)=>{const s=r.clientWidth;i(t,e),s{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||n(i,s)}));return a.observe(r),function(t,e){Er.size||window.addEventListener("resize",Pr),Er.set(t,e)}(t,n),a}function wr(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Er.delete(t),Er.size||window.removeEventListener("resize",Pr)}(t)}function Cr(t,e,i){const s=t.canvas,r=jt((e=>{null!==t.ctx&&i(function(t,e){const i=mr[t.type]||t.type,{x:s,y:r}=Fi(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==r?r:null}}(e,t))}),t,(t=>{const e=t[0];return[e,e.offsetX,e.offsetY]}));return function(t,e,i){t.addEventListener(e,i,yr)}(s,e,r),r}class Mr extends fr{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,s=t.getAttribute("height"),r=t.getAttribute("width");if(t.$chartjs={initial:{height:s,width:r,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",gr(r)){const e=Bi(t,"width");void 0!==e&&(t.width=e)}if(gr(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Bi(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach((t=>{const s=i[t];W(s)?e.removeAttribute(t):e.setAttribute(t,s)}));const s=i.style||{};return Object.keys(s).forEach((t=>{e.style[t]=s[t]})),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),r={attach:xr,detach:_r,resize:kr}[e]||Cr;s[e]=r(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];s&&(({attach:wr,detach:wr,resize:wr}[e]||vr)(t,e,s),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return function(t,e,i,s){const r=Ti(t),n=Ii(r,"margin"),a=Ai(r.maxWidth,t,"clientWidth")||mt,o=Ai(r.maxHeight,t,"clientHeight")||mt,h=function(t,e,i){let s,r;if(void 0===e||void 0===i){const n=Mi(t);if(n){const t=n.getBoundingClientRect(),a=Ti(n),o=Ii(a,"border","width"),h=Ii(a,"padding");e=t.width-h.width-o.width,i=t.height-h.height-o.height,s=Ai(a.maxWidth,n,"clientWidth"),r=Ai(a.maxHeight,n,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||mt,maxHeight:r||mt}}(t,e,i);let{width:l,height:c}=h;if("content-box"===r.boxSizing){const t=Ii(r,"border","width"),e=Ii(r,"padding");l-=e.width+t.width,c-=e.height+t.height}return l=Math.max(0,l-n.width),c=Math.max(0,s?Math.floor(l/s):c-n.height),l=Li(Math.min(l,a,h.maxWidth)),c=Li(Math.min(c,o,h.maxHeight)),l&&!c&&(c=Li(l/2)),{width:l,height:c}}(t,e,i,s)}isAttached(t){const e=Mi(t);return!(!e||!e.isConnected)}}class Ar{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),n=this._notify(r,t,e,i);return"afterDestroy"===e&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),n}_notify(t,e,i,s){s=s||{};for(const r of t){const t=r.plugin;if(!1===J(t[i],[e,s,r.options],t)&&s.cancelable)return!1}return!0}invalidate(){W(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,s=X(i.options&&i.options.plugins,{}),r=function(t){const e={},i=[],s=Object.keys(js.plugins.items);for(let t=0;tt.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 Tr(t,e){return e||!1!==t?!0===t?{}:t:null}function Dr(t,{plugin:e,local:i},s,r){const n=t.pluginScopeKeys(e),a=t.getOptionScopes(s,n);return i&&e.defaults&&a.push(e.defaults),t.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ir(t,e){const i=Oe.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Fr(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function Lr(t){const e=t.options||(t.options={});e.plugins=X(e.plugins,{}),e.scales=function(t,e){const i=Ie[t.type]||{scales:{}},s=e.scales||{},r=Ir(t.type,e),n=Object.create(null),a=Object.create(null);return Object.keys(s).forEach((t=>{const e=s[t];if(!$(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const o=Fr(t,e),h=function(t,e){return t===e?"_index_":"_value_"}(o,r),l=i.scales||{};n[o]=n[o]||t,a[t]=rt(Object.create(null),[{axis:o},e,l[o],l[h]])})),t.data.datasets.forEach((i=>{const r=i.type||t.type,o=i.indexAxis||Ir(r,e),h=(Ie[r]||{}).scales||{};Object.keys(h).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,o),r=i[e+"AxisID"]||n[e]||e;a[r]=a[r]||Object.create(null),rt(a[r],[{axis:e},s[r],h[t]])}))})),Object.keys(a).forEach((t=>{const e=a[t];rt(e,[Oe.scales[e.type],Oe.scale])})),a}(t,e)}function Rr(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Or=new Map,Br=new Set;function Vr(t,e){let i=Or.get(t);return i||(i=e(),Or.set(t,i),Br.add(i)),i}const zr=(t,e,i)=>{const s=ot(e,i);void 0!==s&&t.add(s)};class Nr{constructor(t){this._config=function(t){return(t=t||{}).data=Rr(t.data),Lr(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=Rr(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(),Lr(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Vr(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Vr(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Vr(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Vr(`${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:s,type:r}=this,n=this._cachedScopes(t,i),a=n.get(e);if(a)return a;const o=new Set;e.forEach((e=>{t&&(o.add(t),e.forEach((e=>zr(o,t,e)))),e.forEach((t=>zr(o,s,t))),e.forEach((t=>zr(o,Ie[r]||{},t))),e.forEach((t=>zr(o,Oe,t))),e.forEach((t=>zr(o,Fe,t)))}));const h=Array.from(o);return 0===h.length&&h.push(Object.create(null)),Br.has(e)&&n.set(e,h),h}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ie[e]||{},Oe.datasets[e]||{},{type:e},Oe,Fe]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:n,subPrefixes:a}=Hr(this._resolverCache,t,s);let o=n;(function(t,e){const{isScriptable:i,isIndexable:s}=li(t);for(const r of e){const e=i(r),n=s(r),a=(n||e)&&t[r];if(e&&(ct(a)||Gr(a))||n&&q(a))return!0}return!1})(n,e)&&(r.$shared=!1,o=hi(n,i=ct(i)?i():i,this.createResolver(t,i,a)));for(const t of e)r[t]=o[t];return r}createResolver(t,e,i=[""],s){const{resolver:r}=Hr(this._resolverCache,t,i);return $(e)?hi(r,e,void 0,s):r}}function Hr(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const r=i.join();let n=s.get(r);return n||(n={resolver:oi(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(r,n)),n}const Gr=t=>$(t)&&Object.getOwnPropertyNames(t).reduce(((e,i)=>e||ct(t[i])),!1),jr=["top","bottom","left","right","chartArea"];function Wr(t,e){return"top"===t||"bottom"===t||-1===jr.indexOf(t)&&"x"===e}function qr(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function $r(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),J(i&&i.onComplete,[t],e)}function Yr(t){const e=t.chart,i=e.options.animation;J(i&&i.onProgress,[t],e)}function Ur(t){return Ci()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Xr={},Kr=t=>{const e=Ur(t);return Object.values(Xr).filter((t=>t.canvas===e)).pop()};function Jr(t,e,i){const s=Object.keys(t);for(const r of s){const s=+r;if(s>=e){const n=t[r];delete t[r],(i>0||s>e)&&(t[s+i]=n)}}}class Zr{constructor(t,e){const i=this.config=new Nr(e),s=Ur(t),r=Kr(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const n=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Ci()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?ur:Mr}(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,n.aspectRatio),o=a&&a.canvas,h=o&&o.height,l=o&&o.width;this.id=j(),this.ctx=a,this.canvas=o,this.width=l,this.height=h,this._options=n,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 Ar,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}((t=>this.update(t)),n.resizeDelay||0),this._dataChanges=[],Xr[this.id]=this,a&&o?(Zi.listen(this,"complete",$r),Zi.listen(this,"progress",Yr),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:s,_aspectRatio:r}=this;return W(t)?e&&r?r:s?i/s: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}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ri(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ne(this.canvas,this.ctx),this}stop(){return Zi.stop(this),this}resize(t,e){Zi.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,n=this.platform.getMaximumSize(s,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),o=this.width?"resize":"attach";this.width=n.width,this.height=n.height,this._aspectRatio=this.aspectRatio,Ri(this,a,!0)&&(this.notifyPlugins("resize",{size:n}),J(i.onResize,[this,n],this),this.attached&&this._doResize(o)&&this.render())}ensureScalesHaveIDs(){Z(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let r=[];e&&(r=r.concat(Object.keys(e).map((t=>{const i=e[t],s=Fr(t,i),r="r"===s,n="x"===s;return{options:i,dposition:r?"chartArea":n?"bottom":"left",dtype:r?"radialLinear":n?"category":"linear"}})))),Z(r,(e=>{const r=e.options,n=r.id,a=Fr(n,r),o=X(r.type,e.dtype);void 0!==r.position&&Wr(r.position,a)===Wr(e.dposition)||(r.position=e.dposition),s[n]=!0;let h=null;n in i&&i[n].type===o?h=i[n]:(h=new(js.getScale(o))({id:n,type:o,ctx:this.ctx,chart:this}),i[h.id]=h),h.init(r,t)})),Z(s,((t,e)=>{t||delete i[e]})),Z(i,(t=>{dr.configure(this,t,t.options),dr.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;te.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,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i{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()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let n=0;for(let t=0,e=this.data.datasets.length;t{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(qr("z","_idx"));const{_active:a,_lastEvent:o}=this;o?this._eventHandler(o,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Z(this.scales,(t=>{dr.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);pt(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:r}of e)Jr(t,s,"_removeElements"===i?-r:r)}_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(",")))),s=i(0);for(let t=1;tt.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;dr.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Z(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=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,r=this.chartArea,n={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",n)&&(s&&We(e,{left:!1===i.left?0:r.left-i.left,right:!1===i.right?this.width:r.right+i.right,top:!1===i.top?0:r.top-i.top,bottom:!1===i.bottom?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&qe(e),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return je(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=tr.modes[e];return"function"==typeof r?r(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=ai(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 s=i?"show":"hide",r=this.getDatasetMeta(t),n=r.controller._resolveAnimations(void 0,s);lt(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),n.update(r,{visible:i}),this.update((e=>e.datasetIndex===t?s: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(),Zi.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};Z(this.options.events,(t=>i(t,s)))}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])},r=(t,e)=>{this.canvas&&this.resize(t,e)};let n;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",n)};n=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():n()}unbindEvents(){Z(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},Z(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,n,a,o;for("dataset"===e&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,o=t.length;a{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}}));!Q(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const s=this.options.hover,r=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),n=r(e,t),a=i?t:r(t,e);n.length&&this.updateHoverStyle(n,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 r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:r}=this,n=e,a=this._getActiveElements(t,s,i,n),o=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),h=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,o);i&&(this._lastEvent=null,J(r.onHover,[t,a,this],this),o&&J(r.onClick,[t,a,this],this));const l=!Q(a,s);return(l||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=h,l}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}}const Qr=()=>Z(Zr.instances,(t=>t._plugins.invalidate())),tn=!0;function en(t,e,i){const{startAngle:s,pixelMargin:r,x:n,y:a,outerRadius:o,innerRadius:h}=e;let l=r/o;t.beginPath(),t.arc(n,a,o,s-l,i+l),h>r?(l=r/h,t.arc(n,a,h,i+l,s-l,!0)):t.arc(n,a,r,i+yt,s-yt),t.closePath(),t.clip()}function sn(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function rn(t,e,i,s,r,n){const{x:a,y:o,startAngle:h,pixelMargin:l,innerRadius:c}=e,p=Math.max(e.outerRadius+s+i-l,0),d=c>0?c+s+i+l:0;let f=0;const u=r-h;if(s){const t=((c>0?c-s:0)+(p>0?p-s:0))/2;f=(u-(0!==t?u*t/(t+s):u))/2}const m=(u-Math.max(.001,u*p-i/dt)/p)/2,g=h+m+f,y=r-m-f,{outerStart:v,outerEnd:b,innerStart:x,innerEnd:_}=function(t,e,i,s){const r=function(t){return ti(t,["outerStart","outerEnd","innerStart","innerEnd"])}(t.options.borderRadius),n=(i-e)/2,a=Math.min(n,s*e/2),o=t=>{const e=(i-Math.min(n,t))*s/2;return Lt(t,0,Math.min(n,e))};return{outerStart:o(r.outerStart),outerEnd:o(r.outerEnd),innerStart:Lt(r.innerStart,0,a),innerEnd:Lt(r.innerEnd,0,a)}}(e,d,p,y-g),E=p-v,S=p-b,P=g+v/E,k=y-b/S,w=d+x,C=d+_,M=g+x/w,A=y-_/C;if(t.beginPath(),n){if(t.arc(a,o,p,P,k),b>0){const e=sn(S,k,a,o);t.arc(e.x,e.y,b,k,y+yt)}const e=sn(C,y,a,o);if(t.lineTo(e.x,e.y),_>0){const e=sn(C,A,a,o);t.arc(e.x,e.y,_,y+yt,A+Math.PI)}if(t.arc(a,o,d,y-_/d,g+x/d,!0),x>0){const e=sn(w,M,a,o);t.arc(e.x,e.y,x,M+Math.PI,g-yt)}const i=sn(E,g,a,o);if(t.lineTo(i.x,i.y),v>0){const e=sn(E,P,a,o);t.arc(e.x,e.y,v,g-yt,P)}}else{t.moveTo(a,o);const e=Math.cos(P)*p+a,i=Math.sin(P)*p+o;t.lineTo(e,i);const s=Math.cos(k)*p+a,r=Math.sin(k)*p+o;t.lineTo(s,r)}t.closePath()}Object.defineProperties(Zr,{defaults:{enumerable:tn,value:Oe},instances:{enumerable:tn,value:Xr},overrides:{enumerable:tn,value:Ie},registry:{enumerable:tn,value:js},version:{enumerable:tn,value:"3.9.1"},getChart:{enumerable:tn,value:Kr},register:{enumerable:tn,value:(...t)=>{js.add(...t),Qr()}},unregister:{enumerable:tn,value:(...t)=>{js.remove(...t),Qr()}}});class nn extends Ds{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:r,distance:n}=At(s,{x:t,y:e}),{startAngle:a,endAngle:o,innerRadius:h,outerRadius:l,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),p=this.options.spacing/2,d=X(c,o-a)>=ft||Ft(r,a,o),f=Rt(n,h+p,l+p);return d&&f}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:r,innerRadius:n,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:o,spacing:h}=this.options,l=(s+r)/2,c=(n+a+h+o)/2;return{x:e+Math.cos(l)*c,y:i+Math.sin(l)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/2,r=(e.spacing||0)/2,n=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>ft?Math.floor(i/ft):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(s){a=s/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*a,Math.sin(e)*a),this.circumference>=dt&&(a=s)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const o=function(t,e,i,s,r){const{fullCircles:n,startAngle:a,circumference:o}=e;let h=e.endAngle;if(n){rn(t,e,i,s,a+ft,r);for(let e=0;eo&&n>o;return{count:s,start:h,loop:e.loop,ilen:l(a+(l?o-t:t))%n,b=()=>{f!==u&&(t.lineTo(g,u),t.lineTo(g,f),t.lineTo(g,m))};for(h&&(p=r[v(0)],t.moveTo(p.x,p.y)),c=0;c<=o;++c){if(p=r[v(c)],p.skip)continue;const e=p.x,i=p.y,s=0|e;s===d?(iu&&(u=i),g=(y*g+e)/++y):(b(),t.lineTo(e,i),d=s,y=0,f=u=i),m=i}b()}function pn(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?ln:cn}nn.id="arc",nn.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0},nn.defaultRoutes={backgroundColor:"backgroundColor"};const dn="function"==typeof Path2D;class fn extends Ds{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 s=i.spanGaps?this._loop:this._fullLoop;wi(this._points,i,t,s,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=function(t,e){const i=t.points,s=t.options.spanGaps,r=i.length;if(!r)return[];const n=!!t._loop,{start:a,end:o}=function(t,e,i,s){let r=0,n=e-1;if(i&&!s)for(;rr&&t[n%e].skip;)n--;return n%=e,{start:r,end:n}}(i,r,n,s);return function(t,e,i,s){return s&&s.setContext&&i?function(t,e,i,s){const r=t._chart.getContext(),n=Ki(t.options),{_datasetIndex:a,options:{spanGaps:o}}=t,h=i.length,l=[];let c=n,p=e[0].start,d=p;function f(t,e,s,r){const n=o?-1:1;if(t!==e){for(t+=h;i[t%h].skip;)t-=n;for(;i[e%h].skip;)e+=n;t%h!=e%h&&(l.push({start:t%h,end:e%h,loop:s,style:r}),c=r,p=e%h)}}for(const t of e){p=o?p:t.start;let e,n=i[p%h];for(d=p+1;d<=t.end;d++){const o=i[d%h];e=Ki(s.setContext(ai(r,{type:"segment",p0:n,p1:o,p0DataIndex:(d-1)%h,p1DataIndex:d%h,datasetIndex:a}))),Ji(e,c)&&f(p,d-1,t.loop,c),n=o,c=e}p"borderDash"!==t&&"fill"!==t};class mn extends Ds{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:r,y:n}=this.getProps(["x","y"],i);return Math.pow(t-r,2)+Math.pow(e-n,2){Sn(t)}))}var kn={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void Pn(t);const s=t.width;t.data.datasets.forEach(((e,r)=>{const{_data:n,indexAxis:a}=e,o=t.getDatasetMeta(r),h=n||e.data;if("y"===ni([a,t.options.indexAxis]))return;if(!o.controller.supportsDecimation)return;const l=t.scales[o.xAxisID];if("linear"!==l.type&&"time"!==l.type)return;if(t.options.parsing)return;let c,{start:p,count:d}=function(t,e){const i=e.length;let s,r=0;const{iScale:n}=t,{min:a,max:o,minDefined:h,maxDefined:l}=n.getUserBounds();return h&&(r=Lt(Bt(e,n.axis,a).lo,0,i-1)),s=l?Lt(Bt(e,n.axis,o).hi+1,r,i)-r:i-r,{start:r,count:s}}(o,h);if(d<=(i.threshold||4*s))Sn(e);else{switch(W(n)&&(e._data=h,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":c=function(t,e,i,s,r){const n=r.samples||s;if(n>=i)return t.slice(e,e+i);const a=[],o=(i-2)/(n-2);let h=0;const l=e+i-1;let c,p,d,f,u,m=e;for(a[h++]=t[m],c=0;cd&&(d=f,p=t[s],u=s);a[h++]=p,m=u}return a[h++]=t[l],a}(h,p,d,s,i);break;case"min-max":c=function(t,e,i,s){let r,n,a,o,h,l,c,p,d,f,u=0,m=0;const g=[],y=e+i-1,v=t[e].x,b=t[y].x-v;for(r=e;rf&&(f=o,c=r),u=(m*u+n.x)/++m;else{const i=r-1;if(!W(l)&&!W(c)){const e=Math.min(l,c),s=Math.max(l,c);e!==p&&e!==i&&g.push({...t[e],x:u}),s!==p&&s!==i&&g.push({...t[s],x:u})}r>0&&i!==p&&g.push(t[i]),g.push(n),h=e,m=0,d=f=o,l=c=p=r}}return g}(h,p,d,s);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=c}}))},destroy(t){Pn(t)}};function wn(t,e,i,s){if(s)return;let r=e[t],n=i[t];return"angle"===t&&(r=It(r),n=It(n)),{property:t,start:r,end:n}}function Cn(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Mn(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function An(t,e){let i=[],s=!1;return q(t)?(s=!0,i=t):i=function(t,e){const{x:i=null,y:s=null}=t||{},r=e.points,n=[];return e.segments.forEach((({start:t,end:e})=>{e=Cn(t,e,r);const a=r[t],o=r[e];null!==s?(n.push({x:a.x,y:s}),n.push({x:o.x,y:s})):null!==i&&(n.push({x:i,y:a.y}),n.push({x:i,y:o.y}))})),n}(t,e),i.length?new fn({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function Tn(t){return t&&!1!==t.fill}function Dn(t,e,i){let s=t[e].fill;const r=[e];let n;if(!i)return s;for(;!1!==s&&-1===r.indexOf(s);){if(!Y(s))return s;if(n=t[s],!n)return!1;if(n.visible)return s;r.push(s),s=n.fill}return!1}function In(t,e,i){const s=function(t){const e=t.options,i=e.fill;let s=X(i&&i.target,i);return void 0===s&&(s=!!e.backgroundColor),!1!==s&&null!==s&&(!0===s?"origin":s)}(t);if($(s))return!isNaN(s.value)&&s;let r=parseFloat(s);return Y(r)&&Math.floor(r)===r?function(t,e,i,s){return"-"!==t&&"+"!==t||(i=e+i),!(i===e||i<0||i>=s)&&i}(s[0],e,r,i):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Fn(t,e,i){const s=[];for(let r=0;r=0;--e){const i=r[e].$filler;i&&(i.line.updateControlPoints(n,i.axis),s&&i.fill&&On(t.ctx,i,n))}},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;Tn(i)&&On(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;Tn(s)&&"beforeDatasetDraw"===i.drawTime&&On(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Gn=(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 jn extends Ds{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=J(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,s=ri(i.font),r=s.size,n=this._computeTitleHeight(),{boxWidth:a,itemHeight:o}=Gn(i,r);let h,l;e.font=s.string,this.isHorizontal()?(h=this.maxWidth,l=this._fitRows(n,r,a,o)+10):(l=this.maxHeight,h=this._fitCols(n,r,a,o)+10),this.width=Math.min(h,t.maxWidth||this.maxWidth),this.height=Math.min(l,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:r,maxWidth:n,options:{labels:{padding:a}}}=this,o=this.legendHitBoxes=[],h=this.lineWidths=[0],l=s+a;let c=t;r.textAlign="left",r.textBaseline="middle";let p=-1,d=-l;return this.legendItems.forEach(((t,f)=>{const u=i+e/2+r.measureText(t.text).width;(0===f||h[h.length-1]+u+2*a>n)&&(c+=l,h[h.length-(f>0?0:1)]=0,d+=l,p++),o[f]={left:0,top:d,row:p,width:u,height:s},h[h.length-1]+=u+a})),c}_fitCols(t,e,i,s){const{ctx:r,maxHeight:n,options:{labels:{padding:a}}}=this,o=this.legendHitBoxes=[],h=this.columnSizes=[],l=n-t;let c=a,p=0,d=0,f=0,u=0;return this.legendItems.forEach(((t,n)=>{const m=i+e/2+r.measureText(t.text).width;n>0&&d+s+2*a>l&&(c+=p+a,h.push({width:p,height:d}),f+=p+a,u++,p=d=0),o[n]={left:f,top:d,col:u,width:m,height:s},p=Math.max(p,m),d+=s+a})),c+=p,h.push({width:p,height:d}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,n=ji(r,this.left,this.width);if(this.isHorizontal()){let r=0,a=qt(i,this.left+s,this.right-this.lineWidths[r]);for(const o of e)r!==o.row&&(r=o.row,a=qt(i,this.left+s,this.right-this.lineWidths[r])),o.top+=this.top+t+s,o.left=n.leftForLtr(n.x(a),o.width),a+=o.width+s}else{let r=0,a=qt(i,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const o of e)o.col!==r&&(r=o.col,a=qt(i,this.top+t+s,this.bottom-this.columnSizes[r].height)),o.top=a,o.left+=this.left+s,o.left=n.leftForLtr(n.x(o.left),o.width),a+=o.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;We(t,this),this._draw(),qe(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:n}=t,a=Oe.color,o=ji(t.rtl,this.left,this.width),h=ri(n.font),{color:l,padding:c}=n,p=h.size,d=p/2;let f;this.drawTitle(),s.textAlign=o.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=h.string;const{boxWidth:u,boxHeight:m,itemHeight:g}=Gn(n,p),y=this.isHorizontal(),v=this._computeTitleHeight();f=y?{x:qt(r,this.left+c,this.right-i[0]),y:this.top+c+v,line:0}:{x:this.left+c,y:qt(r,this.top+v+c,this.bottom-e[0].height),line:0},Wi(this.ctx,t.textDirection);const b=g+c;this.legendItems.forEach(((x,_)=>{s.strokeStyle=x.fontColor||l,s.fillStyle=x.fontColor||l;const E=s.measureText(x.text).width,S=o.textAlign(x.textAlign||(x.textAlign=n.textAlign)),P=u+d+E;let k=f.x,w=f.y;o.setWidth(this.width),y?_>0&&k+P+c>this.right&&(w=f.y+=b,f.line++,k=f.x=qt(r,this.left+c,this.right-i[f.line])):_>0&&w+b>this.bottom&&(k=f.x=k+e[f.line].width+c,f.line++,w=f.y=qt(r,this.top+v+c,this.bottom-e[f.line].height)),function(t,e,i){if(isNaN(u)||u<=0||isNaN(m)||m<0)return;s.save();const r=X(i.lineWidth,1);if(s.fillStyle=X(i.fillStyle,a),s.lineCap=X(i.lineCap,"butt"),s.lineDashOffset=X(i.lineDashOffset,0),s.lineJoin=X(i.lineJoin,"miter"),s.lineWidth=r,s.strokeStyle=X(i.strokeStyle,a),s.setLineDash(X(i.lineDash,[])),n.usePointStyle){const a={radius:m*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:r},h=o.xPlus(t,u/2);Ge(s,a,h,e+d,n.pointStyleWidth&&u)}else{const n=e+Math.max((p-m)/2,0),a=o.leftForLtr(t,u),h=ii(i.borderRadius);s.beginPath(),Object.values(h).some((t=>0!==t))?Ke(s,{x:a,y:n,w:u,h:m,radius:h}):s.rect(a,n,u,m),s.fill(),0!==r&&s.stroke()}s.restore()}(o.x(k),w,x),k=((t,e,i,s)=>t===(s?"left":"right")?i:"center"===t?(e+i)/2:e)(S,k+u+d,y?k+P:this.right,t.rtl),function(t,e,i){Ue(s,i.text,t,e+g/2,h,{strikethrough:i.hidden,textAlign:o.textAlign(i.textAlign)})}(o.x(k),w,x),y?f.x+=P+c:f.y+=b})),qi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=ri(e.font),s=si(e.padding);if(!e.display)return;const r=ji(t.rtl,this.left,this.width),n=this.ctx,a=e.position,o=i.size/2,h=s.top+o;let l,c=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),l=this.top+h,c=qt(t.align,c,this.right-p);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);l=h+qt(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const d=qt(a,c,c+p);n.textAlign=r.textAlign(Wt(a)),n.textBaseline="middle",n.strokeStyle=e.color,n.fillStyle=e.color,n.font=i.string,Ue(n,e.text,d,l,i)}_computeTitleHeight(){const t=this.options.title,e=ri(t.font),i=si(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Rt(t,this.left,this.right)&&Rt(e,this.top,this.bottom))for(r=this.legendHitBoxes,i=0;it.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:r,color:n}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const a=t.controller.getStyle(i?0:void 0),o=si(a.borderWidth);return{text:e[t.index].label,fillStyle:a.backgroundColor,fontColor:n,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(o.width+o.height)/4,strokeStyle:a.borderColor,pointStyle:s||a.pointStyle,rotation:a.rotation,textAlign:r||a.textAlign,borderRadius:0,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 qn extends Ds{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 s=q(i.text)?i.text.length:1;this._padding=si(i.padding);const r=s*ri(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:r,options:n}=this,a=n.align;let o,h,l,c=0;return this.isHorizontal()?(h=qt(a,i,r),l=e+t,o=r-i):("left"===n.position?(h=i+t,l=qt(a,s,e),c=-.5*dt):(h=r-t,l=qt(a,e,s),c=.5*dt),o=s-e),{titleX:h,titleY:l,maxWidth:o,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=ri(e.font),s=i.lineHeight/2+this._padding.top,{titleX:r,titleY:n,maxWidth:a,rotation:o}=this._drawArgs(s);Ue(t,e.text,0,0,i,{color:e.color,maxWidth:a,rotation:o,textAlign:Wt(e.align),textBaseline:"middle",translation:[r,n]})}}var $n={id:"title",_element:qn,start(t,e,i){!function(t,e){const i=new qn({ctx:t.ctx,options:e,chart:t});dr.configure(t,i,e),dr.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;dr.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;dr.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}};const Yn=new WeakMap;var Un={id:"subtitle",start(t,e,i){const s=new qn({ctx:t.ctx,options:i,chart:t});dr.configure(t,s,i),dr.addBox(t,s),Yn.set(t,s)},stop(t){dr.removeBox(t,Yn.get(t)),Yn.delete(t)},beforeUpdate(t,e,i){const s=Yn.get(t);dr.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Xn={average(t){if(!t.length)return!1;let e,i,s=0,r=0,n=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function Zn(t,e){const{element:i,datasetIndex:s,index:r}=e,n=t.getDatasetMeta(s).controller,{label:a,value:o}=n.getLabelAndValue(r);return{chart:t,label:a,parsed:n.getParsed(r),raw:t.data.datasets[s].data[r],formattedValue:o,dataset:n.getDataset(),dataIndex:r,datasetIndex:s,element:i}}function Qn(t,e){const i=t.chart.ctx,{body:s,footer:r,title:n}=t,{boxWidth:a,boxHeight:o}=e,h=ri(e.bodyFont),l=ri(e.titleFont),c=ri(e.footerFont),p=n.length,d=r.length,f=s.length,u=si(e.padding);let m=u.height,g=0,y=s.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);y+=t.beforeBody.length+t.afterBody.length,p&&(m+=p*l.lineHeight+(p-1)*e.titleSpacing+e.titleMarginBottom),y&&(m+=f*(e.displayColors?Math.max(o,h.lineHeight):h.lineHeight)+(y-f)*h.lineHeight+(y-1)*e.bodySpacing),d&&(m+=e.footerMarginTop+d*c.lineHeight+(d-1)*e.footerSpacing);let v=0;const b=function(t){g=Math.max(g,i.measureText(t).width+v)};return i.save(),i.font=l.string,Z(t.title,b),i.font=h.string,Z(t.beforeBody.concat(t.afterBody),b),v=e.displayColors?a+2+e.boxPadding:0,Z(s,(t=>{Z(t.before,b),Z(t.lines,b),Z(t.after,b)})),v=0,i.font=c.string,Z(t.footer,b),i.restore(),g+=u.width,{width:g,height:m}}function ta(t,e,i,s){const{x:r,width:n}=i,{width:a,chartArea:{left:o,right:h}}=t;let l="center";return"center"===s?l=r<=(o+h)/2?"left":"right":r<=n/2?l="left":r>=a-n/2&&(l="right"),function(t,e,i,s){const{x:r,width:n}=s,a=i.caretSize+i.caretPadding;return"left"===t&&r+n+a>e.width||"right"===t&&r-n-a<0||void 0}(l,t,e,i)&&(l="center"),l}function ea(t,e,i){const s=i.yAlign||e.yAlign||function(t,e){const{y:i,height:s}=e;return it.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||ta(t,e,i,s),yAlign:s}}function ia(t,e,i,s){const{caretSize:r,caretPadding:n,cornerRadius:a}=t,{xAlign:o,yAlign:h}=i,l=r+n,{topLeft:c,topRight:p,bottomLeft:d,bottomRight:f}=ii(a);let u=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,o);const m=function(t,e,i){let{y:s,height:r}=t;return"top"===e?s+=i:s-="bottom"===e?r+i:r/2,s}(e,h,l);return"center"===h?"left"===o?u+=l:"right"===o&&(u-=l):"left"===o?u-=Math.max(c,d)+r:"right"===o&&(u+=Math.max(p,f)+r),{x:Lt(u,0,s.width-e.width),y:Lt(m,0,s.height-e.height)}}function sa(t,e,i){const s=si(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function ra(t){return Kn([],Jn(t))}function na(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class aa extends Ds{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||t._chart,this._chart=this.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,r=new ss(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=(this,ai(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}getTitle(t,e){const{callbacks:i}=e,s=i.beforeTitle.apply(this,[t]),r=i.title.apply(this,[t]),n=i.afterTitle.apply(this,[t]);let a=[];return a=Kn(a,Jn(s)),a=Kn(a,Jn(r)),a=Kn(a,Jn(n)),a}getBeforeBody(t,e){return ra(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,s=[];return Z(t,(t=>{const e={before:[],lines:[],after:[]},r=na(i,t);Kn(e.before,Jn(r.beforeLabel.call(this,t))),Kn(e.lines,r.label.call(this,t)),Kn(e.after,Jn(r.afterLabel.call(this,t))),s.push(e)})),s}getAfterBody(t,e){return ra(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,s=i.beforeFooter.apply(this,[t]),r=i.footer.apply(this,[t]),n=i.afterFooter.apply(this,[t]);let a=[];return a=Kn(a,Jn(s)),a=Kn(a,Jn(r)),a=Kn(a,Jn(n)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],n=[];let a,o,h=[];for(a=0,o=e.length;at.filter(e,s,r,i)))),t.itemSort&&(h=h.sort(((e,s)=>t.itemSort(e,s,i)))),Z(h,(e=>{const i=na(t.callbacks,e);s.push(i.labelColor.call(this,e)),r.push(i.labelPointStyle.call(this,e)),n.push(i.labelTextColor.call(this,e))})),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=n,this.dataPoints=h,h}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,n=[];if(s.length){const t=Xn[i.position].call(this,s,this._eventPosition);n=this._createItems(i),this.title=this.getTitle(n,i),this.beforeBody=this.getBeforeBody(n,i),this.body=this.getBody(n,i),this.afterBody=this.getAfterBody(n,i),this.footer=this.getFooter(n,i);const e=this._size=Qn(this,i),a=Object.assign({},t,e),o=ea(this.chart,i,a),h=ia(i,a,o,this.chart);this.xAlign=o.xAlign,this.yAlign=o.yAlign,r={opacity:1,x:h.x,y:h.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(r={opacity:0});this._tooltipItems=n,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:n,cornerRadius:a}=i,{topLeft:o,topRight:h,bottomLeft:l,bottomRight:c}=ii(a),{x:p,y:d}=t,{width:f,height:u}=e;let m,g,y,v,b,x;return"center"===r?(b=d+u/2,"left"===s?(m=p,g=m-n,v=b+n,x=b-n):(m=p+f,g=m+n,v=b-n,x=b+n),y=m):(g="left"===s?p+Math.max(o,l)+n:"right"===s?p+f-Math.max(h,c)-n:this.caretX,"top"===r?(v=d,b=v-n,m=g-n,y=g+n):(v=d+u,b=v+n,m=g+n,y=g-n),x=v),{x1:m,x2:g,x3:y,y1:v,y2:b,y3:x}}drawTitle(t,e,i){const s=this.title,r=s.length;let n,a,o;if(r){const h=ji(i.rtl,this.x,this.width);for(t.x=sa(this,i.titleAlign,i),e.textAlign=h.textAlign(i.titleAlign),e.textBaseline="middle",n=ri(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=n.string,o=0;o0!==t))?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Ke(t,{x:e,y:u,w:h,h:o,radius:a}),t.fill(),t.stroke(),t.fillStyle=n.backgroundColor,t.beginPath(),Ke(t,{x:i,y:u+1,w:h-2,h:o-2,radius:a}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(e,u,h,o),t.strokeRect(e,u,h,o),t.fillStyle=n.backgroundColor,t.fillRect(i,u+1,h-2,o-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:n,displayColors:a,boxHeight:o,boxWidth:h,boxPadding:l}=i,c=ri(i.bodyFont);let p=c.lineHeight,d=0;const f=ji(i.rtl,this.x,this.width),u=function(i){e.fillText(i,f.x(t.x+d),t.y+p/2),t.y+=p+r},m=f.textAlign(n);let g,y,v,b,x,_,E;for(e.textAlign=n,e.textBaseline="middle",e.font=c.string,t.x=sa(this,m,i),e.fillStyle=i.bodyColor,Z(this.beforeBody,u),d=a&&"right"!==m?"center"===n?h/2+l:h+2+l:0,b=0,_=s.length;b<_;++b){for(g=s[b],y=this.labelTextColors[b],e.fillStyle=y,Z(g.before,u),v=g.lines,a&&v.length&&(this._drawColorBox(e,t,b,f,i),p=Math.max(c.lineHeight,o)),x=0,E=v.length;x0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const i=Xn[t.position].call(this,this._active,this._eventPosition);if(!i)return;const n=this._size=Qn(this,t),a=Object.assign({},i,this._size),o=ea(e,t,a),h=ia(t,a,o,e);s._to===h.x&&r._to===h.y||(this.xAlign=o.xAlign,this.yAlign=o.yAlign,this.width=n.width,this.height=n.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const n=si(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),Wi(t,e.textDirection),r.y+=n.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),qi(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=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}})),r=!Q(i,s),n=this._positionChanged(s,e);(r||n)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],n=this._getActiveElements(t,r,e,i),a=this._positionChanged(n,t),o=e||!Q(n,r)||a;return o&&(this._active=n,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),o}_getActiveElements(t,e,i,s){const r=this.options;if("mouseout"===t.type)return[];if(!s)return e;const n=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&n.reverse(),n}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,n=Xn[r.position].call(this,t,e);return!1!==n&&(i!==n.x||s!==n.y)}}aa.positioners=Xn;var oa={id:"tooltip",_element:aa,positioners:Xn,afterInit(t,e,i){i&&(t.tooltip=new aa({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))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:{beforeTitle:G,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"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},ha=Object.freeze({__proto__:null,Decimation:kn,Filler:Hn,Legend:Wn,SubTitle:Un,Title:$n,Tooltip:oa});class la extends Hs{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(W(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:Lt(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,s){const r=t.indexOf(e);return-1===r?((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):r!==t.lastIndexOf(e)?i:r}(i,t,X(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 r=this.getLabels();r=0===t&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.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){const e=this.getLabels();return t>=0&&te.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 ca(t,e,{horizontal:i,minRotation:s}){const r=wt(s),n=(i?Math.sin(r):Math.cos(r))||.001,a=.75*e*(""+t).length;return Math.min(e/n,a)}la.id="category",la.defaults={ticks:{callback:la.prototype.getLabelForValue}};class pa extends Hs{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 W(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:s,max:r}=this;const n=t=>s=e?s:t,a=t=>r=i?r:t;if(t){const t=_t(s),e=_t(r);t<0&&e<0?a(0):t>0&&e>0&&n(0)}if(s===r){let e=1;(r>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*r)),a(r+e),t||n(s-e)}this.min=s,this.max=r}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 s=function(t,e){const i=[],{bounds:s,step:r,min:n,max:a,precision:o,count:h,maxTicks:l,maxDigits:c,includeBounds:p}=t,d=r||1,f=l-1,{min:u,max:m}=e,g=!W(n),y=!W(a),v=!W(h),b=(m-u)/(c+1);let x,_,E,S,P=Et((m-u)/f/d)*d;if(P<1e-14&&!g&&!y)return[{value:u},{value:m}];S=Math.ceil(m/P)-Math.floor(u/P),S>f&&(P=Et(S*P/f/d)*d),W(o)||(x=Math.pow(10,o),P=Math.ceil(P*x)/x),"ticks"===s?(_=Math.floor(u/P)*P,E=Math.ceil(m/P)*P):(_=u,E=m),g&&y&&r&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((a-n)/r,P/1e3)?(S=Math.round(Math.min((a-n)/P,l)),P=(a-n)/S,_=n,E=a):v?(_=g?n:_,E=y?a:E,S=h-1,P=(E-_)/S):(S=(E-_)/P,S=Pt(S,Math.round(S),P/1e3)?Math.round(S):Math.ceil(S));const k=Math.max(Mt(P),Mt(_));x=Math.pow(10,W(o)?k:o),_=Math.round(_*x)/x,E=Math.round(E*x)/x;let w=0;for(g&&(p&&_!==n?(i.push({value:n}),_0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Y(t)?Math.max(0,t):null,this.max=Y(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=e=>i=t?i:e,n=t=>s=e?s:t,a=(t,e)=>Math.pow(10,Math.floor(xt(t))+e);i===s&&(i<=0?(r(1),n(10)):(r(a(i,-1)),n(a(s,1)))),i<=0&&r(a(s,-1)),s<=0&&n(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&r(a(i,-1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor(xt(e.max)),s=Math.ceil(e.max/Math.pow(10,i)),r=[];let n=U(t.min,Math.pow(10,Math.floor(xt(e.min)))),a=Math.floor(xt(n)),o=Math.floor(n/Math.pow(10,a)),h=a<0?Math.pow(10,Math.abs(a)):1;do{r.push({value:n,major:fa(n)}),++o,10===o&&(o=1,++a,h=a>=0?1:h),n=Math.round(o*Math.pow(10,a)*h)/h}while(ar?{start:e-i,end:e}:{start:e,end:e+i}}function ya(t,e,i,s,r){const n=Math.abs(Math.sin(i)),a=Math.abs(Math.cos(i));let o=0,h=0;s.starte.r&&(o=(s.end-e.r)/n,t.r=Math.max(t.r,e.r+o)),r.starte.b&&(h=(r.end-e.b)/a,t.b=Math.max(t.b,e.b+h))}function va(t){return 0===t||180===t?"center":t<180?"left":"right"}function ba(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function xa(t,e,i,s){const{ctx:r}=t;if(i)r.arc(t.xCenter,t.yCenter,e,0,ft);else{let i=t.getPointPosition(0,e);r.moveTo(i.x,i.y);for(let n=1;n{const i=J(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),s=[],r=[],n=t._pointLabels.length,a=t.options.pointLabels,o=a.centerPointLabels?dt/n:0;for(let p=0;p=0&&t=0;r--){const e=s.setContext(t.getPointLabelContext(r)),n=ri(e.font),{x:a,y:o,textAlign:h,left:l,top:c,right:p,bottom:d}=t._pointLabelItems[r],{backdropColor:f}=e;if(!W(f)){const t=ii(e.borderRadius),s=si(e.backdropPadding);i.fillStyle=f;const r=l-s.left,n=c-s.top,a=p-l+s.width,o=d-c+s.height;Object.values(t).some((t=>0!==t))?(i.beginPath(),Ke(i,{x:r,y:n,w:a,h:o,radius:t}),i.fill()):i.fillRect(r,n,a,o)}Ue(i,t._pointLabels[r],a,o+n.lineHeight/2,n,{color:e.color,textAlign:h,textBaseline:"middle"})}}(this,r),s.display&&this.ticks.forEach(((t,e)=>{0!==e&&(a=this.getDistanceFromCenterForValue(t.value),function(t,e,i,s){const r=t.ctx,n=e.circular,{color:a,lineWidth:o}=e;!n&&!s||!a||!o||i<0||(r.save(),r.strokeStyle=a,r.lineWidth=o,r.setLineDash(e.borderDash),r.lineDashOffset=e.borderDashOffset,r.beginPath(),xa(t,i,n,s),r.closePath(),r.stroke(),r.restore())}(this,s.setContext(this.getContext(e-1)),a,r))})),i.display){for(t.save(),n=r-1;n>=0;n--){const s=i.setContext(this.getPointLabelContext(n)),{color:r,lineWidth:h}=s;h&&r&&(t.lineWidth=h,t.strokeStyle=r,t.setLineDash(s.borderDash),t.lineDashOffset=s.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),o=this.getPointPosition(n,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(o.x,o.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,n;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((s,a)=>{if(0===a&&!e.reverse)return;const o=i.setContext(this.getContext(a)),h=ri(o.font);if(r=this.getDistanceFromCenterForValue(this.ticks[a].value),o.showLabelBackdrop){t.font=h.string,n=t.measureText(s.label).width,t.fillStyle=o.backdropColor;const e=si(o.backdropPadding);t.fillRect(-n/2-e.left,-r-h.size/2-e.top,n+e.width,h.size+e.height)}Ue(t,s.label,0,-r,h,{color:o.color})})),t.restore()}drawTitle(){}}_a.id="radialLinear",_a.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Fs.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},_a.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},_a.descriptors={angleLines:{_fallback:"grid"}};const Ea={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Sa=Object.keys(Ea);function Pa(t,e){return t-e}function ka(t,e){if(W(e))return null;const i=t._adapter,{parser:s,round:r,isoWeekday:n}=t._parseOpts;let a=e;return"function"==typeof s&&(a=s(a)),Y(a)||(a="string"==typeof s?i.parse(a,s):i.parse(a)),null===a?null:(r&&(a="week"!==r||!St(n)&&!0!==n?i.startOf(a,r):i.startOf(a,"isoWeek",n)),+a)}function wa(t,e,i,s){const r=Sa.length;for(let n=Sa.indexOf(t);n=e?i[s]:i[r]]=!0}}else t[e]=!0}function Ma(t,e,i){const s=[],r={},n=e.length;let a,o;for(a=0;a=0&&(e[h].major=!0);return e}(t,s,r,i):s}class Aa extends Hs{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),s=this._adapter=new Us._date(t.adapters.date);s.init(e),rt(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:ka(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:r,minDefined:n,maxDefined:a}=this.getUserBounds();function o(t){n||isNaN(t.min)||(s=Math.min(s,t.min)),a||isNaN(t.max)||(r=Math.max(r,t.max))}n&&a||(o(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||o(this.getMinMax(!1))),s=Y(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Y(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,n=function(t,e,i){let s=0,r=t.length;for(;ss&&t[r-1]>i;)r--;return s>0||r=Sa.indexOf(i);n--){const i=Sa[n];if(Ea[i].common&&t._adapter.diff(r,s,i)>=e-1)return i}return Sa[i?Sa.indexOf(i):0]}(this,n.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Sa.indexOf(t)+1,i=Sa.length;e+t.value)))}initOffsets(t){let e,i,s=0,r=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),r=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const n=t.length<3?.5:.25;s=Lt(s,0,n),r=Lt(r,0,n),this._offsets={start:s,end:r,factor:1/(s+1+r)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,n=r.unit||wa(r.minUnit,e,i,this._getLabelCapacity(e)),a=X(r.stepSize,1),o="week"===n&&r.isoWeekday,h=St(o)||!0===o,l={};let c,p,d=e;if(h&&(d=+t.startOf(d,"isoWeek",o)),d=+t.startOf(d,h?"day":n),t.diff(i,e,n)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+n);const f="data"===s.ticks.source&&this.getDataTimestamps();for(c=d,p=0;ct-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,s){const r=this.options,n=r.time.displayFormats,a=this._unit,o=this._majorUnit,h=a&&n[a],l=o&&n[o],c=i[e],p=o&&l&&c&&c.major,d=this._adapter.format(t,s||(p?l:h)),f=r.ticks.callback;return f?J(f,[d,e,i],this):d}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t=t[o].pos&&e<=t[h].pos&&({lo:o,hi:h}=Bt(t,"pos",e)),({pos:s,time:n}=t[o]),({pos:r,time:a}=t[h])):(e>=t[o].time&&e<=t[h].time&&({lo:o,hi:h}=Bt(t,"time",e)),({time:s,pos:n}=t[o]),({time:r,pos:a}=t[h]));const l=r-s;return l?n+(a-n)*(e-s)/l:n}Aa.id="time",Aa.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Da extends Aa{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ta(e,this.min),this._tableRange=Ta(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let n,a,o,h,l;for(n=0,a=t.length;n=e&&h<=i&&s.push(h);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(n=0,a=s.length;n100&&Oa.classList.add("vis")}));const Na=(t,e)=>t.filter((t=>t.City===e)),Ha=(t,e)=>{dataLayer.push({event:"spon.interactiveClick","spon.object":`Show City: ${t[0].City}`}),Fa=t;const i=document.getElementById("popup");var s;Ga(i,t[0]),Wa(i,e[t[0].City]),$a(i,t[0]),La.data.datasets[0].data=[],La.update(),s=[t[0].Percentages.Buildings,t[0].Percentages.Systems,t[0].Percentages.Living,t[0].Percentages.Leadership],La.data.datasets[0].data=s,La.update()},Ga=(t,e)=>{ja(t.querySelector("#popup-hero-img"),e.Images),t.querySelector(".popup-brief-rank").innerHTML=e.OverallRank,t.querySelector(".popup-brief-cityname").innerHTML=e.City,t.querySelector(".popup-brief-overall").innerHTML=e.OverallScore,t.querySelector(".popup-brief-buildings-overall").innerHTML=e.CircularBuildings,t.querySelector(".popup-brief-systems-overall").innerHTML=e.CircularSystems,t.querySelector(".popup-brief-living-overall").innerHTML=e.CircularLiving,t.querySelector(".popup-brief-leadership-overall").innerHTML=e.CircularLeadership},ja=(t,e)=>{t.src=e.DesktopJPEG,t.parentElement.children[0].srcset=e.MobileWebp,t.parentElement.children[1].srcset=e.MobileJPEG,t.parentElement.children[2].srcset=e.DesktopWebp,t.parentElement.children[3].srcset=e.DesktopJPEG},Wa=(t,e)=>{const i=t.querySelector(".popup-city-text");i.innerHTML=``,qa(i,e.Categories)},qa=(t,e)=>{e.forEach((e=>{const i=document.createElement("div");i.classList.add("popup-city-text-block");const s=document.createElement("h3");s.classList.add("popup-city-text-title-"+e.Title.toLowerCase()),s.innerText="Circular "+e.Title,i.append(s),e.Text.forEach((t=>{if("string"==typeof t){const e=document.createElement("p");e.innerText=t,i.append(e)}if("object"==typeof t){const e=document.createElement("p");e.classList.add("list"),e.innerHTML=`${t.ul}`,i.append(e);const s=document.createElement("ul");t.li.forEach((t=>{const e=document.createElement("li");e.innerText=t,s.append(e)})),i.append(s)}}));const r=document.createElement("h4");r.innerText="Related Links ",i.append(r);const n=document.createElement("ul");n.classList.add("related-links"),e.Links.forEach((t=>{const e=document.createElement("li"),i=document.createElement("a");i.href=t.Url,i.target="_blank",i.dataset.eventExternal="",i.innerText=t.Title,e.append(i),e.innerHTML+=" "+t.Source,n.append(e)})),i.append(n),t.append(i)}))},$a=(t,e)=>{const i=t.querySelector(".popup-card");i.querySelector(".popup-card-buildings-ov").innerHTML=e.CircularBuildings,i.querySelector(".popup-card-buildings-energy").innerHTML=e.CbEnergyEfficiency,i.querySelector(".popup-card-buildings-urban").innerHTML=e.CbBuildingCertifications,i.querySelector(".popup-card-buildings-cert").innerHTML=e.CbBuildingTemperature,i.querySelector(".popup-card-living-ov").innerHTML=e.CircularLiving,i.querySelector(".popup-card-living-green").innerHTML=e.CvGreenSpace,i.querySelector(".popup-card-living-transport").innerHTML=e.CvTransport,i.querySelector(".popup-card-living-sharing").innerHTML=e.CvSharingEconomy,i.querySelector(".popup-card-systems-ov").innerHTML=e.CircularSystems,i.querySelector(".popup-card-systems-solid").innerHTML=e.CsSolidWasteRecycling,i.querySelector(".popup-card-systems-renew").innerHTML=e.CsRenewableEnergyConsumption,i.querySelector(".popup-card-systems-water").innerHTML=e.CsWaterRecycling,i.querySelector(".popup-card-leadership-ov").innerHTML=e.CircularLeadership,i.querySelector(".popup-card-leadership-paris").innerHTML=e.ClTheParisAgreement,i.querySelector(".popup-card-leadership-poly").innerHTML=e.ClPoliciesRoadmaps,i.querySelector(".popup-card-leadership-investment").innerHTML=e.ClInvestment};function Ya(t,e,i){let s;const r=parseInt(Fa[0].OverallRank);s=e?r+1:r-1,s>=26?s=1:s<=0&&(s=25),Ba();const n=t.filter((t=>parseInt(t.OverallRank)==s));Ha(n,i),H("city",n[0].City)}function Ua(){document.body.classList.add("lock")}const Xa=t=>{fetch(t).then((t=>t.json())).then((t=>(t=>{const e=document.getElementById("index-container");t.forEach((t=>{const i=(s=`\n
\n
\n
\n
${t.OverallRank}
\n
${t.CircularBuildingsRank}
\n
${t.CbEnergyEfficiencyRank}
\n
${t.CbBuildingCertificationsRank}
\n
${t.CbBuildingTemperatureRank}
\n\n
${t.CircularSystemsRank}
\n
${t.CsSolidWasteRecyclingRank}
\n
${t.CsRenewableEnergyConsumptionRank}
\n
${t.CsWaterRecyclingRank}
\n\n
${t.CircularLivingRank}
\n
${t.CvGreenSpaceRank}
\n
${t.CvTransportRank}
\n
${t.CvSharingEconomyRank}
\n\n
${t.CircularLeadershipRank}
\n
${t.ClTheParisAgreementRank}
\n
${t.ClPoliciesRoadmapsRank}
\n
${t.ClInvestmentRank}
\n
\n
\n
${t.City}
\n
\n
\n
\n
${t.OverallScore}
\n
${t.CircularBuildings}
\n
${t.CbEnergyEfficiency}
\n
${t.CbBuildingCertifications}
\n
${t.CbBuildingTemperature}
\n\n
${t.CircularSystems}
\n
${t.CsSolidWasteRecycling}
\n
${t.CsRenewableEnergyConsumption}
\n
${t.CsWaterRecycling}
\n\n
${t.CircularLiving}
\n
${t.CvGreenSpace}
\n
${t.CvTransport}
\n
${t.CvSharingEconomy}
\n\n
${t.CircularLeadership}
\n
${t.ClTheParisAgreement}
\n
${t.ClPoliciesRoadmaps}
\n
${t.ClInvestment}
\n
\n
\n
\n
\n \n
\n
\n
\n
\n `,(new DOMParser).parseFromString(s,"text/html").body.firstChild);var s;e.append(i)}));const i=document.createElement("div");i.setAttribute("class","col-lg-1 col-sm-1 col-xs-1 my-sizer-element"),e.append(i),(()=>{var t=document.querySelector(".my-shuffle-container"),e=t.querySelector(".my-sizer-element");const i="overall";let s=i,r=i;t.classList.add(i);const n=new V(document.getElementById("index-container"),{itemSelector:".city",sizer:e});function a(t){return parseInt(t.getAttribute(`data-${s}`),10)}const o=()=>{if(document.body.dataset.sort=s,"overall"==s)n.sort({compare:function(t,e){return parseInt(t.element.getAttribute(`data-${s}`),10)-parseInt(e.element.getAttribute(`data-${s}`),10)}});else{const t={by:a};n.sort(t)}};o();const h=e=>{s=e,r&&t.classList.remove(r),t.classList.add(s),r=s};N(h,o),z(h,o)})(),Ka(t)})(t)))},Ka=t=>{fetch("https://assets.contentstack.io/v3/assets/blt57caa63e0368f6e8/bltad9bd98d7fbd6b80/636d28397487894eca7dcd1c/holcim-city-text.json").then((t=>t.json())).then((e=>function(t,e){const i=document.getElementsByClassName("city-content");for(let s of i)s.addEventListener("click",(function(){const i=Na(t,this.dataset.city);Ha(i,e),H("city",this.dataset.city),Ua()}));document.getElementById("popup-close").addEventListener("click",(function(){document.body.classList.remove("lock"),Oa.classList.remove("vis"),H()})),document.getElementById("popup-prev").addEventListener("click",(function(){Ya(t,!1,e)})),document.getElementById("popup-next").addEventListener("click",(function(){Ya(t,!0,e)})),Oa.addEventListener("click",(function(){Ba()})),function(t,e){const i=document.getElementById("learn-more-select-dropdown");i.children[0].addEventListener("click",Va);const s=i.children[1].children;for(let i of s)i.addEventListener("click",(()=>{const s=Na(t,i.innerText);Ha(s,e),Ua(),za()}));document.addEventListener("click",(function(t){i.contains(t.target)||za()}))}(t,e),La=new Zr(document.getElementById("popup-city-chart"),{type:"doughnut",data:{datasets:[{label:"My First Dataset",data:[],backgroundColor:["#1D4370","#04BBF1","#6FE4C6","#94C12E"],hoverOffset:4}]},options:{borderWidth:0,plugins:{tooltip:{enabled:!0,backgroundColor:"#FFF",titleColor:"#000",titleAlign:"center",bodyFont:{size:18,weight:"700",family:'"Mulish", Helvetica, sans-serif'},bodyColor:"#000",padding:20,borderColor:"#000",borderWidth:1,caretSize:10,cornerRadius:0,displayColors:!1,callbacks:{label:function(t){return`${t.parsed}%`}}}}}});const s=(()=>{if(window.location.search){const t=new URLSearchParams(window.location.search),e=Object.fromEntries(t.entries());if(e.city)return decodeURI(e.city)}})();if(s){const i=s.replace(/^\w/,(t=>t.toUpperCase()));if(i){const s=Na(t,i);Ha(s,e),Ua()}}}(t,e)))};var Ja=i(355),Za=i.n(Ja),Qa=i(421),to=i.n(Qa);const eo="https://dev-wbo-assets-s3.s3.amazonaws.com/s3/mspandorasbox/holcim/assets/animations";let io=0,so=!0;document.addEventListener("scroll",(function(t){var e=window.pageYOffset||document.documentElement.scrollTop;so=e>io,io=e<=0?0:e}));const ro=new(Za())({trigger:{offset:{element:{x:0,y:(t,e,i)=>.2},viewport:{x:0,y:(t,e,i)=>t.visible?0:.2}}}}),no=[[0,48],[48,96],[96,147],[147,192],[192,240]],ao=[[48,0],[96,48],[144,96],[192,144],[240,192]],oo=document.getElementById("building-lottie"),ho=to().loadAnimation({container:oo,renderer:"svg",loop:!1,autoplay:!1,path:`${eo}/mobile_intro.json`,rendererSettings:{preserveAspectRatio:"xMinYMin slice"}}),lo=document.getElementById("systems-lottie"),co=to().loadAnimation({container:lo,renderer:"svg",loop:!1,autoplay:!1,path:`${eo}/mobile_step1.json`,rendererSettings:{preserveAspectRatio:"xMinYMin slice"}}),po=document.getElementById("living-lottie"),fo=to().loadAnimation({container:po,renderer:"svg",loop:!1,autoplay:!1,path:`${eo}/mobile_step2.json`,rendererSettings:{preserveAspectRatio:"xMinYMin slice"}}),uo=document.getElementById("leadership-lottie"),mo=to().loadAnimation({container:uo,renderer:"svg",loop:!1,autoplay:!1,path:`${eo}/mobile_step3.json`,rendererSettings:{preserveAspectRatio:"xMinYMin slice"}});function go(t){switch(t){case 1:ho.play();break;case 2:co.play();break;case 3:fo.play();break;case 4:mo.play()}}const yo=document.getElementsByClassName("behind-video-thumbnail-clickable"),vo=()=>{for(var t=0;t{e&&(function(){const t=(()=>{if(window.location.search){const t=new URLSearchParams(window.location.search),e=Object.fromEntries(t.entries());if(e.v)return decodeURI(e.v)}})(),e=document.getElementById(`${t}--video`);e&&(xo(e),_o(e.dataset.url,e.dataset.length,e.children[1].children[0].innerHTML,e.children[1].children[1].innerHTML,e.children[1].children[2].innerHTML))}(),e=!1)}};function bo(t){const e=t.replace("--video","");window.history.replaceState(null,null,`?v=${e}`)}function xo(t){for(var e=0;e{function t(){const t=window.document.location.href,e=encodeURIComponent(t),i={facebook:"https://www.facebook.com/sharer/sharer.php?u=",twitter:" https://twitter.com/share?url=",linkedin:"https://www.linkedin.com/sharing/share-offsite/?url="}[this.dataset.site]+e;dataLayer.push({event:"spon.interactiveClick","spon.object":`${this.dataset.site} shared`}),window.open(i,"share","width=626, height=600")}const e=document.getElementsByClassName("share-article-btn");for(let i=0;i{To()}))}));const wo=document.getElementById("mid-collage"),Co=document.querySelector(".mid-collage-ring"),Mo=document.querySelector(".mid-collage-dog"),Ao=document.querySelector(".mid-collage-building img"),To=()=>{(()=>{const t=document.getElementById("needle-line"),e=document.getElementById("hero");let i=window.scrollY;const s=`transform: translate(-50%, 50%) rotate(${parseInt(i/e.offsetHeight*2.5*100)+180}deg) translate(-50%, 50%); transform-box: fill-box; transform-origin: center;`;t&&t.setAttribute("style",s)})(),wo.getBoundingClientRect().y,wo.getBoundingClientRect().height,wo.getBoundingClientRect().y,window.innerHeight,wo.getBoundingClientRect().height,wo.getBoundingClientRect().y,window.innerHeight,wo.getBoundingClientRect().height,window.innerHeight,wo.getBoundingClientRect().y,window.innerHeight,wo.getBoundingClientRect().height,window.innerHeight;const t=function(t,e){let i;return i=(-t.getBoundingClientRect().y+window.innerHeight)/(t.getBoundingClientRect().height+window.innerHeight/2),i}(wo);if(t>0&&t<1){Co.style=`transform: rotate(${100*t/2}deg)`,Mo.style=`transform: translateX(${100*t/2}px)`;let e=-100*t*.25+25;Ao.style=`transform: translateY(${e}%)`}};document.getElementById("indepth-method").addEventListener("click",(function(){document.getElementById("indepth-method-hide").classList.toggle("show"),"Full Methodology"==this.innerText?this.innerText="Hide":this.innerText="Full Methodology"}));const Do=document.getElementById("sticky-nav").querySelectorAll("li a"),Io=document.getElementById("sticky-nav").querySelector(".odometer");for(let t=0;t{Xa("https://assets.contentstack.io/v3/assets/blt57caa63e0368f6e8/blt8872d7a44cc86cdf/6356cb270f8594109805288f/holcim-nov-3-22.json");((t,e,i)=>{fetch(e).then((t=>t.text())).then((e=>{!function(e){const i=document.createElement("div");i.className="svg-wrapper",i.innerHTML=e,t.append(i)}(e)})).catch(console.error.bind(console))})(document.getElementById("hero-svg"),"https://images.contentstack.io/v3/assets/blt57caa63e0368f6e8/blt7f83d9204fce9215/62b36d84bc32396c52cd7d7e/hero-06.svg");const t=new(Za());t.add("[data-trigger]"),t.add("[data-triggerAlways]",{once:!1}),t.add("[data-trigger]");const e=document.querySelectorAll("[data-callback]"),i=document.getElementById("sticky-nav"),s=i.children[1].children,r=i.children[0];r.addEventListener("click",(function(t){i.classList.toggle("open")}));for(var n=0;n{o(),this.classList.add("active")}),100)}));function a(t){r.innerText=t}function o(){for(var t=0;t{t.add(e,{toggle:{callback:{in:t=>{const e=document.querySelector(`[data-${t.element.dataset.anchor}]`);o(),a(e.firstElementChild.innerText),e.classList.add("active")}}}})})),(()=>{const t=document.getElementsByClassName("meth-category-section"),e=document.querySelectorAll(".meth-trigger"),i=document.getElementById("bk-ring"),s=document.getElementById("methedology-lottie"),r=to().loadAnimation({container:s,renderer:"svg",loop:!1,autoplay:!1,path:`${eo}/desktop_anim.json`,rendererSettings:{preserveAspectRatio:"xMinYMin slice"}});r.stop();for(let s=0;s{t[s].classList.add("show"),0==s?i.classList.remove("grow"):1==s&&i.classList.add("grow"),so?r.playSegments(no[s],!0):(s==e.length-1&&i.classList.add("grow"),s>0&&s{0==s&&(so?r.playSegments(ao[s],!0):r.playSegments(ao[0],!0)),s==e.length-1&&so?i.classList.remove("grow"):t[s].classList.remove("show")}}}});for(let e=0;e{go(e)}}}})})(),window.innerWidth<760?document.body.classList.add("mobile"):document.body.classList.add("desktop"),vo(),function(){const t=document.querySelectorAll("[data-event-external]");for(let e=0;e{"use strict";t(t.s=910)}]);