1import{i as e,n as t,o as n,t as r}from"./jquery.module-B6IvM_qW.js";var i=e(((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define(n):typeof t==`object`&&t.exports?t.exports=n():e.EvEmitter=n()})(typeof window<`u`?window:e,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(!(!e||!t)){var n=this._events=this._events||{},r=n[e]=n[e]||[];return r.indexOf(t)==-1&&r.push(t),this}},t.once=function(e,t){if(!(!e||!t)){this.on(e,t);var n=this._onceEvents=this._onceEvents||{},r=n[e]=n[e]||{};return r[t]=!0,this}},t.off=function(e,t){var n=this._events&&this._events[e];if(!(!n||!n.length)){var r=n.indexOf(t);return r!=-1&&n.splice(r,1),this}},t.emitEvent=function(e,t){var n=this._events&&this._events[e];if(!(!n||!n.length)){n=n.slice(0),t||=[];for(var r=this._onceEvents&&this._onceEvents[e],i=0;i<n.length;i++){var a=n[i];r&&r[a]&&(this.off(e,a),delete r[a]),a.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e})})),a=e(((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define(n):typeof t==`object`&&t.exports?t.exports=n():e.getSize=n()})(window,function(){function e(e){var t=parseFloat(e);return e.indexOf(`%`)==-1&&!isNaN(t)&&t}function t(){}var n=typeof console>`u`?t:function(e){console.error(e)},r=[`paddingLeft`,`paddingRight`,`paddingTop`,`paddingBottom`,`marginLeft`,`marginRight`,`marginTop`,`marginBottom`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`borderBottomWidth`],i=r.length;function a(){for(var e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},t=0;t<i;t++){var n=r[t];e[n]=0}return e}function o(e){var t=getComputedStyle(e);return t||n(`Style returned `+t+`. Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1`),t}var s=!1,c;function l(){if(!s){s=!0;var t=document.createElement(`div`);t.style.width=`200px`,t.style.padding=`1px 2px 3px 4px`,t.style.borderStyle=`solid`,t.style.borderWidth=`1px 2px 3px 4px`,t.style.boxSizing=`border-box`;var n=document.body||document.documentElement;n.appendChild(t);var r=o(t);c=Math.round(e(r.width))==200,u.isBoxSizeOuter=c,n.removeChild(t)}}function u(t){if(l(),typeof t==`string`&&(t=document.querySelector(t)),!(!t||typeof t!=`object`||!t.nodeType)){var n=o(t);if(n.display==`none`)return a();var s={};s.width=t.offsetWidth,s.height=t.offsetHeight;for(var u=s.isBorderBox=n.boxSizing==`border-box`,d=0;d<i;d++){var f=r[d],p=n[f],m=parseFloat(p);s[f]=isNaN(m)?0:m}var h=s.paddingLeft+s.paddingRight,g=s.paddingTop+s.paddingBottom,_=s.marginLeft+s.marginRight,v=s.marginTop+s.marginBottom,y=s.borderLeftWidth+s.borderRightWidth,b=s.borderTopWidth+s.borderBottomWidth,x=u&&c,S=e(n.width);S!==!1&&(s.width=S+(x?0:h+y));var C=e(n.height);return C!==!1&&(s.height=C+(x?0:g+b)),s.innerWidth=s.width-(h+y),s.innerHeight=s.height-(g+b),s.outerWidth=s.width+_,s.outerHeight=s.height+v,s}}return u})})),o=e(((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define(n):typeof t==`object`&&t.exports?t.exports=n():e.matchesSelector=n()})(window,function(){var e=(function(){var e=window.Element.prototype;if(e.matches)return`matches`;if(e.matchesSelector)return`matchesSelector`;for(var t=[`webkit`,`moz`,`ms`,`o`],n=0;n<t.length;n++){var r=t[n]+`MatchesSelector`;if(e[r])return r}})();return function(t,n){return t[e](n)}})})),s=e(((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define([`desandro-matches-selector/matches-selector`],function(t){return n(e,t)}):typeof t==`object`&&t.exports?t.exports=n(e,o()):e.fizzyUIUtils=n(e,e.matchesSelector)})(window,function(e,t){var n={};n.extend=function(e,t){for(var n in t)e[n]=t[n];return e},n.modulo=function(e,t){return(e%t+t)%t};var r=Array.prototype.slice;n.makeArray=function(e){return Array.isArray(e)?e:e==null?[]:typeof e==`object`&&typeof e.length==`number`?r.call(e):[e]},n.removeFrom=function(e,t){var n=e.indexOf(t);n!=-1&&e.splice(n,1)},n.getParent=function(e,n){for(;e.parentNode&&e!=document.body;)if(e=e.parentNode,t(e,n))return e},n.getQueryElement=function(e){return typeof e==`string`?document.querySelector(e):e},n.handleEvent=function(e){var t=`on`+e.type;this[t]&&this[t](e)},n.filterFindElements=function(e,r){e=n.makeArray(e);var i=[];return e.forEach(function(e){if(e instanceof HTMLElement){if(!r){i.push(e);return}t(e,r)&&i.push(e);for(var n=e.querySelectorAll(r),a=0;a<n.length;a++)i.push(n[a])}}),i},n.debounceMethod=function(e,t,n){n||=100;var r=e.prototype[t],i=t+`Timeout`;e.prototype[t]=function(){var e=this[i];clearTimeout(e);var t=arguments,a=this;this[i]=setTimeout(function(){r.apply(a,t),delete a[i]},n)}},n.docReady=function(e){var t=document.readyState;t==`complete`||t==`interactive`?setTimeout(e):document.addEventListener(`DOMContentLoaded`,e)},n.toDashed=function(e){return e.replace(/(.)([A-Z])/g,function(e,t,n){return t+`-`+n}).toLowerCase()};var i=e.console;return n.htmlInit=function(t,r){n.docReady(function(){var a=n.toDashed(r),o=`data-`+a,s=document.querySelectorAll(`[`+o+`]`),c=document.querySelectorAll(`.js-`+a),l=n.makeArray(s).concat(n.makeArray(c)),u=o+`-options`,d=e.jQuery;l.forEach(function(e){var n=e.getAttribute(o)||e.getAttribute(u),a;try{a=n&&JSON.parse(n)}catch(t){i&&i.error(`Error parsing `+o+` on `+e.className+`: `+t);return}var s=new t(e,a);d&&d.data(e,r,s)})})},n})})),c=e(((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define([`ev-emitter/ev-emitter`,`get-size/get-size`],n):typeof t==`object`&&t.exports?t.exports=n(i(),a()):(e.Outlayer={},e.Outlayer.Item=n(e.EvEmitter,e.getSize))})(window,function(e,t){function n(e){for(var t in e)return!1;return!0}var r=document.documentElement.style,i=typeof r.transition==`string`?`transition`:`WebkitTransition`,a=typeof r.transform==`string`?`transform`:`WebkitTransform`,o={WebkitTransition:`webkitTransitionEnd`,transition:`transitionend`}[i],s={transform:a,transition:i,transitionDuration:i+`Duration`,transitionProperty:i+`Property`,transitionDelay:i+`Delay`};function c(e,t){e&&(this.element=e,this.layout=t,this.position={x:0,y:0},this._create())}var l=c.prototype=Object.create(e.prototype);l.constructor=c,l._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:`absolute`})},l.handleEvent=function(e){var t=`on`+e.type;this[t]&&this[t](e)},l.getSize=function(){this.size=t(this.element)},l.css=function(e){var t=this.element.style;for(var n in e){var r=s[n]||n;t[r]=e[n]}},l.getPosition=function(){var e=getComputedStyle(this.element),t=this.layout._getOption(`originLeft`),n=this.layout._getOption(`originTop`),r=e[t?`left`:`right`],i=e[n?`top`:`bottom`],a=parseFloat(r),o=parseFloat(i),s=this.layout.size;r.indexOf(`%`)!=-1&&(a=a/100*s.width),i.indexOf(`%`)!=-1&&(o=o/100*s.height),a=isNaN(a)?0:a,o=isNaN(o)?0:o,a-=t?s.paddingLeft:s.paddingRight,o-=n?s.paddingTop:s.paddingBottom,this.position.x=a,this.position.y=o},l.layoutPosition=function(){var e=this.layout.size,t={},n=this.layout._getOption(`originLeft`),r=this.layout._getOption(`originTop`),i=n?`paddingLeft`:`paddingRight`,a=n?`left`:`right`,o=n?`right`:`left`,s=this.position.x+e[i];t[a]=this.getXValue(s),t[o]=``;var c=r?`paddingTop`:`paddingBottom`,l=r?`top`:`bottom`,u=r?`bottom`:`top`,d=this.position.y+e[c];t[l]=this.getYValue(d),t[u]=``,this.css(t),this.emitEvent(`layout`,[this])},l.getXValue=function(e){var t=this.layout._getOption(`horizontal`);return this.layout.options.percentPosition&&!t?e/this.layout.size.width*100+`%`:e+`px`},l.getYValue=function(e){var t=this.layout._getOption(`horizontal`);return this.layout.options.percentPosition&&t?e/this.layout.size.height*100+`%`:e+`px`},l._transitionTo=function(e,t){this.getPosition();var n=this.position.x,r=this.position.y,i=e==this.position.x&&t==this.position.y;if(this.setPosition(e,t),i&&!this.isTransitioning){this.layoutPosition();return}var a=e-n,o=t-r,s={};s.transform=this.getTranslate(a,o),this.transition({to:s,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},l.getTranslate=function(e,t){var n=this.layout._getOption(`originLeft`),r=this.layout._getOption(`originTop`);return e=n?e:-e,t=r?t:-t,`translate3d(`+e+`px, `+t+`px, 0)`},l.goTo=function(e,t){this.setPosition(e,t),this.layoutPosition()},l.moveTo=l._transitionTo,l.setPosition=function(e,t){this.position.x=parseFloat(e),this.position.y=parseFloat(t)},l._nonTransition=function(e){for(var t in this.css(e.to),e.isCleaning&&this._removeStyles(e.to),e.onTransitionEnd)e.onTransitionEnd[t].call(this)},l.transition=function(e){if(!parseFloat(this.layout.options.transitionDuration)){this._nonTransition(e);return}var t=this._transn;for(var n in e.onTransitionEnd)t.onEnd[n]=e.onTransitionEnd[n];for(n in e.to)t.ingProperties[n]=!0,e.isCleaning&&(t.clean[n]=!0);e.from&&(this.css(e.from),this.element.offsetHeight),this.enableTransition(e.to),this.css(e.to),this.isTransitioning=!0};function u(e){return e.replace(/([A-Z])/g,function(e){return`-`+e.toLowerCase()})}var d=`opacity,`+u(a);l.enableTransition=function(){if(!this.isTransitioning){var e=this.layout.options.transitionDuration;e=typeof e==`number`?e+`ms`:e,this.css({transitionProperty:d,transitionDuration:e,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(o,this,!1)}},l.onwebkitTransitionEnd=function(e){this.ontransitionend(e)},l.onotransitionend=function(e){this.ontransitionend(e)};var f={"-webkit-transform":`transform`};l.ontransitionend=function(e){if(e.target===this.element){var t=this._transn,r=f[e.propertyName]||e.propertyName;delete t.ingProperties[r],n(t.ingProperties)&&this.disableTransition(),r in t.clean&&(this.element.style[e.propertyName]=``,delete t.clean[r]),r in t.onEnd&&(t.onEnd[r].call(this),delete t.onEnd[r]),this.emitEvent(`transitionEnd`,[this])}},l.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(o,this,!1),this.isTransitioning=!1},l._removeStyles=function(e){var t={};for(var n in e)t[n]=``;this.css(t)};var p={transitionProperty:``,transitionDuration:``,transitionDelay:``};return l.removeTransitionStyles=function(){this.css(p)},l.stagger=function(e){e=isNaN(e)?0:e,this.staggerDelay=e+`ms`},l.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:``}),this.emitEvent(`remove`,[this])},l.remove=function(){if(!i||!parseFloat(this.layout.options.transitionDuration)){this.removeElem();return}this.once(`transitionEnd`,function(){this.removeElem()}),this.hide()},l.reveal=function(){delete this.isHidden,this.css({display:``});var e=this.layout.options,t={},n=this.getHideRevealTransitionEndProperty(`visibleStyle`);t[n]=this.onRevealTransitionEnd,this.transition({from:e.hiddenStyle,to:e.visibleStyle,isCleaning:!0,onTransitionEnd:t})},l.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent(`reveal`)},l.getHideRevealTransitionEndProperty=function(e){var t=this.layout.options[e];if(t.opacity)return`opacity`;for(var n in t)return n},l.hide=function(){this.isHidden=!0,this.css({display:``});var e=this.layout.options,t={},n=this.getHideRevealTransitionEndProperty(`hiddenStyle`);t[n]=this.onHideTransitionEnd,this.transition({from:e.visibleStyle,to:e.hiddenStyle,isCleaning:!0,onTransitionEnd:t})},l.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:`none`}),this.emitEvent(`hide`))},l.destroy=function(){this.css({position:``,left:``,right:``,top:``,bottom:``,transition:``,transform:``})},c})})),l=e(((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define([`ev-emitter/ev-emitter`,`get-size/get-size`,`fizzy-ui-utils/utils`,`./item`],function(t,r,i,a){return n(e,t,r,i,a)}):typeof t==`object`&&t.exports?t.exports=n(e,i(),a(),s(),c()):e.Outlayer=n(e,e.EvEmitter,e.getSize,e.fizzyUIUtils,e.Outlayer.Item)})(window,function(e,t,n,r,i){var a=e.console,o=e.jQuery,s=function(){},c=0,l={};function u(e,t){var n=r.getQueryElement(e);
1if(!n){a&&a.error(`Bad element for `+this.constructor.namespace+`: `+(n||e));return}this.element=n,o&&(this.$element=o(this.element)),this.options=r.extend({},this.constructor.defaults),this.option(t);var i=++c;this.element.outlayerGUID=i,l[i]=this,this._create(),this._getOption(`initLayout`)&&this.layout()}u.namespace=`outlayer`,u.Item=i,u.defaults={containerStyle:{position:`relative`},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:`0.4s`,hiddenStyle:{opacity:0,transform:`scale(0.001)`},visibleStyle:{opacity:1,transform:`scale(1)`}};var d=u.prototype;r.extend(d,t.prototype),d.option=function(e){r.extend(this.options,e)},d._getOption=function(e){var t=this.constructor.compatOptions[e];return t&&this.options[t]!==void 0?this.options[t]:this.options[e]},u.compatOptions={initLayout:`isInitLayout`,horizontal:`isHorizontal`,layoutInstant:`isLayoutInstant`,originLeft:`isOriginLeft`,originTop:`isOriginTop`,resize:`isResizeBound`,resizeContainer:`isResizingContainer`},d._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),r.extend(this.element.style,this.options.containerStyle),this._getOption(`resize`)&&this.bindResize()},d.reloadItems=function(){this.items=this._itemize(this.element.children)},d._itemize=function(e){for(var t=this._filterFindItemElements(e),n=this.constructor.Item,r=[],i=0;i<t.length;i++){var a=t[i],o=new n(a,this);r.push(o)}return r},d._filterFindItemElements=function(e){return r.filterFindElements(e,this.options.itemSelector)},d.getItemElements=function(){return this.items.map(function(e){return e.element})},d.layout=function(){this._resetLayout(),this._manageStamps();var e=this._getOption(`layoutInstant`),t=e===void 0?!this._isLayoutInited:e;this.layoutItems(this.items,t),this._isLayoutInited=!0},d._init=d.layout,d._resetLayout=function(){this.getSize()},d.getSize=function(){this.size=n(this.element)},d._getMeasurement=function(e,t){var r=this.options[e],i;r?(typeof r==`string`?i=this.element.querySelector(r):r instanceof HTMLElement&&(i=r),this[e]=i?n(i)[t]:r):this[e]=0},d.layoutItems=function(e,t){e=this._getItemsForLayout(e),this._layoutItems(e,t),this._postLayout()},d._getItemsForLayout=function(e){return e.filter(function(e){return!e.isIgnored})},d._layoutItems=function(e,t){if(this._emitCompleteOnItems(`layout`,e),!(!e||!e.length)){var n=[];e.forEach(function(e){var r=this._getItemLayoutPosition(e);r.item=e,r.isInstant=t||e.isLayoutInstant,n.push(r)},this),this._processLayoutQueue(n)}},d._getItemLayoutPosition=function(){return{x:0,y:0}},d._processLayoutQueue=function(e){this.updateStagger(),e.forEach(function(e,t){this._positionItem(e.item,e.x,e.y,e.isInstant,t)},this)},d.updateStagger=function(){var e=this.options.stagger;if(e==null){this.stagger=0;return}return this.stagger=m(e),this.stagger},d._positionItem=function(e,t,n,r,i){r?e.goTo(t,n):(e.stagger(i*this.stagger),e.moveTo(t,n))},d._postLayout=function(){this.resizeContainer()},d.resizeContainer=function(){if(this._getOption(`resizeContainer`)){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},d._getContainerSize=s,d._setContainerMeasure=function(e,t){if(e!==void 0){var n=this.size;n.isBorderBox&&(e+=t?n.paddingLeft+n.paddingRight+n.borderLeftWidth+n.borderRightWidth:n.paddingBottom+n.paddingTop+n.borderTopWidth+n.borderBottomWidth),e=Math.max(e,0),this.element.style[t?`width`:`height`]=e+`px`}},d._emitCompleteOnItems=function(e,t){var n=this;function r(){n.dispatchEvent(e+`Complete`,null,[t])}var i=t.length;if(!t||!i){r();return}var a=0;function o(){a++,a==i&&r()}t.forEach(function(t){t.once(e,o)})},d.dispatchEvent=function(e,t,n){var r=t?[t].concat(n):n;if(this.emitEvent(e,r),o)if(this.$element=this.$element||o(this.element),t){var i=o.Event(t);i.type=e,this.$element.trigger(i,n)}else this.$element.trigger(e,n)},d.ignore=function(e){var t=this.getItem(e);t&&(t.isIgnored=!0)},d.unignore=function(e){var t=this.getItem(e);t&&delete t.isIgnored},d.stamp=function(e){e=this._find(e),e&&(this.stamps=this.stamps.concat(e),e.forEach(this.ignore,this))},d.unstamp=function(e){e=this._find(e),e&&e.forEach(function(e){r.removeFrom(this.stamps,e),this.unignore(e)},this)},d._find=function(e){if(e)return typeof e==`string`&&(e=this.element.querySelectorAll(e)),e=r.makeArray(e),e},d._manageStamps=function(){!this.stamps||!this.stamps.length||(this._getBoundingRect
1(),this.stamps.forEach(this._manageStamp,this))},d._getBoundingRect=function(){var e=this.element.getBoundingClientRect(),t=this.size;this._boundingRect={left:e.left+t.paddingLeft+t.borderLeftWidth,top:e.top+t.paddingTop+t.borderTopWidth,right:e.right-(t.paddingRight+t.borderRightWidth),bottom:e.bottom-(t.paddingBottom+t.borderBottomWidth)}},d._manageStamp=s,d._getElementOffset=function(e){var t=e.getBoundingClientRect(),r=this._boundingRect,i=n(e);return{left:t.left-r.left-i.marginLeft,top:t.top-r.top-i.marginTop,right:r.right-t.right-i.marginRight,bottom:r.bottom-t.bottom-i.marginBottom}},d.handleEvent=r.handleEvent,d.bindResize=function(){e.addEventListener(`resize`,this),this.isResizeBound=!0},d.unbindResize=function(){e.removeEventListener(`resize`,this),this.isResizeBound=!1},d.onresize=function(){this.resize()},r.debounceMethod(u,`onresize`,100),d.resize=function(){!this.isResizeBound||!this.needsResizeLayout()||this.layout()},d.needsResizeLayout=function(){var e=n(this.element);return this.size&&e&&e.innerWidth!==this.size.innerWidth},d.addItems=function(e){var t=this._itemize(e);return t.length&&(this.items=this.items.concat(t)),t},d.appended=function(e){var t=this.addItems(e);t.length&&(this.layoutItems(t,!0),this.reveal(t))},d.prepended=function(e){var t=this._itemize(e);if(t.length){var n=this.items.slice(0);this.items=t.concat(n),this._resetLayout(),this._manageStamps(),this.layoutItems(t,!0),this.reveal(t),this.layoutItems(n)}},d.reveal=function(e){if(this._emitCompleteOnItems(`reveal`,e),!(!e||!e.length)){var t=this.updateStagger();e.forEach(function(e,n){e.stagger(n*t),e.reveal()})}},d.hide=function(e){if(this._emitCompleteOnItems(`hide`,e),!(!e||!e.length)){var t=this.updateStagger();e.forEach(function(e,n){e.stagger(n*t),e.hide()})}},d.revealItemElements=function(e){var t=this.getItems(e);this.reveal(t)},d.hideItemElements=function(e){var t=this.getItems(e);this.hide(t)},d.getItem=function(e){for(var t=0;t<this.items.length;t++){var n=this.items[t];if(n.element==e)return n}},d.getItems=function(e){e=r.makeArray(e);var t=[];return e.forEach(function(e){var n=this.getItem(e);n&&t.push(n)},this),t},d.remove=function(e){var t=this.getItems(e);this._emitCompleteOnItems(`remove`,t),!(!t||!t.length)&&t.forEach(function(e){e.remove(),r.removeFrom(this.items,e)},this)},d.destroy=function(){var e=this.element.style;e.height=``,e.position=``,e.width=``,this.items.forEach(function(e){e.destroy()}),this.unbindResize();var t=this.element.outlayerGUID;delete l[t],delete this.element.outlayerGUID,o&&o.removeData(this.element,this.constructor.namespace)},u.data=function(e){e=r.getQueryElement(e);var t=e&&e.outlayerGUID;return t&&l[t]},u.create=function(e,t){var n=f(u);return n.defaults=r.extend({},u.defaults),r.extend(n.defaults,t),n.compatOptions=r.extend({},u.compatOptions),n.namespace=e,n.data=u.data,n.Item=f(i),r.htmlInit(n,e),o&&o.bridget&&o.bridget(e,n),n};function f(e){function t(){e.apply(this,arguments)}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t}var p={ms:1,s:1e3};function m(e){if(typeof e==`number`)return e;var t=e.match(/(^\d*\.?\d*)(\w*)/),n=t&&t[1],r=t&&t[2];if(!n.length)return 0;n=parseFloat(n);var i=p[r]||1;return n*i}return u.Item=i,u})})),u=e(((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define([`outlayer/outlayer`],n):typeof t==`object`&&t.exports?t.exports=n(l()):(e.Isotope=e.Isotope||{},e.Isotope.Item=n(e.Outlayer))})(window,function(e){function t(){e.Item.apply(this,arguments)}var n=t.prototype=Object.create(e.Item.prototype),r=n._create;n._create=function(){this.id=this.layout.itemGUID++,r.call(this),this.sortData={}},n.updateSortData=function(){if(!this.isIgnored){this.sortData.id=this.id,this.sortData[`original-order`]=this.id,this.sortData.random=Math.random();var e=this.layout.options.getSortData,t=this.layout._sorters;for(var n in e){var r=t[n];this.sortData[n]=r(this.element,this)}}};var i=n.destroy;return n.destroy=function(){i.apply(this,arguments),this.css({display:``})},t})})),d=e(((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define([`get-size/get-size`,`outlayer/outlayer`],n):typeof t==`object`&&t.exports?t.exports=n(a(),l()):(e.Isotope=e.Isotope||{},e.Isotope.LayoutMode=n(e.getSize,e.Outlayer))})(window,function(e,t){function n(e){this.isotope=e,e&&(this.options=e.options[this.namespace],this.element=e.element,this.items=e.filteredItems,this.size=e.size)}var r=n.prototype;return[`_resetLayout`,`_getItemLayoutPosition`,`_manageStamp`,`_getContainerSize`,`_getElementOffset`,`needsResizeLayout`,`_getOption`].forEach(function(e){r[e]=function(){return t.prototype[e].apply(this.isotope,arguments)}}),r.needsVerticalResizeLayout=function(){var t=e(this.isotope.element);
1return this.isotope.size&&t&&t.innerHeight!=this.isotope.size.innerHeight},r._getMeasurement=function(){this.isotope._getMeasurement.apply(this,arguments)},r.getColumnWidth=function(){this.getSegmentSize(`column`,`Width`)},r.getRowHeight=function(){this.getSegmentSize(`row`,`Height`)},r.getSegmentSize=function(e,t){var n=e+t,r=`outer`+t;if(this._getMeasurement(n,r),!this[n]){var i=this.getFirstItemSize();this[n]=i&&i[r]||this.isotope.size[`inner`+t]}},r.getFirstItemSize=function(){var t=this.isotope.filteredItems[0];return t&&t.element&&e(t.element)},r.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},r.getSize=function(){this.isotope.getSize(),this.size=this.isotope.size},n.modes={},n.create=function(e,t){function i(){n.apply(this,arguments)}return i.prototype=Object.create(r),i.prototype.constructor=i,t&&(i.options=t),i.prototype.namespace=e,n.modes[e]=i,i},n})})),f=e(((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define([`outlayer/outlayer`,`get-size/get-size`],n):typeof t==`object`&&t.exports?t.exports=n(l(),a()):e.Masonry=n(e.Outlayer,e.getSize)})(window,function(e,t){var n=e.create(`masonry`);n.compatOptions.fitWidth=`isFitWidth`;var r=n.prototype;return r._resetLayout=function(){this.getSize(),this._getMeasurement(`columnWidth`,`outerWidth`),this._getMeasurement(`gutter`,`outerWidth`),this.measureColumns(),this.colYs=[];for(var e=0;e<this.cols;e++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},r.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var e=this.items[0],n=e&&e.element;this.columnWidth=n&&t(n).outerWidth||this.containerWidth}var r=this.columnWidth+=this.gutter,i=this.containerWidth+this.gutter,a=i/r,o=r-i%r;a=Math[o&&o<1?`round`:`floor`](a),this.cols=Math.max(a,1)},r.getContainerWidth=function(){var e=t(this._getOption(`fitWidth`)?this.element.parentNode:this.element);this.containerWidth=e&&e.innerWidth},r._getItemLayoutPosition=function(e){e.getSize();var t=e.size.outerWidth%this.columnWidth,n=Math[t&&t<1?`round`:`ceil`](e.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var r=this.options.horizontalOrder?`_getHorizontalColPosition`:`_getTopColPosition`,i=this[r](n,e),a={x:this.columnWidth*i.col,y:i.y},o=i.y+e.size.outerHeight,s=n+i.col,c=i.col;c<s;c++)this.colYs[c]=o;return a},r._getTopColPosition=function(e){var t=this._getTopColGroup(e),n=Math.min.apply(Math,t);return{col:t.indexOf(n),y:n}},r._getTopColGroup=function(e){if(e<2)return this.colYs;for(var t=[],n=this.cols+1-e,r=0;r<n;r++)t[r]=this._getColGroupY(r,e);return t},r._getColGroupY=function(e,t){if(t<2)return this.colYs[e];var n=this.colYs.slice(e,e+t);return Math.max.apply(Math,n)},r._getHorizontalColPosition=function(e,t){var n=this.horizontalColIndex%this.cols;n=e>1&&n+e>this.cols?0:n;var r=t.size.outerWidth&&t.size.outerHeight;return this.horizontalColIndex=r?n+e:this.horizontalColIndex,{col:n,y:this._getColGroupY(n,e)}},r._manageStamp=function(e){var n=t(e),r=this._getElementOffset(e),i=this._getOption(`originLeft`)?r.left:r.right,a=i+n.outerWidth,o=Math.floor(i/this.columnWidth);o=Math.max(0,o);var s=Math.floor(a/this.columnWidth);s-=a%this.columnWidth?0:1,s=Math.min(this.cols-1,s);for(var c=(this._getOption(`originTop`)?r.top:r.bottom)+n.outerHeight,l=o;l<=s;l++)this.colYs[l]=Math.max(c,this.colYs[l])},r._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var e={height:this.maxY};return this._getOption(`fitWidth`)&&(e.width=this._getContainerFitWidth()),e},r._getContainerFitWidth=function(){for(var e=0,t=this.cols;--t&&this.colYs[t]===0;)e++;return(this.cols-e)*this.columnWidth-this.gutter},r.needsResizeLayout=function(){var e=this.containerWidth;return this.getContainerWidth(),e!=this.containerWidth},n})})),p=e(((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define([`../layout-mode`,`masonry-layout/masonry`],n):typeof t==`object`&&t.exports?t.exports=n(d(),f()):n(e.Isotope.LayoutMode,e.Masonry)})(window,function(e,t){var n=e.create(`masonry`),r=n.prototype,i={_getElementOffset:!0,layout:!0,_getMeasurement:!0};for(var a in t.prototype)i[a]||(r[a]=t.prototype[a]);var o=r.measureColumns;r.measureColumns=function(){this.items=this.isotope.filteredItems,o.call(this)};var s=r._getOption;return r._getOption=function(e){return e==`fitWidth`?this.options.isFitWidth===void 0?this.options.fitWidth:this.options.isFitWidth:s.apply(this.isotope,arguments)},n})})),m=e(((e,t)=>{(function(n,r){typeof define==`function`&&define.amd?define([`../layout-mode`],r):typeof e==`object`?t.exports=r(d()):r(n.Isotope.LayoutMode)}
1)(window,function(e){var t=e.create(`fitRows`),n=t.prototype;return n._resetLayout=function(){this.x=0,this.y=0,this.maxY=0,this._getMeasurement(`gutter`,`outerWidth`)},n._getItemLayoutPosition=function(e){e.getSize();var t=e.size.outerWidth+this.gutter,n=this.isotope.size.innerWidth+this.gutter;this.x!==0&&t+this.x>n&&(this.x=0,this.y=this.maxY);var r={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+e.size.outerHeight),this.x+=t,r},n._getContainerSize=function(){return{height:this.maxY}},t})})),h=e(((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define([`../layout-mode`],n):typeof t==`object`&&t.exports?t.exports=n(d()):n(e.Isotope.LayoutMode)})(window,function(e){var t=e.create(`vertical`,{horizontalAlignment:0}),n=t.prototype;return n._resetLayout=function(){this.y=0},n._getItemLayoutPosition=function(e){e.getSize();var t=(this.isotope.size.innerWidth-e.size.outerWidth)*this.options.horizontalAlignment,n=this.y;return this.y+=e.size.outerHeight,{x:t,y:n}},n._getContainerSize=function(){return{height:this.y}},t})})),g=n(e(((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define([`outlayer/outlayer`,`get-size/get-size`,`desandro-matches-selector/matches-selector`,`fizzy-ui-utils/utils`,`./item`,`./layout-mode`,`./layout-modes/masonry`,`./layout-modes/fit-rows`,`./layout-modes/vertical`],function(t,r,i,a,o,s){return n(e,t,r,i,a,o,s)}):typeof t==`object`&&t.exports?t.exports=n(e,l(),a(),o(),s(),u(),d(),p(),m(),h()):e.Isotope=n(e,e.Outlayer,e.getSize,e.matchesSelector,e.fizzyUIUtils,e.Isotope.Item,e.Isotope.LayoutMode)})(window,function(e,t,n,r,i,a,o){var s=e.jQuery,c=String.prototype.trim?function(e){return e.trim()}:function(e){return e.replace(/^\s+|\s+$/g,``)},l=t.create(`isotope`,{layoutMode:`masonry`,isJQueryFiltering:!0,sortAscending:!0});l.Item=a,l.LayoutMode=o;var u=l.prototype;u._create=function(){for(var e in this.itemGUID=0,this._sorters={},this._getSorters(),t.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=[`original-order`],o.modes)this._initLayoutMode(e)},u.reloadItems=function(){this.itemGUID=0,t.prototype.reloadItems.call(this)},u._itemize=function(){for(var e=t.prototype._itemize.apply(this,arguments),n=0;n<e.length;n++){var r=e[n];r.id=this.itemGUID++}return this._updateItemsSortData(e),e},u._initLayoutMode=function(e){var t=o.modes[e],n=this.options[e]||{};this.options[e]=t.options?i.extend(t.options,n):n,this.modes[e]=new t(this)},u.layout=function(){if(!this._isLayoutInited&&this._getOption(`initLayout`)){this.arrange();return}this._layout()},u._layout=function(){var e=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,e),this._isLayoutInited=!0},u.arrange=function(e){this.option(e),this._getIsInstant();var t=this._filter(this.items);this.filteredItems=t.matches,this._bindArrangeComplete(),this._isInstant?this._noTransition(this._hideReveal,[t]):this._hideReveal(t),this._sort(),this._layout()},u._init=u.arrange,u._hideReveal=function(e){this.reveal(e.needReveal),this.hide(e.needHide)},u._getIsInstant=function(){var e=this._getOption(`layoutInstant`),t=e===void 0?!this._isLayoutInited:e;return this._isInstant=t,t},u._bindArrangeComplete=function(){var e,t,n,r=this;function i(){e&&t&&n&&r.dispatchEvent(`arrangeComplete`,null,[r.filteredItems])}this.once(`layoutComplete`,function(){e=!0,i()}),this.once(`hideComplete`,function(){t=!0,i()}),this.once(`revealComplete`,function(){n=!0,i()})},u._filter=function(e){var t=this.options.filter;t||=`*`;for(var n=[],r=[],i=[],a=this._getFilterTest(t),o=0;o<e.length;o++){var s=e[o];if(!s.isIgnored){var c=a(s);c&&n.push(s),c&&s.isHidden?r.push(s):!c&&!s.isHidden&&i.push(s)}}return{matches:n,needReveal:r,needHide:i}},u._getFilterTest=function(e){return s&&this.options.isJQueryFiltering?function(t){return s(t.element).is(e)}:typeof e==`function`?function(t){return e(t.element)}:function(t){return r(t.element,e)}},u.updateSortData=function(e){var t;e?(e=i.makeArray(e),t=this.getItems(e)):t=this.items,this._getSorters(),this._updateItemsSortData(t)},u._getSorters=function(){var e=this.options.getSortData;for(var t in e){var n=e[t];this._sorters[t]=d(n)}},u._updateItemsSortData=function(e){for(var t=e&&e.length,n=0;t&&n<t;n++)e[n].updateSortData()};var d=(function(){function e(e){if(typeof e!=`string`)return e;var n=c(e).split(` `),r=n[0],i=r.match(/^\[(.+)\]$/),a=t(i&&i[1],r),o=l.sortDataParsers[n[1]];return e=o?function(e){return e&&o(a(e))}:function(e){return e&&a(e)},e}function t(e,t){return e?function(t){return t.getAttribute(e)}:function(e){var n=e.querySelector(t);return n&&n.textContent}}return e})();l.sortDataParsers={parseInt:function(e){return parseInt(e,10)},parseFloat:function(e){return parseFloat(e)}},u._sort=function(){if(this.options.sortBy){var e=i.makeArray(this.options.sortBy);this._getIsSameSortBy(e)||(this.sortHistory=e.concat(this.sortHistory));var t=f(this.sortHistory,this.options.sortAscending);this.filteredItems.sort(t)}},u._getIsSameSortBy=function(e){for(var t=0;t<e.length;t++)if(e[t]!=this.sortHistory[t])return!1;return!0};function f(e,t){return function(n,r){for(var i=0;i<e.length;i++){var a=e[i],o=n.sortData[a],s=r.sortData[a];if(o>s||o<s){var c=(t[a]===void 0?t:t[a])?1:-1;return(o>s?1:-1)*c}}return 0}}u._mode=function(){var e=this.options.layoutMode,t=this.modes[e];if(!t)throw Error(`No layout mode: `+e);return t.options=this.options[e],t},u._resetLayout=function(){t.prototype._resetLayout.call(this),this._mode()._resetLayout()},u._getItemLayoutPosition=function(e){return this._mode()._getItemLayoutPosition(e)},u._manageStamp=function(e){this._mode()._manageStamp(e)},u._getContainerSize=function(){return this._mode()._getContainerSize()},u.needsResizeLayout=function(){return this._mode().needsResizeLayout()},u.appended=function(e){var t=this.addItems(e);if(t.length){var n=this._filterRevealAdded(t);this.filteredItems=this.filteredItems.concat(n)}},u.prepended=function(e){var t=this._itemize(e);if(t.length){this._resetLayout(),this._manageStamps();var n=this._filterRevealAdded(t);this.layoutItems(this.filteredItems),this.filteredItems=n.concat(this.filteredItems),this.items=t.concat(this.items)}},u._filterRevealAdded=function(e){var t=this._filter(e);return this.hide(t.needHide),this.reveal(t.matches),this.layoutItems(t.matches,!0),t.matches},u.insert=function(e){var t=this.addItems(e);if(t.length){var n,r,i=t.length;for(n=0;n<i;n++)r=t[n],this.element.appendChild(r.element);var a=this._filter(t).matches;for(n=0;n<i;n++)t[n].isLayoutInstant=!0;for(this.arrange(),n=0;n<i;n++)delete t[n].isLayoutInstant;this.reveal(a)}};var p=u.remove;return u.remove=function(e){e=i.makeArray(e);var t=this.getItems(e);p.call(this,e);for(var n=t&&t.length,r=0;n&&r<n;r++){var a=t[r];i.removeFrom(this.filteredItems,a)}},u.shuffle=function(){for(var e=0;e<this.items.length;e++){var t=this.items[e];t.sortData.random=Math.random()}this.options.sortBy=`random`,this._sort(),this._layout()},u._noTransition=function(e,t){var n=this.options.transitionDuration;this.options.transitionDuration=0;var r=e.apply(this,t);return this.options.transitionDuration=n,r},u.getFilteredItemElements=function(){return this.filteredItems.map(function(e){return e.element})},l})}))(),1),_=class{elem;iso;filters;filterMultiple;options;constructor(e){this.elem=e,this.filters=[],this.options={itemSelector:`.iso-masonry > li`,sortBy:[`weight`],filter:e=>this.filterFunction(e)},this.elem.dataset.isotope=`true`}initializeMasonry(){this.initializeGrid(),this.initializeFilters(),this.checkForImages()}
1checkForImages(){this.elem.querySelectorAll(`img`).forEach(e=>{e.complete||e.addEventListener(`load`,()=>this.updateLayout())})}updateLayout(){this.iso.arrange(this.options)}initializeGrid(){this.iso=new g.default(`.iso-masonry`,this.options)}initializeFilters(){this.addClickListenerFilters()}setOrder(e){e.querySelectorAll(`[data-order]`).forEach(e=>{e.style.order=e.dataset.order})}addClickListenerFilters(){let e=e=>{e.preventDefault();let t=e.target;t.classList.toggle(`active`);let n=document.querySelector(`#filters a[data-filter='*']`),r=document.querySelectorAll(`#filters .active`);t==n||r.length==0?(r.forEach(e=>{e.classList.remove(`active`),e.removeAttribute(`aria-current`)}),n?.classList.add(`active`),n?.setAttribute(`aria-current`,`true`),this.filters=[]):(n?.classList.remove(`active`),n?.removeAttribute(`aria-current`),this.applyFilter(n)),t.classList.contains(`active`)?t.setAttribute(`aria-current`,`true`):t.removeAttribute(`aria-current`),this.applyFilter(t)},t=e=>{e.preventDefault();let t=e.target,n=document.querySelector(`#filters .active`);n!=t&&(t.classList.toggle(`active`),t.setAttribute(`aria-current`,`true`),n?.classList.remove(`active`),n?.removeAttribute(`aria-current`),this.filters=[],this.addFilter(t.dataset.filter),this.applyFilter(t))},n=document.querySelector(`#filters`);n&&(this.filterMultiple=n.dataset.filterType==`multiple`,this.setOrder(n),n.querySelectorAll(`a`).forEach(n=>{n.removeEventListener(`click`,this.filterMultiple?e:t),n.addEventListener(`click`,this.filterMultiple?e:t)}),this.applyFilter(n.querySelector(`.active`)))}applyFilter(e){if(e==null)return;let t=e?.dataset.filter;e?.classList.contains(`active`)?this.addFilter(t):this.removeFilter(t),this.iso.arrange({filter:e=>this.filterFunction(e)}),setTimeout(()=>{this.updateLayout()},150)}addFilter(e){e&&(this.filters.includes(e)||this.filters.push(e))}removeFilter(e){let t=this.filters.indexOf(e);t!=-1&&this.filters.splice(t,1)}filterFunction(e){let t=!1;return this.filters.forEach(n=>{e.matches(n)&&!e.classList.contains(`hide`)&&(t=!0)}),this.filters.length==0||t}},v=null;function y(){document.querySelectorAll(`.iso-masonry`).forEach(e=>{e.dataset.isotope!=`true`&&(v=new _(e),v.initializeMasonry())})}function b(){v?.updateLayout()}var x=class extends HTMLElement{connectedCallback(){y()}};customElements.define(`shn-masonry`,x);function S(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==`x`?t:t&3|8).toString(16)})}function C(e,t,n){if(e===void 0)return;n===void 0&&(n=``);let r=document.createElement(e);if(typeof t==`object`)for(let e in t)r.setAttribute(e,t[e]);Array.isArray(n)||(n=[n]);for(let e of n)if(e==``)break;else e.tagName?r.appendChild(e):r.appendChild(document.createTextNode(e));return r}function w(){let e=window.location.href,t=e.indexOf(`#`),n=e.indexOf(`?`);if(t<n&&n!=-1&&t!=-1){let r=e.substring(t,n),i=e.substring(n,e.length);e=e.substring(0,t);let a=e+i+r;window.location.replace(a)}}w();var T=class e{static sequence=0;elem;contentId;testIdSuffix;bodyElement=null;navHeight;constructor(t){this.elem=t,this.contentId=t.dataset.contentid||``;let n=this.elem.id||this.contentId||`auto-${++e.sequence}`;this.testIdSuffix=n.replace(/[^a-zA-Z0-9_-]/g,`-`),this.elem.setAttribute(`tabindex`,`0`),this.elem.dataset.testid||(this.elem.dataset.testid=`tooltip-trigger-${this.testIdSuffix}`);let r=Array.from(this.elem.childNodes).filter(e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim());if(r.length){let e=document.createElement(`span`);e.className=`tooltip-link-text`;
1for(let t of r)e.appendChild(t);this.elem.insertBefore(e,this.elem.firstChild)}if(!this.elem.querySelector(`.icon-help`)){let e=document.createElement(`i`);e.className=`icon-help`,this.elem.appendChild(e)}}initializeToolTips(){this.preventDefaultClick(),this.loadToolTip(),this.addListeners();let e=document.querySelector(`header`);this.navHeight=e?e.clientHeight:0}checkBoundingBox(){this.bodyElement&&(this.elem.classList.add(`active`),this.bodyElement.classList.add(`active`))}addListeners(){this.elem.addEventListener(`click`,e=>{e.preventDefault(),this.checkBoundingBox(),this.handleFocus()}),this.elem.addEventListener(`keydown`,e=>this.handleKeyDown(e)),this.elem.addEventListener(`focus`,()=>this.handleFocus()),this.elem.addEventListener(`blur`,()=>this.clearAriaDescribedBy()),this.elem.addEventListener(`mouseenter`,()=>{this.checkBoundingBox(),this.handleFocus()}),this.elem.addEventListener(`mouseleave`,()=>{this.bodyElement&&(this.bodyElement.classList.remove(`active`),this.clearAriaDescribedBy()),this.elem.classList.remove(`active`)}),document.addEventListener(`click`,e=>{this.elem.contains(e.target)||(this.elem.classList.remove(`active`),this.clearAriaDescribedBy()),this.bodyElement&&!this.bodyElement.contains(e.target)&&!this.elem.contains(e.target)&&(this.bodyElement.classList.remove(`active`),this.clearAriaDescribedBy())}),this.elem.addEventListener(`keydown`,e=>{e.key===`Escape`&&this.bodyElement&&(this.bodyElement.classList.remove(`active`),this.clearAriaDescribedBy(),this.elem.focus())}),window.addEventListener(`scroll`,()=>{this.elem.classList.remove(`active`)})}handleFocus(){this.bodyElement&&this.bodyElement.setAttribute(`aria-hidden`,`false`)}clearAriaDescribedBy(){this.bodyElement&&this.bodyElement.setAttribute(`aria-hidden`,`true`)}handleKeyDown(e){e.key===`Enter`||e.key===` `?(e.preventDefault(),this.bodyElement&&!this.bodyElement.classList.contains(`active`)?(this.checkBoundingBox(),this.handleFocus(),this.bodyElement.setAttribute(`tabindex`,`-1`),this.bodyElement.focus()):(this.bodyElement&&(this.bodyElement.classList.remove(`active`),this.clearAriaDescribedBy()),this.elem.focus())):e.key===`Escape`&&(this.bodyElement&&(this.bodyElement.classList.remove(`active`),this.clearAriaDescribedBy()),this.elem.focus())}preventDefaultClick(){this.elem.addEventListener(`click`,e=>{e.preventDefault()})}async loadToolTip(){if(this.elem.dataset.contentLoaded!==`true`){this.elem.dataset.contentLoaded=`true`;try{let e=await fetch(`/api/Concept/GetConcept/?contentId=${this.contentId}`);if(!e.ok)throw Error(`Failed to fetch tooltip content`);let t=await e.text();this.insertBody(t)}catch(e){console.error(`Tooltip Load Error:`,e)}}}insertBody(e){this.bodyElement=C(`div`,{},``);let t=C(`span`,{class:`sr-only`,"aria-label":`Toelichting:`},``);this.bodyElement.appendChild(t);let n=document.createRange().createContextualFragment(e);for(let e of n.querySelectorAll(`*`))this.bodyElement?.appendChild(e);this.bodyElement.classList.add(`content-tooltip`),this.bodyElement.dataset.contentid=this.contentId,this.bodyElement.dataset.testid||(this.bodyElement.dataset.testid=`tooltip-content-${this.testIdSuffix}`),this.bodyElement.id=`tooltip-${this.contentId}`,this.bodyElement.setAttribute(`role`,`tooltip`),this.bodyElement.setAttribute(`tabindex`,`-1`),this.bodyElement.setAttribute(`aria-hidden`,`true`),this.elem.setAttribute(`aria-describedby`,this.bodyElement.id),this.elem.insertAdjacentElement(`afterend`,this.bodyElement)}};function E(){let e=document.querySelectorAll(`.concept-tooltip`);for(let t of e)new T(t).initializeToolTips()}document.addEventListener(`DOMContentLoaded`,E);async function D(e){let t=e.target,n=document.querySelector(`.switch-error-message`),r=document.querySelector(`input[name="__RequestVerificationToken"]`).value;n.style.display=`none`;let i=()=>{t.checked=!t.checked,n.style.display=`block`};try{switch((await fetch(window.location.pathname,{method:`PUT`,headers:{RequestVerificationToken:r},body:new URLSearchParams({allowDocumentNotification:t.checked.toString()})})).status){case 200:return;case 401:window.location.reload();break;default:i()}}catch{i()}}function O(){let e=document.querySelector(`#switch.notification_trigger`);e&&e.addEventListener(`click`,D)}document.addEventListener(`DOMContentLoaded`,O);function k(){function e(e){return e.closest(`.label-container`)?.querySelector(`.info-text`)}function t(t){let n=e(this);return n?.classList.contains(`is-hidden`)&&(n.classList.remove(`is-hidden`),n.setAttribute(`aria-hidden`,`false`),this.setAttribute(`aria-expanded`,`true`)),t.preventDefault(),!1}function n(t){let n=e(this);return n?.classList.contains(`is-hidden`)||(n.classList.add(`is-hidden`),n.setAttribute(`aria-hidden`,`true`),this.setAttribute(`aria-expanded`,`false`)),t.preventDefault(),!1}document.querySelectorAll(`fieldset .label-container .info-link`).forEach(r=>{r.setAttribute(`aria-expanded`,`false`),r.setAttribute(`aria-controls`,r.closest(`.label-container`)?.querySelector(`.info-text`)?.id??``),r.setAttribute(`role`,`button`),r.addEventListener(`click`,function(r){e(this)?.classList.contains(`is-hidden`)?t.call(this,r):n.call(this,r)}),r.addEventListener(`mouseover`,t),r.addEventListener(`mouseout`,n),r.addEventListener(`focus`,t),r.addEventListener(`blur`,n),r.addEventListener(`ke
1ydown`,(e=>{e.key===`Escape`&&n.call(r,e)}))}),window.addEventListener(`scroll`,()=>{document.querySelectorAll(`fieldset .label-container .info-text`).forEach(e=>{e.classList.add(`is-hidden`),e.setAttribute(`aria-hidden`,`true`)}),document.querySelectorAll(`fieldset .label-container .info-link`).forEach(e=>{e.setAttribute(`aria-expanded`,`false`)})})}function ee(e=null){let t=`img[data-focal-point]`;(e?e.querySelectorAll(t):document.querySelectorAll(t)).forEach(e=>{te(e)})}function te(e){e.dataset.focalPoint&&(e.style.objectPosition=e.dataset.focalPoint)}document.addEventListener(`DOMContentLoaded`,()=>{k(),ee()}),new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e instanceof HTMLElement&&ee(e)})})}).observe(document.body,{childList:!0,subtree:!0});var ne=class{elem;action;constructor(e,t){this.elem=e,this.action=t,this.elem.classList.add(`clickable-div`)}initiateClickable(){if(this.action instanceof HTMLLinkElement){let e=()=>{window.location.href=this.action.href};this.elem.removeEventListener(`click`,e),this.elem.addEventListener(`click`,e)}else{let e=()=>{this.action.click()};this.elem.removeEventListener(`click`,e),this.elem.addEventListener(`click`,e)}}};function re(){document.querySelectorAll(`[data-clickable-div]`).forEach(e=>{let t=e.querySelector(`[data-clickable-div-action]`);if(!(t instanceof HTMLAnchorElement)&&!(t instanceof HTMLButtonElement)&&t){let n=t.querySelector(`a`),r=t.querySelector(`button`);if(t=n||r,!t)return;new ne(e,t).initiateClickable()}else(t instanceof HTMLAnchorElement||t instanceof HTMLButtonElement)&&new ne(e,t).initiateClickable()})}document.addEventListener(`DOMContentLoaded`,()=>{re()}),r();function ie(e){if(this.classList.contains(`clicked-once`))return e.preventDefault(),!1;this.classList.contains(`ignore-click-once`)||(this.classList.add(`clicked-once`),(this.nodeName.toLowerCase()===`button`||this.nodeName.toLowerCase()===`input`)&&(this.disabled=!0,this.getAttribute(`type`)===`submit`&&this.closest(`form`).submit()))}function ae(e=null){let t=e??document,n=[].slice.call(t.querySelectorAll(`a.button:not(.ignore-clickonce), button:not(.ignore-clickonce), input[type=submit]:not(.ignore-clickonce), input[type=button]:not
1(.ignore-clickonce)`));for(let e in n)n[e].addEventListener(`click`,ie)}function oe(){new Foundation.Reveal(t(`#`+t(this).data(`modal-id`))).open()}function se(){if(window.dataLayer){let e=document.getElementsByTagName(`datalayer`);for(let t of e){let e={};Object.keys(t.dataset).forEach(n=>{e[n]=t.dataset[n]}),window.dataLayer.push(e)}for(let t of e)t.parentNode.removeChild(t)}}window.addEventListener(`load`,se);var ce=class{getTableHeaderTitles(e){let t=[];return e.querySelectorAll(`tr:first-child td`).forEach(e=>{t.push(e.textContent||``)}),t}createInlineTableHeader(e){return C(`span`,{class:`inline-table-header`},e)}setResponsiveClassOnTable(e){e.classList.add(`responsive-table`)}makeTableResponsive(e){let t=this.getTableHeaderTitles(e);e.querySelectorAll(`tr:not(:first-child)`).forEach(e=>{e.querySelectorAll(`td`).forEach((e,n)=>{e.insertBefore(this.createInlineTableHeader(t[n]),e.firstChild)})}),this.setResponsiveClassOnTable(e)}},le=class{element;loaderElement;identifier;showLoader(){this.element.appendChild(this.loaderElement)}hideLoader(){this.loaderElement.remove()}},ue=class extends le{identifier=`loader-overlay`;constructor(e){super(),this.element=e,this.constructLoaderMarkup()}constructLoaderMarkup(){let e=document.createElement(`div`);e.classList.add(this.identifier);let t=document.createElement(`div`);t.classList.add(`loader-container`),e.appendChild(t);let n=document.createElement(`h2`);n.innerText=`Aan het laden`,t.appendChild(n);let r=document.createElement(`div`);r.classList.add(`loading-dots`),t.appendChild(r);let i=document.createElement(`div`);i.classList.add(`dot`),r.appendChild(i);let a=document.createElement(`div`);a.classList.add(`dot`),r.appendChild(a);let o=document.createElement(`div`);o.classList.add(`dot`),r.appendChild(o),this.loaderElement=e}},de=class extends le{identifier=`loader-overlay`;buttonIcon;buttons;constructor(e){super(),this.element=e,this.buttons=this.element.querySelectorAll(`.button`)}showLoader(){this.buttons[0]?.classList.add(`button-loading`)}hideLoader(){this.buttons[0]?.classList.remove(`button-loading`)}},fe=class{elem;guid;Dotloader;ButtonLoader;url;blockId;blockName;hasButton;saveAction;buttonLoader;isActive;constructor(e){let t=document.querySelector(`link[rel="canonical"]`)?.href;this.elem=e,this.blockId=e.dataset.blockId,this.blockName=e.dataset.blockName,this.url=new URL(e.querySelector(`a.start-questionnaire:first-child`)?.getAttribute(`data-action-url`)??``,t).href,this.Dotloader=new ue(e),this.ButtonLoader=new de(e),this.saveAction=new URL(e.dataset.saveAction,window.location.origin),this.guid=this.getFormSessionGuid(),this.hasButton=this.elem.querySelector(`.button`)!=null}getFormSessionGuid(){return this.getUrlParameter(`id`)||S()}getUrlParameter(e){return new URLSearchParams(window.location.search).get(e)}showLoader(e=``){switch(e){case``:this.hasButton?this.ButtonLoader.showLoader():this.Dotloader.showLoader();break;case`dots`:this.Dotloader.showLoader();break;case`button`:this.ButtonLoader.showLoader();break}}hideLoader(e=``){switch(e){case``:this.hasButton?this.ButtonLoader.hideLoader():this.Dotloader.hideLoader();break;case`dots`:this.Dotloader.hideLoader();break;case`button`:this.ButtonLoader.hideLoader();break}}},pe=class e extends fe{static hasClaimedUrlStart=!1;isAutostart;hijackRow;isAutoscrollDisabled=!1;hasChart;pageId;questionnairePageUrl;startPointHtml;shnValidate;canonicalUrl;constructor(e){super(e),this.isAutostart=e.getAttribute(`data-autostart`)==`true`,this.hijackRow=e.getAttribute(`data-hijack-row`)==`true`,this.pageId=e.getAttribute(`data-page-id`)??``,this.questionnairePageUrl=null,this.setFocusState(),this.canonicalUrl=document.querySelector(`link[rel="canonical"]`)?.href,this.startPointHtml=e.closest(`.row`)?.innerHTML,this.addResizeListener(),this.shnValidate=window.shnValidate}addResizeListener(){let e;window.addEventListener(`resize`,()=>{clearTimeout(e),e=setTimeout(()=>{this.resetToolBlockHeightFix(),this.setToolBlockHeight()},250)})}addLoadMoreButton(e){let t=C(`button`,{class:`load-more-button`,"data-testid":`load-more-btn`},document.querySelector(`html`).lang==`en`?`Load more answers`:`Meer antwoorden laden`);e?.appendChild(t),t.addEventListener(`click`,e=>this.loadMoreAnswers(e))}loadMoreAnswers(e){let t=e.target;
1t.parentElement.querySelectorAll(`.field.hide`).forEach(e=>e.classList.remove(`hide`)),t.remove()}checkAnswerLength(){this.elem.querySelectorAll(`.question`).forEach(e=>{let t=[...e.querySelectorAll(`input:checked`)].pop(),n=e.querySelectorAll(`input`),r=Array.prototype.indexOf.call(n,t);if(e?.dataset.hideAnswers==`True`&&r<5){let t=Array.from(e.querySelectorAll(`.field`));t.length>6&&(t.slice(5).forEach(e=>{e.classList.add(`hide`)}),this.addLoadMoreButton(e))}})}async startQuestionnaire(){this.elem.classList.remove(`hide`),this.getUrlParameter(`id`)||this.getUrlParameter(`blockid`)||this.getUrlParameter(`block`)?await this.tryStartWithUrlParameter():this.initStartQuestionnaire()}openQuestionnaire(){this.isActive=!0,this.elem.classList.remove(`clickable`),this.elem.dataset.removeEventListeners=`true`,this.showLoader();let e=new URL(this.url,this.canonicalUrl);e.searchParams.set(`formsessionguid`,this.guid),e.searchParams.set(`blockid`,this.blockId),e.searchParams.set(`pageid`,this.pageId),e.searchParams.set(`pageurl`,this.getQuestionnairePageUrl()),fetch(e,{method:`GET`,mode:`cors`,credentials:`include`}).then(e=>{switch(e.status){case 200:return e.text();case 404:case 500:throw Error(`Status: `+e.status+` Message`+e.statusText)}}).then(e=>{if(!(this.blockId!=this.getUrlParameter(`blockid`)&&this.getUrlParameter(`blockid`)!=null)){try{if(JSON.parse(e).restart===!0){this.guid=S(),this.openQuestionnaire();return}}catch{}this.hijackRow&&(this.hideOtherTools(),this.elem.classList.contains(`show-as-tile`)?this.elem.closest(`.columns`)?.classList.add(`large-18`):this.elem.closest(`.columns`)?.classList.add(`large-20`)),this.handleStartTool_response(e)}}).catch(()=>{this.hideLoader(),this.isActive=!1})}async tryStartWithUrlParameter(){if(this.getUrlParameter(`pageaction`)===`save`){this.showLoader(`dots`),await this.saveQuestionnaire();return}if(this.isAutostart){this.openFirstFromUrlMatch();return}let e=this.getUrlParameter(`blockid`);if(e==this.blockId){this.openFirstFromUrlMatch();return}if(this.getUrlParameter(`block`)==this.blockName){this.openFirstFromUrlMatch();return}let t=this.getUrlParameter(`id`);!e&&t==this.guid&&this.openFirstFromUrlMatch()}openFirstFromUrlMatch(){e.hasClaimedUrlStart||(e.hasClaimedUrlStart=!0,this.openQuestionnaire())}handleStartTool_response(e){this.hideLoader();let t;e?e.indexOf(`advice-wrapper`)>=0?(this.renderAdvice(e),this.initRestartToolButton(),t=`advice`):(this.loadNextQuestion(e),this.initButtonIntercept()):this.exitQuestionnaire(),this.initNextQuestionButton(),this.initPreviousQuestionButton(),this.checkAnswerLength(),this.elem.classList.contains(`show-as-tile`)&&(this.removeInlineToolHeader(),this.elem.closest(`.columns`).classList.remove(`medium-12`),this.elem.closest(`.columns`).classList.add(`medium-24`)),this.hijackRow&&(t!=`advice`&&this.removeAllOtherChildren(),this.addCloseQuestionnaireLink()),this.hideLoader(),this.isAutostart?this.isAutoscrollDisabled=!1:this.isAutoscrollDisabled||this.scrollToFirstHeader(),this.initializeToolElements(),this.setQuestionnairePageUrl(),this.updateVisibleTrigger(t),ae(this.elem);let n=document.querySelector(`[data-modal-id`);n&&n.addEventListener(`click`,oe),se()}checkInCard(){let e=this.elem.closest(`shn-card`);e&&e.querySelectorAll(`ul`).forEach(e=>{e.querySelectorAll(`li`).forEach(t=>{t.firstChild!=t.querySelector(`a`)&&t.querySelectorAll(`a`).forEach(t=>{t.classList.add(`no-pseudo`),e.classList.add(`force-list-style`)})})})}removeAllOtherChildren(){let e=this.elem.closest(`.row`),t=this.elem.closest(`.columns`);e.querySelectorAll(`.columns`).forEach(e=>{e!=t&&e.classList.add(`hide`)}),document.querySelectorAll(`.tool-block`).forEach(e=>{this.elem!=e&&e.classList.add(`hide`)})}exitQuestionnaire(){this.removeQueryParameters(),re(),y(),location.reload()}renderAdvice(e){if(this.elem.innerHTML=e,this.hasChart=this.elem.querySelector(`canvas`)!=null,this.elem.querySelectorAll(`table`).forEach(e=>{new ce().makeTableResponsive(e)}),this.hasChart){function e(r){if(n(r)===!0)r.parentNode.replaceChild(t(r),r);else{let t=-1,n=r.children;for(;++t<n.length;)e(n[t])}return r}function t(e){let t=document.createElement(`script`);t.text=e.innerHTML;let n=-1,r=e.attributes,i;for(;r.length>n++;)i=r[n],t.setAttribute(i?.name,i?.value);return t}function n(e){return e.tagName===`SCRIPT`}e(this.elem),setTimeout(()=>this.elem.dispatchEvent(new CustomEvent(`advice-rendered`,{detail:{callback:()=>{setTimeout(()=>{this.resetToolBlockHeightFix(),this.setToolBlockHeight()},250)}}})),1e3)}this.elem.querySelector(`.thankyou-wrapper`)!==null&&this.removeQueryParameters(),this.elem.querySelector(`[data-save]`)?.addEventListener(`click`,async e=>{e.preventDefault(),this.showLoader(),await this.saveQuestionnaire()}
1),this.elem.querySelector(`[data-save]`)?.addEventListener(`keypress`,(async e=>{e.key===`Enter`&&(this.showLoader(),await this.saveQuestionnaire())}))}registerVirtualPageView(e,t){let n={event:e,pageName:t};window.dataLayer!==void 0&&window.dataLayer.push(n)}removeInlineToolHeader(){this.elem.closest(`.columns`)?.querySelector(`.tool-inline-header`)?.remove(),this.elem.closest(`.columns`)?.parentElement?.querySelector(`:scope> .tool-inline-header`)?.remove()}nextQuestion(e,t){if(e.preventDefault(),t.classList.contains(`disabled`))return;t.classList.toggle(`disabled`);let n=this.elem.querySelector(`form`);if(this.shnValidate.init(n.id),!this.shnValidate.validate(n.id)){t.classList.toggle(`disabled`);return}t.classList.add(`button-loading`);let r=n.action,i=t.getAttribute(`data-eventname`),a=t.getAttribute(`data-pagename`);fetch(new URL(r,this.canonicalUrl)+`?pageurl=`+encodeURIComponent(this.getQuestionnairePageUrl()),{method:`post`,mode:`cors`,credentials:`include`,body:new FormData(n),cache:`no-cache`}).then(e=>{if(e.ok)return e.text();if(e.status==404)throw Error(`Status: `+e.status+` Message`+e.statusText)}).then(e=>{if(this.blockId===void 0){this.handleStartTool_response(e);return}e.indexOf(`advice-wrapper`)>=0||e.indexOf(`thankyou-wrapper`)>=0?this.fetchAdvice(e,i,a):this.handleStartTool_response(e),t.classList.toggle(`disabled`)}).catch(e=>{t.classList.toggle(`disabled`),e.status===400?window.location.reload():t.classList.remove(`button-loading`)})}resetToolBlockHeightFix(){this.elem.style.height=`auto`,this.elem.style.maxHeight=`none`,this.elem.style.maxHeight=this.elem.offsetHeight+150+`px`}setToolBlockHeight(){this.elem.style.maxHeight=`unset`}initNextQuestionButton(){let e=this.elem.querySelector(`#nextQuestionnaireStep`);e?.addEventListener(`click`,t=>{this.nextQuestion(t,e)});let t=this.elem.querySelector(`form`).id;this.shnValidate.IsSumQuestion(t)&&(this.shnValidate.init(t),this.shnValidate.validate(t))}fetchAdvice(e,t,n){let r=new URL(`/api/ToolEndpoint/ToolEndpoints/?blockId=${this.blockId}&formSessionGuid=${this.guid}`,this.canonicalUrl);fetch(r,{method:`GET`,mode:`cors`,credentials:`include`}).then(e=>{if(!e.ok)throw e;return e.json()}).then(r=>{for(let i of r)i.toolEndpointType.value===`d3298fd6`&&(window.location=i.context),i.toolEndpointType.value===`02fd104b`&&(this.registerVirtualPageView(t,n),this.handleStartTool_response(e))})}initPreviousQuestionButton(){let e=this.elem.querySelector(`.previous-questionnaire-step`);e?.addEventListener(`click`,t=>{t.preventDefault();let n=this.elem.querySelector(`form`)?.dataset.step,r=Number(n??1);e.classList.add(`button-loading`);let i=this.elem.querySelector(`form`),a=e.getAttribute(`data-reseturl`);if(a){let t=new URL(a+`?pageurl=`+encodeURIComponent(this.getQuestionnairePageUrl()),this.canonicalUrl);fetch(t,{method:`POST`,body:new FormData(i),credentials:`include`}).then(e=>e.text()).then(t=>{if(r<=1)e.classList.remove(`button-loading`),this.closeQuestionnaire();else return this.handleStartTool_response(t)})}})}async saveQuestionnaire(){let e=this.saveAction,t=this.elem.querySelector(`[data-save]`);if(t?.classList.contains(`button-loading`))return;t?.classList.add(`button-loading`);let n=new URL(this.getQuestionnairePageUrl());n.searchParams.set(`pageaction`,`save`),e.searchParams.set(`FormSessionGuid`,this.guid),e.searchParams.set(`pageurl`,n.href);let r=await fetch(`${e.origin}/api/antiforgery/token/`,{method:`GET`,credentials:`include`});if(!r.ok)throw Error(`Could not retrieve request verification token.`);let i=(await r.text()).replaceAll(`"`,``),a=await fetch(e.href,{method:`post`,credentials:`include`,headers:{RequestVerificationToken:i,"X-Requested-With":`XMLHttpRequest`}});if(a.ok)this.handleStartTool_response(await a.text());else{if(a.status===401||a.status===403){let e=a.headers.get(`location`);e&&(window.location.href=e)}else a.status===400&&window.location.reload();this.hideLoader()}}initRestartToolButton(){let e=this.elem.querySelector(`#restartQuestionnaire`);e&&e.addEventListener(`click`,e=>{e.preventDefault(),this.guid=S(),this.openQuestionnaire()})}initButtonIntercept(){let e=document.querySelector(`#nextQuestionnaireStep`);(e?.closest(`form`)?.querySelector(`input`)).addEventListener(`ke
1ydown`,t=>{t.key==`Enter`&&(t.preventDefault(),e.click())})}initStartQuestionnaire(){this.isAutostart&&this.openQuestionnaire();let e=this.elem.querySelector(`a.start-questionnaire:first-child`);e&&e.addEventListener(`click`,e=>{e.preventDefault();let t=this.elem.dataset.blockName;t&&globalThis.history.replaceState({},document.title,`./?block=${t}`),this.openQuestionnaire()})}initializeToolElements(){k()}closeQuestionnaire(){this.isActive=!1,this.elem.closest(`.row`).innerHTML=this.startPointHtml,window.history.replaceState({},document.title,window.location.origin+window.location.pathname),document.querySelectorAll(`.tool-block`).forEach(async function(t){await new e(t).startQuestionnaire()})}closeQuestionnaireClicked=e=>(e.preventDefault(),this.closeQuestionnaire(),!1);addCloseQuestionnaireLink(){let e=C(`a`,{href:`#`,class:`close-questionnaire-form hidden`,"aria-label":`Sluit formulier`},``),t=C(`span`,{class:`icon-close`},``);e.appendChild(t);let n=this.elem.querySelector(`.meun-right`);if(n){let t=document.createElement(`li`);t.appendChild(e),n.appendChild(t)}else this.elem.appendChild(e);e.addEventListener(`click`,this.closeQuestionnaireClicked)}loadNextQuestion(e){try{let t=JSON.parse(e);window.location=t.redirect;return}catch{}this.elem.innerHTML=e,this.initializeToolElements(),this.checkInCard()}scrollToFirstHeader(){let e=0;e=globalThis.matchMedia(`(width >= 1240px)`).matches?document.querySelector(`.fixed-nav`)?.scrollHeight:document.querySelector(`.mobile-bar`)?.scrollHeight;let t=this.elem.closest(`.row`);if(t.classList.contains(`content-row`)&&(t=t.parentElement.closest(`.row`)),t!=null){let n=t.getBoundingClientRect(),r=e+24;if(n.top>=r&&n.bottom<=window.innerHeight)return;window.scrollTo({top:n.top-e-24+48+window.scrollY,left:0,behavior:`smooth`})}}setQuestionnairePageUrl(){let e=new URL(window.location.origin+window.location.pathname);e.searchParams.set(`id`,this.guid),e.searchParams.set(`blockid`,this.blockId),e.searchParams.set(`pageid`,this.pageId),this.questionnairePageUrl=e.toString()}updateVisibleTrigger(e){let t=new URL(window.location.href);e?t.searchParams.set(`trigger`,e):t.searchParams.delete(`trigger`);let n=t.toString();n!==window.location.href&&window.history.pushState({},``,n)}getQuestionnairePageUrl(){return this.questionnairePageUrl??window.location.href}removeQueryParameters(){let e=new URL(window.location.href);if(e.search){e.search=``;try{window.history.replaceState(null,``,e.toString())}catch(e){console.error(e)}}}hideOtherTools(){document.querySelectorAll(`.questionnaire-tiles`).forEach(e=>{e!=this.elem.closest(`.columns`)&&e.remove()})}setFocusState(){let e=!1;window.addEventListener(`keydown`,t=>{[`Tab`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`].includes(t.key)&&(e=!0)}),window.addEventListener(`mousedown`,()=>{e=!1}),document.addEventListener(`focus`,t=>{let n=t.target,r=n.parentElement;r&&(n.closest(`.radio-field`)||n.closest(`.radio-custom`)||n.closest(`.control`))&&(e?r.classList.add(`focus-visible`):r.classList.remove(`focus-visible`))},!0),document.addEventListener(`blur`,e=>{let t=e.target.parentElement;t&&t.classList.remove(`focus-visible`)},!0)}};function me(){document.querySelectorAll(`.tool-block`).forEach(e=>{new pe(e).startQuestionnaire()})}document.addEventListener(`DOMContentLoaded`,()=>{me()});var he=class{elem;ceil;currentNum=0;max;min;delay=1e3;speed=1;threshold;constructor(e){this.elem=e,this.ceil=parseFloat(e.innerHTML.replaceAll(`.`,``)),this.setThreshold(),this.setMaxMin(),this.delay/=this.threshold,this.delay==1e3&&(this.delay/=10)}startAnimation(){this.elem.closest(`#statistic`).dataset.animated=`true`,this.animate()}animate(){setTimeout(()=>{this.currentNum+=Math.floor(Math.random()*(this.max-this.min+1)+this.min),this.currentNum<this.ceil?(this.changeInnerHTML(),this.animate()):(this.currentNum=this.ceil,this.changeInnerHTML())},this.delay)}changeInnerHTML(){this.elem.innerHTML=String(this.numberWithCommas(this.currentNum))}numberWithCommas(e){e=e.toString();let t=/(-?\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,`$1.$2`);return e}setMaxMin(){let e=Number(String(this.ceil).slice(0,2)),t=Number(String(this.ceil).length);this.threshold<10?this.max=2:this.threshold==100?this.max=Number(String(e).padEnd(t-2,`0`))*this.speed:this.max=Math.ceil(this.ceil/this.threshold*this.speed),this.min=this.max-this.threshold,this.min<0&&(this.min*=-1)}setThreshold(){if(this.ceil<10){this.threshold=1;return}else if(this.ceil<100){this.threshold=10;return}this.threshold=100}};function ge(e){let t=e.getBoundingClientRect(),n=t.top,r=t.bottom;return n>=0&&r<=window.innerHeight}function _e(e){let t=[],n=``;return e.split(` `).forEach(function(e){let n=e.replaceAll(`.`,``);t.push(n)}),t.forEach(function(e){parseFloat(e)?n+=`<span id='number'>`+e+`</span> `:n+=e+` `}),n}
1function ve(){document.querySelectorAll(`#statistic`).forEach(e=>{if(e.dataset.animated!=`true`){let t=e.querySelector(`.title`);t.innerHTML=_e(t.innerHTML);let n=e.querySelector(`#number`);ge(n)&&new he(n).startAnimation()}})}document.addEventListener(`DOMContentLoaded`,()=>{ve()}),document.addEventListener(`scroll`,()=>{ve()});var ye=class extends HTMLElement{connectedCallback(){this.initInfogram()}initInfogram(){this.loadInfogram(`infogram-async`)}loadInfogram(e){let t=`InfogramEmbeds`,n=document.getElementsByTagName(`script`)[0];if(window[t]?.initialized)window[t]?.process();else if(!document.getElementById(e)){let t=document.createElement(`script`);t.async=!0,t.id=e,t.src=`https://e.infogram.com/js/dist/embed-loader-min.js`,n.parentNode.insertBefore(t,n)}}};customElements.define(`shn-infogram`,ye);var be=class extends HTMLElement{expantion;expandedHeight;collapsedHeight;padding=16;connectedCallback(){this.addEventListener(`loaded`,()=>{this.expantion=this.querySelector(`.expand`),this.addEventListeners(),this.calculateMaxHeights(),this.checkAppointments()})}calculateMaxHeights(){let e=this.querySelectorAll(`.future`),t=this.querySelectorAll(`.appointment.past`),n=this.querySelector(`.appointments`),r=0;t.forEach(e=>{e.style.display=`block`}),e.forEach(e=>{r+=e.offsetHeight+this.padding}),t.forEach(e=>{r+=e.offsetHeight+this.padding}),t.forEach(e=>{e.style.display=``}),this.style.setProperty(`--collapsedHeight`,r+4*this.padding+`px`),this.style.setProperty(`--expandedHeight`,n.offsetHeight+2*this.padding+`px`)}addEventListeners(){this.expantion?.addEventListener(`click`,this.toggleExpand.bind(this)),this.expantion?.addEventListener(`keydown`,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.toggleExpand())})}toggleExpand(){let e=this.querySelector(`.appointments`).classList.toggle(`expanded`);this.classList.toggle(`expanded`),this.querySelectorAll(`.appointment.past`).forEach(t=>{e?(t.removeAttribute(`tabindex`),t.removeAttribute(`aria-hidden`),t.style.display=`block`):(t.setAttribute(`tabindex`,`-1`),t.setAttribute(`aria-hidden`,`true`),t.style.display=`none`)}),this.calculateMaxHeights(),e?(this.style.maxHeight=this.style.getPropertyValue(`--expandedHeight`),this.expantion.setAttribute(`aria-expanded`,`true`)):(this.style.maxHeight=this.style.getPropertyValue(`--collapsedHeight`),this.expantion.setAttribute(`aria-expanded`,`false`))}checkAppointments(){let e=this.parentElement,t=this.querySelectorAll(`.appointment.future`),n=e.querySelector(`.has-appointments`),r=e.querySelector(`.has-no-appointments`);t.length>0?r.remove():n.remove()}};customElements.define(`shn-appointments`,be);var xe=class extends HTMLElement{accordions;lastAccordion;line;lineAnimationTiming=`400`;linePadding=15;initialPadding=87;spacing=83;innerWidth;lineUpdateTimeout;lineUpdateFrame;connectedCallback(){this.accordions=this.querySelectorAll(`shn-accordion`),this.lastAccordion=this.accordions[this.accordions.length-1],this.lineAnimationTiming=this.lastAccordion?.style.getPropertyValue(`--animation-timing`),this.line=this.querySelector(`.line`),this.line.style.setProperty(`--animation-timing`,this.lastAccordion?.style.getPropertyValue(`--animation-timing`)),this.addEventListeners(),this.setSpacing(),this.scheduleLineUpdate(),this.style.setProperty(`--active-height`,this.initialPadding+`px`),this.innerWidth=window.innerWidth}setSpacing(){let e=48,t=30;window.innerWidth<1240?(this.initialPadding=79,this.spacing=75,this.linePadding=0,e=40,t=0):(this.initialPadding=87,this.linePadding=15,this.spacing=82),this.id!=``&&(this.initialPadding-=e,this.linePadding+=t),this.accordions.forEach(e=>{let t=e.getBoundingClientRect().top-this.getBoundingClientRect().top+12;e.style.setProperty(`--active-height`,t+`px`)})}addEventListeners(){this.accordions.forEach(e=>{e.addEventListener(`change`,t=>{t.preventDefault(),this.setActiveState(e),this.closeOtherAccordions(e),this.trackLineUpdateDuringAnimation()})}),window.addEventListener(`resize`,()=>{this.innerWidth!=window.innerWidth&&(this.innerWidth=window.innerWidth,this.closeAllAccordions(),this.setSpacing(),this.scheduleLineUpdate())})}scheduleLineUpdate(){window.requestAnimationFrame(()=>{this.updateLinePosition()})}trackLineUpdateDuringAnimation(){window.clearTimeout(this.lineUpdateTimeout),window.cancelAnimationFrame(this.lineUpdateFrame??0
1);let e=Number.parseInt(this.lineAnimationTiming||`400`,10),t=window.performance.now()+e+20,n=()=>{this.updateLinePosition(),window.performance.now()<t&&(this.lineUpdateFrame=window.requestAnimationFrame(n))};n()}updateLinePosition(){let e=this.querySelector(`.main-body`),t=this.querySelectorAll(`.accordion-item > .item`),n=t[0],r=t[t.length-1];if(!e||!n||!r)return;let i=e.getBoundingClientRect(),a=n.getBoundingClientRect(),o=r.getBoundingClientRect(),s=window.innerWidth<1240?8:0,c=a.top-i.top+a.height/2,l=Math.max(o.top-a.top-s,1);this.line.style.setProperty(`--line-top`,`${c}px`),this.line.style.setProperty(`--line-height`,`${l}px`)}setActiveState(e){this.style.setProperty(`--active-height`,e.style.getPropertyValue(`--active-height`))}closeOtherAccordions(e){this.accordions.forEach(t=>{let n=t.querySelector(`button.accordion-header`)??t.querySelector(`.tab-header`),r=t.querySelector(`.accordion-content`)??t.querySelector(`.tab-content`);n?.getAttribute(`aria-expanded`)===`true`&&t!=e&&(n.setAttribute(`aria-expanded`,`false`),r&&(r.style.overflow=`hidden`))})}closeAllAccordions(){this.accordions.forEach(e=>{let t=e.querySelector(`button.accordion-header`)??e.querySelector(`.tab-header`),n=e.querySelector(`.accordion-content`)??e.querySelector(`.tab-content`);t&&t.setAttribute(`aria-expanded`,`false`),n&&(n.style.overflow=`hidden`)})}};customElements.get(`shn-step-block`)||customElements.define(`shn-step-block`,xe);var Se=class extends HTMLElement{dialog;titleElement;closeButton=null;closeButtonTextElement=null;contentContainer;triggerElement=null;constructor(){super(),this.dialog=this.createDialog(),this.titleElement=this.dialog.querySelector(`.dialog-title`),this.contentContainer=this.dialog.querySelector(`.dialog-content`),this.dialog.addEventListener(`click`,e=>this.handleBackdropClick(e)),document.addEventListener(`keydown`,e=>this.handleEscKey(e))}connectedCallback(){this.dialog.isConnected||(this.appendChild(this.dialog),this.moveChildrenToDialog()),this.removeAttribute(`open`),this.updateComponent()}static get observedAttributes(){return[`open`,`title`,`close-button-text`,`alignment`,`show-close-button`,`backdrop-styling`,`blurred-background`]}attributeChangedCallback(){this.updateComponent()}createDialog(){let e=document.createElement(`dialog`);return e.classList.add(`dialog`),e.setAttribute(`role`,`dialog`),e.setAttribute(`aria-modal`,`true`),e.setAttribute(`aria-labelledby`,`dialog-title`),e.innerHTML=` 2 <div class="dialog-header"> 3 <h2 id="dialog-title" class="title dialog-title"></h2> 4 </div> 5 <div class="dialog-content"></div> 6 `,e}moveChildrenToDialog(){for(;this.firstChild&&this.firstChild!==this.dialog;)this.contentContainer.appendChild(this.firstChild)}updateComponent(){let e=this.hasAttribute(`open`),t=this.getAttribute(`title`)||``,n=this.getAttribute(`alignment`),r=this.getAttribute(`blurred-background`)!==`false`;this.titleElement.textContent=t,this.updateCloseButton(),this.updateAlignment(n),this.toggleBlurredBackground(e,r),this.toggleDialogVisibility(e,r)}updateCloseButton(){let e=this.getAttribute(`close-button-text`)||`Sluiten`;this.getAttribute(`show-close-button`)===`false`?this.closeButton&&=(this.closeButton.remove(),null):this.closeButton||(this.closeButton=document.createElement(`button`),this.closeButton.classList.add(`dialog-close`,`ignore-clickonce`),this.closeButton.setAttribute(`aria-label`,`Close`),this.closeButton.innerHTML=`<span class="close-button-text">${e}</span><i class="icon-close"></i>`,this.closeButton.addEventListener(`click`,()=>this.closeDialog()),this.dialog.querySelector(`.dialog-header`)?.prepend(this.closeButton))}updateAlignment(e){this.dialog.classList.remove(`is-aligned-bottom`,`is-aligned-align-top`,`is-aligned-align-center`),e&&this.dialog.classList.add(`is-aligned-${e}`)}toggleBlurredBackground(e,t){this.dialog.classList.toggle(`has-blurred-background`,e&&t),document.body.classList.toggle(`dialog-open`,e&&t)}toggleDialogVisibility(e,t){if(e){this.triggerElement=document.activeElement,t?this.dialog.showModal():this.dialog.show(),this.dialog.focus();return}this.dialog.close(),this.triggerElement?.focus()}handleBackdropClick(e){this.getAttribute(`blurred-background`)!==`false`&&e.target===this.dialog&&this.closeDialog()}handleEscKey(e){this.getAttribute(`blurred-background`)!==`false`&&e.key===`Escape`&&this.hasAttribute(`open`)&&(e.preventDefault(),this.closeDialog())}closeDialog(){this.dialog.classList.add(`closing`),this.dialog.addEventListener(`animationend`,()=>{this.dialog.classList.remove(`closing`),this.removeAttribute(`open`),this.dialog.close(),this.triggerElement&&this.triggerElement.focus()},{once:!0})}};customElements.define(`shn-dialog`,Se);var Ce=class extends HTMLElement{minAnimationTimeConst=400;maxAnimationTimeConst=600;headerButton;content;shouldScroll;scrollLeeway;height;animation;leeway;resizeObserver;connectedCallback(){this.content=this.querySelector(`.accordion-content`)??this.querySelector(`.tab-content`),this.headerButton=this.querySelector(`button.accordion-header`)??this.querySelector(`.tab-header`),this.initializeAnimations(),this.addEventListeners(),this.initializeResizeObserver(),this.showPreviousHeadingAlert()}initializeAnimations(){this.height=this.content?.scrollHeight,this.leeway=this.height*.2;let e=this.height*.5>this.maxAnimationTimeConst?this.maxAnimationTimeConst:this.height*.5;this.animation=this.height*.5<this.minAnimationTimeConst?this.minAnimationTimeConst:Math.ceil(e/100)*100,this.style.setProperty(`--animation-timing`,this.animation+`ms`),this.style.setProperty(`--max-height`,this.height+this.leeway+`px`),this.content.classList.add(`loaded`)}addEventListeners(){this.getAttribute(`event-listener`)!==`true`&&(this.setAttribute(`event-listener`,`true`),this.headerButton.addEventListener(`click`,e=>{let t=this.headerButton.getAttribute(`aria-expanded`)===`true`;e.preventDefault(),e.detail<=1&&(this.headerButton.setAttribute(`aria-expanded`,String(!t)),this.dispatchEvent(new Event(`change`)))}),this.initializeAccessibility())}
6initializeAccessibility(){this.addEventListener(`keyup`,e=>{let t=this.headerButton.getAttribute(`aria-expanded`)===`true`;if((e.key==`Enter`||e.key==` `)&&this.headerButton.dispatchEvent(new Event(`click`)),this.dispatchEvent(new Event(`change`)),this.shouldScroll&&t!=(this.headerButton.getAttribute(`aria-expanded`)===`true`)){let e=this.getBoundingClientRect();window.scrollTo({left:e.left,top:e.top+window.scrollY-this.scrollLeeway,behavior:`smooth`})}})}initializeResizeObserver(){this.content&&(this.resizeObserver=new ResizeObserver(e=>{requestAnimationFrame(()=>{this.updateContentHeight()})}),this.resizeObserver.observe(this.content))}showPreviousHeadingAlert(){let e=this.getPreviousHeading();if(!e){console.debug(`Accordion: no previous heading found for`,this),this.isDebugAlertEnabled()&&this.renderDebugAlert(`NONE`,`No previous heading found`);return}let t=e.tagName.toUpperCase(),n=(e.textContent||``).trim();this.updateHeaderButtonHeading(t,n),this.renderDebugAlert(t,n)}updateHeaderButtonHeading(e,t){if(!this.headerButton)return;let n=/^H([1-6])$/i.exec(e);if(!n)return;let r=Number.parseInt(n[1],10),i=`H`+Math.min(r+1,6),a=t||e,o=this.headerButton.querySelector(`.tab-label-text`),s=this.headerButton.querySelector(`.accordion-prev-heading`);if(o){let e=o.querySelector(`.accordion-prev-heading`);if(!e){e=document.createElement(i),e.className=`accordion-prev-heading`,e.setAttribute(`aria-hidden`,`true`);let t=Array.from(o.childNodes);o.textContent=``,t.forEach(t=>e.appendChild(t)),o.appendChild(e)}if(e.tagName!==i){let t=document.createElement(i);t.className=e.className,t.setAttribute(`aria-hidden`,`true`),t.style.cssText=e.style.cssText||`font-size:inherit;margin:0;display:inline-block;`,Array.from(e.childNodes).forEach(e=>t.appendChild(e)),e.replaceWith(t)}return}if(s)if(s.tagName===i)s.textContent=a;else{let e=document.createElement(i);e.className=s.className,e.setAttribute(`aria-hidden`,`true`),e.style.cssText=s.style.cssText||`font-size:inherit;margin-left:8px;display:inline-block;`,e.textContent=a,this.headerButton.replaceChild(e,s)}else{let e=document.createElement(i);e.className=`accordion-prev-heading`,e.setAttribute(`aria-hidden`,`true`),e.style.cssText=`font-size:inherit;margin-left:8px;display:inline-block;`,e.textContent=a,this.headerButton.appendChild(e)}}renderDebugAlert(e,t){if(console.debug(`Accordion: previous heading detected`,e,t),!this.isDebugAlertEnabled())return;let n=this.querySelector(`.accordion-heading-alert`);n||(n=document.createElement(`div`),n.className=`accordion-heading-alert`,n.setAttribute(`role`,`status`),n.setAttribute(`aria-live`,`polite`),n.style.cssText=`border:1px solid #f1c40f;padding:6px 8px;margin-bottom:8px;background:#fffbe6;color:#333;font-size:13px;border-radius:4px;`,this.insertBefore(n,this.firstChild));let r=t?` — `+t:``;n.textContent=`Previous heading: ${e}${r}`}isDebugAlertEnabled(){return this.hasAttribute(`debug`)||this.dataset.debug===`true`}getPreviousHeading(){let e=this.previousSibling;for(;e;){let t=this.findHeadingInSubtree(e);if(t)return t;e=e.previousSibling}let t=this.parentNode;for(;t&&t!==document.documentElement;){let e=t.previousSibling;for(;e;){let t=this.findHeadingInSubtree(e);if(t)return t;e=e.previousSibling}t=t.parentNode}return null}findHeadingInSubtree(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return null;let t=e;if(/^H[1-6]$/.test(t.nodeName)){let e=t;return e.closest(`shn-accordion`)?null:e}let n=Array.from(t.children);for(let e=n.length-1;e>=0;e--){let t=this.findHeadingInSubtree(n[e]);if(t)return t}return null}updateContentHeight(){if(!this.content)return;let e=this.content.style.maxHeight,t=this.content.style.height,n=this.content.style.overflow;this.content.style.maxHeight=`none`,this.content.style.height=`auto`,this.content.style.overflow=`visible`,this.content.offsetHeight;let r=this.content.scrollHeight;this.content.style.maxHeight=e,this.content.style.height=t,this.content.style.overflow=n,this.height=r,this.leeway=this.height*.2,this.style.setProperty(`--max-height`,this.height+this.leeway+`px`)}disconnectedCallback(){this.resizeObserver&&this.resizeObserver.disconnect()}};customElements.define(`shn-accordion`,Ce);var we=class extends HTMLElement{connectedCallback(){let e=(e,t)=>
6e.every(Boolean)?t:``,t=this.getAttribute(`type`)||`info`,n=this.getAttribute(`header`)||``,r=(this.getAttribute(`header-tag`)||`h3`).toLowerCase(),i=this.getAttribute(`icon`)||``,a=this.getAttribute(`message`)||``,o=this.getAttribute(`primary-button-text`)||`Action`,s=this.getAttribute(`primary-button-link`)||``,c=this.getAttribute(`primary-button-target`)||`_self`,l=this.getAttribute(`secondary-button-text`)||``,u=this.getAttribute(`secondary-button-link`)||``,d=this.getAttribute(`secondary-button-target`)||`_self`,f=this.hasAttribute(`column-classes`)?(this.getAttribute(`column-classes`)||``).trim():``,p=new Set([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`span`]).has(r)?r:`h3`,m=p.startsWith(`h`)?``:` role="heading" aria-level="3"`,h=!!(i||n),g=!!a,_=!!(o&&s),v=!!(l&&u),y=_||v,b=`${h?``:` no-header`}${g?``:` no-body`}${y?``:` no-footer`}`,x=[`alert`,`is-${t}`,f,b.trim()].filter(Boolean).join(` `);this.innerHTML=` 7 <div class="${x}" role="alert"> 8 ${e([h],`<div class="header"> 9 ${e([i],`<i aria-hidden="true" class="icon icon-${i}"></i>`)} 10 ${e([n],`<${p} class="title"${m}>${n}</${p}>`)} 11 </div>`)} 12 ${e([g],`<div class="body"> 13 <p>${a}</p> 14 </div>`)} 15 ${e([y],`<div class="footer"> 16 ${e([_],`<a href="${s}" target="${c}" class="button">${o}</a>`)} 17 ${e([v],`<a href="${u}" target="${d}" class="button">${l}</a>`)} 18 </div>`)} 19 </div> 20 `,this.style.display=`block`}static get observedAttributes(){return[`type`,`header`,`header-tag`,`icon`,`message`,`primary-button-text`,`primary-button-link`,`primary-button-target`,`secondary-button-text`,`secondary-button-link`,`secondary-button-target`,`column-classes`]}attributeChangedCallback(e,t,n){t!==n&&this.connectedCallback()}};customElements.define(`shn-alert`,we);var Te=class extends HTMLElement{tabs=[];contents=[];activeIndex=0;userInitiated=!1;connectedCallback(){this.initTabs(),this.showTab(0),this.addKeyboardNavigation()}initTabs(){let e=Array.from(this.querySelectorAll(`.tab-header`)),t=Array.from(this.querySelectorAll(`.tab-content`));e.forEach((e,t)=>{e.setAttribute(`role`,`tab`),e.setAttribute(`id`,`tab-${t}`),e.setAttribute(`aria-controls`,`content-${t}`),e.setAttribute(`tabindex`,t===0?`0`:`-1`),e.setAttribute(`aria-selected`,String(t===0)),e.addEventListener(`click`,()=>{this.userInitiated=!0,this.showTab(t),this.userInitiated=!1}),this.tabs.push(e)}),this.contents=t}
20showTab(e){this.tabs.forEach((t,n)=>{let r=n===e;t.classList.toggle(`active`,r),t.setAttribute(`aria-selected`,String(r)),t.setAttribute(`tabindex`,r?`0`:`-1`),r&&this.userInitiated&&t.focus()}),this.contents.forEach((t,n)=>{t.hidden=n!==e,t.classList.toggle(`active`,n===e),t.setAttribute(`role`,`tabpanel`),t.setAttribute(`aria-labelledby`,`tab-${e}`)}),this.activeIndex=e}addKeyboardNavigation(){this.tabs.forEach((e,t)=>{e.addEventListener(`keydown`,e=>{switch(this.userInitiated=!0,e.key){case`ArrowLeft`:this.showTab((this.activeIndex-1+this.tabs.length)%this.tabs.length);break;case`ArrowRight`:this.showTab((this.activeIndex+1)%this.tabs.length);break;case`Home`:this.showTab(0);break;case`End`:this.showTab(this.tabs.length-1);break;case`Enter`:case` `:this.showTab(this.activeIndex);break;default:return}e.preventDefault(),this.userInitiated=!1})})}};customElements.define(`shn-tabs`,Te);var Ee=class extends HTMLElement{wrapper;constructor(){super(),this.wrapper=this.createWrapper()}static get observedAttributes(){return[`label`,`value`]}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){if(e===`value`&&n!==null){let e=Math.max(0,Math.min(2,parseInt(n,10)));if(e.toString()!==n){this.setAttribute(`value`,e.toString());return}}this.render()}createWrapper(){let e=document.createElement(`div`);return e.classList.add(`rating`),e.setAttribute(`role`,`listitem`),e}render(){Array.from(this.children).forEach(e=>{e.tagName!==`DATA`&&this.removeChild(e)}),this.wrapper.innerHTML=``,this.wrapper.className=`rating`;let e=this.getAttribute(`label`)||``,t=this.querySelectorAll(`data`);if(t.length>1)this.renderMultiple(e,t);else{let t=parseInt(this.getAttribute(`value`)||`0`,10);this.renderSingle(e,Math.max(0,Math.min(2,t)))}}renderSingle(e,t){this.updateWrapper(t),e&&this.updateLabel(e),this.updateScoreText(t),this.updateAriaAttributes(e,2,t),this.appendChild(this.wrapper)}renderMultiple(e,t){let n=null;if(e){n=`rating-label-${Math.random().toString(36).slice(2)}`;let t=document.createElement(`div`);t.className=`rating-label`,t.textContent=e,t.id=n,this.appendChild(t)}let r=document.createElement(`ul`);r.className=`rating-list`,r.setAttribute(`role`,`list`),n&&r.setAttribute(`aria-labelledby`,n),t.forEach(t=>{let n=t.getAttribute(`date`)||`Onbekende datum`,i=parseInt(t.getAttribute(`value`)||`0`,10),a=Math.max(0,Math.min(2,i)),o=this.getScoreText(a),s=document.createElement(`li`);s.setAttribute(`role`,`listitem`),s.className=`is-${[`low`,`medium`,`high`][a]} rating-list-item`,s.setAttribute(`aria-label`,`${e}, ${n}: ${o}`),s.innerHTML=`<div class="date">${n}</div> <div class="chip">${o}</div>`,r.appendChild(s)}),this.appendChild(r)}updateWrapper(e){this.wrapper.classList.add(`is-${[`low`,`medium`,`high`][e]}`);let t=document.createElement(`div`);t.classList.add(`chip`),this.wrapper.appendChild(t)}updateScoreText(e){let t=this.wrapper.querySelector(`.chip`);t instanceof HTMLElement&&(t.textContent=this.getScoreText(e))}updateLabel(e){let t=document.createElement(`div`);t.className=`rating-label`,t.textContent=e,this.appendChild(t)}updateAriaAttributes(e,t,n){e&&this.wrapper.setAttribute(`aria-label`,`Score ${e}: ${this.getScoreText(n)}`)}getScoreText(e){return{0:`Geen zorgen`,1:`Soms zorgen`}[e]??`Vaak zorgen`}};customElements.define(`shn-status-chip`,Ee);var De=class extends HTMLElement{action;connectedCallback(){this.removePseudoElements(),this.action=this.querySelector(`[data-action]`),E()}removePseudoElements(){this.querySelectorAll(`ul`).forEach(e=>{e.querySelectorAll(`li`).forEach(t=>{t.firstChild!=t.querySelector(`a`)&&t.querySelectorAll(`a`).forEach(t=>{t.classList.add(`no-pseudo`),e.classList.add(`force-list-style`)})})})}checkIfClickable(){if(this.action){let e=this.getClickFunction();this.removeEventListener(`click`,e),this.addEventListener(`click`,e),this.classList.add(`clickable`)}}getClickFunction(){let e=null;return e=this.action instanceof HTMLButtonElement||this.action.classList.contains(`start-questionnaire`)?t=>{if(this.action=this.querySelector(`[data-action]`),!(t.target instanceof HTMLElement&&t.target.classList.contains(`has-tip`))){if(this.dataset.removeEventListeners==`true`){this.removeEventListener(`click`,e);return}this.action.click()}}:e=>{e.target instanceof HTMLElement&&e.target.classList.contains(`has-tip`)||this.querySelector(`[data-action]`)?.click()},e}checkActionLink(){if(this.querySelectorAll(`[data-action]`).length>1)return;(this.action instanceof HTMLAnchorElement||this.action instanceof HTMLButtonElement)&&this.checkIfClickable();let e=this.action?.querySelectorAll(`a`),t=this.action?.querySelectorAll(`button`);if(!(e?.length>1||t?.length>1)){if(e)this.action=e[0];else if(t)this.action=t[0];else return;this.checkIfClickable()}}};customElements.define(`shn-card`,De);var Oe=class e extends HTMLElement{videoElement=null;static currentlyPlayingVideo=null;cookieCheckInterval;previousCookieValue;observer;connectedCallback(){this.updateCookieConsentClass(),this.addEventListener(`click`,()=>{if(!this.classList.contains(`loaded`))if(this.checkCookieConsent())e.currentlyPlayingVideo&&e.currentlyPlayingVideo!==this.videoElement&&(e.currentlyPlayingVideo.src=``,e.currentlyPlayingVideo.parentElement?.classList.remove(`loaded`),e.currentlyPlayingVideo.remove()),this.videoElement=C(`iframe`,{src:(this.dataset.videoUrl?this.dataset.videoUrl:``)+`&autoplay=1&cc_lang_pref=nl&cc_load_policy=1`,title:`Video: `+(this.querySelector(`.title`)?.innerText??`Youtube Video Player`),allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share`,allowfullscreen:``,referrerPolicy:`strict-origin-when-cross-origin`},``),this.appendChild(this.videoElement),this.bringVideoToFront(),e.currentlyPlayingVideo=this.videoElement;
20else{let e={videoId:this.id,videoUrl:this.getAttribute(`data-video-url`)};this.dispatchEvent(new CustomEvent(`show-cookie-dialog`,{bubbles:!0,composed:!0,detail:e}))}}),this.previousCookieValue=document.cookie,this.observer=new MutationObserver(()=>{document.cookie!==this.previousCookieValue&&(this.previousCookieValue=document.cookie,this.updateCookieConsentClass())}),this.observer.observe(document.head,{childList:!0,subtree:!0}),this.observer.observe(document.body,{childList:!0,subtree:!0}),this.cookieCheckInterval=window.setInterval(()=>{this.updateCookieConsentClass()},1e4)}disconnectedCallback(){window.clearInterval(this.cookieCheckInterval),this.observer.disconnect()}bringVideoToFront(){this.classList.add(`loaded`),window.focus()}checkCookieConsent(){let e=document.cookie.split(`;`).find(e=>e.trimStart().startsWith(`CookieSettings=`));if(!e)return!1;try{let t=decodeURIComponent(e.slice(e.indexOf(`=`)+1).trim());return new URLSearchParams(t).get(`Tracking`)===`True`}catch{return!1}}updateCookieConsentClass(){this.checkCookieConsent()?this.classList.remove(`no-cookie-consent`):this.classList.add(`no-cookie-consent`)}};customElements.define(`shn-video-card`,Oe);var ke=class extends HTMLElement{currentActive=1;countCards;nextButton;previousButton;touchstartX=0;touchendX=0;length;animationDirection=`right`;connectedCallback(){this.hasAttribute(`role`)||this.setAttribute(`role`,`region`),this.hasAttribute(`aria-roledescription`)||this.setAttribute(`aria-roledescription`,`carousel`),this.hasAttribute(`aria-live`)||this.setAttribute(`aria-live`,`polite`),this.countCards=this.querySelectorAll(`shn-card`).length,this.setEventlisteners(),this.setActive(!1),this.get
20SetAllHeights()}getSetAllHeights(){let e=Array.prototype.slice.call(this.querySelectorAll(`shn-card`)),t=e[0],n=0;e.forEach(e=>{e!=t&&e.remove()}),setTimeout(()=>{e.forEach(e=>{let r=e.cloneNode(!0);r.style.display=`flex`,t?.after(r),n<r.clientHeight&&(n=r.clientHeight),r.remove()}),e.slice().reverse().forEach(e=>{e!=t&&t.after(e),e.style.height=n+`px`})},100)}navigateRight(){let e=this.checkFullWidth()?this.length-1:this.length;this.currentActive<e&&(this.currentActive++,this.animationDirection=`right`,this.setActive(),this.focusActiveCard())}navigateLeft(){this.currentActive>1&&(this.currentActive--,this.animationDirection=`left`,this.setActive(),this.focusActiveCard())}focusActiveCard(){let e=this.querySelector(`shn-card.index-${this.currentActive}`);e&&(e.hasAttribute(`tabindex`)||e.setAttribute(`tabindex`,`-1`),e.focus())}focusActiveBullet(){let e=this.querySelector(`.item.index-${this.currentActive}`);e&&(e.hasAttribute(`tabindex`)||e.setAttribute(`tabindex`,`0`),e.focus())}setEventlisteners(){this.nextButton=this.querySelector(`.next`),this.nextButton.addEventListener(`click`,e=>{e.preventDefault(),this.navigateRight()}),this.previousButton=this.querySelector(`.previous`),this.previousButton.addEventListener(`click`,e=>{e.preventDefault(),this.navigateLeft()}),this.querySelectorAll(`.item`).forEach(e=>{e.addEventListener(`click`,()=>{this.handleItemSelection(e)}),e.addEventListener(`keydown`,(t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),this.handleItemSelection(e))}))}),this.addEventListener(`keydown`,e=>{if(e.key===`Tab`||!document.activeElement?.classList.contains(`item`))return;let t=this.previousButton&&!this.previousButton.classList.contains(`no-show`),n=this.nextButton&&!this.nextButton.classList.contains(`no-show`);e.key===`ArrowRight`&&n?(e.preventDefault(),this.navigateRight(),this.focusActiveBullet()):e.key===`ArrowLeft`&&t&&(e.preventDefault(),this.navigateLeft(),this.focusActiveBullet())}),this.addSwipeListeners(),this.resizeListerners()}handleItemSelection(e){this.querySelectorAll(`.item`).forEach(e=>{e.classList.remove(`shift-left`),e.classList.remove(`shift-right`)});let t=parseInt(Array.from(e.classList).filter(e=>RegExp(/index-/).exec(e))[0].substring(6));this.checkFullWidth()&&t>this.length-1&&(t=this.length-1),this.currentActive=t,this.setActive(),this.focusActiveCard()}addSwipeListeners(){this.addEventListener(`touchstart`,e=>{this.touchstartX=e.changedTouches[0].screenX}),this.addEventListener(`touchend`,e=>{this.touchendX=e.changedTouches[0].screenX,this.checkDirection()})}resizeListerners(){window.addEventListener(`resize`,()=>{this.updateButtonState(),this.currentActive>this.length-1&&this.checkFullWidth()&&(this.currentActive=this.length-1),this.setActive(!1)})}checkDirection(){this.touchendX<this.touchstartX&&this.navigateRight(),this.touchendX>this.touchstartX&&this.navigateLeft()}setActive(e=!0){let t=this.querySelectorAll(`[class*='index-']`);if(this.length=t.length/2,t.forEach(e=>{if(e.classList.contains(`index-${this.currentActive}`)){if(this.length<=2&&this.checkFullWidth()&&e.tagName==`SPAN`){e.classList.remove(`active`);return}e.classList.add(`active`)}else e.classList.remove(`active`)}),this.updateButtonState(),this.animateDots(),e){let e=window.innerWidth>=1240?72:48,t=document.querySelector(`header`).clientHeight+e,n=this.getBoundingClientRect().top+window.scrollY-t;window.scrollTo({top:n,behavior:`smooth`})}this.closest(`.iso-masonry`)&&b()}animateDots(){let e=this.querySelector(`.item.active`),t=this.querySelectorAll(`.item`);for(let[n,r]of t.entries())n<Array.prototype.indexOf.call(t,e)?(r.classList.add(`shift-right`),r.classList.remove(`shift-left`)):n===Array.prototype.indexOf.call(t,e)?(r.classList.remove(`shift-left`),r.classList.remove(`shift-right`)):(r.classList.add(`shift-left`),r.classList.remove(`shift-right`))}checkFullWidth(){return this.parentElement.classList.contains(`large-24`)&&window.innerWidth>1240}updateButtonState(){let e=this.checkFullWidth()?this.length-1:this.length;if(e===1){this.previousButton?.classList.add(`no-show`),this.previousButton?.setAttribute(`aria-hidden`,`true`),this.nextButton?.classList.add(`no-show`),this.nextButton?.setAttribute(`aria-hidden`,`true`),this.classList.add(`no-padding`);return}switch(this.currentActive){case 1:this.previousButton?.classList.add(`no-show`),this.previousButton?.setAttribute(`aria-hidden`,`true`),this.nextButton?.classList.remove(`no-show`);break;case e:this.nextButton?.classList.add(`no-show`),this.nextButton?.setAttribute(`aria-hidden`,`true`),this.previousButton?.classList.remove(`no-show`),this.previousButton?.removeAttribute(`aria-hidden`);break;default:this.nextButton?.classList.remove(`no-show`),this.nextButton?.removeAttribute(`aria-hidden`),this.previousButton?.classList.remove(`no-show`),this.previousButton?.removeAttribute(`aria-hidden`);break}}};customElements.define(`shn-carrousel-card`,ke);var Ae=class extends HTMLElement{dropdown;items;searchInput;dropdownButton;hasSearch;activeIndex=-1;selectedIndex=-1;connectedCallback(){this.initDropDown()}initDropDown(){if(this.hasSearch=this.dataset.hasSearch===`true`,this.dropdownButton=this.querySelector(`.dropdown-search`),this.dropdown=this.querySelector(`.dropdown-content`),this.searchInput=this.hasSearch?this.querySelector(`#search`):null,!this.dropdown)return;this.dropdown.id||(this.dropdown.id=`${this.id||`shn-dropdown`}-list`),this.dropdownButton&&(this.dropdownButton.setAttribute(`aria-haspopup`,`listbox`),this.dropdownButton.setAttribute(`aria-expanded`,`false`),this.dropdownButton.setAttribute(`aria-controls`,this.dropdown.id),this.dropdownButton.setAttribute(`type`,`button`)),this.setAttribute(`role`,`combobox`),this.setAttribute(`aria-haspopup`,`listbox`),this.removeAttribute(`aria-expanded`),this.dropdown.setAttribute(`role`,`listbox`);let e=this.dropdown.querySelectorAll(`button[data-query-name], button, [data-query-name], [role='option']`);this.items=Array.from(e).filter(e=>e!==this.searchInput);let t=0;for(let e of this.items){if(e.id||=`dropdown-option-${t}-${Math.random().toString(36).slice(2,7)}`,e.setAttribute(`role`,`option`),e.setAttribute(`aria-selected`,`false`),e.tagName.toLowerCase()===`button`){let t=e;t.getAttribute(`type`)||t.setAttribute(`type`,`button`)}t++}this.addEventListeners()}get value(){return this.dropdownButton?this.dropdownButton.innerHTML:``}set value(e){this.dropdownButton&&(this.dropdownButton.innerHTML=e,this.dropdownButton.setAttribute(`aria-label`,e),this.dispatchEvent(new Event(`changed`)))}openDropdown(){this.classList.add(`active`),this.dropdownButton&&this.dropdownButton.setAttribute(`aria-expanded`,`true`),this.dropdown&&(this.dropdown.style.display=`block`),this.activeIndex===-1&&this.items.length>0&&(this.activeIndex=0,this.updateActiveDescendant())}closeDropdown(e=!0){this.classList.remove(`active`),this.dropdownButton&&this.dropdownButton.setAttribute(`aria-expanded`,`false`),this.dropdown&&(this.dropdown.style.display=`none`),e&&(this.activeIndex=-1),this.dropdownButton&&this.dropdownButton.removeAttribute(`aria-activedescendant`),this.updateActiveDescendant()}updateActiveDescendant(){for(let[e,t]of this.items.entries())e===this.activeIndex?(t.classList.add(`active`),this.dropdownButton&&this.dropdownButton.setAttribute(`aria-activedescendant`,t.id),t.scrollIntoView({block:`nearest`})):t.classList.remove(`active`),e===this.selectedIndex?(t.classList.add(`selected`),t.setAttribute(`aria-selected`,`true`)):(t.classList.remove(`selected`),t.setAttribute(`aria-selected`,`false`));this.activeIndex===-1&&this.dropdownButton&&this.dropdownButton.removeAttribute(`aria-activedescendant`)}addEventListeners(){if(!(!this.dropdownButton||!this.dropdown)&&(this.dropdownButton.addEventListener(`click`,e=>{e.stopPropagation(),this.classList.contains(`active`)?this.closeDropdown():this.openDropdown()}
20),this.dropdownButton.addEventListener(`keydown`,e=>{if(!this.classList.contains(`active`)&&(e.key===`ArrowDown`||e.key===`ArrowUp`)){this.openDropdown(),e.preventDefault();return}this.classList.contains(`active`)&&(e.key===`ArrowDown`?(this.activeIndex=(this.activeIndex+1+this.items.length)%this.items.length,this.updateActiveDescendant(),e.preventDefault()):e.key===`ArrowUp`?(this.activeIndex=(this.activeIndex-1+this.items.length)%this.items.length,this.updateActiveDescendant(),e.preventDefault()):e.key===`Enter`||e.key===` `?(this.activeIndex>-1&&this.selectItem(this.activeIndex),this.closeDropdown(),e.preventDefault()):e.key===`Escape`&&(this.closeDropdown(),e.preventDefault()))}),this.dropdown.addEventListener(`click`,e=>{let t=e.target.closest(`[data-query-name], button, [role='option']`);if(!t)return;e.preventDefault(),e.stopPropagation();let n=this.dropdown.querySelectorAll(`button[data-query-name], button, [data-query-name], [role='option']`);this.items=Array.from(n).filter(e=>e!==this.searchInput);let r=this.items.indexOf(t);if(r>-1)this.selectItem(r),this.closeDropdown(!1);else{let e=t.dataset.queryName;if(e){let t=this.items.findIndex(t=>t.dataset.queryName===e);t>-1&&(this.selectItem(t),this.closeDropdown(!1))}}}),document.addEventListener(`click`,e=>{this.contains(e.target)||this.closeDropdown()}),this.hasSearch&&this.searchInput)){let e=null;this.searchInput.addEventListener(`keyup`,()=>{e&&globalThis.clearTimeout(e),e=globalThis.setTimeout(()=>{let e=(this.searchInput.value||``).toUpperCase();for(let t of this.items){let n=(t.textContent||``).toUpperCase();t.style.display=n.includes(e)?``:`none`}},120)})}}selectItem(e){if(!this.items[e])return;this.selectedIndex=e,this.activeIndex=e;let t=this.items[e].textContent||``;this.dropdownButton&&(this.dropdownButton.innerHTML=t,this.dropdownButton.setAttribute(`aria-label`,t)),this.updateActiveDescendant(),this.dispatchEvent(new Event(`changed`));let n=this.items[e].dataset.queryName??null;this.updateUrlFilter(n)}updateUrlFilter(e){try{let t=new URL(globalThis.location.href),n=t.searchParams;e?n.set(`filter`,e):n.delete(`filter`),t.search=n.toString(),globalThis.history.replaceState(null,document.title,t.toString())}catch(t){console.error(`Failed to update URL filter:`,t);let n=new URLSearchParams(globalThis.location.search);e?n.set(`filter`,e):n.delete(`filter`);let r=n.toString()?`${globalThis.location.pathname}?${n.toString()}`:globalThis.location.pathname;globalThis.history.replaceState(null,document.title,r)}}};customElements.define(`shn-dropdown`,Ae);var je=class extends HTMLElement{queryParamName=`filter`;searchDropdown;allFilterableContent;connectedCallback(){this.allFilterableContent=document.querySelectorAll(`[data-taxonomy-ids]`),this.searchDropdown=this.querySelector(`#search-hero`),this.addInputListeners(),this.setActive()}setActive(){let e=null,t=new URL(document.URL).searchParams.get(this.queryParamName);e=t?this.searchDropdown.querySelector(`button[data-query-name='${t}']`):this.searchDropdown.querySelector(`button#all`),this.searchDropdown.querySelectorAll(`button`).forEach(t=>{t==e?(t.classList.add(`selected`),this.searchDropdown.value=t.innerHTML):t.classList.remove(`selected`)}),this.searchDropdown.dispatchEvent(new Event(`changed`))}addInputListeners(){this.searchDropdown&&this.searchDropdown.addEventListener(`changed`,()=>{let e=this.searchDropdown.querySelector(`button.selected, [data-query-name].selected, .selected`);if(!e)return;let t=e.dataset.value??``,n=t?t.split(`,`).map(e=>e.trim()).filter(Boolean):null,r=e.dataset.queryName||e.dataset.queryname||null;if(this.updateUrl(r),e.id===`all`)for(let e of Array.from(this.allFilterableContent||[]))this.setDisplay(e,`show`);else for(let e of Array.from(this.allFilterableContent||[])){let t=e.dataset.taxonomyIds||``,r=new Set(t.split(`,`).map(e=>e.trim()).filter(Boolean)),i=n?.some(e=>r.has(e));this.setDisplay(e,i?`show`:`hide`)}this.updateMasonryChips(),this.showHideRows(),document.querySelector(`.iso-masonry`)&&b()})}updateUrl(e){let t=new URLSearchParams(window.location.search);e?t.set(this.queryParamName,e):t.delete(this.queryParamName);let n=t.toString()?`${window.location.pathname}?${t.toString()}`:window.location.pathname;history.replaceState(window.history.state,`card-filter: ${e}`,n)}
20showHideRows(){document.querySelectorAll(`.row`).forEach(e=>{let t=!0;for(let n of e.children)if(!n.classList.contains(`hide`)){t=!1;break}t&&!e.classList.contains(`content-row`)?e.classList.add(`hide`):e.classList.remove(`hide`)})}setDisplay(e,t){e.closest(`.iso-masonry`)||e.parentElement.classList.contains(`block`)?t==`show`?e.parentElement.classList.remove(`hide`):e.parentElement.classList.add(`hide`):t==`show`?e.classList.remove(`hide`):e.classList.add(`hide`)}updateMasonryChips(){document.querySelectorAll(`shn-masonry`)?.forEach(e=>{let t=e.querySelectorAll(`li.masonry-tile`),n=[],r=!1;t.forEach(e=>{if(!e.classList.contains(`hide`)){let t=e.dataset.cardType;r=!0,n.indexOf(t)==-1&&n.push(t)}}),this.setChipState(e,n),r?e.parentElement.classList.remove(`hide`):e.parentElement.classList.add(`hide`),setTimeout(b,100)})}setChipState(e,t){let n=e.querySelectorAll(`li.chip`),r=!1;n.forEach(e=>{let n=!1;t.forEach(t=>{e.querySelector(`[data-filter="[data-card-type~='${t}']"]`)&&(n=!0)}),n?e.classList.remove(`hide`):(e.classList.add(`hide`),e.querySelector(`.active`)&&(r=!0))}),r&&(e.querySelector(`li.chip:not(.hide)>a`)?.dispatchEvent(new Event(`click`)),setTimeout(()=>{b()},100))}};customElements.define(`shn-search-hero`,je);function Me(e){return e+.5|0}var Ne=(e,t,n)=>Math.max(Math.min(e,n),t);function Pe(e){return Ne(Me(e*2.55),0,255)}function Fe(e){return Ne(Me(e*255),0,255)}function A(e){return Ne(Me(e/2.55)/100,0,1)}function Ie(e){return Ne(Me(e*100),0,100)}var j={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},Le=[...`0123456789ABCDEF`],Re=e=>Le[e&15],ze=e=>Le[(e&240)>>4]+Le[e&15],Be=e=>(e&240)>>4==(e&15),Ve=e=>Be(e.r)&&Be(e.g)&&Be(e.b)&&Be(e.a);function He(e){var t=e.length,n;return e[0]===`#`&&(t===4||t===5?n={r:255&j[e[1]]*17,g:255&j[e[2]]*17,b:255&j[e[3]]*17,a:t===5?j[e[4]]*17:255}:(t===7||t===9)&&(n={r:j[e[1]]<<4|j[e[2]],g:j[e[3]]<<4|j[e[4]],b:j[e[5]]<<4|j[e[6]],a:t===9?j[e[7]]<<4|j[e[8]]:255})),n}var Ue=(e,t)=>e<255?t(e):``;function We(e){var t=Ve(e)?Re:ze;return e?`#`+t(e.r)+t(e.g)+t(e.b)+Ue(e.a,t):void 0}var Ge=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ke(e,t,n){let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function qe(e,t,n){let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function Je(e,t,n){let r=Ke(e,1,.5),i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function Ye(e,t,n,r,i){return e===i?(t-n)/r+(t<n?6:0):t===i?(n-e)/r+2:(e-t)/r+4}function Xe(e){let t=e.r/255,n=e.g/255,r=e.b/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s,c,l;return i!==a&&(l=i-a,c=o>.5?l/(2-i-a):l/(i+a),s=Ye(t,n,r,l,i),s=s*60+.5),[s|0,c||0,o]}function Ze(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Fe)}function Qe(e,t,n){return Ze(Ke,e,t,n)}function $e(e,t,n){return Ze(Je,e,t,n)}function et(e,t,n){return Ze(qe,e,t,n)}function tt(e){return(e%360+360)%360}function nt(e){let t=Ge.exec(e),n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Pe(+t[5]):Fe(+t[5]));let i=tt(+t[2]),a=t[3]/100,o=t[4]/100;return r=t[1]===`hwb`?$e(i,a,o):t[1]===`hsv`?et(i,a,o):Qe(i,a,o),{r:r[0],g:r[1],b:r[2],a:n}}function rt(e,t){var n=Xe(e);n[0]=tt(n[0]+t),n=Qe(n),e.r=n[0],e.g=n[1],e.b=n[2]}function it(e){if(!e)return;let t=Xe(e),n=t[0],r=Ie(t[1]),i=Ie(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${A(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}var at={x:`dark`,Z:`light`,Y:`re`,X:`blu`,W:`gr`,V:`medium`,U:`slate`,A:`ee`,T:`ol`,S:`or`,B:`ra`,C:`lateg`,D:`ights`,R:`in`,Q:`turquois`,E:`hi`,P:`ro`,O:`al`,N:`le`,M:`de`,L:`yello`,F:`en`,K:`ch`,G:`arks`,H:`ea`,I:`ightg`,J:`wh`},ot={OiceXe:`f0f8ff`,antiquewEte:`faebd7`,aqua:`ffff`,aquamarRe:`7fffd4`,azuY:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`0`,blanKedOmond:`ffebcd`,Xe:`ff`,XeviTet:`8a2be2`,bPwn:`a52a2a`,burlywood:`deb887`,caMtXe:`5f9ea0`,KartYuse:`7fff00`,KocTate:`d2691e`,cSO:`ff7f50`,cSnflowerXe:`6495ed`,cSnsilk:`fff8dc`,crimson:`dc143c`,cyan:`ffff`,xXe:`8b`,xcyan:`8b8b`,xgTMnPd:`b8860b`,xWay:`a9a9a9`,xgYF:`6400`,xgYy:`a9a9a9`,xkhaki:`bdb76b`,xmagFta:`8b008b`,xTivegYF:`556b2f`,xSange:`ff8c00`,xScEd:`9932cc`,xYd:`8b0000`,xsOmon:`e9967a`,xsHgYF:`8fbc8f`,xUXe:`483d8b`,xUWay:`2f4f4f`,xUgYy:`2f4f4f`,xQe:`ced1`,xviTet:`9400d3`,dAppRk:`ff1493`,dApskyXe:`bfff`,dimWay:`696969`,dimgYy:`696969`,dodgerXe:`1e90ff`,fiYbrick:`b22222`,flSOwEte:`fffaf0`,foYstWAn:`228b22`,fuKsia:`ff00ff`,gaRsbSo:`dcdcdc`,ghostwEte:`f8f8ff`,gTd:`ffd700`,gTMnPd:`daa520`,Way:`808080`,gYF:`8000`,gYFLw:`adff2f`,gYy:`808080`,honeyMw:`f0fff0`,hotpRk:`ff69b4`,RdianYd:`cd5c5c`,Rdigo:`4b0082`,ivSy:`fffff0`,khaki:`f0e68c`,lavFMr:`e6e6fa`,lavFMrXsh:`fff0f5`,lawngYF:`7cfc00`,NmoncEffon:`fffacd`,ZXe:`add8e6`,ZcSO:`f08080`,Zcyan:`e0ffff`,ZgTMnPdLw:`fafad2`,ZWay:`d3d3d3`,ZgYF:`90ee90`,ZgYy:`d3d3d3`,ZpRk:`ffb6c1`,ZsOmon:`ffa07a`,ZsHgYF:`20b2aa`,ZskyXe:`87cefa`,ZUWay:`778899`,ZUgYy:`778899`,ZstAlXe:`b0c4de`,ZLw:`ffffe0`,lime:`ff00`,limegYF:`32cd32`,lRF:`faf0e6`,magFta:`ff00ff`,maPon:`800000`,VaquamarRe:`66cdaa`,VXe:`cd`,VScEd:`ba55d3`,VpurpN:`9370db`,VsHgYF:`3cb371`,VUXe:`7b68ee`,VsprRggYF:`fa9a`,VQe:`48d1cc`,VviTetYd:`c71585`,midnightXe:`191970`,mRtcYam:`f5fffa`,mistyPse:`ffe4e1`,moccasR:`ffe4b5`,navajowEte:`ffdead`,navy:`80`,Tdlace:`fdf5e6`,Tive:`808000`,TivedBb:`6b8e23`,Sange:`ffa500`,SangeYd:`ff4500`,ScEd:`da70d6`,pOegTMnPd:`eee8aa`,pOegYF:`98fb98`,pOeQe:`afeeee`,pOeviTetYd:`db7093`,papayawEp:`ffefd5`,pHKpuff:`ffdab9`,peru:`cd853f`,pRk:`ffc0cb`,plum:`dda0dd`,powMrXe:`b0e0e6`,purpN:`800080`,YbeccapurpN:`663399`,Yd:`ff0000`,Psybrown:`bc8f8f`,PyOXe:`4169e1`,saddNbPwn:`8b4513`,sOmon:`fa8072`,sandybPwn:`f4a460`,sHgYF:`2e8b57`,sHshell:`fff5ee`,siFna:`a0522d`,silver:`c0c0c0`,skyXe:`87ceeb`,UXe:`6a5acd`,UWay:`708090`,UgYy:`708090`,snow:`fffafa`,sprRggYF:`ff7f`,stAlXe:`4682b4`,tan:`d2b48c`,teO:`8080`,tEstN:`d8bfd8`,tomato:`ff6347`,Qe:`40e0d0`,viTet:`ee82ee`,JHt:`f5deb3`,wEte:`ffffff`,wEtesmoke:`f5f5f5`,Lw:`ffff00`,LwgYF:`9acd32`};function st(){let e={},t=Object.keys(ot),n=Object.keys(at),r,i,a,o,s;for(r=0;r<t.length;r++){for(o=s=t[r],i=0;i<n.length;i++)a=n[i],s=s.replace(a,at[a]);a=parseInt(ot[o],16),e[s]=[a>>16&255,a>>8&255,a&255]}return e}var ct;function lt(e){ct||(ct=st(),ct.transparent=[0,0,0,0]);let t=ct[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var ut=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function dt(e){let t=ut.exec(e),n=255,r,i,a;if(t){if(t[7]!==r){let e=+t[7];n=t[8]?Pe(e):Ne(e*255,0,255)}return r=+t[1],i=+t[3],a=+t[5],r=255&(t[2]?Pe(r):Ne(r,0,255)),i=255&(t[4]?Pe(i):Ne(i,0,255)),a=255&(t[6]?Pe(a):Ne(a,0,255)),{r,g:i,b:a,a:n}}}function ft(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${A(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var pt=e=>e<=.0031308?e*12.92:e**(1/2.4)*1.055-.055,mt=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function ht(e,t,n){let r=mt(A(e.r)),i=mt(A(e.g)),a=mt(A(e.b));return{r:Fe(pt(r+n*(mt(A(t.r))-r))),g:Fe(pt(i+n*(mt(A(t.g))-i))),b:Fe(pt(a+n*(mt(A(t.b))-a))),a:e.a+n*(t.a-e.a)}}function gt(e,t,n){if(e){let r=Xe(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Qe(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function _t(e,t){return e&&Object.assign(t||{},e)}function vt(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>
vendor: 4,106 bytes, line 20
203&&(t.a=Fe(e[3]))):(t=_t(e,{r:0,g:0,b:0,a:1}),t.a=Fe(t.a)),t}function yt(e){return e.charAt(0)===`r`?dt(e):nt(e)}var bt=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,r;n===`object`?r=vt(t):n===`string`&&(r=He(t)||lt(t)||yt(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=_t(this._rgb);return e&&(e.a=A(e.a)),e}set rgb(e){this._rgb=vt(e)}rgbString(){return this._valid?ft(this._rgb):void 0}hexString(){return this._valid?We(this._rgb):void 0}hslString(){return this._valid?it(this._rgb):void 0}mix(e,t){if(e){let n=this.rgb,r=e.rgb,i,a=t===i?.5:t,o=2*a-1,s=n.a-r.a,c=((o*s===-1?o:(o+s)/(1+o*s))+1)/2;i=1-c,n.r=255&c*n.r+i*r.r+.5,n.g=255&c*n.g+i*r.g+.5,n.b=255&c*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=ht(this._rgb,e._rgb,t)),this}clone(){return new e(this.rgb)}alpha(e){return this._rgb.a=Fe(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb;return e.r=e.g=e.b=Me(e.r*.3+e.g*.59+e.b*.11),this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return gt(this._rgb,2,e),this}darken(e){return gt(this._rgb,2,-e),this}saturate(e){return gt(this._rgb,1,e),this}desaturate(e){return gt(this._rgb,1,-e),this}rotate(e){return rt(this._rgb,e),this}};function M(){}var xt=(()=>{let e=0;return()=>e++})();function N(e){return e==null}function P(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)===`[object`&&t.slice(-6)===`Array]`}function F(e){return e!==null&&Object.prototype.toString.call(e)===`[object Object]`}function I(e){return(typeof e==`number`||e instanceof Number)&&isFinite(+e)}function L(e,t){return I(e)?e:t}function R(e,t){return e===void 0?t:e}var St=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100:+e/t,Ct=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100*t:+e;function z(e,t,n){if(e&&typeof e.call==`function`)return e.apply(n,t)}function B(e,t,n,r){let i,a,o;if(P(e))if(a=e.length,r)for(i=a-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;i<a;i++)t.call(n,e[i],i);else if(F(e))for(o=Object.keys(e),a=o.length,i=0;i<a;i++)t.call(n,e[o[i]],o[i])}function wt(e,t){let n,r,i,a;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],a=t[n],i.datasetIndex!==a.datasetIndex||i.index!==a.index)return!1;return!0}function Tt(e){if(P(e))return e.map(Tt);if(F(e)){let t=Object.create(null),n=Object.keys(e),r=n.length,i=0;for(;i<r;++i)t[n[i]]=Tt(e[n[i]]);return t}return e}function Et(e){return[`__proto__`,`prototype`,`constructor`].indexOf(e)===-1}function Dt(e,t,n,r){if(!Et(e))return;let i=t[e],a=n[e];F(i)&&F(a)?Ot(i,a,r):t[e]=Tt(a)}function Ot(e,t,n){let r=P(t)?t:[t],i=r.length;if(!F(e))return e;n||={};let a=n.merger||Dt,o;for(let t=0;t<i;++t){if(o=r[t],!F(o))continue;let i=Object.keys(o);for(let t=0,r=i.length;t<r;++t)a(i[t],e,o,n)}return e}function kt(e,t){return Ot(e,t,{merger:At})}function At(e,t,n){if(!Et(e))return;let r=t[e],i=n[e];F(r)&&F(i)?kt(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Tt(i))}var jt={"":e=>e,x:e=>e.x,y:e=>e.y};function Mt(e){let t=e.split(`.`),n=[],r=``;for(let e of t)r+=e,r.endsWith(`\\`)?r=r.slice(0,-1)+`.`:(n.push(r),r=``);return n}function Nt(e){let t=Mt(e);return e=>{for(let n of t){if(n===``)break;e&&=e[n]}return e}}function Pt(e,t){return(jt[t]||(jt[t]=Nt(t)))(e)}function Ft(e){return e.charAt(0).toUpperCase()+e.slice(1)}var It=e=>e!==void 0,Lt=e=>typeof e==`function`,Rt=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function zt(e){return e.type===`mouseup`||e.type===`click`||e.type===`contextmenu`}var V=Math.PI,H=2*V;H+V;var Bt=1/0,Vt=V/180,U=V/2,Ht=V/4,Ut=V*2/3,Wt=Math.log10,Gt=Math.sign;function Kt(e,t,n){return Math.abs(e-t)<n}function qt(e){let t=Math.round(e);e=Kt(e,t,e/1e3)?t:e;let n=10**Math.floor(Wt(e)),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function Jt(e){let t=[],n=Math.sqrt(e),r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((e,t)=>
vendor: 17,352 bytes, line 20
20e-t).pop(),t}function Yt(e){return typeof e==`symbol`||typeof e==`object`&&!!e&&!(Symbol.toPrimitive in e||`toString`in e||`valueOf`in e)}function Xt(e){return!Yt(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Zt(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function Qt(e,t,n){let r,i,a;for(r=0,i=e.length;r<i;r++)a=e[r][n],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function W(e){return V/180*e}function $t(e){return 180/V*e}function en(e){if(!I(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function tn(e,t){let n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n);return a<-.5*V&&(a+=H),{angle:a,distance:i}}function nn(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function G(e){return(e%H+H)%H}function rn(e,t,n,r){let i=G(e),a=G(t),o=G(n),s=G(a-i),c=G(o-i),l=G(i-a),u=G(i-o);return i===a||i===o||r&&a===o||s>c&&l<u}function K(e,t,n){return Math.max(t,Math.min(n,e))}function an(e){return K(e,-32768,32767)}function on(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function sn(e,t,n){n||=(n=>e[n]<t);let r=e.length-1,i=0,a;for(;r-i>1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}var cn=(e,t,n,r)=>sn(e,n,r?r=>{let i=e[r][t];return i<n||i===n&&e[r+1][t]===n}:r=>e[r][t]<n),ln=(e,t,n)=>sn(e,n,r=>e[r][t]>=n);function un(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}var dn=[`push`,`pop`,`shift`,`splice`,`unshift`];function fn(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),dn.forEach(t=>{let n=`_onData`+Ft(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){let i=r.apply(this,t);return e._chartjs.listeners.forEach(e=>{typeof e[n]==`function`&&e[n](...t)}),i}})})}function pn(e,t){let n=e._chartjs;if(!n)return;let r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(dn.forEach(t=>{delete e[t]}),delete e._chartjs)}function mn(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var hn=function(){return typeof window>`u`?function(e){return e()}:window.requestAnimationFrame}();function gn(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,hn.call(window,()=>{r=!1,e.apply(t,n)}))}}function _n(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}var vn=e=>e===`start`?`left`:e===`end`?`right`:`center`,yn=(e,t,n)=>e===`start`?t:e===`end`?n:(t+n)/2,bn=e=>e===0||e===1,xn=(e,t,n)=>-(2**(10*--e)*Math.sin((e-t)*H/n)),Sn=(e,t,n)=>2**(-10*e)*Math.sin((e-t)*H/n)+1,Cn={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-(--e*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>--e*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*U)+1,easeOutSine:e=>Math.sin(e*U),easeInOutSine:e=>-.5*(Math.cos(V*e)-1),easeInExpo:e=>e===0?0:2**(10*(e-1)),easeOutExpo:e=>e===1?1:-(2**(-10*e))+1,easeInOutExpo:e=>bn(e)?e:e<.5?.5*2**(10*(e*2-1)):.5*(-(2**(-10*(e*2-1)))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1- --e*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>bn(e)?e:xn(e,.075,.3),easeOutElastic:e=>bn(e)?e:Sn(e,.075,.3),easeInOutElastic(e){let t=.1125,n=.45;return bn(e)?e:e<.5?.5*xn(e*2,t,n):.5+.5*Sn(e*2-1,t,n)},easeInBack(e){return e*e*(2.70158*e-1.70158)},easeOutBack(e){return--e*e*(2.70158*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Cn.easeOutBounce(1-e),easeOutBounce(e){let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?Cn.easeInBounce(e*2)*.5:Cn.easeOutBounce(e*2-1)*.5+.5};function wn(e){if(e&&typeof e==`object`){let t=e.toString();return t===`[object CanvasPattern]`||t===`[object CanvasGradient]`}return!1}function Tn(e){return wn(e)?e:new bt(e)}function En(e){return wn(e)?e:new bt(e).saturate(.5).darken(.1).hexString()}var Dn=[`x`,`y`,`borderWidth`,`radius`,`tension`],On=[`color`,`borderColor`,`backgroundColor`];function kn(e){e.set(`animation`,{delay:void 0,duration:1e3,easing:`easeOutQuart`,fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe(`animation`,{_fallback:!1,_indexable:!1,_scriptable:e=>e!==`onProgress`&&e!==`onComplete`&&e!==`fn`}),e.set(`animations`,{colors:{type:`color`,properties:On},numbers:{type:`number`,properties:Dn}}),e.describe(`animations`,{_fallback:`animation`}),e.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:e=>e|0}}}})}function An(e){e.set(`layout`,{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var jn=new Map;function Mn(e,t){t||={};let n=e+JSON.stringify(t),r=jn.get(n);return r||(r=new Intl.NumberFormat(e,t),jn.set(n,r)),r}function Nn(e,t,n){return Mn(t,n).format(e)}var Pn={values(e){return P(e)?e:``+e},numeric(e,t,n){if(e===0)return`0`;let r=this.chart.options.locale,i,a=e;if(n.length>1){let t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>0x38d7ea4c68000)&&(i=`scientific`),a=Fn(e,n)}let o=Wt(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),Nn(e,r,c)},logarithmic(e,t,n){if(e===0)return`0`;let r=n[t].significand||e/10**Math.floor(Wt(e));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?Pn.numeric.call(this,e,t,n):``}};function Fn(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var In={formatters:Pn};function Ln(e){e.set(`scale`,{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:`ticks`,clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:``,padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:``,padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:In.formatters.values,minor:{},major:{},align:`center`,crossAlign:`near`,showLabelBackdrop:!1,backdropColor:`rgba(255, 255, 255, 0.75)`,backdropPadding:2}}),e.route(`scale.ticks`,`color`,``,`color`),e.route(`scale.grid`,`color`,``,`borderColor`),e.route(`scale.border`,`color`,``,`borderColor`),e.route(`scale.title`,`color`,``,`color`),e.describe(`scale`,{_fallback:!1,_scriptable:e=>!e.startsWith(`before`)&&!e.startsWith(`after`)&&e!==`callback`&&e!==`parser`,_indexable:e=>e!==`borderDash`&&e!==`tickBorderDash`&&e!==`dash`}),e.describe(`scales`,{_fallback:`scale`}),e.describe(`scale.ticks`,{_scriptable:e=>e!==`backdropPadding`&&e!==`callback`,_indexable:e=>e!==`backdropPadding`})}var Rn=Object.create(null),zn=Object.create(null);function Bn(e,t){if(!t)return e;let n=t.split(`.`);for(let t=0,r=n.length;t<r;++t){let r=n[t];e=e[r]||(e[r]=Object.create(null))}return e}function Vn(e,t,n){return typeof t==`string`?Ot(Bn(e,t),n):Ot(Bn(e,``),t)}var q=new class{constructor(e,t){this.animation=void 0,this.backgroundColor=`rgba(0,0,0,0.1)`,this.borderColor=`rgba(0,0,0,0.1)`,this.color=`#666`,this.datasets={},this.devicePixelRatio=e=>e.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=(e,t)=>En(t.backgroundColor),this.hoverBorderColor=(e,t)=>En(t.borderColor),this.hoverColor=(e,t)=>En(t.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(e),this.apply(t)}set(e,t){return Vn(this,e,t)}get(e){return Bn(this,e)}describe(e,t){return Vn(zn,e,t)}override(e,t){return Vn(Rn,e,t)}route(e,t,n,r){let i=Bn(this,e),a=Bn(this,n),o=`_`+t;Object.defineProperties(i,{[o]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){let e=this[o],t=a[r];return F(e)?Object.assign({},t,e):R(e,t)},set(e){this[o]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith(`on`),_indexable:e=>e!==`events`,hover:{_fallback:`interaction`},interaction:{_scriptable:!1,_indexable:!1}},[kn,An,Ln]);function Hn(e){return!e||N(e.size)||N(e.family)?null:(e.style?e.style+` `:``)+(e.weight?e.weight+` `:``)+e.size+`px `+e.family}function Un(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function Wn(e,t,n,r){r||={};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0,s=n.length,c,l,u,d,f;for(c=0;c<s;c++)if(d=n[c],d!=null&&!P(d))o=Un(e,i,a,o,d);else if(P(d))for(l=0,u=d.length;l<u;l++)f=d[l],f!=null&&!P(f)&&(o=Un(e,i,a,o,f));e.restore();let p=a.length/2;if(p>n.length){for(c=0;c<p;c++)delete i[a[c]];a.splice(0,p)}return o}function Gn(e,t,n){let r=e.currentDevicePixelRatio,i=n===0?0:Math.max(n/2,.5);return Math.round((t-i)*r)/r+i}function Kn(e,t){!t&&!e||(t||=e.getContext(`2d`),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function qn(e,t,n,r){Jn(e,t,n,r,null)}function Jn(e,t,n,r,i){let a,o,s,c,l,u,d,f,p=t.pointStyle,m=t.rotation,h=t.radius,g=(m||0)*Vt;if(p&&typeof p==`object`&&(a=p.toString(),a===`[object HTMLImageElement]`||a===`[object HTMLCanvasElement]`)){e.save(),e.translate(n,r),e.rotate(g),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(h)||h<=0)){switch(e.beginPath(),p){default:i?e.ellipse(n,r,i/2,h,0,0,H):e.arc(n,r,h,0,H),e.closePath();break;case`triangle`:u=i?i/2:h,e.moveTo(n+Math.sin(g)*u,r-Math.cos(g)*h),g+=Ut,e.lineTo(n+Math.sin(g)*u,r-Math.cos(g)*h),g+=Ut,e.lineTo(n+Math.sin(g)*u,r-Math.cos(g)*h),e.closePath();break;case`rectRounded`:l=h*.516,c=h-l,o=Math.cos(g+Ht)*c,d=Math.cos(g+Ht)*(i?i/2-l:c),s=Math.sin(g+Ht)*c,f=Math.sin(g+Ht)*(i?i/2-l:c),e.arc(n-d,r-s,l,g-V,g-U),e.arc(n+f,r-o,l,g-U,g),e.arc(n+d,r+s,l,g,g+U),e.arc(n-f,r+o,l,g+U,g+V),e.closePath();break;case`rect`:if(!m){c=Math.SQRT1_2*h,u=i?i/2:c,e.rect(n-u,r-c,2*u,2*c);break}g+=Ht;case`rectRot`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+f,r-o),e.lineTo(n+d,r+s),e.lineTo(n-f,r+o),e.closePath();break;case`crossRot`:g+=Ht;case`cross`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case`star`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o),g+=Ht,d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case`line`:o=i?i/2:Math.cos(g)*h,s=Math.sin(g)*h,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s);break;case`dash`:e.moveTo(n,r),e.lineTo(n+Math.cos(g)*(i?i/2:h),r+Math.sin(g)*h);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Yn(e,t,n){return n||=.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Xn(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Zn(e){e.restore()}function Qn(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),N(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function $n(e,t,n,r,i){if(i.strikethrough||i.underline){let a=e.measureText(r),o=t-a.actualBoundingBoxLeft,s=t+a.actualBoundingBoxRight,c=n-a.actualBoundingBoxAscent,l=n+a.actualBoundingBoxDescent,u=i.strikethrough?(c+l)/2:l;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,u),e.lineTo(s,u),e.stroke()}}function er(e,t){let n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function tr(e,t,n,r,i,a={}){let o=P(t)?t:[t],s=a.strokeWidth>0&&a.strokeColor!==``,c,l;for(e.save(),e.font=i.string,Qn(e,a),c=0;c<o.length;++c)l=o[c],a.backdrop&&er(e,a.backdrop),s&&(a.strokeColor&&(e.strokeStyle=a.strokeColor),N(a.strokeWidth)||(e.lineWidth=a.strokeWidth),e.strokeText(l,n,r,a.maxWidth)),e.fillText(l,n,r,a.maxWidth),$n(e,n,r,l,a),r+=Number(i.lineHeight);e.restore()}function nr(e,t){let{x:n,y:r,w:i,h:a,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*V,V,!0),e.lineTo(n,r+a-o.bottomLeft),e.arc(n+o.bottomLeft,r+a-o.bottomLeft,o.bottomLeft,V,U,!0),e.lineTo(n+i-o.bottomRight,r+a),e.arc(n+i-o.bottomRight,r+a-o.bottomRight,o.bottomRight,U,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-U,!0),e.lineTo(n+o.topLeft,r)}var rr=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ir=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ar(e,t){let n=(``+e).match(rr);if(!n||n[1]===`normal`)return t*1.2;switch(e=+n[2],n[3]){case`px`:return e;case`%`:e/=100;break}return t*e}var or=e=>+e||0;function sr(e,t){let n={},r=F(t),i=r?Object.keys(t):t,a=F(e)?r?n=>R(e[n],e[t[n]]):t=>e[t]:()=>e;for(let e of i)n[e]=or(a(e));return n}function cr(e){return sr(e,{top:`y`,right:`x`,bottom:`y`,left:`x`})}function lr(e){return sr(e,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])}function J(e){let t=cr(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Y(e,t){e||={},t||=q.font;let n=R(e.size,t.size);typeof n==`string`&&(n=parseInt(n,10));let r=R(e.style,t.style);r&&!(``+r).match(ir)&&(console.warn(`Invalid font style specified: "`+r+`"`),r=void 0);let i={family:R(e.family,t.family),lineHeight:ar(R(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:R(e.weight,t.weight),string:``};return i.string=Hn(i),i}function ur(e,t,n,r){let i=!0,a,o,s;for(a=0,o=e.length;a<o;++a)if(s=e[a],s!==void 0&&(t!==void 0&&typeof s==`function`&&(s=s(t),i=!1),n!==void 0&&P(s)&&(s=s[n%s.length],i=!1),s!==void 0))return r&&!i&&(r.cacheable=!1),s}function dr(e,t,n){let{min:r,max:i}=e,a=Ct(t,(i-r)/2),o=(e,t)=>n&&e===0?0:e+t;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function fr(e,t){return Object.assign(Object.create(e),t)}function pr(e,t=[``],n,r,i=()=>e[0]){let a=n||e;return r===void 0&&(r=kr(`_fallback`,e)),new Proxy({[Symbol.toStringTag]:`Object`,_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:n=>pr([n,...e],t,a,r)},{deleteProperty(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get(n,r){return vr(n,r,()=>Or(r,t,e,n))},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(e,t){return Ar(e).includes(t)},ownKeys(e){return Ar(e)},set(e,t,n){let r=e._storage||=i();return e[t]=r[t]=n,delete e._keys,!0}})}function mr(e,t,n,r){let i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:hr(e,r),setContext:t=>mr(e,t,n,r),override:i=>mr(e.override(i),t,n,r)};return new Proxy(i,{deleteProperty(t,n){return delete t[n],delete e[n],!0},get(e,t,n){return vr(e,t,()=>yr(e,t,n))},getOwnPropertyDescriptor(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(t,n){return Reflect.has(e,n)},ownKeys(){return Reflect.ownKeys(e)},set(t,n,r){return e[n]=r,delete t[n],!0}})}function hr(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Lt(n)?n:()=>n,isIndexable:Lt(r)?r:()=>r}}var gr=(e,t)=>e?e+Ft(t):t,_r=(e,t)=>F(t)&&e!==`adapters`&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function vr(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t===`constructor`)return e[t];let r=n();return e[t]=r,r}function yr(e,t,n){let{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e,s=r[t];return Lt(s)&&o.isScriptable(t)&&(s=br(t,s,e,n)),P(s)&&s.length&&(s=xr(t,s,e,o.isIndexable)),_r(t,s)&&(s=mr(s,i,a&&a[t],o)),s}function br(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw Error(`Recursion detected: `+Array.from(s).join(`->`)+`->`+e);s.add(e);let c=t(a,o||r);return s.delete(e),_r(e,c)&&(c=Tr(i._scopes,i,e,c)),c}function xr(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(a.index!==void 0&&r(e))return t[a.index%t.length];if(F(t[0])){let n=t,r=i._scopes.filter(e=>e!==n);t=[];for(let c of n){let n=Tr(r,i,e,c);t.push(mr(n,a,o&&o[e],s))}}return t}function Sr(e,t,n){return Lt(e)?e(t,n):e}var Cr=(e,t)=>
vendor: 4,718 bytes, line 20
20e===!0?t:typeof e==`string`?Pt(t,e):void 0;function wr(e,t,n,r,i){for(let a of t){let t=Cr(n,a);if(t){e.add(t);let a=Sr(t._fallback,n,i);if(a!==void 0&&a!==n&&a!==r)return a}else if(t===!1&&r!==void 0&&n!==r)return null}return!1}function Tr(e,t,n,r){let i=t._rootScopes,a=Sr(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let c=Er(s,o,n,a||n,r);return c===null||a!==void 0&&a!==n&&(c=Er(s,o,a,c,r),c===null)?!1:pr(Array.from(s),[``],i,a,()=>Dr(t,n,r))}function Er(e,t,n,r,i){for(;n;)n=wr(e,t,n,r,i);return n}function Dr(e,t,n){let r=e._getTarget();t in r||(r[t]={});let i=r[t];return P(i)&&F(n)?n:i||{}}function Or(e,t,n,r){let i;for(let a of t)if(i=kr(gr(a,e),n),i!==void 0)return _r(e,i)?Tr(n,r,e,i):i}function kr(e,t){for(let n of t){if(!n)continue;let t=n[e];if(t!==void 0)return t}}function Ar(e){let t=e._keys;return t||=e._keys=jr(e._scopes),t}function jr(e){let t=new Set;for(let n of e)for(let e of Object.keys(n).filter(e=>!e.startsWith(`_`)))t.add(e);return Array.from(t)}function Mr(){return typeof window<`u`&&typeof document<`u`}function Nr(e){let t=e.parentNode;return t&&t.toString()===`[object ShadowRoot]`&&(t=t.host),t}function Pr(e,t,n){let r;return typeof e==`string`?(r=parseInt(e,10),e.indexOf(`%`)!==-1&&(r=r/100*t.parentNode[n])):r=e,r}var Fr=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Ir(e,t){return Fr(e).getPropertyValue(t)}var Lr=[`top`,`right`,`bottom`,`left`];function Rr(e,t,n){let r={};n=n?`-`+n:``;for(let i=0;i<4;i++){let a=Lr[i];r[a]=parseFloat(e[t+`-`+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var zr=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Br(e,t){let n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r,o=!1,s,c;if(zr(i,a,e.target))s=i,c=a;else{let e=t.getBoundingClientRect();s=r.clientX-e.left,c=r.clientY-e.top,o=!0}return{x:s,y:c,box:o}}function Vr(e,t){if(`native`in e)return e;let{canvas:n,currentDevicePixelRatio:r}=t,i=Fr(n),a=i.boxSizing===`border-box`,o=Rr(i,`padding`),s=Rr(i,`border`,`width`),{x:c,y:l,box:u}=Br(e,n),d=o.left+(u&&s.left),f=o.top+(u&&s.top),{width:p,height:m}=t;return a&&(p-=o.width+s.width,m-=o.height+s.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((l-f)/m*n.height/r)}}function Hr(e,t,n){let r,i;if(t===void 0||n===void 0){let a=e&&Nr(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{let e=a.getBoundingClientRect(),o=Fr(a),s=Rr(o,`border`,`width`),c=Rr(o,`padding`);t=e.width-c.width-s.width,n=e.height-c.height-s.height,r=Pr(o.maxWidth,a,`clientWidth`),i=Pr(o.maxHeight,a,`clientHeight`)}}return{width:t,height:n,maxWidth:r||Bt,maxHeight:i||Bt}}var Ur=e=>Math.round(e*10)/10;function Wr(e,t,n,r){let i=Fr(e),a=Rr(i,`margin`),o=Pr(i.maxWidth,e,`clientWidth`)||Bt,s=Pr(i.maxHeight,e,`clientHeight`)||Bt,c=Hr(e,t,n),{width:l,height:u}=c;if(i.boxSizing===`content-box`){let e=Rr(i,`border`,`width`),t=Rr(i,`padding`);l-=t.width+e.width,u-=t.height+e.height}return l=Math.max(0,l-a.width),u=Math.max(0,r?l/r:u-a.height),l=Ur(Math.min(l,o,c.maxWidth)),u=Ur(Math.min(u,s,c.maxHeight)),l&&!u&&(u=Ur(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=Ur(Math.floor(u*r))),{width:l,height:u}}function Gr(e,t,n){let r=t||1,i=Ur(e.height*r),a=Ur(e.width*r);e.height=Ur(e.height),e.width=Ur(e.width);let o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}var Kr=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Mr()&&(window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t))}catch{}return e}();function qr(e,t){let n=Ir(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}var Jr=function(e,t){return{x(n){return e+e+t-n},setWidth(e){t=e},textAlign(e){return e===`center`?e:e===`right`?`left`:`right`},xPlus(e,t){return e-t},leftForLtr(e,t){return e-t}}},Yr=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Xr(e,t,n){return e?Jr(t,n):Yr()}function Zr(e,t){let n,r;(t===`ltr`||t===`rtl`)&&(n=e.canvas.style,r=[n.getPropertyValue(`direction`),n.getPropertyPriority(`direction`)],n.setProperty(`direction`,t,`important`),e.prevTextDirection=r)}function Qr(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty(`direction`,t[0],t[1]))}function $r(e,t,n){return e.options.clip?e[n]:t[n]}function ei(e,t){let{xScale:n,yScale:r}=e;return n&&r?{left:$r(n,t,`left`),right:$r(n,t,`right`),top:$r(r,t,`top`),bottom:$r(r,t,`bottom`)}:t}function ti(e,t){let n=t._clip;if(n.disabled)return!1;let r=ei(t,e.chartArea);
vendor: 10,832 bytes, line 20
20return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}var ni=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,r){let i=t.listeners[r],a=t.duration;i.forEach(r=>r({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||=(this._running=!0,hn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;let i=n.items,a=i.length-1,o=!1,s;for(;a>=0;--a)s=i[a],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(e),o=!0):(i[a]=i[i.length-1],i.pop());o&&(r.draw(),this._notify(r,n,e,`progress`)),i.length||(n.running=!1,this._notify(r,n,e,`complete`),n.initial=!1),t+=i.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let n=t.items,r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),`complete`)}remove(e){return this._charts.delete(e)}},ri=`transparent`,ii={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let r=Tn(e||ri),i=r.valid&&Tn(t||ri);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}},ai=class{constructor(e,t,n,r){let i=t[n];r=ur([e.to,r,i,e.from]);let a=ur([e.from,i,r]);this._active=!0,this._fn=e.fn||ii[e.type||typeof a],this._easing=Cn[e.easing]||Cn.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);let r=this._target[this._prop],i=n-this._start,a=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=ur([e.to,t,r,e.from]),this._from=ur([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,n=this._duration,r=this._prop,i=this._from,a=this._loop,o=this._to,s;if(this._active=i!==o&&(a||t<n),!this._active){this._target[r]=o,this._notify(!0);return}if(t<0){this._target[r]=i;return}s=t/n%2,s=a&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,o,s)}wait(){let e=this._promises||=[];return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){let t=e?`res`:`rej`,n=this._promises||[];for(let e=0;e<n.length;e++)n[e][t]()}},oi=class{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!F(e))return;let t=Object.keys(q.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{let i=e[r];if(!F(i))return;let a={};for(let e of t)a[e]=i[e];(P(i.properties)&&i.properties||[r]).forEach(e=>{(e===r||!n.has(e))&&n.set(e,a)})})}_animateOptions(e,t){let n=t.options,r=ci(e,n);if(!r)return[];let i=this._createAnimations(r,n);return n.$shared&&si(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){let n=this._properties,r=[],i=e.$animations||={},a=Object.keys(t),o=Date.now(),s;for(s=a.length-1;s>=0;--s){let c=a[s];if(c.charAt(0)===`$`)continue;if(c===`options`){r.push(...this._animateOptions(e,t));continue}let l=t[c],u=i[c],d=n.get(c);if(u)if(d&&u.active()){u.update(d,l,o);continue}else u.cancel();if(!d||!d.duration){e[c]=l;continue}i[c]=u=new ai(d,e,c,l),r.push(u)}return r}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let n=this._createAnimations(e,t);if(n.length)return ni.add(this._chart,n),!0}};function si(e,t){let n=[],r=Object.keys(t);for(let t=0;t<r.length;t++){let i=e[r[t]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function ci(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function li(e,t){let n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,a=n.max===void 0?t:0;return{start:r?a:i,end:r?i:a}}function ui(e,t,n){if(n===!1)return!1;let r=li(e,n),i=li(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function di(e){let t,n,r,i;return F(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function fi(e,t){let n=[],r=e._getSortedDatasetMetas(t),i,a;for(i=0,a=r.length;i<a;++i)n.push(r[i].index);return n}function pi(e,t,n,r={}){let i=e.keys,a=r.mode===`single`,o,s,c,l;if(t===null)return;let u=!1;for(o=0,s=i.length;o<s;++o){if(c=+i[o],c===n){if(u=!0,r.all)continue;break}l=e.values[c],I(l)&&(a||t===0||Gt(t)===Gt(l))&&(t+=l)}return!u&&!r.all?0:t}function mi(e,t){let{iScale:n,vScale:r}=t,i=n.axis===`x`?`x`:`y`,a=r.axis===`x`?`x`:`y`,o=Object.keys(e),s=Array(o.length),c,l,u;for(c=0,l=o.length;c<l;++c)u=o[c],s[c]={[i]:u,[a]:e[u]};return s}function hi(e,t){let n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function gi(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function _i(e){let{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:-1/0,max:i?n:1/0}}function vi(e,t,n){let r=e[t]||(e[t]={});return r[n]||(r[n]={})}function yi(e,t,n,r){for(let i of t.getMatchingVisibleMetas(r).reverse()){let t=e[i.index];if(n&&t>0||!n&&t<0)return i.index}return null}function bi(e,t){let{chart:n,_cachedMeta:r}=e,i=n._stacks||={},{iScale:a,vScale:o,index:s}=r,c=a.axis,l=o.axis,u=gi(a,o,r),d=t.length,f;for(let e=0;e<d;++e){let n=t[e],{[c]:a,[l]:d}=n,p=n._stacks||={};f=p[l]=vi(i,u,a),f[s]=d,f._top=yi(f,o,!0,r.type),f._bottom=yi(f,o,!1,r.type);let m=f._visualValues||={};m[s]=d}}function xi(e,t){let n=e.scales;return Object.keys(n).filter(e=>n[e].axis===t).shift()}function Si(e,t){return fr(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:`default`,type:`dataset`})}function Ci(e,t,n){return fr(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:`default`,type:`data`})}function wi(e,t){let n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t||=e._parsed;for(let e of t){let t=e._stacks;if(!t||t[r]===void 0||t[r][n]===void 0)return;delete t[r][n],t[r]._visualValues!==void 0&&t[r]._visualValues[n]!==void 0&&delete t[r]._visualValues[n]}}}var Ti=e=>e===`reset`||e===`none`,Ei=(e,t)=>t?e:Object.assign({},e),Di=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:fi(n,!0),values:null},Oi=class{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=hi(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled(`filler`)&&console.warn(`Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options`)}updateIndex(e){this.index!==e&&wi(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>e===`x`?t:e===`r`?r:n,i=t.xAxisID=R(n.xAxisID,xi(e,`x`)),a=t.yAxisID=R(n.yAxisID,xi(e,`y`)),o=t.rAxisID=R(n.rAxisID,xi(e,`r`)),s=t.indexAxis,c=t.iAxisID=r(s,i,a,o),l=t.vAxisID=r(s,a,i,o);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(c),t.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update(`reset`)}_destroy(){let e=this._cachedMeta;this._data&&pn(this._data,this),e._stacked&&wi(e)}_dataCheck(){let e=this.getDataset(),t=e.data||=[],n=this._data;if(F(t)){let e=this._cachedMeta;this._data=mi(t,e)}else if(n!==t){if(n){pn(n,this);let e=this._cachedMeta;wi(e),e._parsed=[]}t&&Object.isExtensible(t)&&fn(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();let i=t._stacked;t._stacked=hi(t.vScale,t),t.stack!==n.stack&&(r=!0,wi(t),t.stack=n.stack),this._resyncElements(e),(r||i!==t._stacked)&&(bi(this,t._parsed),t._stacked=hi(t.vScale,t))}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:a}=n,o=i.axis,s=e===0&&t===r.length||n._sorted,c=e>0&&n._parsed[e-1],l,u,d;if(this._parsing===!1)n._parsed=r,n._sorted=!0,d=r;else{d=P(r[e])?this.parseArrayData(n,r,e,t):F(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);let i=()=>u[o]===null||c&&u[o]<c[o];for(l=0;l<t;++l)n._parsed[l+e]=u=d[l],s&&(i()&&(s=!1),c=u);n._sorted=s}a&&bi(this,d)}parsePrimitiveData(e,t,n,r){let{iScale:i,vScale:a}=e,o=i.axis,s=a.axis,c=i.getLabels(),l=i===a,u=Array(r),d,f,p;for(d=0,f=r;d<f;++d)p=d+n,u[d]={[o]:l||i.parse(c[p],p),[s]:a.parse(t[p],p)};return u}parseArrayData(e,t,n,r){let{xScale:i,yScale:a}=e,o=Array(r),s,c,l,u;for(s=0,c=r;s<c;++s)l=s+n,u=t[l],o[s]={x:i.parse(u[0],l),y:a.parse(u[1],l)};return o}parseObjectData(e,t,n,r){let{xScale:i,yScale:a}=e,{xAxisKey:o=`x`,yAxisKey:s=`y`}=this._parsing,c=Array(r),l,u,d,f;for(l=0,u=r;l<u;++l)d=l+n,f=t[d],c[l]={x:i.parse(Pt(f,o),d),y:a.parse(Pt(f,s),d)};return c}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){let r=this.chart,i=this._cachedMeta,a=t[e.axis
vendor: 10,741 bytes, line 20
20];return pi({keys:fi(r,!0),values:t._stacks[e.axis]._visualValues},a,i.index,{mode:n})}updateRangeFromParsed(e,t,n,r){let i=n[t.axis],a=i===null?NaN:i,o=r&&n._stacks[t.axis];r&&o&&(r.values=o,a=pi(r,i,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,t){let n=this._cachedMeta,r=n._parsed,i=n._sorted&&e===n.iScale,a=r.length,o=this._getOtherScale(e),s=Di(t,n,this.chart),c={min:1/0,max:-1/0},{min:l,max:u}=_i(o),d,f;function p(){f=r[d];let t=f[o.axis];return!I(f[e.axis])||l>t||u<t}for(d=0;d<a&&!(!p()&&(this.updateRangeFromParsed(c,e,f,s),i));++d);if(i){for(d=a-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(c,e,f,s);break}}return c}getAllParsedValues(e){let t=this._cachedMeta._parsed,n=[],r,i,a;for(r=0,i=t.length;r<i;++r)a=t[r][e.axis],I(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(e){let t=this._cachedMeta,n=t.iScale,r=t.vScale,i=this.getParsed(e);return{label:n?``+n.getLabelForValue(i[n.axis]):``,value:r?``+r.getLabelForValue(i[r.axis]):``}}_update(e){let t=this._cachedMeta;this.update(e||`default`),t._clip=di(R(this.options.clip,ui(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){let e=this._ctx,t=this.chart,n=this._cachedMeta,r=n.data||[],i=t.chartArea,a=[],o=this._drawStart||0,s=this._drawCount||r.length-o,c=this.options.drawActiveElementsOnTop,l;for(n.dataset&&n.dataset.draw(e,i,o,s),l=o;l<o+s;++l){let t=r[l];t.hidden||(t.active&&c?a.push(t):t.draw(e,i))}for(l=0;l<a.length;++l)a[l].draw(e,i)}getStyle(e,t){let n=t?`active`:`default`;return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){let r=this.getDataset(),i;if(e>=0&&e<this._cachedMeta.data.length){let t=this._cachedMeta.data[e];i=t.$context||=Ci(this.getContext(),e,t),i.parsed=this.getParsed(e),i.raw=r.data[e],i.index=i.dataIndex=e}else i=this.$context||=Si(this.chart.getContext(),this.index),i.dataset=r,i.index=i.datasetIndex=this.index;return i.active=!!t,i.mode=n,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t=`default`,n){let r=t===`active`,i=this._cachedDataOpts,a=e+`-`+t,o=i[a],s=this.enableOptionSharing&&It(n);if(o)return Ei(o,s);let c=this.chart.config,l=c.datasetElementScopeKeys(this._type,e),u=r?[`${e}Hover`,`hover`,e,``]:[e,``],d=c.getOptionScopes(this.getDataset(),l),f=Object.keys(q.elements[e]),p=c.resolveNamedOptions(d,f,()=>this.getContext(n,r,t),u);return p.$shared&&(p.$shared=s,i[a]=Object.freeze(Ei(p,s))),p}_resolveAnimations(e,t,n){let r=this.chart,i=this._cachedDataOpts,a=`animation-${t}`,o=i[a];if(o)return o;let s;if(r.options.animation!==!1){let r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,t),a=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(a,this.getContext(e,n,t))}let c=new oi(r,s&&s.animations);return s&&s._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||=Object.assign({},e)}includeOptions(e,t){return!t||Ti(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,i=this.getSharedOptions(n),a=this.includeOptions(t,i)||i!==r;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:a}}updateElement(e,t,n,r){Ti(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!Ti(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;let i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,`active`,!1)}setHoverStyle(e,t,n){this._setStyle(e,n,`active`,!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!0)}_resyncElements(e){let t=this._data,n=this._cachedMeta.data;for(let[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];let r=n.length,i=t.length,a=Math.min(i,r);a&&this.parse(0,a),i>r?this._insertElements(r,i-r,e):i<r&&this._removeElements(i,r-i)}_insertElements(e,t,n=!0){let r=this._cachedMeta,i=r.data,a=e+t,o,s=e=>{for(e.length+=t,o=e.length-1;o>=a;o--)e[o]=e[o-t]};for(s(i),o=e;o<a;++o)i[o]=new this.dataElementType;this._parsing&&s(r._parsed),this.parse(e,t),n&&this.updateElements(i,e,t,`reset`)}updateElements(e,t,n,r){}_removeElements(e,t){let n=this._cachedMeta;if(this._parsing){let r=n._parsed.splice(e,t);n._stacked&&wi(n,r)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{let[t,n,r]=e;this[t](n,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){let e=arguments.length;this._sync([`_insertElements`,this.getDataset().data.length-e,e])}_onDataPop(){this._sync([`_removeElements`,this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync([`_removeElements`,0,1])}_onDataSplice(e,t){t&&this._sync([`_removeElements`,e,t]);let n=arguments.length-2;n&&this._sync([`_insertElements`,e,n])}_onDataUnshift(){this._sync([`_insertElements`,0,arguments.length])}};function ki(e,t,n){let r=1,i=1,a=0,o=0;if(t<H){let s=e,c=s+t,l=Math.cos(s),u=Math.sin(s),d=Math.cos(c),f=Math.sin(c),p=(e,t,r)=>rn(e,s,c,!0)?1:Math.max(t,t*n,r,r*n),m=(e,t,r)=>rn(e,s,c,!0)?-1:Math.min(t,t*n,r,r*n),h=p(0,l,d),g=p(U,u,f),_=m(V,l,d),v=m(V+U,u,f);r=(h-_)/2,i=(g-v)/2,a=-(h+_)/2,o=-(g+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}var Ai=class extends Oi{static id=`doughnut`;static defaults={datasetElementType:!1,dataElementType:`arc`,animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:`number`,properties:[`circumference`,`endAngle`,`innerRadius`,`outerRadius`,`startAngle`,`x`,`y`,`offset`,`borderWidth`,`spacing`]}},cutout:`50%`,rotation:0,circumference:360,radius:`100%`,spacing:0,indexAxis:`r`};static descriptors={_scriptable:e=>e!==`spacing`,_indexable:e=>e!==`spacing`&&!e.startsWith(`borderDash`)&&!e.startsWith(`hoverBorderDash`)};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data,{labels:{pointStyle:n,textAlign:r,color:i,useBorderRadius:a,borderRadius:o}}=e.legend.options;return t.labels.length&&t.datasets.length?t.labels.map((t,s)=>{let c=e.getDatasetMeta(0).controller.getStyle(s);return{text:t,fillStyle:c.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(s),lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:c.borderWidth,strokeStyle:c.borderColor,textAlign:r,pointStyle:n,borderRadius:a&&(o||c.borderRadius),index:s}}):[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){let n=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=n;else{let i=e=>+n[e];if(F(n[e])){let{key:e=`value`}=this._parsing;i=t=>+Pt(n[t],e)}let a,o;for(a=e,o=e+t;a<o;++a)r._parsed[a]=i(a)}}_getRotation(){return W(this.options.rotation-90)}_getCircumference(){return W(this.options.circumference)}_getRotationExtents(){let e=H,t=-H;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){let r=this.chart.getDatasetMeta(n).controller,i=r._getRotation(),a=r._getCircumference();e=Math.min(e,i),t=Math.max(t,i+a)}return{rotation:e,circumference:t-e}}update(e){let{chartArea:t}=this.chart,n=this._cachedMeta,r=n.data,i=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(t.width,t.height)-i)/2,0),o=Math.min(St(this.options.cutout,a),1),s=this._getRingWeight(this.index),{circumference:c,rotation:l}=this._getRotationExtents(),{ratioX:u,ratioY:d,offsetX:f,offsetY:p}=ki(l,c,o),m=(t.width-i)/u,h=(t.height-i)/d,g=Math.max(Math.min(m,h)/2,0),_=Ct(this.options.radius,g),v=(_-Math.max(_*o,0))/this._getVisibleDatasetWeightTotal();this.offsetX=f*_,this.offsetY=p*_,n.total=this.calculateTotal(),this.outerRadius=_-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*s,0),this.updateElements(r,0,r.length,e)}_circumference(e,t){let n=this.options,r=this._cachedMeta,i=this._getCircumference();return t&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||r._parsed[e]===null||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*i/H)}updateElements(e,t,n,r){let i=r===`reset`,a=this.chart,o=a.chartArea,s=a.options.animation,c=(o.left+o.right)/2,l=(o.top+o.bottom)/2,u=i&&s.animateScale,d=u?0:this.innerRadius,f=u?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(t,r),h=this._getRotation(),g;for(g=0;g<t;++g)h+=this._circumference(g,i);for(g=t;g<t+n;++g){let t=this._circumference(g,i),n=e[g],a={x:c+this.offsetX,y:l+this.offsetY,startAngle:h,endAngle:h+t,circumference:t,outerRadius:f,innerRadius:d};m&&(a.options=p||this.resolveDataElementOptions(g,n.active?`active`:r)),h+=t,this.updateElement(n,g,a,r)}}calculateTotal(){let e=this._cachedMeta,t=e.data,n=0,r;for(r=0;r<t.length;r++){let i=e._parsed[r];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(r)&&!t[r].hidden&&(n+=Math.abs(i))}return n}calculateCircumference(e){let t=this._cachedMeta.total;return t>0&&!isNaN(e)?Math.abs(e)/t*H:0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=Nn(t._parsed[e],n.options.locale);return{label:r[e]||``,value:i}}getMaxBorderWidth(e){let t=0,n=this.chart,r,i,a,o,s;if(!e){for(r=0,i=n.data.datasets.length;r<i;++r)if(n.isDatasetVisible(r)){a=n.getDatasetMeta(r),e=a.data,o=a.controller;break}}if(!e)return 0;for(r=0,i=e.length;r<i;++r)s=o.resolveDataElementOptions(r),s.borderAlign!==`inner`&&(t=Math.max(t,s.borderWidth||0,s.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let n=0,r=e.length;n<r;++n){let e=this.resolveDataElementOptions(n);t=Math.max(t,e.offset||0,e.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t}_getRingWeight(e){return Math.max(R(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};function ji(){throw Error(`This method is not implemented: Check that a complete date adapter is provided.`)}var Mi={_date:class e{static override(t){Object.assign(e.prototype,t)}options;constructor(e){this.options=e||{}}init(){}formats(){return ji()}parse(){return ji()}format(){return ji()}add(){return ji()}diff(){return ji()}startOf(){return ji()}endOf(){return ji()}}};
vendor: 4,170 bytes, line 20
20function Ni(e,t,n,r){let{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!==`r`&&o&&a.length){let o=s._reversePixels?ln:cn;if(!r){let r=o(a,t,n);if(c){let{vScale:t}=i._cachedMeta,{_parsed:n}=e,a=n.slice(0,r.lo+1).reverse().findIndex(e=>!N(e[t.axis]));r.lo-=Math.max(0,a);let o=n.slice(r.hi).findIndex(e=>!N(e[t.axis]));r.hi+=Math.max(0,o)}return r}else if(i._sharedOptions){let e=a[0],r=typeof e.getRange==`function`&&e.getRange(t);if(r){let e=o(a,t,n-r),i=o(a,t,n+r);return{lo:e.lo,hi:i.hi}}}}return{lo:0,hi:a.length-1}}function Pi(e,t,n,r,i){let a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let e=0,n=a.length;e<n;++e){let{index:n,data:s}=a[e],{lo:c,hi:l}=Ni(a[e],t,o,i);for(let e=c;e<=l;++e){let t=s[e];t.skip||r(t,n,e)}}}function Fi(e){let t=e.indexOf(`x`)!==-1,n=e.indexOf(`y`)!==-1;return function(e,r){let i=t?Math.abs(e.x-r.x):0,a=n?Math.abs(e.y-r.y):0;return Math.sqrt(i**2+a**2)}}function Ii(e,t,n,r,i){let a=[];return!i&&!e.isPointInArea(t)||Pi(e,n,t,function(n,o,s){!i&&!Yn(n,e.chartArea,0)||n.inRange(t.x,t.y,r)&&a.push({element:n,datasetIndex:o,index:s})},!0),a}function Li(e,t,n,r){let i=[];function a(e,n,a){let{startAngle:o,endAngle:s}=e.getProps([`startAngle`,`endAngle`],r),{angle:c}=tn(e,{x:t.x,y:t.y});rn(c,o,s)&&i.push({element:e,datasetIndex:n,index:a})}return Pi(e,n,t,a),i}function Ri(e,t,n,r,i,a){let o=[],s=Fi(n),c=1/0;function l(n,l,u){let d=n.inRange(t.x,t.y,i);if(r&&!d)return;let f=n.getCenterPoint(i);if(!(a||e.isPointInArea(f))&&!d)return;let p=s(t,f);p<c?(o=[{element:n,datasetIndex:l,index:u}],c=p):p===c&&o.push({element:n,datasetIndex:l,index:u})}return Pi(e,n,t,l),o}function zi(e,t,n,r,i,a){return!a&&!e.isPointInArea(t)?[]:n===`r`&&!r?Li(e,t,n,i):Ri(e,t,n,r,i,a)}function Bi(e,t,n,r,i){let a=[],o=n===`x`?`inXRange`:`inYRange`,s=!1;return Pi(e,n,t,(e,r,c)=>{e[o]&&e[o](t[n],i)&&(a.push({element:e,datasetIndex:r,index:c}),s||=e.inRange(t.x,t.y,i))}),r&&!s?[]:a}var Vi={evaluateInteractionItems:Pi,modes:{index(e,t,n,r){let i=Vr(t,e),a=n.axis||`x`,o=n.includeInvisible||!1,s=n.intersect?Ii(e,i,a,r,o):zi(e,i,a,!1,r,o),c=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{let t=s[0].index,n=e.data[t];n&&!n.skip&&c.push({element:n,datasetIndex:e.index,index:t})}),c):[]},dataset(e,t,n,r){let i=Vr(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1,s=n.intersect?Ii(e,i,a,r,o):zi(e,i,a,!1,r,o);if(s.length>0){let t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;e<n.length;++e)s.push({element:n[e],datasetIndex:t,index:e})}return s},point(e,t,n,r){return Ii(e,Vr(t,e),n.axis||`xy`,r,n.includeInvisible||!1)},nearest(e,t,n,r){let i=Vr(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1;return zi(e,i,a,n.intersect,r,o)},x(e,t,n,r){return Bi(e,Vr(t,e),`x`,n.intersect,r)},y(e,t,n,r){return Bi(e,Vr(t,e),`y`,n.intersect,r)}}},Hi=[`left`,`top`,`right`,`bottom`];function Ui(e,t){return e.filter(e=>e.pos===t)}function Wi(e,t){return e.filter(e=>Hi.indexOf(e.pos)===-1&&e.box.axis===t)}function Gi(e,t){return e.sort((e,n)=>{let r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function Ki(e){let t=[],n,r,i,a,o,s;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:a,options:{stack:o,stackWeight:s=1}}=i,t.push({index:n,box:i,pos:a,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&a+o,stackWeight:s});return t}function qi(e){let t={};for(let n of e){let{stack:e,pos:r,stackWeight:i}=n;if(!e||!Hi.includes(r))continue;let a=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=i}return t}function Ji(e,t){let n=qi(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t,a,o,s;for(a=0,o=e.length;a<o;++a){s=e[a];let{fullSize:o}=s.box,c=n[s.stack],l=c&&s.stackWeight/c.weight;s.horizontal?(s.width=l?l*r:o&&t.availableWidth,s.height=i):(s.width=r,s.height=l?l*i:o&&t.availableHeight)}return n}function Yi(e){let t=Ki(e),n=Gi(t.filter(e=>e.box.fullSize),!0),r=Gi(Ui(t,`left`),!0),i=Gi(Ui(t,`right`)),a=Gi(Ui(t,`top`),!0),o=Gi(Ui(t,`bottom`)),s=Wi(t,`x`),c=Wi(t,`y`);return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(c).concat(o).concat(s),chartArea:Ui(t,`chartArea`),vertical:r.concat(i).c
vendor: 4,273 bytes, line 20
20oncat(c),horizontal:a.concat(o).concat(s)}}function Xi(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Zi(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Qi(e,t,n,r){let{pos:i,box:a}=n,o=e.maxPadding;if(!F(i)){n.size&&(e[i]-=n.size);let t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?a.height:a.width),n.size=t.size/t.count,e[i]+=n.size}a.getPadding&&Zi(o,a.getPadding());let s=Math.max(0,t.outerWidth-Xi(o,e,`left`,`right`)),c=Math.max(0,t.outerHeight-Xi(o,e,`top`,`bottom`)),l=s!==e.w,u=c!==e.h;return e.w=s,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function $i(e){let t=e.maxPadding;function n(n){let r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n(`top`),e.x+=n(`left`),n(`right`),n(`bottom`)}function ea(e,t){let n=t.maxPadding;function r(e){let r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?[`left`,`right`]:[`top`,`bottom`])}function ta(e,t,n,r){let i=[],a,o,s,c,l,u;for(a=0,o=e.length,l=0;a<o;++a){s=e[a],c=s.box,c.update(s.width||t.w,s.height||t.h,ea(s.horizontal,t));let{same:o,other:d}=Qi(t,n,s,r);l|=o&&i.length,u||=d,c.fullSize||i.push(s)}return l&&ta(i,t,n,r)||u}function na(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function ra(e,t,n,r){let i=n.padding,{x:a,y:o}=t;for(let s of e){let e=s.box,c=r[s.stack]||{count:1,placed:0,weight:1},l=s.stackWeight/c.weight||1;if(s.horizontal){let r=t.w*l,a=c.size||e.height;It(c.start)&&(o=c.start),e.fullSize?na(e,i.left,o,n.outerWidth-i.right-i.left,a):na(e,t.left+c.placed,o,r,a),c.start=o,c.placed+=r,o=e.bottom}else{let r=t.h*l,o=c.size||e.width;It(c.start)&&(a=c.start),e.fullSize?na(e,a,i.top,o,n.outerHeight-i.bottom-i.top):na(e,a,t.top+c.placed,o,r),c.start=a,c.placed+=r,a=e.right}}t.x=a,t.y=o}var ia={addBox(e,t){e.boxes||=[],t.fullSize=t.fullSize||!1,t.position=t.position||`top`,t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){let n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;let i=J(e.options.layout.padding),a=Math.max(t-i.width,0),o=Math.max(n-i.height,0),s=Yi(e.boxes),c=s.vertical,l=s.horizontal;B(e.boxes,e=>{typeof e.beforeLayout==`function`&&e.beforeLayout()});let u=c.reduce((e,t)=>t.box.options&&t.box.options.display===!1?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);Zi(f,J(r));let p=Object.assign({maxPadding:f,w:a,h:o,x:i.left,y:i.top},i),m=Ji(c.concat(l),d);ta(s.fullSize,p,d,m),ta(c,p,d,m),ta(l,p,d,m)&&ta(c,p,d,m),$i(p),ra(s.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,ra(s.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},B(s.chartArea,t=>{let n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},aa=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n||=e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}},oa=class extends aa{acquireContext(e){return e&&e.getContext&&e.getContext(`2d`)||null}updateConfig(e){e.options.animation=!1}},sa=`$chartjs`,ca={touchstart:`mousedown`,touchmove:`mousemove`,touchend:`mouseup`,pointerenter:`mouseenter`,pointerdown:`mousedown`,pointermove:`mousemove`,pointerup:`mouseup`,pointerleave:`mouseout`,pointerout:`mouseout`},la=e=>e===null||e===``;function ua(e,t){let n=e.style,r=e.getAttribute(`height`),i=e.getAttribute(`width`);if(e[sa]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||`block`,n.boxSizing=n.boxSizing||`border-box`,la(i)){let t=qr(e,`width`);t!==void 0&&(e.width=t)}if(la(r))if(e.style.height===``)e.height=e.width/(t||2);else{let t=qr(e,`height`);t!==void 0&&(e.height=t)}return e}var da=Kr?{passive:!0}:!1;function fa(e,t,n){e&&e.addEventListener(t,n,da)}
vendor: 6,860 bytes, line 20
20function pa(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,da)}function ma(e,t){let n=ca[e.type]||e.type,{x:r,y:i}=Vr(e,t);return{type:n,chart:t,native:e,x:r===void 0?null:r,y:i===void 0?null:i}}function ha(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function ga(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=ha(n.addedNodes,r),t&&=!ha(n.removedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function _a(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=ha(n.removedNodes,r),t&&=!ha(n.addedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}var va=new Map,ya=0;function ba(){let e=window.devicePixelRatio;e!==ya&&(ya=e,va.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function xa(e,t){va.size||window.addEventListener(`resize`,ba),va.set(e,t)}function Sa(e){va.delete(e),va.size||window.removeEventListener(`resize`,ba)}function Ca(e,t,n){let r=e.canvas,i=r&&Nr(r);if(!i)return;let a=gn((e,t)=>{let r=i.clientWidth;n(e,t),r<i.clientWidth&&n()},window),o=new ResizeObserver(e=>{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;n===0&&r===0||a(n,r)});return o.observe(i),xa(e,a),o}function wa(e,t,n){n&&n.disconnect(),t===`resize`&&Sa(e)}function Ta(e,t,n){let r=e.canvas,i=gn(t=>{e.ctx!==null&&n(ma(t,e))},e);return fa(r,t,i),i}var Ea=class extends aa{acquireContext(e,t){let n=e&&e.getContext&&e.getContext(`2d`);return n&&n.canvas===e?(ua(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[sa])return!1;let n=t[sa].initial;[`height`,`width`].forEach(e=>{let r=n[e];N(r)?t.removeAttribute(e):t.setAttribute(e,r)});let r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[sa],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||={};r[t]=({attach:ga,detach:_a,resize:Ca}[t]||Ta)(e,t,n)}removeEventListener(e,t){let n=e.$proxies||={},r=n[t];r&&(({attach:wa,detach:wa,resize:wa}[t]||pa)(e,t,r),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return Wr(e,t,n,r)}isAttached(e){let t=e&&Nr(e);return!!(t&&t.isConnected)}};function Da(e){return!Mr()||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas?oa:Ea}var Oa=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}hasValue(){return Xt(this.x)&&Xt(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};function ka(e,t){let n=e.options.ticks,r=Aa(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?Ma(t):[],o=a.length,s=a[0],c=a[o-1],l=[];if(o>i)return Na(t,l,a,o/i),l;let u=ja(a,t,i);if(o>0){let e,n,r=o>1?Math.round((c-s)/(o-1)):null;for(Pa(t,l,u,N(r)?0:s-r,s),e=0,n=o-1;e<n;e++)Pa(t,l,u,a[e],a[e+1]);return Pa(t,l,u,c,N(r)?t.length:c+r),l}return Pa(t,l,u),l}function Aa(e){let t=e.options.offset,n=e._tickSize(),r=e._length/n+ +!t,i=e._maxLength/n;return Math.floor(Math.min(r,i))}function ja(e,t,n){let r=Fa(e),i=t.length/n;if(!r)return Math.max(i,1);let a=Jt(r);for(let e=0,t=a.length-1;e<t;e++){let t=a[e];if(t>i)return t}return Math.max(i,1)}function Ma(e){let t=[],n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Na(e,t,n,r){let i=0,a=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===a&&(t.push(e[o]),i++,a=n[i*r])}function Pa(e,t,n,r,i){let a=R(r,0),o=Math.min(R(i,e.length),e.length),s=0,c,l,u;for(n=Math.ceil(n),i&&(c=i-r,n=c/Math.floor(c/n)),u=a;u<0;)s++,u=Math.round(a+s*n);for(l=Math.max(a,0);l<o;l++)l===u&&(t.push(e[l]),s++,u=Math.round(a+s*n))}function Fa(e){let t=e.length,n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}var Ia=e=>e===`left`?`right`:e===`right`?`left`:e,La=(e,t,n)=>t===`top`||t===`left`?e[t]+n:e[t]-n,Ra=(e,t)=>Math.min(t||e,e);function za(e,t){let n=[],r=e.length/t,i=e.length,a=0;for(;a<i;a+=r)n.push(e[Math.floor(a)]);return n}function Ba(e,t,n){let r=e.ticks.length,i=Math.min(t,r-1),a=e._startPixel,o=e._endPixel,s=1e-6,c=e.getPixelForTick(i),l;if(!(n&&(l=r===1?Math.max(c-a,o-c):t===0?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(i-1))/2,c+=i<t?l:-l,c<a-s||c>o+s)))return c}function Va(e,t){B(e,e=>{let n=e.gc,r=n.length/2,i;if(r>t){for(i=0;i<r;++i)delete e.data[n[i]];n.splice(0,r)}})}function Ha(e){return e.drawTicks?e.tickLength:0}function Ua(e,t){if(!e.display)return 0;let n=Y(e.font,t),r=J(e.padding);return(P(e.text)?e.text.length:1)*n.lineHeight+r.height}function Wa(e,t){return fr(e,{scale:t,type:`scale`})}function Ga(e,t,n){return fr(e,{tick:n,index:t,type:`tick`})}function Ka(e,t,n){let r=vn(e);return(n&&t!==`right`||!n&&t===`right`)&&(r=Ia(r)),r}function qa(e,t,n,r){let{top:i,left:a,bottom:o,right:s,chart:c}=e,{chartArea:l,scales:u}=c,d=0,f,p,m,h=o-i,g=s-a;if(e.isHorizontal()){if(p=yn(r,a,s),F(n)){let e=Object.keys(n)[0],r=n[e];m=u[e].getPixelForValue(r)+h-t}else m=n===`center`?(l.bottom+l.top)/2+h-t:La(e,n,t);f=s-a}else{if(F(n)){let e=Object.keys(n)[0],r=n[e];p=u[e].getPixelForValue(r)-g+t}else p=n===`center`?(l.left+l.right)/2-g+t:La(e,n,t);m=yn(r,o,i),d=n===`left`?-U:U}return{titleX:p,titleY:m,maxWidth:f,rotation:d}}var Ja=class e extends Oa{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:r}=this;return e=L(e,1/0),t=L(t,-1/0),n=L(n,1/0),r=L(r,-1/0),{min:L(e,n),max:L(t,r),minDefined:I(e),maxDefined:I(t)}}getMinMax(e){let{min:t,max:n,minDefined:r,maxDefined:i}=this.getUserBounds(),a;if(r&&i)return{min:t,max:n};let o=this.getMatchingVisibleMetas();for(let s=0,c=o.length;s<c;++s)a=o[s].controller.getMinMax(this,e),r||(t=Math.min(t,a.min)),i||(n=Math.max(n,a.max)
vendor: 37,876 bytes, line 20
20);return t=i&&t>n?n:t,n=r&&t>n?t:n,{min:L(t,L(n,t)),max:L(n,L(t,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||=this._computeLabelItems(e)}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){z(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:i,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||=(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=dr(this,i,r),!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=o<this.ticks.length;this._convertTicksToLabels(s?za(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source===`auto`)&&(this.ticks=ka(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,n;this.isHorizontal()?(t=this.left,n=this.right):(t=this.top,n=this.bottom,e=!e),this._startPixel=t,this._endPixel=n,this._reversePixels=e,this._length=n-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){z(this.options.afterUpdate,[this])}beforeSetDimensions(){z(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){z(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),z(this.options[e],[this])}beforeDataLimits(){this._callHooks(`beforeDataLimits`)}determineDataLimits(){}afterDataLimits(){this._callHooks(`afterDataLimits`)}beforeBuildTicks(){this._callHooks(`beforeBuildTicks`)}buildTicks(){return[]}afterBuildTicks(){this._callHooks(`afterBuildTicks`)}beforeTickToLabelConversion(){z(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){let t=this.options.ticks,n,r,i;for(n=0,r=e.length;n<r;n++)i=e[n],i.label=z(t.callback,[i.value,n,e],this)}afterTickToLabelConversion(){z(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){z(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let e=this.options,t=e.ticks,n=Ra(this.ticks.length,e.ticks.maxTicksLimit),r=t.minRotation||0,i=t.maxRotation,a=r,o,s,c;if(!this._isVisible()||!t.display||r>=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let l=this._getLabelSizes(),u=l.widest.width,d=l.highest.height,f=K(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/n:f/(n-1),u+6>o&&(o=f/(n-(e.offset?.5:1)),s=this.maxHeight-Ha(e.grid)-t.padding-Ua(e.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),a=$t(Math.min(Math.asin(K((l.highest.height+6)/o,-1,1)),Math.asin(K(s/c,-1,1))-Math.asin(K(d/c,-1,1)))),a=Math.max(r,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){z(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:i}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){let a=Ua(r,t.options.font);if(o?(e.width=this.maxWidth,e.height=Ha(i)+a):(e.height=this.maxHeight,e.width=Ha(i)+a),n.display&&this.ticks.length){let{first:t,last:r,widest:i,highest:a}=this._getLabelSizes(),s=n.padding*2,c=W(this.labelRotation),l=Math.cos(c),u=Math.sin(c);if(o){let t=n.mirror?0:u*i.width+l*a.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{let t=n.mirror?0:l*i.width+u*a.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,l)}}this._handleMargins(),o?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){let{ticks:{align:i,padding:a},position:o}=this.options,s=this.labelRotation!==0,c=o!==`top`&&this.axis===`x`;if(this.isHorizontal()){let o=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1),u=0,d=0;s?c?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):i===`start`?d=t.width:i===`end`?u=e.width:i!==`inner`&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-l+a)*this.width/(this.width-l),0)}else{let n=t.height/2,r=e.height/2;i===`start`?(n=0,r=e.height):i===`end`&&(n=t.height,r=0),this.paddingTop=n+a,this.paddingBottom=r+a}}_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(){z(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t===`top`||t===`bottom`||e===`x`}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,n;for(t=0,n=e.length;t<n;t++)N(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){let t=this.options.ticks.sampleSize,n=this.ticks;t<n.length&&(n=za(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){let{ctx:r,_longestTextCache:i}=this,a=[],o=[],s=Math.floor(t/Ra(t,n)),c=0,l=0,u,d,f,p,m,h,g,_,v,y,b;for(u=0;u<t;u+=s){if(p=e[u].label,m=this._resolveTickFontOptions(u),r.font=h=m.string,g=i[h]=i[h]||{data:{},gc:[]},_=m.lineHeight,v=y=0,!N(p)&&!P(p))v=Un(r,g.data,g.gc,v,p),y=_;else if(P(p))for(d=0,f=p.length;d<f;++d)b=p[d],!N(b)&&!P(b)&&(v=Un(r,g.data,g.gc,v,b),y+=_);a.push(v),o.push(y),c=Math.max(v,c),l=Math.max(y,l)}Va(i,t);let x=a.indexOf(c),S=o.indexOf(l),C=e=>({width:a[e]||0,height:o[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(S),widths:a,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return an(this._alignToPixels?Gn(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&e<t.length){let n=t[e];return n.$context||=Ga(this.getContext(),e,n)}return this.$context||=Wa(this.chart.getContext(),this)}_tickSize(){let e=this.options.ticks,t=W(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),i=this._getLabelSizes(),a=e.autoSkipPadding||0,o=i?i.widest.width+a:0,s=i?i.highest.height+a:0;return this.isHorizontal()?s*n>o*r?o/n:s/r:s*r<o*n?s/n:o/r}_isVisible(){let e=this.options.display;return e===`auto`?this.getMatchingVisibleMetas().length>0:!!e}_computeGridLineItems(e){let t=this.axis,n=this.chart,r=this.options,{grid:i,position:a,border:o}=r,s=i.offset,c=this.isHorizontal(),l=this.ticks.length+ +!!s,u=Ha(i),d=[],f=o.setContext(this.getContext()),p=f.display?f.width:0,m=p/2,h=function(e){return Gn(n,e,p)},g,_,v,y,b,x,S,C,w,T,E,D;if(a===`top`)g=h(this.bottom),x=this.bottom-u,C=g-m,T=h(e.top)+m,D=e.bottom;else if(a===`bottom`)g=h(this.top),T=e.top,D=h(e.bottom)-m,x=g+m,C=this.top+u;else if(a===`left`)g=h(this.right),b=this.right-u,S=g-m,w=h(e.left)+m,E=e.right;else if(a===`right`)g=h(this.left),w=e.left,E=h(e.right)-m,b=g+m,S=this.left+u;else if(t===`x`){if(a===`center`)g=h((e.top+e.bottom)/2+.5);else if(F(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}T=e.top,D=e.bottom,x=g+m,C=x+u}else if(t===`y`){if(a===`center`)g=h((e.left+e.right)/2);else if(F(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}b=g-m,S=b-u,w=e.left,E=e.right}let O=R(r.ticks.maxTicksLimit,l),k=Math.max(1,Math.ceil(l/O));for(_=0;_<l;_+=k){let e=this.getContext(_),t=i.setContext(e),r=o.setContext(e),a=t.lineWidth,l=t.color,u=r.dash||[],f=r.dashOffset,p=t.tickWidth,m=t.tickColor,h=t.tickBorderDash||[],g=t.tickBorderDashOffset;v=Ba(this,_,s),v!==void 0&&(y=Gn(n,v,a),c?b=S=w=E=y:x=C=T=D=y,d.push({tx1:b,ty1:x,tx2:S,ty2:C,x1:w,y1:T,x2:E,y2:D,width:a,color:l,borderDash:u,borderDashOffset:f,tickWidth:p,tickColor:m,tickBorderDash:h,tickBorderDashOffset:g}))}return this._ticksLength=l,this._borderValue=g,d}_computeLabelItems(e){let t=this.axis,n=this.options,{position:r,ticks:i}=n,a=this.isHorizontal(),o=this.ticks,{align:s,crossAlign:c,padding:l,mirror:u}=i,d=Ha(n.grid),f=d+l,p=u?-l:f,m=-W(this.labelRotation),h=[],g,_,v,y,b,x,S,C,w,T,E,D,O=`middle`;if(r===`top`)x=this.bottom-p,S=this._getXAxisLabelAlignment();else if(r===`bottom`)x=this.top+p,S=this._getXAxisLabelAlignment();else if(r===`left`){let e=this._getYAxisLabelAlignment(d);S=e.textAlign,b=e.x}else if(r===`right`){let e=this._getYAxisLabelAlignment(d);S=e.textAlign,b=e.x}else if(t===`x`){if(r===`center`)x=(e.top+e.bottom)/2+f;else if(F(r)){let e=Object.keys(r)[0],t=r[e];x=this.chart.scales[e].getPixelForValue(t)+f}S=this._getXAxisLabelAlignment()}else if(t===`y`){if(r===`center`)b=(e.left+e.right)/2-f;else if(F(r)){let e=Object.keys(r)[0],t=r[e];b=this.chart.scales[e].getPixelForValue(t)}S=this._getYAxisLabelAlignment(d).textAlign}t===`y`&&(s===`start`?O=`top`:s===`end`&&(O=`bottom`));let k=this._getLabelSizes();for(g=0,_=o.length;g<_;++g){v=o[g],y=v.label;let e=i.setContext(this.getContext(g));C=this.getPixelForTick(g)+i.labelOffset,w=this._resolveTickFontOptions(g),T=w.lineHeight,E=P(y)?y.length:1;let t=E/2,n=e.color,s=e.textStrokeColor,l=e.textStrokeWidth,d=S;a?(b=C,S===`inner`&&(d=g===_-1?this.options.reverse?`left`:`right`:g===0?this.options.reverse?`right`:`left`:`center`),D=r===`top`?c===`near`||m!==0?-E*T+T/2:c===`center`?-k.highest.height/2-t*T+T:-k.highest.height+T/2:c===`near`||m!==0?T/2:c===`center`?k.highest.height/2-t*T:k.highest.height-E*T,u&&(D*=-1),m!==0&&!e.showLabelBackdrop&&(b+=T/2*Math.sin(m))):(x=C,D=(1-E)*T/2);let f;if(e.showLabelBackdrop){let t=J(e.backdropPadding),n=k.heights[g],r=k.widths[g],i=D-t.top,a=0-t.left;switch(O){case`middle`:i-=n/2;break;case`bottom`:i-=n;break}switch(S){case`center`:a-=r/2;break;case`right`:a-=r;break;case`inner`:g===_-1?a-=r:g>0&&(a-=r/2);break}f={left:a,top:i,width:r+t.width,height:n+t.height,color:e.backdropColor}}h.push({label:y,font:w,textOffset:D,options:{rotation:m,color:n,strokeColor:s,strokeWidth:l,textAlign:d,textBaseline:O,translation:[b,x],backdrop:f}})}return h}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-W(this.labelRotation))return e===`top`?`left`:`right`;let n=`center`;return t.align===`start`?n=`left`:t.align===`end`?n=`right`:t.align===`inner`&&(n=`inner`),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,a=this._getLabelSizes(),o=e+i,s=a.widest.width,c,l;return t===`left`?r?(l=this.right+i,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l+=s)):(l=this.right-o,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l=this.left)):t===`right`?r?(l=this.left+i,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l-=s)):(l=this.left+o,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l=this.right)):c=`right`,{textAlign:c,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t===`left`||t===`right`)return{top:0,left:this.left,bottom:e.height,right:this.right};if(t===`top`||t===`bottom`)return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:n,top:r,width:i,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,i,a),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,n=this.ctx,r=this._gridLineItems||=this._computeGridLineItems(e),i,a,o=(e,t,r)=>{!r.width||!r.color||(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(i=0,a=r.length;i<a;++i){let e=r[i];t.drawOnChartArea&&o({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&o({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){let{chart:e,ctx:t,options:{border:n,grid:r}}=this,i=n.setContext(this.getContext()),a=n.display?i.width:0;if(!a)return;let o=r.setContext(this.getContext(0)).lineWidth,s=this._borderValue,c,l,u,d;this.isHorizontal()?(c=Gn(e,this.left,a)-a/2,l=Gn(e,this.right,o)+o/2,u=d=s):(u=Gn(e,this.top,a)-a/2,d=Gn(e,this.bottom,o)+o/2,c=l=s),t.save(),t.lineWidth=i.width,t.strokeStyle=i.color,t.beginPath(),t.moveTo(c,u),t.lineTo(l,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;let t=this.ctx,n=this._computeLabelArea();n&&Xn(t,n);let r=this.getLabelItems(e);for(let e of r){let n=e.options,r=e.font,i=e.label,a=e.textOffset;tr(t,i,0,a,r,n)}n&&Zn(t)}drawTitle(){let{ctx:e,options:{position:t,title:n,reverse:r}}=this;if(!n.display)return;let i=Y(n.font),a=J(n.padding),o=n.align,s=i.lineHeight/2;t===`bottom`||t===`center`||F(t)?(s+=a.bottom,P(n.text)&&(s+=i.lineHeight*(n.text.length-1))):s+=a.top;let{titleX:c,titleY:l,maxWidth:u,rotation:d}=qa(this,s,t,o);tr(e,n.text,0,0,i,{color:n.color,maxWidth:u,rotation:d,textAlign:Ka(o,t,r),textBaseline:`middle`,translation:[c,l]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){let t=this.options,n=t.ticks&&t.ticks.z||0,r=R(t.grid&&t.grid.z,-1),i=R(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:n,draw:e=>{this.draw(e)}}]:[{z:r,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:e=>{this.drawLabels(e)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+`AxisID`,r=[],i,a;for(i=0,a=t.length;i<a;++i){let a=t[i];a[n]===this.id&&(!e||a.type===e)&&r.push(a)}return r}_resolveTickFontOptions(e){return Y(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){let e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}},Ya=class{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){let t=Object.getPrototypeOf(e),n;Qa(t)&&(n=this.register(t));let r=this.items,i=e.id,a=this.scope+`.`+i;if(!i)throw Error(`class does not have id: `+e);return i in r?a:(r[i]=e,Xa(e,a,n),this.override&&q.override(e.id,e.overrides),a)}get(e){return this.items[e]}unregister(e){let t=this.items,n=e.id,r=this.scope;n in t&&delete t[n],r&&n in q[r]&&(delete q[r][n],this.override&&delete Rn[n])}};function Xa(e,t,n){let r=Ot(Object.create(null),[n?q.get(n):{},q.get(t),e.defaults]);q.set(t,r),e.defaultRoutes&&Za(t,e.defaultRoutes),e.descriptors&&q.describe(t,e.descriptors)}function Za(e,t){Object.keys(t).forEach(n=>{let r=n.split(`.`),i=r.pop(),a=[e].concat(r).join(`.`),o=t[n].split(`.`),s=o.pop(),c=o.join(`.`);q.route(a,i,c,s)})}function Qa(e){return`id`in e&&`defaults`in e}var X=new class{constructor(){this.controllers=new Ya(Oi,`datasets`,!0),this.elements=new Ya(Oa,`elements`),this.plugins=new Ya(Object,`plugins`),this.scales=new Ya(Ja,`scales`),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each(`register`,e)}remove(...e){this._each(`unregister`,e)}addControllers(...e){this._each(`register`,e,this.controllers)}addElements(...e){this._each(`register`,e,this.elements)}addPlugins(...e){this._each(`register`,e,this.plugins)}addScales(...e){this._each(`register`,e,this.scales)}getController(e){return this._get(e,this.controllers,`controller`)}getElement(e){return this._get(e,this.elements,`element`)}getPlugin(e){return this._get(e,this.plugins,`plugin`)}getScale(e){return this._get(e,this.scales,`scale`)}removeControllers(...e){this._each(`unregister`,e,this.controllers)}removeElements(...e){this._each(`unregister`,e,this.elements)}removePlugins(...e){this._each(`unregister`,e,this.plugins)}removeScales(...e){this._each(`unregister`,e,this.scales)}_each(e,t,n){[...t].forEach(t=>{let r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):B(t,t=>{let r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){let r=Ft(e);z(n[`before`+r],[],n),t[e](n),z(n[`after`+r],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){let n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){let r=t.get(e);if(r===void 0)throw Error(`"`+e+`" is not a registered `+n+`.`);return r}},$a=class{constructor(){this._init=void 0}notify(e,t,n,r){if(t===`beforeInit`&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,`install`)),this._init===void 0)return;let i=r?this._descriptors(e).filter(r):this._descriptors(e),a=this._notify(i,e,t,n);return t===`afterDestroy`&&(this._notify(i,e,`stop`),this._notify(this._init,e,`uninstall`),this._init=void 0),a}_notify(e,t,n,r){r||={};for(let i of e){let e=i.plugin,a=e[n];if(z(a,[t,r,i.options],e)===!1&&r.cancelable)return!1}return!0}invalidate(){N(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;let t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){let n=e&&e.config,r=R(n.options&&n.options.plugins,{}),i=eo(n);return r===!1&&!t?[]:no(e,i,r,t)}_notifyStateChanges(e){let t=this._oldCache||[],n=this._cache,r=(e,t)=>e.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,`stop`),this._notify(r(n,t),e,`start`)}};function eo(e){let t={},n=[],r=Object.keys(X.plugins.items);for(let e=0;e<r.length;e++)n.push(X.getPlugin(r[e]));let i=e.plugins||[];for(let e=0;e<i.length;e++){let r=i[e];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function to(e,t){return!t&&e===!1?null:e===!0?{}:e}function no(e,{plugins:t,localIds:n},r,i){let a=[],o=e.getContext();for(let s of t){let t=s.id,c=to(r[t],i);c!==null&&a.push({plugin:s,options:ro(e.config,{plugin:s,local:n[t]},c,o)})}return a}function ro(e,{plugin:t,local:n},r,i){let a=e.pluginScopeKeys(t),o=e.getOptionScopes(r,a);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[``],{scriptable:!1,indexable:!1,allKeys:!0})}function io(e,t){let n=q.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||`x`}function ao(e,t){let n=e;return e===`_index_`?n=t:e===`_value_`&&(n=t===`x`?`y`:`x`),n}function oo(e,t){return e===t?`_index_`:`_value_`}function so(e){if(e===`x`||e===`y`||e===`r`)return e}function co(e){if(e===`top`||e===`bottom`)return`x`;if(e===`left`||e===`right`)return`y`}function lo(e,...t){if(so(e))return e;for(let n of t){let t=n.axis||co(n.position)||e.length>1&&so(e[0].toLowerCase());if(t)return t}throw Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function uo(e,t,n){if(n[t+`AxisID`]===e)return{axis:t}}function fo(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return uo(e,`x`,n[0])||uo(e,`y`,n[0])}return{}}function po(e,t){let n=Rn[e.type]||{scales:{}},r=t.scales||{},i=io(e.type,t),a=Object.create(null);return Object.keys(r).forEach(t=>{let o=r[t];if(!F(o))return console.error(`Invalid scale configuration for scale: ${t}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);let s=lo(t,o,fo(t,e),q.scales[o.type]),c=oo(s,i),l=n.scales||{};a[t]=kt(Object.create(null),[{axis:s},o,l[s],l[c]])}),e.data.datasets.forEach(n=>{let i=n.type||e.type,o=n.indexAxis||io(i,t),s=(Rn[i]||{}).scales||{};Object.keys(s).forEach(e=>{let t=ao(e,o),i=n[t+`AxisID`]||t;a[i]=a[i]||Object.create(null),kt(a[i],[{axis:t},r[i],s[e]])})}),Object.keys(a).forEach(e=>{let t=a[e];kt(t,[q.scales[t.type],q.scale])}),a}function mo(e){let t=e.options||={};t.plugins=R(t.plugins,{}),t.scales=po(e,t)}function ho(e){return e||={},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function go(e){return e||={},e.data=ho(e.data),mo(e),e}var _o=new Map,vo=new Set;function yo(e,t){let n=_o.get(e);return n||(n=t(),_o.set(e,n),vo.add(n)),n}var bo=(e,t,n)=>{let r=Pt(t,n);r!==void 0&&e.add(r)},xo=class{constructor(e){this._config=go(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=ho(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),mo(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return yo(e,()=>[[`datasets.${e}`,``]])}datasetAnimationScopeKeys(e,t){return yo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,``]])}datasetElementScopeKeys(e,t){return yo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,``]])}pluginScopeKeys(e){let t=e.id,n=this.type;return yo(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let n=this._scopeCache,r=n.get(e);return(!r||t)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){let{options:r,type:i}=this,a=this._cachedScopes(e,n),o=a.get(t);if(o)return o;let s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>bo(s,e,t))),t.forEach(e=>bo(s,r,e)),t.forEach(e=>bo(s,Rn[i]||{},e)),t.forEach(e=>bo(s,q,e)),t.forEach(e=>bo(s,zn,e))});let c=Array.from(s);return c.length===0&&c.push(Object.create(null)),vo.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,Rn[t]||{},q.datasets[t]||{},{type:t},q,zn]}resolveNamedOptions(e,t,n,r=[``]){let i={$shared:!0},{resolver:a,subPrefixes:o}=So(this._resolverCache,e,r),s=a;if(wo(a,t)){i.$shared=!1,n=Lt(n)?n():n;let t=this.createResolver(e,n,o);s=mr(a,n,t)}for(let e of t)i[e]=s[e];return i}createResolver(e,t,n=[``],r){let{resolver:i}=So(this._resolverCache,e,n);return F(t)?mr(i,t,void 0,r):i}};function So(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=n.join(),a=r.get(i);return a||(a={resolver:pr(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes(`hover`))},r.set(i,a)),a}var Co=e=>F(e)&&Object.getOwnPropertyNames(e).some(t=>Lt(e[t]));function wo(e,t){let{isScriptable:n,isIndexable:r}=hr(e);for(let i of t){let t=n(i),a=r(i),o=(a||t)&&e[i];if(t&&(Lt(o)||Co(o))||a&&P(o))return!0}return!1}var To=`4.5.1`,Eo=[`top`,`bottom`,`left`,`right`,`chartArea`];function Do(e,t){return e===`top`||e===`bottom`||Eo.indexOf(e)===-1&&t===`x`}function Oo(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function ko(e){let t=e.chart,n=t.options.animation;t.notifyPlugins(`afterRender`),z(n&&n.onComplete,[e],t)}function Ao(e){let t=e.chart,n=t.options.animation;z(n&&n.onProgress,[e],t)}function jo(e){return Mr()&&typeof e==`string`?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var Mo={},No=e=>{let t=jo(e);return Object.values(Mo).filter(e=>e.canvas===t).pop()};function Po(e,t,n){let r=Object.keys(e);for(let i of r){let r=+i;if(r>=t){let a=e[i];delete e[i],(n>0||r>t)&&(e[r+n]=a)}}}function Fo(e,t,n,r){return!n||e.type===`mouseout`?null:r?t:e}var Io=class{static defaults=q;static instances=Mo;static overrides=Rn;static registry=X;static version=To;static getChart=No;static register(...e){X.add(...e),Lo()}static unregister(...e){X.remove(...e),Lo()}constructor(e,t){let n=this.config=new xo(t),r=jo(e),i=No(r);if(i)throw Error(`Canvas is already in use. Chart with ID '`+i.id+`' must be destroyed before the canvas with ID '`+i.canvas.id+`' can be reused.`);let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||(Da(r))),this.platform.updateConfig(n);let o=this.platform.acquireContext(r,a.aspectRatio),s=o&&o.canvas,c=s&&s.height,l=s&&s.width;if(this.id=xt(),this.ctx=o,this.canvas=s,this.width=l,this.height=c,this._options=a,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 $a,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=_n(e=>this.update(e),a.resizeDelay||0),this._dataChanges=[],Mo[this.id]=this,!o||!s){console.error(`Failed to create chart: can't acquire context from the given item`);return}ni.listen(this,`complete`,ko),ni.listen(this,`progress`,Ao),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:i}=this;return N(e)?t&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return X}_initialize(){return this.notifyPlugins(`beforeInit`),this.options.responsive?this.resize():Gr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins(`afterInit`),this}clear(){return Kn(this.canvas,this.ctx),this}stop(){return ni.stop(this),this}resize(e,t){ni.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,e,t,i),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?`resize`:`attach`;this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Gr(this,o,!0)&&(this.notifyPlugins(`resize`,{size:a}),z(n.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){B(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{}),i=[];t&&(i=i.concat(Object.keys(t).map(e=>{let n=t[e],r=lo(e,n),i=r===`r`,a=r===`x`;return{options:n,dposition:i?`chartArea`:a?`bottom`:`left`,dtype:i?`radialLinear`:a?`category`:`linear`}}))),B(i,t=>{let i=t.options,a=i.id,o=lo(a,i),s=R(i.type,t.dtype);(i.position===void 0||Do(i.position,o)!==Do(t.dposition))&&(i.position=t.dposition),r[a]=!0;let c=null;a in n&&n[a].type===s?c=n[a]:(c=new(X.getScale(s))({id:a,type:s,ctx:this.ctx,chart:this}),n[c.id]=c),c.init(i,e)}),B(r,(e,t)=>{e||delete n[t]}),B(n,e=>{ia.configure(this,e,e.options),ia.addBox(this,e)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(Oo(`order`,`index`))}_removeUnreferencedMetasets(){let{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((e,n)=>{t.filter(t=>t===e._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n<r;n++){let r=t[n],i=this.getDatasetMeta(n),a=r.type||this.config.type;if(i.type&&i.type!==a&&(this._destroyDatasetMeta(n),i=this.getDatasetMeta(n)),i.type=a,i.indexAxis=r.indexAxis||io(a,this.options),i.order=r.order||0,i.index=n,i.label=``+r.label,i.visible=this.isDatasetVisible(n),i.controller)i.controller.updateIndex(n),i.controller.linkScales();else{let t=X.getController(a),{datasetElementType:r,dataElementType:o}=q.datasets[a];Object.assign(t,{dataElementType:X.getElement(o),datasetElementType:r&&X.getElement(r)}),i.controller=new t(this,n),e.push(i.controller)}}return this._updateMetasets(),e}_resetElements(){B(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins(`reset`)}update(e){let t=this.config;t.update();let n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins(`beforeUpdate`,{mode:e,cancelable:!0})===!1)return;let i=this.buildOrUpdateControllers();this.notifyPlugins(`beforeElementsUpdate`);let a=0;for(let e=0,t=this.data.datasets.length;e<t;e++){let{controller:t}=this.getDatasetMeta(e),n=!r&&i.indexOf(t)===-1;t.buildOrUpdateElements(n),a=Math.max(+t.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),r||B(i,e=>{e.reset()}),this._updateDatasets(e),this.notifyPlugins(`afterUpdate`,{mode:e}),this._layers.sort(Oo(`z`,`_idx`));let{_active:o,_lastEvent:s}=this;s?this._eventHandler(s,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){B(this.scales,e=>{ia.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options;(!Rt(new Set(Object.keys(this._listeners)),new Set(e.events))||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:n,start:r,count:i}of t)Po(e,r,n===`_removeElements`?-i:i)}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+`,`+e.splice(1).join(`,`))),r=n(0);for(let e=1;e<t;e++)if(!Rt(r,n(e)))return;return Array.from(r).map(e=>e.split(`,`)).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(this.notifyPlugins(`beforeLayout`,{cancelable:!0})===!1)return;ia.update(this,this.width,this.height,e);let t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],B(this.boxes,e=>{n&&e.position===`chartArea`||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins(`afterLayout`)}_updateDatasets(e){if(this.notifyPlugins(`beforeDatasetsUpdate`,{mode:e,cancelable:!0})!==!1){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,Lt(e)?e({datasetIndex:t}):e);this.notifyPlugins(`afterDatasetsUpdate`,{mode:e})}}_updateDataset(e,t){let n=this.getDatasetMeta(e),r={meta:n,index:e,mode:t,cancelable:!0};this.notifyPlugins(`beforeDatasetUpdate`,r)!==!1&&(n.controller._update(t),r.cancelable=!1,this.notifyPlugins(`afterDatasetUpdate`,r))}render(){this.notifyPlugins(`beforeRender`,{cancelable:!0})!==!1&&(ni.has(this)?this.attached&&!ni.running(this)&&ni.start(this):(this.draw(),ko({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){let{width:e,height:t}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(e,t)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins(`beforeDraw`,{cancelable:!0})===!1)return;let t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins(`afterDraw`)}_getSortedDatasetMetas(e){let t=this._sortedMetasets,n=[],r,i;for(r=0,i=t.length;r<i;++r){let i=t[r];(!e||i.visible)&&n.push(i)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins(`beforeDatasetsDraw`,{cancelable:!0})===!1)return;let e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins(`afterDatasetsDraw`)}_drawDataset(e){let t=this.ctx,n={meta:e,index:e.index,cancelable:!0},r=ti(this,e);this.notifyPlugins(`beforeDatasetDraw`,n)!==!1&&(r&&Xn(t,r),e.controller.draw(),r&&Zn(t),n.cancelable=!1,this.notifyPlugins(`afterDatasetDraw`,n))}isPointInArea(e){return Yn(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){let i=Vi.modes[t];return typeof i==`function`?i(this,e,n,r):[]}getDatasetMeta(e){let t=this.data.datasets[e],n=this._metasets,r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||=fr(null,{chart:this,type:`chart`})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let n=this.getDatasetMeta(e);return typeof n.hidden==`boolean`?!n.hidden:!t.hidden}setDatasetVisibility(e,t){let n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){let r=n?`show`:`hide`,i=this.getDatasetMeta(e),a=i.controller._resolveAnimations(void 0,r);It(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),ni.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins(`beforeDestroy`);let{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Kn(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete Mo[this.id],this.notifyPlugins(`afterDestroy`)}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let e=this._listeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};B(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||={};let e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},i=(e,t)=>{this.canvas&&this.resize(e,t)},a,o=()=>{r(`attach`,o),this.attached=!0,this.resize(),n(`resize`,i),n(`detach`,a)};a=()=>{this.attached=!1,r(`resize`,i),this._stop(),this._resize(0,0),n(`attach`,o)},t.isAttached(this.canvas)?o():a()}unbindEvents(){B(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},B(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){let r=n?`set`:`remove`,i,a,o,s;for(t===`dataset`&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller[`_`+r+`DatasetHoverStyle`]()),o=0,s=e.length;o<s;++o){a=e[o];let t=a&&this.getDatasetMeta(a.datasetIndex).controller;t&&t[r+`HoverStyle`](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){let t=this._active||[],n=e.map(({datasetIndex:e,index:t})=>{let n=this.getDatasetMeta(e);if(!n)throw Error(`No dataset found at index `+e);return{datasetIndex:e,element:n.data[t],index:t}});wt(n,t)||(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,n){let r=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),a=i(t,e),o=n?e:i(e,t);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(e,t){let n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins(`beforeEvent`,n,r)===!1)return;let i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins(`afterEvent`,n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){let{_active:r=[],options:i}=this,a=t,o=this._getActiveElements(e,r,n,a),s=zt(e),c=Fo(e,this._lastEvent,n,s);n&&(this._lastEvent=null,z(i.onHover,[e,o,this],this),s&&z(i.onClick,[e,o,this],this));let l=!wt(o,r);return(l||t)&&(this._active=o,this._updateHoverStyles(o,r,t)),this._lastEvent=c,l}_getActiveElements(e,t,n,r){if(e.type===`mouseout`)return[];if(!n)return t;let i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}};function Lo(){return B(Io.instances,e=>e._plugins.invalidate())}
vendor: 4,653 bytes, line 20
20function Ro(e,t,n){let{startAngle:r,x:i,y:a,outerRadius:o,innerRadius:s,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/o,G(r-n));if(e.beginPath(),e.arc(i,a,o-l/2,r+d/2,n-d/2),s>0){let t=Math.min(l/s,G(r-n));e.arc(i,a,s+l/2,n-t/2,r+t/2,!0)}else{let t=Math.min(l/2,o*G(r-n));if(u===`round`)e.arc(i,a,t,n-V/2,r+V/2,!0);else if(u===`bevel`){let o=2*t*t,s=-o*Math.cos(n+V/2)+i,c=-o*Math.sin(n+V/2)+a,l=o*Math.cos(r+V/2)+i,u=o*Math.sin(r+V/2)+a;e.lineTo(s,c),e.lineTo(l,u)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip(`evenodd`)}function zo(e,t,n){let{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:c}=t,l=i/s;e.beginPath(),e.arc(a,o,s,r-l,n+l),c>i?(l=i/c,e.arc(a,o,c,n+l,r-l,!0)):e.arc(a,o,i,n+U,r-U),e.closePath(),e.clip()}function Bo(e){return sr(e,[`outerStart`,`outerEnd`,`innerStart`,`innerEnd`])}function Vo(e,t,n,r){let i=Bo(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=e=>{let t=(n-Math.min(a,e))*r/2;return K(e,0,Math.min(a,t))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:K(i.innerStart,0,o),innerEnd:K(i.innerEnd,0,o)}}function Ho(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Uo(e,t,n,r,i,a){let{x:o,y:s,startAngle:c,pixelMargin:l,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-l,0),f=u>0?u+r+n+l:0,p=0,m=i-c;if(r){let e=((u>0?u-r:0)+(d>0?d-r:0))/2;p=(m-(e===0?m:m*e/(e+r)))/2}let h=(m-Math.max(.001,m*d-n/V)/d)/2,g=c+h+p,_=i-h-p,{outerStart:v,outerEnd:y,innerStart:b,innerEnd:x}=Vo(t,f,d,_-g),S=d-v,C=d-y,w=g+v/S,T=_-y/C,E=f+b,D=f+x,O=g+b/E,k=_-x/D;if(e.beginPath(),a){let t=(w+T)/2;if(e.arc(o,s,d,w,t),e.arc(o,s,d,t,T),y>0){let t=Ho(C,T,o,s);e.arc(t.x,t.y,y,T,_+U)}let n=Ho(D,_,o,s);if(e.lineTo(n.x,n.y),x>0){let t=Ho(D,k,o,s);e.arc(t.x,t.y,x,_+U,k+Math.PI)}let r=(_-x/f+(g+b/f))/2;if(e.arc(o,s,f,_-x/f,r,!0),e.arc(o,s,f,r,g+b/f,!0),b>0){let t=Ho(E,O,o,s);e.arc(t.x,t.y,b,O+Math.PI,g-U)}let i=Ho(S,g,o,s);if(e.lineTo(i.x,i.y),v>0){let t=Ho(S,w,o,s);e.arc(t.x,t.y,v,g-U,w)}}else{e.moveTo(o,s);let t=Math.cos(w)*d+o,n=Math.sin(w)*d+s;e.lineTo(t,n);let r=Math.cos(T)*d+o,i=Math.sin(T)*d+s;e.lineTo(r,i)}e.closePath()}function Wo(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s}=t,c=t.endAngle;if(a){Uo(e,t,n,r,c,i);for(let t=0;t<a;++t)e.fill();isNaN(s)||(c=o+(s%H||H))}return Uo(e,t,n,r,c,i),e.fill(),c}function Go(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s,options:c}=t,{borderWidth:l,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:p}=c,m=c.borderAlign===`inner`;if(!l)return;e.setLineDash(d||[]),e.lineDashOffset=f,m?(e.lineWidth=l*2,e.lineJoin=u||`round`):(e.lineWidth=l,e.lineJoin=u||`bevel`);let h=t.endAngle;if(a){Uo(e,t,n,r,h,i);for(let t=0;t<a;++t)e.stroke();isNaN(s)||(h=o+(s%H||H))}m&&zo(e,t,h),c.selfJoin&&h-o>=V&&p===0&&u!==`miter`&&Ro(e,t,h),a||(Uo(e,t,n,r,h,i),e.stroke())}var Ko=class extends Oa{static id=`arc`;static defaults={borderAlign:`center`,borderColor:`#fff`,borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:`backgroundColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){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,e&&Object.assign(this,e)}inRange(e,t,n){let{angle:r,distance:i}=tn(this.getProps([`x`,`y`],n),{x:e,y:t}),{startAngle:a,endAngle:o,innerRadius:s,outerRadius:c,circumference:l}=this.getProps([`startAngle`,`endAngle`,`innerRadius`,`outerRadius`,`circumference`],n),u=(this.options.spacing+this.options.borderWidth)/2,d=R(l,o-a),f=rn(r,a,o)&&a!==o,p=d>=H||f,m=on(i,s+u,c+u);return p&&m}getCenterPoint(e){let{x:t,y:n,startAngle:r,endAngle:i,innerRadius:a,outerRadius:o}=this.getProps([`x`,`y`,`startAngle`,`endAngle`,`innerRadius`,`outerRadius`],e),{offset:s,spacing:c}=this.options,l=(r+i)/2,u=(a+o+c+s)/2;return{x:t+Math.cos(l)*u,y:n+Math.sin(l)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:n}=this,r=(t.offset||0)/4,i=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign===`inner`?.33:0,this.fullCircles=n>H?Math.floor(n/H):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let o=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(o)*r,Math.sin(o)*r);let s=r*(1-Math.sin(Math.min(V,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,Wo(e,this,s,i,a),Go(e,this,s,i,a),e.restore(
vendor: 35,670 bytes, lines 20-22
20)}},qo={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;t<n;++t){let n=e[t].element;if(n&&n.hasValue()){let e=n.tooltipPosition();r.add(e.x),i+=e.y,++a}}return a===0||r.size===0?!1:{x:[...r].reduce((e,t)=>e+t)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=1/0,a,o,s;for(a=0,o=e.length;a<o;++a){let n=e[a].element;if(n&&n.hasValue()){let e=nn(t,n.getCenterPoint());e<i&&(i=e,s=n)}}if(s){let e=s.tooltipPosition();n=e.x,r=e.y}return{x:n,y:r}}};function Z(e,t){return t&&(P(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Jo(e){return(typeof e==`string`||e instanceof String)&&e.indexOf(` 21`)>-1?e.split(` 22`):e}function Yo(e,t){let{element:n,datasetIndex:r,index:i}=t,a=e.getDatasetMeta(r).controller,{label:o,value:s}=a.getLabelAndValue(i);return{chart:e,label:o,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Xo(e,t){let n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,c=Y(t.bodyFont),l=Y(t.titleFont),u=Y(t.footerFont),d=a.length,f=i.length,p=r.length,m=J(t.padding),h=m.height,g=0,_=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,d&&(h+=d*l.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){let e=t.displayColors?Math.max(s,c.lineHeight):c.lineHeight;h+=p*e+(_-p)*c.lineHeight+(_-1)*t.bodySpacing}f&&(h+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0,y=function(e){g=Math.max(g,n.measureText(e).width+v)};return n.save(),n.font=l.string,B(e.title,y),n.font=c.string,B(e.beforeBody.concat(e.afterBody),y),v=t.displayColors?o+2+t.boxPadding:0,B(r,e=>{B(e.before,y),B(e.lines,y),B(e.after,y)}),v=0,n.font=u.string,B(e.footer,y),n.restore(),g+=m.width,{width:g,height:h}}function Zo(e,t){let{y:n,height:r}=t;return n<r/2?`top`:n>e.height-r/2?`bottom`:`center`}function Qo(e,t,n,r){let{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(e===`left`&&i+a+o>t.width||e===`right`&&i-a-o<0)return!0}function $o(e,t,n,r){let{x:i,width:a}=n,{width:o,chartArea:{left:s,right:c}}=e,l=`center`;return r===`center`?l=i<=(s+c)/2?`left`:`right`:i<=a/2?l=`left`:i>=o-a/2&&(l=`right`),Qo(l,e,t,n)&&(l=`center`),l}function es(e,t,n){let r=n.yAlign||t.yAlign||Zo(e,n);return{xAlign:n.xAlign||t.xAlign||$o(e,t,n,r),yAlign:r}}function ts(e,t){let{x:n,width:r}=e;return t===`right`?n-=r:t===`center`&&(n-=r/2),n}function ns(e,t,n){let{y:r,height:i}=e;return t===`top`?r+=n:t===`bottom`?r-=i+n:r-=i/2,r}function rs(e,t,n,r){let{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:c}=n,l=i+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=lr(o),m=ts(t,s),h=ns(t,c,l);return c===`center`?s===`left`?m+=l:s===`right`&&(m-=l):s===`left`?m-=Math.max(u,f)+i:s===`right`&&(m+=Math.max(d,p)+i),{x:K(m,0,r.width-t.width),y:K(h,0,r.height-t.height)}}function is(e,t,n){let r=J(n.padding);return t===`center`?e.x+e.width/2:t===`right`?e.x+e.width-r.right:e.x+r.left}function as(e){return Z([],Jo(e))}function os(e,t,n){return fr(e,{tooltip:t,tooltipItems:n,type:`tooltip`})}function ss(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var cs={beforeTitle:M,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode===`dataset`)return t.dataset.label||``;if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return``},afterTitle:M,beforeBody:M,beforeLabel:M,label(e){if(this&&this.options&&this.options.mode===`dataset`)return e.label+`: `+e.formattedValue||e.formattedValue;let t=e.dataset.label||``;t&&(t+=`: `);let n=e.formattedValue;return N(n)||(t+=n),t},labelColor(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:M,afterBody:M,beforeFooter:M,footer:M,afterFooter:M};function Q(e,t,n,r){let i=e[t].call(n,r);return i===void 0?cs[t].call(n,r):i}var ls=class extends Oa{static positioners=qo;constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let e=this._cachedAnimations;if(e)return e;let t=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&t.options.animation&&n.animations,i=new oi(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||=os(this.chart.getContext(),this,this._tooltipItems)}getTitle(e,t){let{callbacks:n}=t,r=Q(n,`beforeTitle`,this,e),i=Q(n,`title`,this,e),a=Q(n,`afterTitle`,this,e),o=[];return o=Z(o,Jo(r)),o=Z(o,Jo(i)),o=Z(o,Jo(a)),o}getBeforeBody(e,t){return as(Q(t.callbacks,`beforeBody`,this,e))}getBody(e,t){let{callbacks:n}=t,r=[];return B(e,e=>{let t={before:[],lines:[],after:[]},i=ss(n,e);Z(t.before,Jo(Q(i,`beforeLabel`,this,e))),Z(t.lines,Q(i,`label`,this,e)),Z(t.after,Jo(Q(i,`afterLabel`,this,e))),r.push(t)}),r}getAfterBody(e,t){return as(Q(t.callbacks,`afterBody`,this,e))}getFooter(e,t){let{callbacks:n}=t,r=Q(n,`beforeFooter`,this,e),i=Q(n,`footer`,this,e),a=Q(n,`afterFooter`,this,e),o=[];return o=Z(o,Jo(r)),o=Z(o,Jo(i)),o=Z(o,Jo(a)),o}_createItems(e){let t=this._active,n=this.chart.data,r=[],i=[],a=[],o=[],s,c;for(s=0,c=t.length;s<c;++s)o.push(Yo(this.chart,t[s]));return e.filter&&(o=o.filter((t,r,i)=>e.filter(t,r,i,n))),e.itemSort&&(o=o.sort((t,r)=>e.itemSort(t,r,n))),B(o,t=>{let n=ss(e.callbacks,t);r.push(Q(n,`labelColor`,this,t)),i.push(Q(n,`labelPointStyle`,this,t)),a.push(Q(n,`labelTextColor`,this,t))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=o,o}update(e,t){let n=this.options.setContext(this.getContext()),r=this._active,i,a=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{let e=qo[n.position].call(this,r,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);let t=this._size=Xo(this,n),o=Object.assign({},e,t),s=es(this.chart,n,o),c=rs(n,o,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:c.x,y:c.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){let i=this.getCaretPosition(e,n,r);t.lineTo(i.x1,i.y1),t.lineTo(i.x2,i.y2),t.lineTo(i.x3,i.y3)}getCaretPosition(e,t,n){let{xAlign:r,yAlign:i}=this,{caretSize:a,cornerRadius:o}=n,{topLeft:s,topRight:c,bottomLeft:l,bottomRight:u}=lr(o),{x:d,y:f}=e,{width:p,height:m}=t,h,g,_,v,y,b;return i===`center`?(y=f+m/2,r===`left`?(h=d,g=h-a,v=y+a,b=y-a):(h=d+p,g=h+a,v=y-a,b=y+a),_=h):(g=r===`left`?d+Math.max(s,l)+a:r===`right`?d+p-Math.max(c,u)-a:this.caretX,i===`top`?(v=f,y=v-a,h=g-a,_=g+a):(v=f+m,y=v+a,h=g+a,_=g-a),b=v),{x1:h,x2:g,x3:_,y1:v,y2:y,y3:b}}drawTitle(e,t,n){let r=this.title,i=r.length,a,o,s;if(i){let c=Xr(n.rtl,this.x,this.width);for(e.x=is(this,n.titleAlign,n),t.textAlign=c.textAlign(n.titleAlign),t.textBaseline=`middle`,a=Y(n.titleFont),o=n.titleSpacing,t.fillStyle=n.titleColor,t.font=a.string,s=0;s<i;++s)t.fillText(r[s],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+o,s+1===i&&(e.y+=n.titleMarginBottom-o)}}_drawColorBox(e,t,n,r,i){let a=this.labelColors[n],o=this.labelPointStyles[n],{boxHeight:s,boxWidth:c}=i,l=Y(i.bodyFont),u=is(this,`left`,i),d=r.x(u),f=s<l.lineHeight?(l.lineHeight-s)/2:0,p=t.y+f;if(i.usePointStyle){let t={radius:Math.min(c,s)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},n=r.leftForLtr(d,c)+c/2,l=p+s/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,qn(e,t,n,l),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,qn(e,t,n,l)}else{e.lineWidth=F(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;let t=r.leftForLtr(d,c),n=r.leftForLtr(r.xPlus(d,1),c-2),o=lr(a.borderRadius);Object.values(o).some(e=>e!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,nr(e,{x:t,y:p,w:c,h:s,radius:o}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),nr(e,{x:n,y:p+1,w:c-2,h:s-2,radius:o}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(t,p,c,s),e.strokeRect(t,p,c,s),e.fillStyle=a.backgroundColor,e.fillRect(n,p+1,c-2,s-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){let{body:r}=this,{bodySpacing:i,bodyAlign:a,displayColors:o,boxHeight:s,boxWidth:c,boxPadding:l}=n,u=Y(n.bodyFont),d=u.lineHeight,f=0,p=Xr(n.rtl,this.x,this.width),m=function(n){t.fillText(n,p.x(e.x+f),e.y+d/2),e.y+=d+i},h=p.textAlign(a),g,_,v,y,b,x,S;for(t.textAlign=a,t.textBaseline=`middle`,t.font=u.string,e.x=is(this,h,n),t.fillStyle=n.bodyColor,B(this.beforeBody,m),f=o&&h!==`right`?a===`center`?c/2+l:c+2+l:0,y=0,x=r.length;y<x;++y){for(g=r[y],_=this.labelTextColors[y],t.fillStyle=_,B(g.before,m),v=g.lines,o&&v.length&&(this._drawColorBox(t,e,y,p,n),d=Math.max(u.lineHeight,s)),b=0,S=v.length;b<S;++b)m(v[b]),d=u.lineHeight;B(g.after,m)}f=0,d=u.lineHeight,B(this.afterBody,m),e.y-=i}drawFooter(e,t,n){let r=this.footer,i=r.length,a,o;if(i){let s=Xr(n.rtl,this.x,this.width);for(e.x=is(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=s.textAlign(n.footerAlign),t.textBaseline=`middle`,a=Y(n.footerFont),t.fillStyle=n.footerColor,t.font=a.string,o=0;o<i;++o)t.fillText(r[o],s.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+n.footerSpacing}}drawBackground(e,t,n,r){let{xAlign:i,yAlign:a}=this,{x:o,y:s}=e,{width:c,height:l}=n,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=lr(r.cornerRadius);t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(o+u,s),a===`top`&&this.drawCaret(e,t,n,r),t.lineTo(o+c-d,s),t.quadraticCurveTo(o+c,s,o+c,s+d),a===`center`&&i===`right`&&this.drawCaret(e,t,n,r),t.lineTo(o+c,s+l-p),t.quadraticCurveTo(o+c,s+l,o+c-p,s+l),a===`bottom`&&this.drawCaret(e,t,n,r),t.lineTo(o+f,s+l),t.quadraticCurveTo(o,s+l,o,s+l-f),a===`center`&&i===`left`&&this.drawCaret(e,t,n,r),t.lineTo(o,s+u),t.quadraticCurveTo(o,s,o+u,s),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){let t=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){let n=qo[e.position].call(this,this._active,this._eventPosition);if(!n)return;let a=this._size=Xo(this,e),o=Object.assign({},n,this._size),s=es(t,e,o),c=rs(e,o,s,t);(r._to!==c.x||i._to!==c.y)&&(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=a.width,this.height=a.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){let t=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(t);let r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=J(t.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,r,t),Zr(e,t.textDirection),i.y+=a.top,this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),Qr(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){let n=this._active,r=e.map(({datasetIndex:e,index:t})=>{let n=this.chart.getDatasetMeta(e);if(!n)throw Error(`Cannot find a dataset at index `+e);return{datasetIndex:e,element:n.data[t],index:t}}),i=!wt(n,r),a=this._positionChanged(r,t);(i||a)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,i=this._active||[],a=this._getActiveElements(e,i,t,n),o=this._positionChanged(a,e),s=t||!wt(a,i)||o;return s&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){let i=this.options;if(e.type===`mouseout`)return[];if(!r)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index)!==void 0);let a=this.chart.getElementsAtEventForMode(e,i.mode,i,n);return i.reverse&&a.reverse(),a}_positionChanged(e,t){let{caretX:n,caretY:r,options:i}=this,a=qo[i.position].call(this,e,t);return a!==!1&&(n!==a.x||r!==a.y)}},us={id:`tooltip`,_element:ls,positioners:qo,afterInit(e,t,n){n&&(e.tooltip=new ls({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(e.notifyPlugins(`beforeTooltipDraw`,{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins(`afterTooltipDraw`,n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.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:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.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:cs},defaultRoutes:{bodyFont:`font`,footerFont:`font`,titleFont:`font`},descriptors:{_scriptable:e=>e!==`filter`&&e!==`itemSort`&&e!==`external`,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:`animation`}},additionalOptionScopes:[`interaction`]};function ds(e,t){let n=[],{bounds:r,step:i,min:a,max:o,precision:s,count:c,maxTicks:l,maxDigits:u,includeBounds:d}=e,f=i||1,p=l-1,{min:m,max:h}=t,g=!N(a),_=!N(o),v=!N(c),y=(h-m)/(u+1),b=qt((h-m)/p/f)*f,x,S,C,w;if(b<1e-14&&!g&&!_)return[{value:m},{value:h}];w=Math.ceil(h/b)-Math.floor(m/b),w>p&&(b=qt(w*b/p/f)*f),N(s)||(x=10**s,b=Math.ceil(b*x)/x),r===`ticks`?(S=Math.floor(m/b)*b,C=Math.ceil(h/b)*b):(S=m,C=h),g&&_&&i&&Zt((o-a)/i,b/1e3)?(w=Math.round(Math.min((o-a)/b,l)),b=(o-a)/w,S=a,C=o):v?(S=g?a:S,C=_?o:C,w=c-1,b=(C-S)/w):(w=(C-S)/b,w=Kt(w,Math.round(w),b/1e3)?Math.round(w):Math.ceil(w));let T=Math.max(en(b),en(S));x=10**(N(s)?T:s),S=Math.round(S*x)/x,C=Math.round(C*x)/x;let E=0;for(g&&(d&&S!==a?(n.push({value:a}),S<a&&E++,Kt(Math.round((S+E*b)*x)/x,a,fs(a,y,e))&&E++):S<a&&E++);E<w;++E){let e=Math.round((S+E*b)*x)/x;if(_&&e>o)break;n.push({value:e})}return _&&d&&C!==o?n.length&&Kt(n[n.length-1].value,o,fs(o,y,e))?n[n.length-1].value=o:n.push({value:o}):(!_||C===o)&&n.push({value:C}),n}function fs(e,t,{horizontal:n,minRotation:r}){let i=W(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(``+e).length;return Math.min(t/a,o)}var ps=class extends Ja{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return N(e)||(typeof e==`number`||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:r,max:i}=this,a=e=>r=t?r:e,o=e=>i=n?i:e;if(e){let e=Gt(r),t=Gt(i);e<0&&t<0?o(0):e>0&&t>0&&a(0)}if(r===i){let t=i===0?1:Math.abs(i*.05);o(i+t),e||a(r-t)}this.min=r,this.max=i}getTickLimit(){let{maxTicksLimit:e,stepSize:t}=this.options.ticks,n;return t?(n=Math.ceil(this.max/t)-Math.floor(this.min/t)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${t} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e||=11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return 1/0}buildTicks(){let e=this.options,t=e.ticks,n=this.getTickLimit();n=Math.max(2,n);let r=ds({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},this._range||this);return e.bounds===`ticks`&&Qt(r,this,`value`),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let e=this.ticks,t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){let r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return Nn(e,this.chart.options.locale,this.options.ticks.format)}};(class extends ps{static id=`linear`;static defaults={ticks:{callback:In.formatters.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=I(e)?e:0,this.max=I(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,n=W(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,i.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}});var ms=e=>Math.floor(Wt(e)),hs=(e,t)=>10**(ms(e)+t);function gs(e){return e/10**ms(e)==1}function _s(e,t,n){let r=10**n,i=Math.floor(e/r);return Math.ceil(t/r)-i}function vs(e,t){let n=ms(t-e);for(;_s(e,t,n)>10;)n++;for(;_s(e,t,n)<10;)n--;return Math.min(n,ms(e))}function ys(e,{min:t,max:n}){t=L(e.min,t);let r=[],i=ms(t),a=vs(t,n),o=a<0?10**Math.abs(a):1,s=10**a,c=i>a?10**i:0,l=Math.round((t-c)*o)/o,u=Math.floor((t-c)/s/10)*s*10,d=Math.floor((l-u)/10**a),f=L(e.min,Math.round((c+u+d*10**a)*o)/o);for(;f<n;)r.push({value:f,major:gs(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,o=a>=0?1:o),f=Math.round((c+u+d*10**a)*o)/o;let p=L(e.max,f);return r.push({value:p,major:gs(p),significand:d}),r}(class extends Ja{static id=`logarithmic`;static defaults={ticks:{callback:In.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let n=ps.prototype.parse.apply(this,[e,t]);if(n===0){this._zero=!0;return}return I(n)&&n>0?n:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=I(e)?Math.max(0,e):null,this.max=I(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!I(this._userMin)&&(this.min=e===hs(this.min,0)?hs(this.min,-1):hs(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),n=this.min,r=this.max,i=t=>n=e?n:t,a=e=>r=t?r:e;n===r&&(n<=0?(i(1),a(10)):(i(hs(n,-1)),a(hs(r,1)))),n<=0&&i(hs(r,-1)),r<=0&&a(hs(n,1)),this.min=n,this.max=r}buildTicks(){let e=this.options,t=ys({min:this._userMin,max:this._userMax},this);return e.bounds===`ticks`&&Qt(t,this,`value`),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return e===void 0?`0`:Nn(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=Wt(e),this._valueRange=Wt(this.max)-Wt(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Wt(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return 10**(this._startValue+t*this._valueRange)}});function bs(e){let t=e.ticks;if(t.display&&e.display){let e=J(t.backdropPadding);return R(t.font&&t.font.size,q.font.size)+e.height}return 0}function xs(e,t,n){return n=P(n)?n:[n],{w:Wn(e,t.string,n),h:n.length*t.lineHeight}}function Ss(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function Cs(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],a=e._pointLabels.length,o=e.options.pointLabels,s=o.centerPointLabels?V/a:0;for(let c=0;c<a;c++){let a=o.setContext(e.getPointLabelContext(c));i[c]=a.padding;let l=e.getPointPosition(c,e.drawingArea+i[c],s),u=Y(a.font),d=xs(e.ctx,u,e._pointLabels[c]);r[c]=d;let f=G(e.getIndexAngle(c)+s),p=Math.round($t(f));ws(n,t,f,Ss(p,l.x,d.w,0,180),Ss(p,l.y,d.h,90,270))}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=Ds(e,r,i)}function ws(e,t,n,r,i){let a=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n)),s=0,c=0;r.start<t.l?(s=(t.l-r.start)/a,e.l=Math.min(e.l,t.l-s)):r.end>t.r&&(s=(r.end-t.r)/a,e.r=Math.max(e.r,t.r+s)),i.start<t.t?(c=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-c)):i.end>t.b&&(c=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+c))}function Ts(e,t,n){let r=e.drawingArea,{extra:i,additionalAngle:a,padding:o,size:s}=n,c=e.getPointPosition(t,r+i+o,a),l=Math.round($t(G(c.angle+U))),u=As(c.y,s.h,l),d=Os(l),f=ks(c.x,s.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+s.w,bottom:u+s.h}}function Es(e,t){if(!t)return!0;let{left:n,top:r,right:i,bottom:a}=e;return!(Yn({x:n,y:r},t)||Yn({x:n,y:a},t)||Yn({x:i,y:r},t)||Yn({x:i,y:a},t))}function Ds(e,t,n){let r=[],i=e._pointLabels.length,a=e.options,{centerPointLabels:o,display:s}=a.pointLabels,c={extra:bs(a)/2,additionalAngle:o?V/i:0},l;for(let a=0;a<i;a++){c.padding=n[a],c.size=t[a];let i=Ts(e,a,c);r.push(i),s===`auto`&&(i.visible=Es(i,l),i.visible&&(l=i))}return r}function Os(e){return e===0||e===180?`center`:e<180?`left`:`right`}function ks(e,t,n){return n===`right`?e-=t:n===`center`&&(e-=t/2),e}function As(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function js(e,t,n){let{left:r,top:i,right:a,bottom:o}=n,{backdropColor:s}=t;if(!N(s)){let n=lr(t.borderRadius),c=J(t.backdropPadding);e.fillStyle=s;let l=r-c.left,u=i-c.top,d=a-r+c.width,f=o-i+c.height;Object.values(n).some(e=>e!==0)?(e.beginPath(),nr(e,{x:l,y:u,w:d,h:f,radius:n}),e.fill()):e.fillRect(l,u,d,f)}}function Ms(e,t){let{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){let t=e._pointLabelItems[i];if(!t.visible)continue;let a=r.setContext(e.getPointLabelContext(i));js(n,a,t);let o=Y(a.font),{x:s,y:c,textAlign:l}=t;tr(n,e._pointLabels[i],s,c+o.lineHeight/2,o,{color:a.color,textAlign:l,textBaseline:`middle`})}}function Ns(e,t,n,r){let{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,H);else{let n=e.getPointPosition(0,t);i.moveTo(n.x,n.y);for(let a=1;a<r;a++)n=e.getPointPosition(a,t),i.lineTo(n.x,n.y)}}function Ps(e,t,n,r,i){let a=e.ctx,o=t.circular,{color:s,lineWidth:c}=t;!o&&!r||!s||!c||n<0||(a.save(),a.strokeStyle=s,a.lineWidth=c,a.setLineDash(i.dash||[]),a.lineDashOffset=i.dashOffset,a.beginPath(),Ns(e,n,o,r),a.closePath(),a.stroke(),a.restore())}function Fs(e,t,n){return fr(e,{label:n,index:t,type:`pointLabel`})}(class extends ps{static id=`radialLinear`;static defaults={display:!0,animate:!0,position:`chartArea`,angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:In.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":`borderColor`,"pointLabels.color":`color`,"ticks.color":`color`};static descriptors={angleLines:{_fallback:`grid`}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let e=this._padding=J(bs(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!1);this.min=I(e)&&!isNaN(e)?e:0,this.max=I(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/bs(this.options))}generateTickLabels(e){ps.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((e,t)=>{let n=z(this.options.pointLabels.callback,[e,t],this);return n||n===0?n:``}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){let e=this.options;e.display&&e.pointLabels.display?Cs(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}getIndexAngle(e){let t=H/(this._pointLabels.length||1),n=this.options.startAngle||0;return G(e*t+W(n))}getDistanceFromCenterForValue(e){if(N(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(N(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e<t.length){let n=t[e];return Fs(this.getContext(),e,n)}}getPointPosition(e,t,n=0){let r=this.getIndexAngle(e)-U+n;return{x:Math.cos(r)*t+this.xCenter,y:Math.sin(r)*t+this.yCenter,angle:r}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){let{left:t,top:n,right:r,bottom:i}=this._pointLabelItems[e];return{left:t,top:n,right:r,bottom:i}}drawBackground(){let{backgroundColor:e,grid:{circular:t}}=this.options;if(e){let n=this.ctx;n.save(),n.beginPath(),Ns(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){let e=this.ctx,t=this.options,{angleLines:n,grid:r,border:i}=t,a=this._pointLabels.length,o,s,c;if(t.pointLabels.display&&Ms(this,a),r.display&&this.ticks.forEach((e,t)=>{if(t!==0||t===0&&this.min<0){s=this.getDistanceFromCenterForValue(e.value);let n=this.getContext(t),o=r.setContext(n),c=i.setContext(n);Ps(this,o,s,a,c)}}),n.display){for(e.save(),o=a-1;o>=0;o--){let r=n.setContext(this.getPointLabelContext(o)),{color:i,lineWidth:a}=r;!a||!i||(e.lineWidth=a,e.strokeStyle=i,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,s=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(o,s),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;let r=this.getIndexAngle(0),i,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign=`center`,e.textBaseline=`middle`,this.ticks.forEach((r,o)=>{if(o===0&&this.min>=0&&!t.reverse)return;let s=n.setContext(this.getContext(o)),c=Y(s.font);if(i=this.getDistanceFromCenterForValue(this.ticks[o].value),s.showLabelBackdrop){e.font=c.string,a=e.measureText(r.label).width,e.fillStyle=s.backdropColor;let t=J(s.backdropPadding);e.fillRect(-a/2-t.left,-i-c.size/2-t.top,a+t.width,c.size+t.height)}tr(e,r.label,0,-i,c,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),e.restore()}drawTitle(){}});var Is={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}},$=Object.keys(Is);function Ls(e,t){return e-t}function Rs(e,t){if(N(t))return null;let n=e._adapter,{parser:r,round:i,isoWeekday:a}=e._parseOpts,o=t;return typeof r==`function`&&(o=r(o)),I(o)||(o=typeof r==`string`?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i===`week`&&(Xt(a)||a===!0)?n.startOf(o,`isoWeek`,a):n.startOf(o,i)),+o)}function zs(e,t,n,r){let i=$.length;for(let a=$.indexOf(e);a<i-1;++a){let e=Is[$[a]],i=e.steps?e.steps:2**53-1;if(e.common&&Math.ceil((n-t)/(i*e.size))<=r)return $[a]}return $[i-1]}function Bs(e,t,n,r,i){for(let a=$.length-1;a>=$.indexOf(n);a--){let n=$[a];if(Is[n].common&&e._adapter.diff(i,r,n)>=t-1)return n}return $[n?$.indexOf(n):0]}function Vs(e){for(let t=$.indexOf(e)+1,n=$.length;t<n;++t)if(Is[$[t]].common)return $[t]}function Hs(e,t,n){if(!n)e[t]=!0;else if(n.length){let{lo:r,hi:i}=sn(n,t),a=n[r]>=t?n[r]:n[i];e[a]=!0}}function Us(e,t,n,r){let i=e._adapter,a=+i.startOf(t[0].value,r),o=t[t.length-1].value,s,c;for(s=a;s<=o;s=+i.add(s,1,r))c=n[s],c>=0&&(t[c].major=!0);return t}function Ws(e,t,n){let r=[],i={},a=t.length,o,s;for(o=0;o<a;++o)s=t[o],i[s]=o,r.push({value:s,major:!1});return a===0||!n?r:Us(e,r,i,n)}var Gs=class extends Ja{static id=`time`;static defaults={bounds:`data`,adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:`millisecond`,displayFormats:{}},ticks:{source:`auto`,callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit=`day`,this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){let n=e.time||={},r=this._adapter=new Mi._date(e.adapters.date);r.init(t),kt(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:Rs(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let e=this.options,t=this._adapter,n=e.time.unit||`day`,{min:r,max:i,minDefined:a,maxDefined:o}=this.getUserBounds();function s(e){!a&&!isNaN(e.min)&&(r=Math.min(r,e.min)),!o&&!isNaN(e.max)&&(i=Math.max(i,e.max))}(!a||!o)&&(s(this._getLabelBounds()),(e.bounds!==`ticks`||e.ticks.source!==`labels`)&&s(this.getMinMax(!1))),r=I(r)&&!isNaN(r)?r:+t.startOf(Date.now(),n),i=I(i)&&!isNaN(i)?i:+t.endOf(Date.now(),n)+1,this.min=Math.min(r,i-1),this.max=Math.max(r+1,i)}_getLabelBounds(){let e=this.getLabelTimestamps(),t=1/0,n=-1/0;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){let e=this.options,t=e.time,n=e.ticks,r=n.source===`labels`?this.getLabelTimestamps():this._generate();e.bounds===`ticks`&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);let i=this.min,a=this.max,o=un(r,i,a);return this._unit=t.unit||(n.autoSkip?zs(t.minUnit,this.min,this.max,this._getLabelCapacity(i)):Bs(this,o.length,t.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit===`year`?void 0:Vs(this._unit),this.initOffsets(r),e.reverse&&o.reverse(),Ws(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t=0,n=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),t=e.length===1?1-r:(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),n=e.length===1?i:(i-this.getDecimalForValue(e[e.length-2]))/2);let a=e.length<3?.5:.25;t=K(t,0,a),n=K(n,0,a),this._offsets={start:t,end:n,factor:1/(t+1+n)}}_generate(){let e=this._adapter,t=this.min,n=this.max,r=this.options,i=r.time,a=i.unit||zs(i.minUnit,t,n,this._getLabelCapacity(t)),o=R(r.ticks.stepSize,1),s=a===`week`&&i.isoWeekday,c=Xt(s)||s===!0,l={},u=t,d,f;if(c&&(u=+e.startOf(u,`isoWeek`,s)),u=+e.startOf(u,c?`day`:a),e.diff(n,t,a)>1e5*o)throw Error(t+` and `+n+` are too far apart with stepSize of `+o+` `+a);let p=r.ticks.source===`data`&&this.getDataTimestamps();for(d=u,f=0;d<n;d=+e.add(d,o,a),f++)Hs(l,d,p);return(d===n||r.bounds===`ticks`||f===1)&&Hs(l,d,p),Object.keys(l).sort(Ls).map(e=>+e)}getLabelForValue(e){let t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){let n=this.options.time.displayFormats,r=this._unit,i=t||n[r];return this._adapter.format(e,i)}_tickFormatFunction(e,t,n,r){let i=this.options,a=i.ticks.callback;if(a)return z(a,[e,t,n],this);let o=i.time.displayFormats,s=this._unit,c=this._majorUnit,l=s&&o[s],u=c&&o[c],d=n[t],f=c&&u&&d&&d.major;return this._adapter.format(e,r||(f?u:l))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t<n;++t)r=e[t],r.label=this._tickFormatFunction(r.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){let t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){let t=this.options.ticks,n=this.ctx.measureText(e).width,r=W(this.isHorizontal()?t.maxRotation:t.minRotation),i=Math.cos(r),a=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:n*i+o*a,h:n*a+o*i}}_getLabelCapacity(e){let t=this.options.time,n=t.displayFormats,r=n[t.unit]||n.millisecond,i=this._tickFormatFunction(e,0,Ws(this,[e],this._majorUnit),r),a=this._getLabelSize(i),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let e=this._cache.data||[],t,n;if(e.length)return e;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,n=r.length;t<n;++t)e=e.concat(r[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){let e=this._cache.labels||[],t,n;if(e.length)return e;let r=this.getLabels();for(t=0,n=r.length;t<n;++t)e.push(Rs(this,r[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return mn(e.sort(Ls))}};function Ks(e,t,n){let r=0,i=e.length-1,a,o,s,c;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=cn(e,`pos`,t)),{pos:a,time:s}=e[r],{pos:o,time:c}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=cn(e,`time`,t)),{time:a,pos:s}=e[r],{time:o,pos:c}=e[i]);let l=o-a;return l?s+(c-s)*(t-a)/l:s}(class extends Gs{static id=`timeseries`;static defaults=Gs.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Ks(t,this.min),this._tableRange=Ks(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:n}=this,r=[],i=[],a,o,s,c,l;for(a=0,o=e.length;a<o;++a)c=e[a],c>=t&&c<=n&&r.push(c);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,o=r.length;a<o;++a)l=r[a+1],s=r[a-1],c=r[a],Math.round((l+s)/2)!==c&&i.push({time:c,pos:a/(o-1)});return i}_generate(){let e=this.min,t=this.max,n=super.getDataTimestamps();return(!n.includes(e)||!n.length)&&n.splice(0,0,e),(!n.includes(t)||n.length===1)&&n.push(t),n.sort((e,t)=>
22e-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(Ks(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return Ks(this._table,n*this._tableRange+this._minPos,!0)}}),Io.register(Ai,Ko,us);var qs=class extends HTMLElement{formatter=new Intl.NumberFormat(document.querySelector(`html`).lang).format;municipality;year;originalPageTitle;originalTableTitle;currentData;tabsElement;canvasElement;chart;async connectedCallback(){this.tabsElement=this.querySelector(`shn-tabs`),this.municipality=this.getAttribute(`municipality`),this.year=this.getAttribute(`year`),this.canvasElement=this.querySelector(`#municipality-statistics`),await this.initDropdowns(),this.addTabEvents(),this.updateTitles(),await this.loadMunicipalityData()}async initDropdowns(){[`municipality`,`year`].forEach(e=>{let t=this.querySelector(`shn-dropdown#${e}`);t.value=this[e],t.querySelector(`[value='${t.value}']`)?.classList.add(`selected`),t.addEventListener(`changed`,t=>this.onDropdownChange(t,e))})}onDropdownChange(e,t){this[t]=e.target.value,this.updateURLWithMunicipalityAndYear()}addTabEvents(){let e=this.tabsElement.querySelectorAll(`.tab-header`),t=this.tabsElement.querySelectorAll(`.tab-content`);e.forEach((n,r)=>{n.addEventListener(`click`,()=>this.activateTab(r,e,t)),n.addEventListener(`keydown`,n=>this.onTabKey(n,r,e,t))})}onTabKey(e,t,n,r){({ArrowLeft:()=>this.activateTab((t-1+n.length)%n.length,n,r),ArrowRight:()=>this.activateTab((t+1)%n.length,n,r),Enter:async()=>await this.loadChart()," ":async()=>await this.loadChart()})[e.key]?.(),e.preventDefault()}activateTab(e,t,n){t.forEach((t,n)=>this.toggleActiveClass(t,n===e,[`aria-selected`,`tabindex`],[`active`])),n.forEach((t,n)=>this.toggleActiveClass(t,n===e,[`aria-hidden`],[`active`],!0)),this.loadChart(),t[e].focus()}toggleActiveClass(e,t,n=[],r=[],i=!1){e.classList.toggle(r[0],t),i&&(e.hidden=!t),n.forEach(n=>{n===`aria-selected`&&e.setAttribute(n,String(t)),n===`tabindex`&&e.setAttribute(n,t?`0`:`-1`),n===`aria-hidden`&&e.setAttribute(n,String(!t))})}async updateURLWithMunicipalityAndYear(){let e=`${document.querySelector(`link[rel='canonical']`).href}${this.municipality.replaceAll(` `,`_`)}/${this.year}/`;history.replaceState(window.history.state,`Gemeente: ${this.municipality}`,e),this.updateTitles(),await this.loadMunicipalityData()}updateTitles(){[`page-title`,`table-title`].forEach(e=>{let t=this.querySelector(`#${e}`),n=e===`page-title`?`originalPageTitle`:`originalTableTitle`;this[n]??=t.innerText,t.innerText=this[n].replace(`Nederland`,this.municipality)})}async loadMunicipalityData(){let e=await fetch(`/api/statistiek/gemeentes/${this.municipality}/${this.year}`);if(!e.ok)return;let t=await e.json();this.currentData={diensten:this.buildDataset(t.diensten),gebeurtenissen:this.buildDataset(t.gebeurtenissen)},this.updateTable(`#events`,this.currentData.gebeurtenissen),this.updateTable(`#services`,this.currentData.diensten),this.loadChart()}buildDataset(e){let t=Object.values(e).map(e=>e===0?1:e).reduce((e,t)=>e+t,0),n={};for(let[r,i]of Object.entries(e)){let e=i===0?1:i,a=e/t*100;n[r]={value:i,chartValue:e,percentage:a<1?`<1%`:Math.round(a)+`%`}}return n}updateTable(e,t){let n=this.tabsElement.querySelector(e).querySelector(`tbody`);n.innerHTML=``;let r=(e,t)=>{let n=C(`td`,``,e);return n.style.width=t,n},i=Object.entries(t).map(([e,{value:t,percentage:n}])=>{let i=C(`tr`,``,``);return i.append(r(e,`60%`),r(t===0?`<5`:this.formatter(t),`20%`),r(t===0?``:n,`20%`)),i});n.append(...i)}async loadChart(){try{let e=this.tabsElement.querySelector(`.tab-header.active`).innerText,t=e===`Gebeurtenissen`?this.currentData.gebeurtenissen:this.currentData.diensten,n=Object.keys(t),r=Object.values(t).map(e=>e.chartValue),i=Object.values(t).reduce((e,t)=>e+t.value,0),a={type:`doughnut`,data:{labels:n,datasets:[{data:r,hoverOffset:4,backgroundColor:[`#F56B01`,`#FAA46F`,`#FED1B0`,`#B935B2`,`#D783D6`]}]},options:{responsive:!0,cutout:`70%`,plugins:{tooltip:{enabled:!0,callbacks:{label:r=>{let i=n[r.dataIndex],a=t[i].value,o=a===0?`<5`:this.formatter(a);
22return e===`Gebeurtenissen`?`${o} aanmeldingen`:`${o} diensten`}}}},onHover:(e,t)=>{document.querySelectorAll(`shn-tabs .tab-content.active tr`).forEach((e,n)=>{e.classList.toggle(`chart-hover`,!!t.length&&n===t[0].index)})},onLeave:()=>{document.querySelectorAll(`shn-tabs .tab-content.active tr`).forEach(e=>e.classList.remove(`chart-hover`))}},plugins:[{id:`centerText`,afterDatasetsDraw:t=>this.drawCenterTextOnChart(t,i,e,this.year)}]};this.chart&&this.chart.destroy(),this.chart=new Io(this.canvasElement,a)}catch(e){console.error(`Error loading chart:`,e)}}drawCenterTextOnChart(e,t,n,r){let i=e.ctx,{x:a,y:o}=e.getDatasetMeta(0).data[0],s=this.formatter(t),c=window.innerWidth<1240,l=n===`Diensten`?`Diensten geleverd door Slachtofferhulp in ${r}`:`Aangemelde slachtoffers in ${r}`;i.save(),i.font=c?`700 24px museo-sans-n7, museo`:`700 30px museo-sans-n7, museo`,i.textAlign=`center`,i.textBaseline=`middle`,i.fillText(s,a,o-32),i.font=c?`300 16px museo-sans-n3, museo-sans`:`300 20px museo-sans-n3, museo-sans`,this.wrapText(i,l,a,o,200,24),i.restore(),this.canvasElement.setAttribute(`aria-label`,`Samenvattende grafiek met in het midden het totaal: ${s} ${l}.`)}wrapText(e,t,n,r,i,a){let o=``;t.split(` `).forEach((t,s,c)=>{let l=`${o}${t} `;e.measureText(l).width>i&&s>0?(e.fillText(o,n,r),o=`${t} `,r+=a):o=l}),e.fillText(o,n,r)}};customElements.define(`shn-gemeente-pagina`,qs),(()=>{let e=null,t=-1,n,r,i=`[data-show-suggestions], .search-field[name='q']`,a=`[data-global-search-root]`,o=e=>e?.closest(a)??null,s=e=>!!e?.closest(`#mainnavigation, .fixed-nav`),c=(e,t,n)=>{(n??document).querySelectorAll(e).forEach(e=>{e.style.display=t})},l=(e,t)=>c(e,`block`,t),u=(e,t)=>
22c(e,`none`,t),d=(e,t)=>{let n=(e.value??``).trim().length>0,r=e.closest(`form.search`)?.querySelector(`[data-search-clear-button]`)??(t??document).querySelector(`[data-search-clear-button]`);r&&(n?r.removeAttribute(`hidden`):r.setAttribute(`hidden`,``))},f=e=>{let t=e?.querySelector(`[data-auto-complete-results]`)??document.querySelector(`[data-auto-complete-results]`);if(!t)return 5;let n=Number.parseInt(t.dataset.maxResults??``,10);return Number.isNaN(n)||n<=0?5:n},p=()=>{let e=document.getElementById(`mainnavigation`);if(!(e?.classList.contains(`active`)&&e?.classList.contains(`search`)))return;let t=document.getElementById(`menu-overlay`);if(t){t.click();return}(e?.querySelector(`[data-search-close-button]`))?.click()},m=e=>{e.forEach((e,n)=>{e.setAttribute(`aria-selected`,n===t?`true`:`false`)})},h=async(t,n)=>{g();let r=n?.querySelector(`[data-auto-complete-results]`);if(r&&r.style.display!==`block`&&l(`[data-auto-complete-results]`,n??void 0),t.length<=2){C(n),u(`[data-search-results]`,n??void 0),l(`[data-search-suggestions]`,n??void 0),b(`Relevante pagina's, gebruik de pijltjestoetsen om te navigeren.`,n);return}try{e=new AbortController,u(`[data-search-suggestions]`,n??void 0),l(`[data-search-results]`,n??void 0),T(!1,n);let r=f(n),i=await _(t,r);T(!0,n),v(i.searchResults,t,i.totalMatching,n)}catch(e){x(e,n)}},g=()=>{e?.abort(),e=null},_=async(t,n)=>{C(null);try{let r=await fetch(`/zoekresultaten/api/autocomplete/?query=${encodeURIComponent(t)}&maxResults=${n}`,{method:`GET`,headers:{"Content-Type":`application/json`},signal:e?.signal});if(!r.ok)throw Error(`HTTP error! status: ${r.status}`);return await r.json()}catch(e){throw T(!0,null),console.error(`Network error:`,e),e}},v=(e,t,r,i)=>{C(i);let a=f(i),o=e.slice(0,a);o.length>0?(u(`[data-no-search-results]`,i??void 0),w(o,i),b(`${o.length} suggesties gevonden voor ${t}, gebruik de pijltjestoetsen om te navigeren.`,i),r>a&&y(t,i),n=(i??document).querySelectorAll(`.result-list-item, .view-all-results-link`)):(l(`[data-no-search-results]`,i??void 0),b(`Geen suggesties gevonden voor ${t}.`,i))},y=(e,t)=>{let n=document.createElement(`div`);n.className=`all-results-container`;let r=document.createElement(`a`);r.id=`viewAllResults`,r.className=`view-all-results-link`,r.dataset.testid=`view-all-results-link`,r.setAttribute(`aria-controls`,`resultList`),r.setAttribute(`role`,`option`),r.setAttribute(`tabindex`,`0`),r.textContent=`Bekijk alle resultaten voor "${e}"`,r.href=`/zoekresultaten/?q=${encodeURIComponent(e).replace(/%20/g,`+`)}`,n.appendChild(r),(t??document).querySelectorAll(`[data-search-results]`).forEach(e=>{e.appendChild(n)})},b=(e,t)=>{(t??document).querySelectorAll(`[data-announce]`).forEach(t=>{t.textContent=e,t.setAttribute(`aria-live`,`assertive`)})},x=(e,t)=>{e.name!==`AbortError`&&console.error(`Error:`,e),S(),T(!0,t)},S=()=>{document.querySelectorAll(`#filterButton, #resetFilterButton`).forEach(e=>{e.removeAttribute(`disabled`),e.removeAttribute(`clicked-once`)})},C=e=>{(e??document).querySelectorAll(`.result-list`).forEach(e=>{e.remove()}),(e??document).querySelectorAll(`.all-results-container`).forEach(e=>{e.remove()})},w=(e,t)=>{let n=document.createElement(`ul`);n.className=`result-list`,n.setAttribute(`role`,`listbox`),n.dataset.testid=`result-list`,e.forEach((t,r)=>{let i=document.createElement(`li`);i.classList.add(`result-list-item`),i.setAttribute(`role`,`option`),i.setAttribute(`tabindex`,`-1`),i.dataset.testid=`result-item`,i.setAttribute(`aria-posinset`,(r+1).toString()),i.setAttribute(`aria-setsize`,e.length.toString());let a=document.createElement(`a`);a.href=t.url,a.setAttribute(`tabindex`,`-1`),a.classList.add(`result-link`),a.innerHTML=t.title,i.appendChild(a),n.appendChild(i)}),(t??document).querySelectorAll(`[data-search-results]`).forEach(e=>{e.appendChild(n)})},T=(e,t)=>{(t??document).querySelectorAll(`[data-auto-complete-results], #searchDiv`).forEach(e=>{e.removeAttribute(`style`)}),(t??document).querySelectorAll(`[data-auto-complete-loader]`).forEach(t=>{t.style.display=e?`none`:`block`}),e||u(`[data-no-search-results]`,t??void 0)};document.querySelectorAll(`[data-auto-complete-results]`).length>0&&(()=>{let e=document.querySelectorAll(i);if(e.length===0){u(`[data-auto-complete-results]`);return}let c=new WeakMap;document.addEventListener(`input`,e=>{let t=e.target;if(!(t instanceof HTMLInputElement)||!t.matches(i))return;let n=o(t),r=(n??document).querySelectorAll(`[data-search-button]`),a=c.get(t);a&&clearTimeout(a);let s=globalThis.setTimeout(()=>{h(t.value,n),t.setAttribute(`aria-expanded`,`true`)},300);c.set(t,s),d(t,n),(n??document).querySelectorAll(`[data-search-term-header]`).forEach(e
22=>{e.innerText=t.value}),r.forEach(e=>{let n=e.querySelector(`.search-button-text`);n&&(n.textContent=`Zoeken naar ${t.value}`)})}),document.addEventListener(`keydown`,e=>{let t=e.target;if(!(t instanceof HTMLInputElement)||!t.matches(i))return;let a=o(t);n=(a??document).querySelectorAll(`.result-list-item, .view-all-results-link`),r=(a??document).querySelectorAll(`.suggestion-list-item`),e.key===`Escape`&&(u(`[data-auto-complete-results]`,a??void 0),t.focus(),t.setAttribute(`aria-expanded`,`false`));let s=n.length>0?n:r;s.length>0&&(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),e.stopPropagation(),O(e.key,s,t))}),document.addEventListener(`focusin`,e=>{let n=e.target;if(!(n instanceof HTMLElement))return;let r=n.matches(i)?n:null;if(r){t=-1;let e=o(r);d(r,e),l(`[data-auto-complete-results]`,e??void 0);return}if(n.matches(`[data-search-button]`)){let e=n.closest(a)??null;if(s(e)){l(`[data-auto-complete-results]`,e??void 0);return}u(`[data-auto-complete-results]`,e??void 0)}}),document.addEventListener(`click`,e=>{let n=e.target;if(!(n instanceof HTMLElement))return;let r=n.closest(`[data-search-clear-button]`);if(!r)return;e.preventDefault();let i=(r.closest(a)??null??document).querySelector(`.search-field[name='q']`);i&&(i.value=``,i.dispatchEvent(new Event(`input`,{bubbles:!0})),t=-1,i.setAttribute(`aria-expanded`,`false`),i.focus())}),e.forEach(e=>{let t=o(e);d(e,t)})})();let E=()=>{let e=document.getElementById(`filterType`);e&&e.addEventListener(`change`,()=>{D(new URLSearchParams(globalThis.location.search).get(`q`),e.value)})};async function D(e,t){try{let n=await fetch(`api/searchfilter`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({query:e,filterType:t})});if(!n.ok)throw Error(`Failed to fetch filtered results.`);let r=await n.text();document.getElementById(`searchResultsList`).innerHTML=r}catch(e){console.error(`Error:`,e)}}E();let O=(e,n,r)=>{e===`ArrowDown`?t<n.length-1&&(t++,m(n),n[t].focus()):e===`ArrowUp`&&(t>0?(t--,m(n),n[t].focus()):(t=-1,m(n),r?.focus()))},k=(e,n)=>{if(t>=0&&t<n.length){let r=n[t];if(r.getAttribute(`aria-selected`)===`true`){e.preventDefault();let n=r.tagName===`A`?r:r.querySelector(`a.result-link, a.view-all-results-link`);n?n.click():console.error(`Geen <a>-element gevonden binnen de gefocuste <li> op index ${t}. Inhoud: ${r.innerHTML}`)}}};document.querySelectorAll(i).length>0&&(document.addEventListener(`keydown`,e=>{if(e.defaultPrevented)return;let t=null,o=e.target instanceof HTMLElement?e.target:null,s=document.activeElement instanceof HTMLElement?document.activeElement:null,c=o?.closest(a)??s?.closest(a)??null,l=c?.querySelector(i)??(document.activeElement instanceof HTMLInputElement&&document.activeElement.matches(i)?document.activeElement:document.querySelector(i));if(n=(c??document).querySelectorAll(`.result-list-item, .view-all-results-link`),r=(c??document).querySelectorAll(`.suggestion-list-item`),n&&n.length>0?t=n:r&&r.length>0&&(t=r),t)switch(e.key){case`ArrowDown`:case`ArrowUp`:e.preventDefault(),O(e.key,t,l);break;case`Escape`:u(`[data-auto-complete-results]`,c??void 0),l?.focus();break;case`Enter`:k(e,t),u(`[data-auto-complete-results]`,c??void 0),l?.setAttribute(`aria-expanded`,`false`);break;default:break}}),document.addEventListener(`click`,e=>{let t=e.target;if(!t)return;let n=t.closest(`[data-auto-complete-results]`),r=t.closest(`a, button, input, textarea, select, [role='option']`);if(n&&!r){u(`[data-auto-complete-results]`),p();return}t.closest(a)||(u(`[data-auto-complete-results]`),p())}),document.addEventListener(`submit`,e=>{let t=e.target;if(!(t instanceof HTMLFormElement)||!t.matches(`form.search`))return;let n=t.closest(a)??null;u(`[data-auto-complete-results]`,n??void 0),t.querySelector(`.search-field[name='q']`)?.setAttribute(`aria-expanded`,`false`)}))})();var Js=(e,t,n,r)=>{let i=new URLSearchParams(globalThis.location.search),a=i.get(n),o=i.get(r);return a||o?(typeof a==`string`&&(e.value=a),typeof o==`string`&&(t.value=o),!0):!1},Ys=(e,t,n,r)=>{let i=new URL(globalThis.location.href);e.value?i.searchParams.set(n,e.value):i.searchParams.delete(n),t.value?i.searchParams.set(r,t.value):i.searchParams.delete(r);let a=`${i.pathname}${i.search}${i.hash}`;globalThis.history.replaceState({},document.title,a)},Xs=(e,t,n,r,i)=>{if(!Js(e,t,r,i))try{let r=globalThis.localStorage.getItem(n);if(!r)return;let i=new URLSearchParams(r),a=i.get(`theme`),o=i.get(`location`);typeof a==`string`&&(e.value=a),typeof o==`string`&&(t.value=o)}catch{globalThis.localStorage.removeItem(n)}},Zs=(e,t,n)=>{if(!(e.value||t.value)){globalThis.localStorage.removeItem(n);return}let r=new URLSearchParams({theme:e.value,location:t.value}).toString();globalThis.localStorage.setItem(n,r)},Qs=(e,t,n)=>{let r=0;
22return e.forEach(e=>{let i=(e.dataset.eventTheme||``).toLowerCase(),a=(e.dataset.eventLocation||``).toLowerCase(),o=(!t||i===t)&&(!n||a===n);e.style.display=o?``:`none`,o&&r++}),r},$s=(e,t)=>{e&&(e.textContent=`${t} ${t===1?`resultaat`:`resultaten`}`)},ec=(e,t,n)=>{e&&(e.textContent=t===0?n:``)},tc=(e,t,n,r,i,a,o)=>{e&&(e.textContent=n===0?r:i),t&&(t.textContent=n===0?a:o)};(()=>{let e=`EventOverviewFilters:${globalThis.location.pathname}`,t=`thema`,n=`locatie`,r=document.getElementById(`event-filter-form`),i=document.getElementById(`theme`),a=document.getElementById(`location`),o=document.getElementById(`clear-filters`),s=document.getElementById(`event-list-container`),c=Array.from(document.querySelectorAll(`#event-list li[data-event-location]`)),l=document.getElementById(`no-results-message`),u=document.getElementById(`interest-list-heading`),d=document.getElementById(`interest-list-intro`),f=document.getElementById(`event-result-count`),p=l?.dataset.noResultsMessage||`Er zijn geen bijeenkomsten gevonden voor jouw filters.`,m=u?.dataset.defaultHeading||`Komen de data of locatie niet uit?`,h=d?.dataset.defaultIntro||`Meld je aan voor de interesselijst`,g=d?.dataset.noResultsIntro||h;if(!r||!i||!a)return;let _=()=>{let r=i.value.toLowerCase(),_=a.value.toLowerCase();i.dataset.hasSelection=r?`true`:`false`,a.dataset.hasSelection=_?`true`:`false`;let v=Qs(c,r,_);$s(f,v),s&&(s.hidden=v===0),ec(l,v,p),tc(u,d,v,p,m,g,h),o&&(o.hidden=!(r||_)),Ys(i,a,t,n),Zs(i,a,e)};r.addEventListener(`submit`,e=>{e.preventDefault(),_()}),i.addEventListener(`change`,_),a.addEventListener(`change`,_),o&&o.addEventListener(`click`,()=>{i.value=``,a.value=``,_()}),Xs(i,a,e,t,n),_(),globalThis.setTimeout(_,0),globalThis.addEventListener(`pageshow`,_)})();var nc=class extends HTMLElement{currentDate;connectedCallback(){this.currentDate=new Date;let e=this.getAttribute(`includes-time`)?.toLowerCase()===`true`,t=this.querySelector(`.date-picker-input`);if(t){t.type=e?`datetime-local`:`date`,this.getAttribute(`default-today`)?.toLowerCase()===`true`&&(t.value=this.formatDate(this.currentDate,e));let n=t.dataset.dateChoiceRestriction;if(n===`future-only`)t.min=this.formatDate(this.currentDate,e);else if(n===`past-only`)t.max=this.formatDate(this.currentDate,e);else if(n===`between-dates`){let e=this.dataset.minDate,n=this.dataset.maxDate;e&&(t.min=e),n&&(t.max=n)}}}pad(e){return e<10?`0`+e:e.toString()}formatDate(e,t){let n=e.getFullYear(),r=this.pad(e.getMonth()+1),i=this.pad(e.getDate());return t?`${n}-${r}-${i}T${this.pad(e.getHours())}:${this.pad(e.getMinutes())}`:`${n}-${r}-${i}`}};customElements.define(`shn-date-picker`,nc),document.documentElement.setAttribute(`data-js-loaded`,`true`);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.